coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: nickfzx on May 23, 2006, 08:23:04 PM

Title: noob question
Post by: nickfzx on May 23, 2006, 08:23:04 PM
Hi so I have setup coppermine, bridged it with my punbb forum and now would like to start customizing it and integrating it.

Don't bite my head of as I'm sure I coud spend a little while searching and find the solution but hey I'm asking anyway.

I want my html menubar with my logo links etc to be above the coppermine gallery....in punbb you simply stick the html code in a file called main.tpl and you can basically stick punbb forum in your site.

Is there a simple main.tpl equivalent in coppermine where I can stick the html code of my sites menubar?


I did a little searching and the answer diddn't jump out at me so I'm asking. :)
Cheers

Nick
Title: Re: noob question
Post by: Nibbler on May 23, 2006, 09:41:19 PM
template.html
Title: Re: noob question
Post by: nickfzx on May 23, 2006, 09:43:04 PM
cool thanks....just working out how to make it run php but i guess i can work that out now
Title: Re: noob question
Post by: Nibbler on May 23, 2006, 09:45:48 PM
http://coppermine-gallery.net/demo/cpg14x/docs/faq.htm#renameTemplateHtml
Title: Re: noob question
Post by: nickfzx on May 23, 2006, 09:47:21 PM
oh...that's a bummer :)

is there a commonly used workaround for this?
Title: Re: noob question
Post by: Joachim Müller on May 24, 2006, 12:08:51 AM
start reading our docs - they are there because we consider them to be mandatory to be read before asking questions. I'm sorry if you're too lazy to read them - in that pareticular case, I'm too lazy to answer your questions.
Title: Re: noob question
Post by: nickfzx on May 24, 2006, 12:11:54 AM
no worries I've been reading them

I see I have to use the theme.php file with function pageheader($.....

in order to put php in there....I am doing it now.  Although it is kinda tricky because the php doesn't seem to be functioning 100% as it should.
Title: Re: noob question
Post by: nickfzx on May 24, 2006, 12:35:30 AM
hi

so sorry to ask again but I am fairly sure that this isn't in the manuals....so I have a php file that I have included by using this mod to the theme.php file:


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

if(empty($custom_header)){
include('MYPHPFILE.php');
static $custom_header;
$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);
}


The Php file consists of an 'if' and 'else' statement...when run on its own the php file will run fine except when included in the theme.php file it only seems to execute the 'if' and not the 'else' statement because even if the 'if' is a negative it still behaves as if it is a possitive and the 'else' doesn't get a chance to run.

Any help on the would be great and sorry if it is a question that is repeated somewhere in the docs/forums.

Cheers

Nick
Title: Re: noob question
Post by: nickfzx on May 24, 2006, 12:51:30 AM
im going ot post the above as a new topic as I doubt anyone will look at this now it says problem solved on it.
Title: 'if' and 'else' malfunction when including php into theme.php
Post by: nickfzx on May 24, 2006, 12:52:56 AM
sorry to ask again but I am fairly sure that this isn't in the manuals....so I have a php file that I have included by using this mod to the theme.php file:


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

if(empty($custom_header)){
include('MYPHPFILE.php');
static $custom_header;
$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);
}


The Php file consists of an 'if' and 'else' statement...when run on its own the php file will run fine except when included in the theme.php file it only seems to execute the 'if' and not the 'else' statement because even if the 'if' is a negative it still behaves as if it is a possitive and the 'else' doesn't get a chance to run.

Any help on the would be great and sorry if it is a question that is repeated somewhere in the docs/forums.

Cheers

Nick
Title: Re: 'if' and 'else' malfunction when including php into theme.php
Post by: nickfzx on May 24, 2006, 05:09:48 AM
it is a problem with the cookie of my site...it seems to return the value guest even if I am logged in...the cookie works fine in the coppermine directory just not when it's called from a file in the coppermine directory!!


Any ideas?
Title: Re: noob question
Post by: Joachim Müller on May 24, 2006, 07:20:17 AM
Quote from: nickfzx on May 24, 2006, 12:51:30 AM
im going ot post the above as a new topic as I doubt anyone will look at this now it says problem solved on it.
merged again. Don't!