Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Coppermine Theme system - HELP  (Read 4019 times)

0 Members and 1 Guest are viewing this topic.

simplythi

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Coppermine Theme system - HELP
« 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.
Logged

Zarsky

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 268
    • Zerr Family Website
Coppermine Theme system - HELP
« Reply #1 on: October 23, 2003, 07:35:34 pm »

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

simplythi

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Coppermine Theme system - HELP
« Reply #2 on: October 23, 2003, 08:27:55 pm »

the FAQ is useless.
Logged

Zarsky

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 268
    • Zerr Family Website
Coppermine Theme system - HELP
« Reply #3 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
Logged
Read the Online DOCs, FAQ, and SEARCH the board BEFORE posting questions for help.

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Coppermine Theme system - HELP
« Reply #4 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
Logged
SANIsoft PHP applications for E Biz
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.