Coppermine Theme system - HELP Coppermine Theme system - HELP
 

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

Coppermine Theme system - HELP

Started by simplythi, October 23, 2003, 07:07:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

simplythi

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.

Zarsky

read the FAQ....or search use the anycontent.php.
Read the Online DOCs, FAQ, and SEARCH the board BEFORE posting questions for help.

simplythi


Zarsky

Quote from: "simplythi"the FAQ is useless.


it is?

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

QuoteThere 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:

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
Read the Online DOCs, FAQ, and SEARCH the board BEFORE posting questions for help.

Tarique Sani

Quote from: "simplythi"the FAQ is useless.
Please dont hide your inadequacies in dismissal of some very hard work by others
SANIsoft PHP applications for E Biz