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] 2   Go Down

Author Topic: How to add an adcode or text/other into the photo window  (Read 17642 times)

0 Members and 1 Guest are viewing this topic.

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
How to add an adcode or text/other into the photo window
« on: August 14, 2012, 12:37:16 am »

I would like to know how to put an adcode or text or some other material in the fullsize image window? (javascript)

Thanks in advance.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: How to add an adcode or text/other into the photo window
« Reply #2 on: August 14, 2012, 12:59:02 am »

Yes I have this in my theme.php:
Code: [Select]
function theme_display_fullsize_pic()
If my adcode is:
Code: [Select]
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->


How shall this then work?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How to add an adcode or text/other into the photo window
« Reply #3 on: August 16, 2012, 02:08:41 pm »

Just add it to your favorite location in the HTML part inside that function (search for $fullsize_html).
Logged

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: Re: How to add an adcode or text/other into the photo window
« Reply #4 on: August 16, 2012, 04:27:53 pm »

You mean in theme.php? Or in some other file? I'm so confused...
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: How to add an adcode or text/other into the photo window
« Reply #5 on: August 16, 2012, 05:07:18 pm »

I just replied to your post:
I have this in my theme.php:
Code: [Select]
function theme_display_fullsize_pic()
Logged

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: Re: How to add an adcode or text/other into the photo window
« Reply #6 on: August 16, 2012, 05:28:34 pm »

I just replied to your post:

I am not a programmer, I wouldn't understand this anyway. I was asking how it shall look in the theme.php but then you say I should put it in some HTML space. My theme.php now looks like:
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2011 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.12
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/themes/water_drop/theme.php $
  $Revision: 8154 $
**********************************************/

define('THEME_HAS_PROGRESS_GRAPHICS'1);
function 
theme_display_fullsize_pic()
?>


<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->

... and my gallery is blank.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #7 on: August 16, 2012, 11:26:48 pm »

Add this to your custom theme.php right before the ?>
Code: [Select]
/******************************************************************************
** 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);
        if (is_image($row['filename'])) {
            $pic_url = get_pic_url($row, 'fullsize');
            $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
            $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
        } else {
            $pic_html = theme_html_picture();
            if (is_movie($row['filename'])) {
                $mime_content = cpg_get_type($row['filename']);
                $ctrl_offset['mov']=15;
                $ctrl_offset['wmv']=45;
                $ctrl_offset['swf']=0;
                $ctrl_offset['rm']=0;
                $ctrl_offset_default=45;
                $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
                preg_match('/width="([0-9]+)".*height="([0-9]+)"/', $pic_html, $matches);
                $width = $matches[1] + $CONFIG['fullsize_padding_x'];
                $height = $matches[2] + $CONFIG['fullsize_padding_y']+ $ctrl_height;
                $resize_window = '<script type="text/javascript">window.resizeTo('.$width.', '.$height.')</script>';
            }
            preg_match('/<td align="center" style="{SLIDESHOW_STYLE}">.*(.*)<\/td>/Us', $pic_html, $matches);
            $pic_html = $matches[1].$resize_window;
        }
    }
    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;">

EOT;
    if ($pic_html) {
        $fullsize_html .= $pic_html;
    } else {
        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
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
  </body>
</html>

EOT;

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

Remove
Code: [Select]
function theme_display_fullsize_pic()
and
Code: [Select]
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
from your custom theme.php first
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #8 on: August 17, 2012, 12:38:38 am »

Is this your gallery? http://kristindaily.org/photos/

If so, you need to upgrade.
<!--Coppermine Photo Gallery 1.5.16 (stable)-->
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: Re: How to add an adcode or text/other into the photo window
« Reply #9 on: August 17, 2012, 12:32:16 pm »

Add this to your custom theme.php right before the ?>
Code: [Select]
/******************************************************************************
** 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);
        if (is_image($row['filename'])) {
            $pic_url = get_pic_url($row, 'fullsize');
            $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
            $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
        } else {
            $pic_html = theme_html_picture();
            if (is_movie($row['filename'])) {
                $mime_content = cpg_get_type($row['filename']);
                $ctrl_offset['mov']=15;
                $ctrl_offset['wmv']=45;
                $ctrl_offset['swf']=0;
                $ctrl_offset['rm']=0;
                $ctrl_offset_default=45;
                $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
                preg_match('/width="([0-9]+)".*height="([0-9]+)"/', $pic_html, $matches);
                $width = $matches[1] + $CONFIG['fullsize_padding_x'];
                $height = $matches[2] + $CONFIG['fullsize_padding_y']+ $ctrl_height;
                $resize_window = '<script type="text/javascript">window.resizeTo('.$width.', '.$height.')</script>';
            }
            preg_match('/<td align="center" style="{SLIDESHOW_STYLE}">.*(.*)<\/td>/Us', $pic_html, $matches);
            $pic_html = $matches[1].$resize_window;
        }
    }
    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;">

EOT;
    if ($pic_html) {
        $fullsize_html .= $pic_html;
    } else {
        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
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
  </body>
</html>

EOT;

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

Remove
Code: [Select]
function theme_display_fullsize_pic()
and
Code: [Select]
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
from your custom theme.php first

Ok! I did this. Now I'm upgrading the gallery. So where do I put this ad code then so it shows above/below the fullsize photo?
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #10 on: August 17, 2012, 09:18:15 pm »

This shows it above and below.
Paste this over the code I posted last time. This should work but is untested.
Code: [Select]
/******************************************************************************
** 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);
        if (is_image($row['filename'])) {
            $pic_url = get_pic_url($row, 'fullsize');
            $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
            $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
        } else {
            $pic_html = theme_html_picture();
            if (is_movie($row['filename'])) {
                $mime_content = cpg_get_type($row['filename']);
                $ctrl_offset['mov']=15;
                $ctrl_offset['wmv']=45;
                $ctrl_offset['swf']=0;
                $ctrl_offset['rm']=0;
                $ctrl_offset_default=45;
                $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
                preg_match('/width="([0-9]+)".*height="([0-9]+)"/', $pic_html, $matches);
                $width = $matches[1] + $CONFIG['fullsize_padding_x'];
                $height = $matches[2] + $CONFIG['fullsize_padding_y']+ $ctrl_height;
                $resize_window = '<script type="text/javascript">window.resizeTo('.$width.', '.$height.')</script>';
            }
            preg_match('/<td align="center" style="{SLIDESHOW_STYLE}">.*(.*)<\/td>/Us', $pic_html, $matches);
            $pic_html = $matches[1].$resize_window;
        }
    }
    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;">
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
EOT;
    if ($pic_html) {
        $fullsize_html .= $pic_html;
    } else {
        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
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
<script src="http://cdn.fastclick.net/js/adcodes/pubcode.min.js"></script><script type="text/javascript">document.write('<scr' + 'ipt type="text/javascript">(function () {try{VCM.media.render({sid:66524,media_type:5,version:"1.2"});} catch(e){document.write(\'<scr\' + \'ipt type="text/javascript" src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=j&t=n&exc=1"></scr\' + \'ipt>\');}}());</scr' + 'ipt>');</script><noscript><a href="http://media.fastclick.net/w/click.here?sid=66524&m=1&c=1" target="_blank"><img src="http://media.fastclick.net/w/get.media?sid=66524&tp=5&d=s&c=1&vcm_acv=1.2" width=728 height=90 border=1></a></noscript>
<!-- ValueClick Media 728x90 LEADERBOARD CODE for Kristin Cavallari Daily -->
  </body>
</html>

EOT;

    $fullsize_html = CPGPluginAPI::filter('fullsize_html', $fullsize_html);
    echo $fullsize_html;
}
/******************************************************************************
** Section <<<theme_display_fullsize_pic>>> - END
******************************************************************************/
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: How to add an adcode or text/other into the photo window
« Reply #11 on: August 17, 2012, 11:14:49 pm »

I did exactly as you said but still: http://nicolerichie.us/photos/displayimage.php?album=591&pid=14963#top_display_media

Maybe it has something to do with the big_pop_up plugin I have? The one that doesn't crop the images...
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #12 on: August 17, 2012, 11:41:36 pm »

probably. let me look at the plugins code to check.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: How to add an adcode or text/other into the photo window
« Reply #13 on: August 17, 2012, 11:44:22 pm »

Maybe it has something to do with the big_pop_up plugin I have?

Yes, it most likely getting in the way.

Uninstall it for a test.

Your adcode could probably be inserted in the plugin's file codebase.php. I really don't have time to look more closely.

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #14 on: August 17, 2012, 11:47:10 pm »

That plugin overwrites the theme completely. you can remove the code from your theme.

Go to the plugins folder and make a backup of codebase.php as codebase.old.php or something similar. Then upload the attached codebase.php

Untested.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: Re: How to add an adcode or text/other into the photo window
« Reply #15 on: August 18, 2012, 12:22:13 am »

That plugin overwrites the theme completely. you can remove the code from your theme.

Go to the plugins folder and make a backup of codebase.php as codebase.old.php or something similar. Then upload the attached codebase.php

Untested.

I must say you're VERY talented in what you do. I think it's working. See http://nicolerichie.us/photos/displayimage.php?album=lasthits&cat=0&pid=8837#top_display_media - Although it gets scrollers, but I guess they have to be there?

I suppose I can edit the codebase.php for smaller ads then?
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #16 on: August 18, 2012, 12:26:16 am »

You could proably do that but you would still have a vertical scroll bar.

I have to look at how the size is calculated. If Joe comes back online maybe he can give a quicker anwser.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #17 on: August 18, 2012, 12:38:17 am »

Try the new attachment. untested.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Hanna.

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 227
  • webstar
Re: Re: How to add an adcode or text/other into the photo window
« Reply #18 on: August 18, 2012, 12:56:58 am »

Try the new attachment. untested.

Works fine too. http://nicolerichie.us/photos/displayimage.php?album=lasthits&cat=0&pid=8837#top_display_media

I will change for a smaller adcode though, it shall be fine. Very nice work! I admire you're skills! Thank you.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: How to add an adcode or text/other into the photo window
« Reply #19 on: August 18, 2012, 01:22:54 am »

If you compare the code you'll see what I adjusted and you can change those values based on the size of your new ads.

If the problem is resolved, please:
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford
Pages: [1] 2   Go Up
 

Page created in 0.031 seconds with 20 queries.