Advanced search  

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

Pages: [1]   Go Down

Author Topic: Space between my custom footer and CPG copyright  (Read 20692 times)

0 Members and 1 Guest are viewing this topic.

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Space between my custom footer and CPG copyright
« on: September 11, 2004, 08:12:21 am »

Hello,

I have just installed Coppermine on my site and I am customizing it.

Do you know how I can change the space (decrease it) between my cistom footer and the CPG copyright footer? You can have a look how is it now on www.bulgaricus.com/galeria
« Last Edit: September 14, 2004, 08:33:22 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #1 on: September 11, 2004, 08:33:27 am »

You have added not only plain html commands, but you alos add an additional <head></head></body> and  </body>, making your output completely non-standards compliant. You have two stylesheets (one you insert, one from coppermine) that has commands that contradict each other (as coppermine's stylesheet is called later, the properties from it will overrule yours). Please post your modifications (how you do insert your content, and what exactly) - just by looking at the html output I can only tell you what doesn't work, but I can't tell you how to make it work.

Joachim
Logged

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Space between my custom footer and CPG copyright
« Reply #2 on: September 11, 2004, 09:06:08 am »

I have added to theme.php the followinh code:

<?php include '../menu_main.htm'; ?>

<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.3.2                                            //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002-2004 Gregory DEMAR                                     //


and

// Function for writing a pagefooter
function pagefooter()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
global $USER, $ALBUM_SET, $CONFIG, $time_start, $query_stats;
global $template_footer;

if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
cpg_debug_output();
}

// Create Custom Footer

if(empty($custom_footer)){
   
include('../stopka_for.php');
}


echo $template_footer;
}
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #3 on: September 11, 2004, 08:54:14 pm »

well, that's not the way this is correcty done, as your custom header will come before coppermine's own header, that contains the redirect stuff in the meta tag.
Generally speaking, remove the <head>, <html> and <body> sections from your custom footer, for more details, zip them up and attach them to your posting, along with any other relevant files. Please don't let us ask for every piece of information, why don't you just give it to us - will make support easier.

Joachim
Logged

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Space between my custom footer and CPG copyright
« Reply #4 on: September 12, 2004, 12:20:37 am »

Sorry for not giving full information. No I will correct my mistake :)

I have attached to that post my header and footer files. My site is biuld that way that each page has at the beginning <include header..> and at the end <include footer..>. Meta tags and the HTML sceleton are in that two files, so it is very easy to update them. If I remove the <head>, <html> and <body>, I will have to create a special version of these files for the gallery which is not very convenient :(
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #5 on: September 12, 2004, 09:57:41 am »

OK, I have created a small mod for you that will add your custom header and footer half-correctly. Please note that this will not create anything that even closely resembles valid code, but I guess you don't mind, as your includes themselves are very far from compliance with anything ;):
It's also not recommended to mess with the classic theme that comes with coppermine as you did, but create your own theme that is based on the classic theme. Anyway, you did what you did, and it's your page to break (will make future updates harder).

Step 1:
edit themes/yourtheme/theme.php and undo your modification, as they're just plainly wrong. Remove
Code: [Select]
<?php include '../menu_main.htm'?>and
Code: [Select]
// Create Custom Footer

if(empty($custom_footer)){
   
include('../stopka_for.php');
}

Step 2:
Edit themes/yourtheme/template.html, find
Code: [Select]
<body>and add after it (in a new line of it's own):
Code: [Select]
{CUSTOM_HEADER}Then find
Code: [Select]
</body>and add right before it (in a new line of it's own)
Code: [Select]
{CUSTOM_FOOTER}Those two entries are the placeholders where you want your custom header and footer finally to appear on your page. You can come up with any other position in your template.html file (within the <body></body> section!) if you want.

Step 3:
Edit themes/yourtheme/theme.php once more, find
Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    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(),
        );

    echo template_eval($template_header, $template_vars);
}
// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    echo $template_footer;
}
and replace with
Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

   // this is the place where the custom header file gets included
   if(empty($custom_header)){
      ob_start();
      include('menu_main.htm');
      $custom_header = cleanup_custom_includes(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
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

   // this is the place where the custom footer file gets included
   if(empty($custom_footer)){
      ob_start();
      include('stopka_for.php');
      $custom_footer = cleanup_custom_includes(ob_get_contents());
      ob_clean();
   }

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
    );

    echo template_eval($template_footer, $template_vars);
}

// Function to clean up any double html leftovers from the custom header and footer that are not meant to get parsed
function cleanup_custom_includes($string) {
    $string = str_replace('<HTML>', '', $string);
    $string = str_replace('<HEAD>', '', $string);
    $string = str_replace('<BODY>', '', $string);
    $string = str_replace('</HTML>', '', $string);
    $string = str_replace('</HEAD>', '', $string);
    $string = str_replace('</BODY>', '', $string);
    return $string;
}

You might have to edit the paths to your include files, look for the lines
Code: [Select]
      include('menu_main.htm');and
Code: [Select]
      include('stopka_for.php');, they have to be the paths to those incluide files, relative from your coppermine root folder (or make them absolute paths, doesn't matter).
Notice the crude replacement function I added (cleanup_custom_includes): it will replace the worst cases of code mismatch by stripping your overhead tags, but they will still leave your page as code soup, with improper reference (e.g. the meta tags residing inside the body of the page). There's a lot of redundant JavaScript on your page as well that would better be done with some simple php code, but then again: you probably will not care. I just want to warn you: creating such proprietary, non-standards code will probably render your site "strangely" in many browsers (not the browser's fault, but your code's fault), and it will make future adjustments necessary to your code.

Step 4:
Upload the whole enchilada to your site, test it and report back here.

Cheers

Joachim
« Last Edit: November 01, 2004, 11:07:10 pm by GauGau »
Logged

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Space between my custom footer and CPG copyright
« Reply #6 on: September 12, 2004, 01:54:52 pm »

Thanks, Joachim for the support. There is such mess im in code because I have a very plain idea of PHP, absolutely no idea of JavaScript and some medium knowledge of HTML. You see, after working hours I administrate Bulgaricus.com as a hobby. I am aware that my site is far from being perfect and I am very grateful when someone poits my mistakes and helps me to correct them.

Coming back to the point of that topic, I have made the changes that you suggested. Some strange code appeared on my page. Can you have a look at it on www.bulgaricus.com/galeria and eventually advise me something?

Thanks in advance!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #7 on: September 12, 2004, 02:20:26 pm »

There's a closing tag missing somewhere. Zip up the full content of your theme folder (in your case the whole folder "classic" and everything within it, preserving the folder structure). Attach the zip to your posting.

Joachim
Logged

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Space between my custom footer and CPG copyright
« Reply #8 on: September 12, 2004, 03:58:37 pm »

O.K. my classic theme is attached
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #9 on: September 12, 2004, 04:12:28 pm »

the issues you're facing are being caused by not reading the instructions I posted, or not doing as suggested. I will not support you any further if you don't do what I tell you to and even don't bother to review your modifications by comparing them to my instructions. You haven't replaced everything I told you to, but only bits of it, that's what is causing the garbled output.
Download attached file, save it into your classic theme folder, rename it from theme.txt to theme.php (rename your existing file to something else, or delete it completely). Upload and smile.

Joachim
Logged

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Space between my custom footer and CPG copyright
« Reply #10 on: September 12, 2004, 05:13:30 pm »

Thanks a lot Joachim! You are great! Now it works :)

Do you know now, how can I move CPG Copyright under my footer and decrease the space between them?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #11 on: September 13, 2004, 09:37:33 am »

I won't tell you how to move the copyright tag around (see http://coppermine.sourceforge.net/faq.php#editCopyrights ). Edit the margin and padding attributes in your stylesheets (you have to modify two of them as you chose to include your header instead of modifying the coppermine theme files as suggested). The classes to look for are "maintable", table, tr, td in themes/classic/style.css and of course http://bulgaricus.com/galeria/themes/classic/style.css
Also remove all height attributes in <table>, <tr> and <td> tags everywhere (as they're a silly thing in the first place), especially in themes/classic/template.html
The next thing to play around with is the spacer image: edit themes/classic/theme.php, find
Code: [Select]
<img src="images/spacer.gif" width="1" height="17" /><br />You'll notice it's in the code several times, change one or more of them to have a smaller hieght attribute, e.g.
Code: [Select]
<img src="images/spacer.gif" width="1" height="5" /><br />
Joachim
Logged

Bulgaricus

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Space between my custom footer and CPG copyright
« Reply #12 on: September 13, 2004, 08:58:12 pm »

Thanks it worked :)
Logged

kroberson

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Space between my custom footer and CPG copyright
« Reply #13 on: June 23, 2005, 01:49:42 am »

ok... I used the exact file you sent to the other guy but changed the file name... however, its causing database issues for some reason... any suggestions... thank you, in advance.

http://www.myspecialdog.com/spotlight/

Kevin
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #14 on: June 30, 2005, 02:12:48 pm »

don't use the pre-made files - instead, try to understand my postings and modify your files accordingly.
Logged

blambert

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Space between my custom footer and CPG copyright
« Reply #15 on: July 11, 2005, 07:59:34 pm »

Thanks GauGau,
you solved my problem.
now I need a IF ELSE SWITCH....can you help with that?
http://www.lambertandassoc.com/photos/index.php
Logged

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Re: Space between my custom footer and CPG copyright
« Reply #16 on: July 19, 2005, 12:02:09 pm »

GauGau rocks  .... this post sorted my probs out as well thankyou very much. I reacon a link to this post should be included in manual under the Custom Header and Footer section.

Dill
www.mystaffie.com
Logged
Dillon Weyer
dill@mystaffie.com

CoasterJoe.com

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Space between my custom footer and CPG copyright
« Reply #17 on: July 31, 2005, 07:42:16 pm »

Hi. Is there a way to modify this code to include more then two files? I would like to be able to include two more. I played around with it a little bit but I could not quite figure it out. Any help or suggestions would be appreciated. Thank you.
Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

   // this is the place where the custom header file gets included
   if(empty($custom_header)){
      ob_start();
      include('menu_main.htm');
      $custom_header = cleanup_custom_includes(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
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

   // this is the place where the custom footer file gets included
   if(empty($custom_footer)){
      ob_start();
      include('stopka_for.php');
      $custom_footer = cleanup_custom_includes(ob_get_contents());
      ob_clean();
   }

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
    );

    echo template_eval($template_footer, $template_vars);
}

// Function to clean up any double html leftovers from the custom header and footer that are not meant to get parsed
function cleanup_custom_includes($string) {
    $string = str_replace('<HTML>', '', $string);
    $string = str_replace('<HEAD>', '', $string);
    $string = str_replace('<BODY>', '', $string);
    $string = str_replace('</HTML>', '', $string);
    $string = str_replace('</HEAD>', '', $string);
    $string = str_replace('</BODY>', '', $string);
    return $string;
}
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Space between my custom footer and CPG copyright
« Reply #18 on: July 31, 2005, 10:21:59 pm »

you can include as many files as you want. If you want to include them in different places, you have to add more placeholder tokens.
Logged

CoasterJoe.com

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Space between my custom footer and CPG copyright
« Reply #19 on: August 01, 2005, 06:35:44 am »

I figured out what I was doing wrong, I was using the code for the header to put stuff in the footer and obvisouly it was notgoing to work :D  I changed it around and it worked perfectly! Thanks for the help!
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 19 queries.