noob question noob question
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

noob question

Started by nickfzx, May 23, 2006, 08:23:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickfzx

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

Nibbler


nickfzx

cool thanks....just working out how to make it run php but i guess i can work that out now


nickfzx

oh...that's a bummer :)

is there a commonly used workaround for this?

Joachim Müller

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.

nickfzx

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.

nickfzx

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

nickfzx

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.

nickfzx

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

nickfzx

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?

Joachim Müller

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!