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: $section variable in theme.php function pagefooter  (Read 5364 times)

0 Members and 1 Guest are viewing this topic.

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
$section variable in theme.php function pagefooter
« on: September 14, 2005, 10:53:03 pm »

I want to add a line in my template.html that looks like this:
Also try searching for images on google: <a href=http://images.google.com/images?q={GOOGLE}>http://images.google.com/images?q={GOOGLE}</a>

I want this to be after the {GALLERY} tag, so I'm putting it in the pagefooter function.

Problem seems to be that $section isn't defined.  Below is my code.  Please help me. :)

Quote
// 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();
    }

$template_vars = array(
        '{GOOGLE}' => urlencode($CONFIG['gallery_name'] . ' ' . $section),
);
« Last Edit: September 16, 2005, 05:59:00 pm by Nibbler »
Logged

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
Re: $section variable in theme.php function pagefooter
« Reply #1 on: September 15, 2005, 03:35:44 pm »

The code works just dandy in the header portion, I just cant get the $section variable to work in the footer.  Please tell me how to get that veriable initialized.
« Last Edit: September 15, 2005, 04:18:56 pm by nukeworker »
Logged

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
Re: $section variable in theme.php function pagefooter
« Reply #2 on: September 15, 2005, 04:37:14 pm »

I guess I'll give up.  I'll just put it at the top of the page, here is the code I'm using to google for more images. (I use this to look for more images on the subject, so I can add them to our galery easily.

In template.html

Change
Code: [Select]
{MAIN_MENU}To
Code: [Select]
{MAIN_MENU}
<br><a href=http://images.google.com/images?q={GOOGLE}>Google for More Images.</a>

In theme.php

Change
Code: [Select]
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,TO
Code: [Select]
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
        '{GOOGLE}' => urlencode($CONFIG['gallery_name'] . ' ' . $section),

This works for me, but you may need to change your key words a little.

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: $section variable in theme.php function pagefooter
« Reply #3 on: September 15, 2005, 07:45:21 pm »

Please respect board rules and don't bump for at least a day.  This isn't a hotline.  Have you searched the boards?  I'm sure there are plenty of posts dealing with placeholders you can read until someone has the time to look into the template system.  As I'm at work I don't have access to my files.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
Re: $section variable in theme.php function pagefooter
« Reply #4 on: September 15, 2005, 09:41:04 pm »

Please respect board rules and don't bump for at least a day.  This isn't a hotline.  Have you searched the boards?  I'm sure there are plenty of posts dealing with placeholders you can read until someone has the time to look into the template system.  As I'm at work I don't have access to my files.
Kegobeer,

I've been using coppermine for a long time, and have given little contributions along the way when I could.  (I'm just ignorant when it comes to the finer details of PHP/coppermine).

I most deffinatly did search the messages boards with multiple keywords, and read every message.  This particular subject was not discussed.

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: $section variable in theme.php function pagefooter
« Reply #5 on: September 16, 2005, 03:16:13 am »

$section is loaded from wherever the pageheader is called.  You can do this to grab and keep the $section variable:

In theme.php, in function pageheader, add this:

Code: [Select]
global $keepsection;
$keepsection = $section;

In function pagefooter, add this:

Code: [Select]
global $keepsection;
Now you have the section in your footer.  If you explain how you want it displayed (ie, at the very bottom after the tag line, just under the gallery, etc) I can show you how to do that.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: $section variable in theme.php function pagefooter
« Reply #6 on: September 16, 2005, 03:31:16 am »

To just display it right above the tag line, do this:

Code: [Select]
    $google = urlencode($CONFIG['gallery_name'] . ' ' . $keepsection);
echo '
<div class="footer">
<a href=http://images.google.com/images?q=', $google, '>http://images.google.com/images?q=', $google, '</a>
</div>
';
    echo $template_footer;
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

nukeworker

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 83
  • Visit NukeWorker.com
    • Nuclear Jobs
Re: $section variable in theme.php function pagefooter
« Reply #7 on: September 16, 2005, 05:44:43 pm »

Thanks Kegobeer, I knew it was simple, it was just alluding me.
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.