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: Adding Ads to Full Size Pop-Up  (Read 6862 times)

0 Members and 1 Guest are viewing this topic.

nana19

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Adding Ads to Full Size Pop-Up
« on: October 01, 2010, 07:11:45 am »

I have tried and search everything I can think off, I tried this here and it was the only thing I could find on this topic:
http://forum.coppermine-gallery.net/index.php/topic,53279.0.html

It is for version 1.4.x of coppermine though and it does not work for 1.5.6, I see the pop up of the full size photo with the ads on it but the photo does not show at all.

Can anyone help me please?

I am using it on this site:
http://mileypictures.us/

If you go to the site and click on an image, the pop-up with show with the ad but no full size image in the pop-up.

Thanks!!
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9097
  • aka Frantz
    • Ma galerie
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

nana19

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Adding Ads to Full Size Pop-Up
« Reply #2 on: October 01, 2010, 08:03:21 am »

I did not see that before, but I really do not understand it at all!

Is there like a copy and paste? I am not to good with coding or php or anything and have no understanding of it.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Adding Ads to Full Size Pop-Up
« Reply #3 on: October 01, 2010, 08:35:15 am »

Upgrade to cpg1.5.8.
Logged

nana19

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Adding Ads to Full Size Pop-Up
« Reply #4 on: October 01, 2010, 08:53:14 am »

I upgraded and still the same problem, I am now running on 1.5.8 of coppermine.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Adding Ads to Full Size Pop-Up
« Reply #5 on: October 01, 2010, 09:05:45 am »

Which problem? You want to add content to the full size view. As described in the docs you have to modify the function theme_display_fullsize_pic in the theme.php file of your theme. You cannot apply mods for cpg1.4.x to cpg1.5.x. Maybe it works, but as you said in your case it doesn't. If you cannot figure out yourself how to accomplish your goals you have to describe exactly where you want to place your content.

Moving to themes board.
Logged

nana19

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Adding Ads to Full Size Pop-Up
« Reply #6 on: October 01, 2010, 02:47:08 pm »

I want to put a 728x90 ad on the full-size pictures.

When you click on a thumbnail and the pop-up for the full size images pops up I want there to be a 728x90 add code right above the full size picture.

The docs are so complicated to understand, I have tried all night and I just can't seem to get it and I was wondering if there was just a copy/paste that I could of used to have this fix.

Thanks for any help on this!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Adding Ads to Full Size Pop-Up
« Reply #7 on: October 01, 2010, 03:53:28 pm »

Find
Code: [Select]
<body style="margin:0px; padding:0px; background-color: gray;">and add your HTML code below that line.
Logged

nana19

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Adding Ads to Full Size Pop-Up
« Reply #8 on: October 01, 2010, 04:11:17 pm »

Ok, after nearly 12 hours I think I finally got it!!

In case anyone else has problems the way I did here is my theme.php file coding:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2010 Coppermine Dev Team
  v1.0 originally written by Gregory Demar

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.5.8
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/themes/water_drop/theme.php $
  $Revision: 7805 $
**********************************************/

define('THEME_HAS_PROGRESS_GRAPHICS'1);

// HTML template for template sys_menu spacer
$template_sys_menu_spacer '<img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';


/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - START
******************************************************************************/
// Display the full size image
function theme_display_fullsize_pic()
{
    global 
$CONFIG$THEME_DIR$FORBIDDEN_SET$LINEBREAK$pid;
    global 
$lang_errors$lang_fullsize_popup$lang_charset;

    
$superCage Inspekt::makeSuperCage();

    if (!
USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
        
printf($lang_errors['login_needed'],'','','','');
        die();
    } elseif (
USER_ID && USER_ACCESS_LEVEL <= 2) {
        
printf($lang_errors['access_intermediate_only'],'','','','');
        die();
    }
    if (
$superCage->get->keyExists('picfile')) {
        if (!
GALLERY_ADMIN_MODE) {
            
cpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
        }
        
//$picfile = $_GET['picfile'];
        //$picfile = $superCage->get->getPath('picfile'); // doesn't work with HTML entities
        
$matches $superCage->get->getMatched('picfile''/^[0-9A-Za-z\/_.-]+$/');
        
$picfile $matches[0];
        
$picname $CONFIG['fullpath'] . $picfile;
        
$imagesize = @getimagesize($picname);
        
$imagedata = array('name' => $picfile'path' => path2url($picname), 'geometry' => $imagesize[3]);
    } elseif (
$pid) {
        
$sql "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} AS p " "WHERE pid='$pid$FORBIDDEN_SET";
        
$result cpg_db_query($sql);
        if (!
mysql_num_rows($result)) {
            
cpg_die(ERROR$lang_errors['non_exist_ap'], __FILE____LINE__);
        }
        
$row mysql_fetch_assoc($result);
        
$pic_url get_pic_url($row'fullsize');
        
$geom 'width="' $row['pwidth'] . '" height="' $row['pheight'] . '"';
        
$imagedata = array('name' => $row['filename'], 'path' => $pic_url'geometry' => $geom);
    }
    if ((!
USER_ID && $CONFIG['allow_unlogged_access'] <= 2) || (USER_ID && USER_ACCESS_LEVEL <= 2)) {
        
// adjust the size of the window if we don't have to catter for a full-size pop-up, but only a text message
        
$row['pwidth'] = 200;
        
$row['pheight'] = 100;
    }

    
$charset = ($CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset']);
    
$fullsize_html = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=
$charset" />
        <title>
{$CONFIG['gallery_name']}{$lang_fullsize_popup['click_to_close']}</title>
        <style type="text/css">
            body { margin: 0; padding: 0; background-color: gray; }
            img { margin:0; padding:0; border:0; }
            #content { margin:0 auto; padding:0; border:0; }
            table { border:0; width:
{$row['pwidth']}px; height:{$row['pheight']}px; border-collapse:collapse}
            td { vertical-align: middle; text-align:center; }
        </style>

        <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
        <script type="text/javascript" src="js/jquery.dimensions.pack.js"></script>
        <script type="text/javascript" src="js/displayimage.fullsize.js"></script>
    </head>
    <body style="margin:0px; padding:0px; background-color: gray;">
<center>
MY AD CODE HERE!
</center>
                    </div>
                </td>
            </tr>
        </table>

EOT;
    } else {
        
$fullsize_html .=  '        <div id="content">'.$LINEBREAK;
        
$fullsize_html .=  '<a href="javascript: window.close()"><img src="'
        
htmlspecialchars($imagedata['path']) . '" '
        
$imagedata['geometry']
        . 
'id="fullsize_image" alt="'
        
htmlspecialchars($imagedata['name'])
        . 
'" title="'
        
htmlspecialchars($imagedata['name'])
        . 
$LINEBREAK $lang_fullsize_popup['click_to_close']
        . 
'" /></a><br />' $LINEBREAK
        
'        </div>'.$LINEBREAK;
    }
    
$fullsize_html .= <<<EOT
  </body>
</html>

EOT;

    
$fullsize_html CPGPluginAPI::filter('fullsize_html'$fullsize_html);
    echo 
$fullsize_html;
}
/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - END
******************************************************************************/
?>

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Adding Ads to Full Size Pop-Up
« Reply #9 on: October 01, 2010, 04:19:25 pm »

Not sure where you got this function code from, but it's not the one from the sample theme of cpg1.5.x.

Here is the correct code for cpg1.5.x:
Code: [Select]
function theme_display_fullsize_pic()
{
    global $CONFIG, $THEME_DIR, $FORBIDDEN_SET, $LINEBREAK, $pid;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    $superCage = Inspekt::makeSuperCage();

    if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
        printf($lang_errors['login_needed'],'','','','');
        die();
    } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
        printf($lang_errors['access_intermediate_only'],'','','','');
        die();
    }
    if ($superCage->get->keyExists('picfile')) {
        if (!GALLERY_ADMIN_MODE) {
            cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
        }
        //$picfile = $_GET['picfile'];
        //$picfile = $superCage->get->getPath('picfile'); // doesn't work with HTML entities
        $matches = $superCage->get->getMatched('picfile', '/^[0-9A-Za-z\/_.-]+$/');
        $picfile = $matches[0];
        $picname = $CONFIG['fullpath'] . $picfile;
        $imagesize = @getimagesize($picname);
        $imagedata = array('name' => $picfile, 'path' => path2url($picname), 'geometry' => $imagesize[3]);
    } elseif ($pid) {
        $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} AS p " . "WHERE pid='$pid' $FORBIDDEN_SET";
        $result = cpg_db_query($sql);
        if (!mysql_num_rows($result)) {
            cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
        }
        $row = mysql_fetch_assoc($result);
        $pic_url = get_pic_url($row, 'fullsize');
        $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
        $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
    }
    if ((!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) || (USER_ID && USER_ACCESS_LEVEL <= 2)) {
        // adjust the size of the window if we don't have to catter for a full-size pop-up, but only a text message
        $row['pwidth'] = 200;
        $row['pheight'] = 100;
    }

    $charset = ($CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset']);
    $fullsize_html = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=$charset" />
        <title>{$CONFIG['gallery_name']}: {$lang_fullsize_popup['click_to_close']}</title>
        <style type="text/css">
            body { margin: 0; padding: 0; background-color: gray; }
            img { margin:0; padding:0; border:0; }
            #content { margin:0 auto; padding:0; border:0; }
            table { border:0; width:{$row['pwidth']}px; height:{$row['pheight']}px; border-collapse:collapse}
            td { vertical-align: middle; text-align:center; }
        </style>

        <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
        <script type="text/javascript" src="js/jquery.dimensions.pack.js"></script>
        <script type="text/javascript" src="js/displayimage.fullsize.js"></script>
    </head>
    <body style="margin:0px; padding:0px; background-color: gray;">
    <!-- PASTE YOUR CODE HERE -->
EOT;
    if ($CONFIG['transparent_overlay'] == 1) {
        $fullsize_html .= <<<EOT
        <table cellpadding="0" cellspacing="0" align="center" style="padding:0px;">
            <tr>

EOT;
        $fullsize_html .=  '<td align="center" valign="middle" background="' . htmlspecialchars($imagedata['path']) . '" ' . $imagedata['geometry'] . ' class="image">';
        $fullsize_html .=  '<div id="content">';
        $fullsize_html .=  '<a href="javascript: window.close()" style="border:none"><img src="images/image.gif?id='
                . floor(rand()*1000+rand())
                . '&amp;fullsize=yes" '
                . $imagedata['geometry']
                . ' alt="'
                . htmlspecialchars($imagedata['name'])
                . '" title="'
                . htmlspecialchars($imagedata['name'])
                . $LINEBREAK . $lang_fullsize_popup['click_to_close']
                . '" /></a><br />' . $LINEBREAK;
        $fullsize_html .=  <<<EOT
                    </div>
                </td>
            </tr>
        </table>

EOT;
    } else {
        $fullsize_html .=  '        <div id="content">'.$LINEBREAK;
        $fullsize_html .=  '<a href="javascript: window.close()"><img src="'
        . htmlspecialchars($imagedata['path']) . '" '
        . $imagedata['geometry']
        . 'id="fullsize_image" alt="'
        . htmlspecialchars($imagedata['name'])
        . '" title="'
        . htmlspecialchars($imagedata['name'])
        . $LINEBREAK . $lang_fullsize_popup['click_to_close']
        . '" /></a><br />' . $LINEBREAK
        . '        </div>'.$LINEBREAK;
    }
    $fullsize_html .= <<<EOT
  </body>
</html>

EOT;

    $fullsize_html = CPGPluginAPI::filter('fullsize_html', $fullsize_html);
    echo $fullsize_html;
}
Just replace the <!-- PASTE YOUR CODE HERE --> with your code.
Logged

nana19

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Adding Ads to Full Size Pop-Up
« Reply #10 on: October 01, 2010, 04:32:59 pm »

I got the code from the "sample theme" in the 1.5.8 zip download.

I replaced the code though, everything is working perfectly!

Thank you all so much for your help! I really appreciate it!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15759
Re: Adding Ads to Full Size Pop-Up
« Reply #11 on: October 01, 2010, 06:02:13 pm »

Marking as solved.
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 21 queries.