forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: MI on July 04, 2005, 07:22:04 am

Title: question about adding header
Post by: MI on July 04, 2005, 07:22:04 am
I read the faq about adding a header but I don't understand where I put my info. 

This is what the faq said to edit:

function pageheader($section, $meta = '')
{
   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   if(empty($custom_header)){
      include('/path/your_file.php');
      static $custom_header = ob_get_contents();
      ob_clean();
   }

   header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
   user_save_profile();

   $template_vars = array(
      '{LANG_DIR}' => $lang_text_dir,
      '{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
      '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
      '{META}' => $meta,
      '{GAL_NAME}' => $CONFIG['gallery_name'],
      '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
      '{MAIN_MENU}' => theme_main_menu(),
      '{ADMIN_MENU}' => theme_admin_mode_menu(),
      '{CUSTOM_HEADER}' => $custom_header,
   );

   echo template_eval($template_header, $template_vars);

This is the header I want to add:

<p align="center"><a href="http://www.beyondpaper.net/">
<img border="0" src="http://i3.photobucket.com/albums/y79/irimomof3/bpheader.jpg" width="625" height="166"></a></p>

<p>&nbsp;</p>

<p>&nbsp;&nbsp; <font size="5" face="Tempus Sans ITC">

<b><a href="http://www.beyondpaper.net/forum/"><font color="#000000">Forum</font></a>&nbsp;

<a href="http://www.beyondpaper.net/gallery"><font color="#000000">Gallery</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/shop/"><font color="#000000">Shop</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/bpteam.htm"><font color="#000000">Our Team</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/contests.htm"><font color="#000000">Contests</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/links.htm"><font color="#000000">Resources</font></a></b></font></p>
 

My question is where does the info I want to put in there fit in?   I know it has been said before but I don't understand.   :\'(
}
Title: Re: question about adding header
Post by: Joachim Müller on July 04, 2005, 08:03:02 am
http://forum.coppermine-gallery.net/index.php?action=search2;search=custom+header;show_complete=1;userspec=gaugau
Title: Re: question about adding header
Post by: MI on July 04, 2005, 09:10:17 pm
Thanks for answering,  but like I said above I have gone through the search and don't understand.  Sorry man,  I just thought I could get a little help.  :\'(
Title: Re: question about adding header
Post by: Nibbler on July 04, 2005, 09:14:16 pm
Save the stuff you want to add into a file, and enter the path to that file into include('/path/your_file.php');
Title: Re: question about adding header
Post by: MI on July 04, 2005, 10:30:27 pm
Ok, I just wanted to make sure I understand this right.   This is the info I want to add:

p align="center"><a href="http://www.beyondpaper.net/">
<img border="0" src="http://i3.photobucket.com/albums/y79/irimomof3/bpheader.jpg" width="625" height="166"></a></p>

<p>&nbsp;</p>

<p>&nbsp;&nbsp; <font size="5" face="Tempus Sans ITC">

<b><a href="http://www.beyondpaper.net/forum/"><font color="#000000">Forum</font></a>&nbsp;

<a href="http://www.beyondpaper.net/gallery"><font color="#000000">Gallery</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/shop/"><font color="#000000">Shop</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/bpteam.htm"><font color="#000000">Our Team</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/contests.htm"><font color="#000000">Contests</font></a>&nbsp;&nbsp;

<a href="http://www.beyondpaper.net/links.htm"><font color="#000000">Resources</font></a></b></font></p>
 
So I save this into a file that I make up and save upload it to my control panel?  And then put the file name in the path :  ('/path/your_file.php');
and that's it?   Does it have to be saved as a php file?
Title: Re: question about adding header
Post by: Nibbler on July 04, 2005, 10:33:07 pm
Save it as an html file if it is just html.
Title: Re: question about adding header
Post by: kegobeer on July 04, 2005, 10:39:28 pm
If all you are doing is adding static HTML, just edit the template.html file and put your code where you want it.
Title: Re: question about adding header
Post by: MI on July 04, 2005, 11:26:47 pm
I treid to add it before I saw post from kegobeer and I got a parse error so I changed it back to what I thought was the original file and I am still getting a parse error:

Parse error: parse error, unexpected '{' in /home/scrap4/public_html/gallery/themes/water_drop/theme.php on line 2


THis is what I changed and how it looks:

function pageheader($section, $meta = ")
{   
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;

 
if(empty($custom_header)){
include('/path/bpheader.htm');
      static $custom_header = ob_get_contents();
      ob_clean();
   }

 header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND

PHY ONL UNI COM NAV INT DEM PRE"');
   user_save_profile();
       
 $template_vars = array('{LANG_DIR}' => $lang_text_dir,

       '{TITLE}' => $CONFIG['gallery_name'] . ' - ' .

$section,        '{CHARSET}' => $CONFIG['charset'] ==

'language file' ? $lang_charset : $CONFIG['charset'],   

     '{META}' => $meta,        '{GAL_NAME}' =>

$CONFIG['gallery_name'],        '{GAL_DESCRIPTION}' =>

$CONFIG['gallery_description'],        '{MAIN_MENU}' =>

theme_main_menu(),        '{ADMIN_MENU}' =>

theme_admin_mode_menu()
 '{CUSTOM_HEADER}' => $custom_header,

        );    echo template_eval($template_header,

$template_vars);
}

what can I do?
Title: Re: question about adding header
Post by: kegobeer on July 05, 2005, 12:53:03 am
Upload a fresh copy of the theme.php file.
Title: Re: question about adding header
Post by: MI on July 05, 2005, 12:55:36 am
where do I find that, I thought I had saved one but I didn't
Title: Re: question about adding header
Post by: kegobeer on July 05, 2005, 01:03:42 am
Download 1.3.3 from our site.
Title: Re: question about adding header
Post by: MI on July 05, 2005, 01:19:42 am
Thank you!!  I got it back up.  :) ;D :)
Title: Re: question about adding header
Post by: Joachim Müller on July 05, 2005, 08:37:38 am
edit themes/yourtheme/template.html, find
Code: [Select]
<body>and add after it (in a new line)
Code: [Select]
<p align="center"><a href="http://www.beyondpaper.net/">
<img border="0" src="http://i3.photobucket.com/albums/y79/irimomof3/bpheader.jpg" width="625" height="166"></a></p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp; <font size="5" face="Tempus Sans ITC">
<b><a href="http://www.beyondpaper.net/forum/"><font color="#000000">Forum</font></a>&nbsp;
<a href="http://www.beyondpaper.net/gallery"><font color="#000000">Gallery</font></a>&nbsp;&nbsp;
<a href="http://www.beyondpaper.net/shop/"><font color="#000000">Shop</font></a>&nbsp;&nbsp;
<a href="http://www.beyondpaper.net/bpteam.htm"><font color="#000000">Our Team</font></a>&nbsp;&nbsp;
<a href="http://www.beyondpaper.net/contests.htm"><font color="#000000">Contests</font></a>&nbsp;&nbsp;
<a href="http://www.beyondpaper.net/links.htm"><font color="#000000">Resources</font></a></b></font></p>
and you should be fine. As suggested above: you're adding plain html, no need to edit theme.php or doing complicated stuff.

Side-note: <font size="5" face="Tempus Sans ITC"> is a silly thing to have in the first place - nearly nobody has this font installed. I strongly recommend learning some html basics.