forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: markp17 on December 31, 2004, 04:13:20 pm

Title: re-placing content in anycontent.php
Post by: markp17 on December 31, 2004, 04:13:20 pm
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
Title: Re: re-placing content in anycontent.php
Post by: Nibbler on December 31, 2004, 04:57:57 pm
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.
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 02, 2005, 06:02:46 pm
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
Title: Re: re-placing content in anycontent.php
Post by: Nibbler on January 02, 2005, 06:12:11 pm
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.
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 02, 2005, 06:15:56 pm
HI

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

Thanks Mark
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 02, 2005, 06:41:38 pm
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);
Title: Re: re-placing content in anycontent.php
Post by: Nibbler on January 02, 2005, 06:54:50 pm
Can you post your full pageheader() function here please ? use the [ code ] and [ /code ] tags to keep it readable.
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 02, 2005, 07:48:03 pm
Hi

Sorry for delay was watching news..

Code: [Select]
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
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 16, 2005, 11:26:09 am
Hi

Any ideas??

Thanks Mark
Title: Re: re-placing content in anycontent.php
Post by: Nibbler on January 16, 2005, 03:24:42 pm
Change the top part to the following:

Code: [Select]
   if(empty($custom_header)){
   include('/banner/pbanner.php');
   static $custom_header;
   $custom_header = ob_get_contents(); 
   ob_clean();
}
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 18, 2005, 12:26:06 pm
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

Code: [Select]
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);
}
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 18, 2005, 12:28:08 pm
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
Title: Re: re-placing content in anycontent.php
Post by: Casper on January 18, 2005, 12:43:11 pm
Then you need to put it in the page footer function.
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 18, 2005, 01:14:42 pm
Tried that and it crashed the software
Title: Re: re-placing content in anycontent.php
Post by: Joachim Müller on January 19, 2005, 07:41:11 am
details?
Title: Re: re-placing content in anycontent.php
Post by: markp17 on January 21, 2005, 11:57:49 am
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
Title: Re: re-placing content in anycontent.php
Post by: Joachim Müller on January 21, 2005, 04:57:12 pm
http://forum.coppermine-gallery.net/index.php?topic=9863.msg44419#msg44419

Joachim