question about adding header question about adding header
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

question about adding header

Started by MI, July 04, 2005, 07:22:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MI

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.   :\'(
}


MI

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.  :\'(

Nibbler

Save the stuff you want to add into a file, and enter the path to that file into include('/path/your_file.php');

MI

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?

Nibbler

Save it as an html file if it is just html.

kegobeer

If all you are doing is adding static HTML, just edit the template.html file and put your code where you want it.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MI

#7
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?

kegobeer

Upload a fresh copy of the theme.php file.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MI

where do I find that, I thought I had saved one but I didn't

kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MI

#11
Thank you!!  I got it back up.  :) ;D :)

Joachim Müller

edit themes/yourtheme/template.html, find <body>and add after it (in a new line)<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.