$section variable in theme.php function pagefooter $section variable in theme.php function pagefooter
 

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

$section variable in theme.php function pagefooter

Started by nukeworker, September 14, 2005, 10:53:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nukeworker

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

nukeworker

#1
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.

nukeworker

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
{MAIN_MENU}
To
{MAIN_MENU}
<br><a href=http://images.google.com/images?q={GOOGLE}>Google for More Images.</a>


In theme.php

Change
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,TO
        '{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

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.
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

Quote from: kegobeer 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.
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

$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:

global $keepsection;
$keepsection = $section;


In function pagefooter, add this:

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.
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

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

    $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;
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