re-placing content in anycontent.php re-placing content in anycontent.php
 

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

re-placing content in anycontent.php

Started by markp17, December 31, 2004, 04:13:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

markp17

Hi

I have tried searching this site, and used what topics I could, yet I must be missing something, as I cannot get the content from anycontent.php to show on any page within coppermine..

The content I have is

<?  include "http://www.anotherdomain.co.uk/pbanner/banner.php"; ?>

Any help is welcome..

Thanks Mark

Nibbler

You add it into 'contents of the main page' in config page, and it should then appear on your main page. Post a link to your site if it doesn't work.

markp17

Hi

Thanks, it brought up a parse error. I can give you the link, but it will have to be via pm, as it is an adult type site..

What I am trying to do is place a banner just above the pagefooter, so far without much success..It needs to appear on every page..

Thanks Mark

Nibbler

If you need it on every page then you need to treat it as a custom footer, not as an anycontent block. Refer to the docs for how to do this.

markp17

HI

Thanks, dead easy when you can find the info, or at least know where to look.

Thanks Mark

markp17

Hi

Well, I spoke too soon, followed what the docs said, and got the following error, although I cannot see anything wrong with script..

Parse error: parse error, expecting `','' or `';'' in /home/virtual/site5/fst/var/www/html/mem/memm/themes/classic/theme.php on line 812

Line 812 
static $custom_header = ob_get_contents();

Fatal error: Call to undefined function: theme_display_album_list_cat() in /home/virtual/site5/fst/var/www/html/mem/memm/index.php on line 647

Line 647
theme_display_album_list_cat($alb_list, $nbAlb, $cat, $PAGE, $totalPages);

Nibbler

Can you post your full pageheader() function here please ? use the [ code ] and [ /code ] tags to keep it readable.

markp17

Hi

Sorry for delay was watching news..


function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;
   
    if(empty($custom_header)){
      include('/banner/pbanner.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);
}
// Function for writing a pagefooter

markp17


Nibbler

Change the top part to the following:

   if(empty($custom_header)){
   include('/banner/pbanner.php');
   static $custom_header;
   $custom_header = ob_get_contents(); 
   ob_clean();
}

markp17

Hi

Nope this didn't work

what is now displays at the bottom of the page is

Powered by Coppermine Photo Gallery
{CUSTOM_HEADER}

can't for the life of me figure out what is wrong

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;
   
    if(empty($custom_header)){
   include('http://www.mydomain.co.uk/pbanner/banner.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);
}

markp17

Ahh, ok I see what is wrong, this will only work if used at the top of a page, I need it to be at the bottom of the page..

Thanks Mark

Casper

Then you need to put it in the page footer function.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

markp17

Tried that and it crashed the software

Joachim Müller


markp17

I placed the code from the above header (as detailed a couple of replies above) simply would not work and brought up a php error, so I suspect it is more like something I have done, such as placing the code in the wrong place. An example of how the code should be placed would be welcome

Thanks Mark

Joachim Müller