theme.html -> Theme.php theme.html -> Theme.php
 

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

theme.html -> Theme.php

Started by eclipselv, March 24, 2005, 12:23:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eclipselv

I need to change the extension of the theme.html file to theme.php.
I have php code that I need to place in the header.

Can someone please tell me the fille that calls this theme.html file so that I can change the extension.

thanks
ELV

Nibbler

Don't even go there. Use a custom header as described in the documentation.


eclipselv


eclipselv

OK......
Im not all that great with php, I am learning and willing to learn.

I inserted the code in the place the faq specified.
It tells me the following:
QuoteParse error: parse error, unexpected '(', expecting ',' or ';' in /home/arf/public_html/gallery/themes/default/theme.php on line 779
The line it is refering to is:
Quotestatic $custom_header = ob_get_contents();

If I remove the () the gallery dispays but the header does not show up.

header.php is in root dir.
The code below is the what I have in my theme.php file.
Here is the link to the gallery: http://www.autoracingforums.net/gallery/

As you can see, it gives me a parse error.....
Any help on this would be very much appreciated.

EclipseLV

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

   if(empty($custom_header)){
      include('home/arf/public_html/header.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);
}

Nibbler

Split that line into 2 lines:

static $custom_header;
$custom_header = ob_get_contents();

eclipselv

ok thanks....
Well the gallery is shoing now, but still no header.

thanks for your help.
EclipseLV

Nibbler

If the path to the header is supposed to be a full server path then it needs to start with a '/' . If I go to http://www.autoracingforums.net/header.php all I get is a blank page.

eclipselv

#8
yah i must have been updating the second you tried to access it. its up i just seen it.

I added the "/" a while ago....

I even doublechecked that the theme is selected in the confic.
When I edit the template.html, the changes show up.

this is what I have now....  and thank you for your help.

{
   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   if(empty($custom_header)){
      include('/home/arf/public_html/header.php');
      static $custom_header;
      $custom_header = ob_get_contents();
      ob_clean();
   }

eclipselv

Thanks for the help....
I have to just use html for now in the template.html file.

If someone knows how to get the php header to work, please let me know.

thanks to all.

EclipseLV