define .... {PHP_DATE} ??? define .... {PHP_DATE} ???
 

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

define .... {PHP_DATE} ???

Started by CanadianJeff, June 02, 2009, 02:49:03 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

CanadianJeff

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html dir="{LANG_DIR}" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/floog/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
</head>
<body>
{CUSTOM_HEADER}
<div class="tha_main_table">
<div class="headerbar">
<div id="site-description">
<a href="./index.php" title="Index" id="logo"><img src="themes/floog/images/cpglogo.png" alt="Logo" title="" /></a>
<h1 style="display: none;">{GAL_NAME}</h1>
<p></p>
<p style="display: none;">{GAL_DESCRIPTION}</p>
</div>
<div class="sitemenu">{SYS_MENU}</div>
</div>

        <img src="images/spacer.gif" width="1" height="15" alt="" />
<div class="sub_header">
{HEADER_BREADCRUMB}
<div id="header-box">
-------> {PHP_DATE}          <-----------
</div>
</div>
<div class="album">
<div class="sub_sub_menu">{SUB_MENU}<br /><br /></div>
              {ADMIN_MENU}
              {GALLERY}
<div style="text-align:center;">
<div>
  {LANGUAGE_SELECT_FLAGS}<br />
  {THEME_SELECT_LIST}{LANGUAGE_SELECT_LIST}
</div>
</div>
        </div>
</div>
  {CUSTOM_FOOTER}{VANITY}
</body>
</html>


I want {PHP_DATE} to be <?php echo date('l F jS Y @ h:i:s A'); ?>

example (Monday June 1st 2009 @ 12:00:00 PM)

Joachim Müller

You can't just add template tokens to template.html - that's just wihsfull thinking. Think of the template tokens as placeholders for stuff that get's defined first in theme.php. To accomplish what you're up to, edit themes/yourtheme/theme.php, find function pageheader($section, $meta = '')and edit as suggested below. If your custom theme doesn't contain that function definition (or, for future reference: any other section that you would like to see changed, i.e. that is suppossed to differ from Coppermine's default), copy that section (and only that section) from themes/sample/theme.php into a new line before ?>in themes/yourtheme/theme.php
In your case, you need to copy// Function for writing a pageheader
function pageheader($section, $meta = '')
{
   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

       $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

   header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
       header("Content-Type: text/html; charset=$charset");
   user_save_profile();

   $template_vars = array('{LANG_DIR}' => $lang_text_dir,
       '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
       '{CHARSET}' => $charset,
       '{META}' => $meta,
       '{GAL_NAME}' => $CONFIG['gallery_name'],
       '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
       '{SYS_MENU}' => theme_main_menu('sys_menu'),
       '{SUB_MENU}' => theme_main_menu('sub_menu'),
       '{ADMIN_MENU}' => theme_admin_mode_menu(),
       '{CUSTOM_HEADER}' => $custom_header,
       );

   echo template_eval($template_header, $template_vars);
}
from themes/sample/theme.php into themes/yourtheme/theme.php if your custom theme doesn't already contain that function definition.

After that, populating the template token is pretty straightforward: edit the code you just pasted in to read like this:// Function for writing a pageheader
function pageheader($section, $meta = '')
{
   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

       $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

   header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
       header("Content-Type: text/html; charset=$charset");
   user_save_profile();

   $template_vars = array('{LANG_DIR}' => $lang_text_dir,
       '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
       '{CHARSET}' => $charset,
       '{META}' => $meta,
       '{GAL_NAME}' => $CONFIG['gallery_name'],
       '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
       '{SYS_MENU}' => theme_main_menu('sys_menu'),
       '{SUB_MENU}' => theme_main_menu('sub_menu'),
       '{ADMIN_MENU}' => theme_admin_mode_menu(),
       '{CUSTOM_HEADER}' => $custom_header,
       '{PHP_DATE}' => date('l F jS Y @ h:i:s A'),
       );

   echo template_eval($template_header, $template_vars);
}
Pretty straightforward if you know the basics.

Joachim

P.S. You probably already guessed it: this has been asked and answered often already, so in the future, please search before posting. Respect board rules in the future as well (you agreed to respect them when signing up) - one of the rules says that you have to post a link to your gallery, especially when asking for themeing support. I guess that the link would be http://www.jefferywilkins.com/gallery/ in this case...