forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: simplythi on October 23, 2003, 07:07:32 pm

Title: Coppermine Theme system - HELP
Post by: simplythi on October 23, 2003, 07:07:32 pm
OK i have a minor issue, I have a php Banner system I want to insert somewhere into the coppermine themes. The only problem is the template is a html file and the piece of code I need to isert into it is php.

So if i renamed the template file to php would the theme still function?

If i add the code to theme.php where would i insert it and with what type of structure?

if it helps at all, this is the piece of code i need to insert.

<?php
    if (@include(getenv('DOCUMENT_ROOT').'/ads/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:2', 0, 'blank', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
    }
?>

Thanks in advance.
Title: Coppermine Theme system - HELP
Post by: Zarsky on October 23, 2003, 07:35:34 pm
read the FAQ....or search use the anycontent.php.
Title: Coppermine Theme system - HELP
Post by: simplythi on October 23, 2003, 08:27:55 pm
the FAQ is useless.
Title: Coppermine Theme system - HELP
Post by: Zarsky on October 23, 2003, 10:02:39 pm
Quote from: "simplythi"
the FAQ is useless.



it is?

like i said ....this is cut directly from the FAQ:

Quote
There are these files to look for:
if you want to add static html-content (for example your site logo), edit /themes/yourtheme/template.html - add/remove anything you want, but be sure to leave everything in that is in brackets.
if you want dynamic content (or want to add PHP-code), edit the file /themes/yourtheme/theme.php
if you want the edit the color scheme of a theme to match the "look-and-feel" of your site, edit /themes/yourtheme/style.css
if you know PHP (at least a little) and want to use PHP-includes, look for function pageheader in /themes/yourtheme/theme.php and edit change it like this:

Code: [Select]
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);
}

You will need to add a new field {CUSTOM_HEADER} in your template.html file.


the anycontent.php file is really the easiest way to do what you are asking
Title: Coppermine Theme system - HELP
Post by: Tarique Sani on October 24, 2003, 06:10:56 am
Quote from: "simplythi"
the FAQ is useless.

Please dont hide your inadequacies in dismissal of some very hard work by others