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: Add Adsense code to full size images  (Read 9797 times)

0 Members and 1 Guest are viewing this topic.

nadioz

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 90
Add Adsense code to full size images
« on: October 30, 2008, 11:48:09 am »

Hi !!

Like explained here http://forum.coppermine-gallery.net/index.php/topic,44115.0.html

After adding the first code i would like to know where should i add the adsense code when i want it to show up at Top of the Full size image. I don't understand where i should ad the code ?

i made a new tread like suggested in the other Faq post.
Logged

nadioz

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 90
Re: Add Adsense code to full size images
« Reply #1 on: October 30, 2008, 11:49:12 am »

I forgot to post a link to my gallery : http://lovelylopez.net/photos/
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add Adsense code to full size images
« Reply #2 on: October 30, 2008, 08:05:21 pm »

Edit themes/yourtheme/theme.php, find
Code: [Select]
function theme_display_fullsize_pic()and edit as suggested below. If that function does not exist in your custom theme, copy
Code: [Select]
// Display the full size image
function theme_display_fullsize_pic()
{
    global $CONFIG, $THEME_DIR, $ALBUM_SET;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    if (isset($_GET['picfile']))
    {
        if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

    $picfile = $_GET['picfile'];
    $picname = $CONFIG['fullpath'] . $picfile;
    $imagesize = @getimagesize($picname);
    $imagedata = array('name' => $picfile, 'path' => path2url($picname), 'geometry' => $imagesize[3]);
    }
    elseif (isset($_GET['pid']))
    {
    $pid = (int)$_GET['pid'];
    $sql = "SELECT * " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='$pid' $ALBUM_SET";
    $result = cpg_db_query($sql);

    if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);

    $row = mysql_fetch_array($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);
    }

?>
<!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=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <script type="text/javascript" src="scripts.js"></script>
  <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; height:100%; width:100%; border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>
  </head>
  <body>
    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>
    <table>
      <tr>
            <td>
          <div id="content">
              <?php     echo  '<a href="javascript: window.close()"><img src="'
                
htmlspecialchars($imagedata['path']) . '" '
                
$imagedata['geometry']
                . 
'alt="'
                
htmlspecialchars($imagedata['name'])
                . 
'" title="'
                
htmlspecialchars($imagedata['name'])
                . 
"\n" $lang_fullsize_popup['click_to_close']
                . 
'" /></a><br />' ."\n";
               
?>

          </div>
        </td>
      </tr>
    </table>
  </body>
</html>
<?php
}
from themes/sample/theme.php into a new line before
Code: [Select]
?>into themes/yourtheme/theme.php

Then just add your adsense code before
Code: [Select]
    <table>into a new line of it's own.

The principle always remains the same and has been asked and answered many times over: the sample theme contains definitions for all customizable sections (variable definitions, functions etc.) of your coppermine output. Identify the section that needs changing, copy the section into your custom theme and then apply your changes/modifications. In fact the sticky thread "Add Adsense code to full size images" comtains all relevant information - I'm not sure what else you need to know.

You're running cpg1.4.12, while the most recent stable release currently is cpg1.4.19, so you're running 7 versions behind. Upgrading is mandatory in terms of security. Instead of worrying about a custom modification that will only drive your visitors mad I suggest taking care of your site instead and updating it. It's your task to keep your gallery up to date.
Logged

nidhhog

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Add Adsense code to full size images
« Reply #3 on: March 02, 2009, 09:59:53 am »

HI
I know it was 100 times, but i could not find answer for my question.
Where shoud I past the adsense code to display ads in a place which I indicated below ?

Does nybody Can help me?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add Adsense code to full size images
« Reply #4 on: March 02, 2009, 10:05:33 am »

Start a thread of your own instead of hijacking someone else's thread. Your reply to this thread will be ignored.
Logged

nidhhog

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Add Adsense code to full size images
« Reply #5 on: March 02, 2009, 10:22:27 am »

So maybe you can tell me , where should I ask about it ?
Stop to be a smart asshole , and start beheve like administrator
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add Adsense code to full size images
« Reply #6 on: March 02, 2009, 10:33:20 am »

Who are you to tell me about the policies on this board and how I should behave? Locking. You're banned. Do not dare to re-register. Bye.
Logged

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: Add Adsense code to full size images
« Reply #7 on: March 02, 2009, 02:13:26 pm »

Just for the record of sensitive CPG forum's visitor:

So maybe you can tell me , where should I ask about it ?

Joachim already had answer that question, this user it's one of those who doesn't like to obey in order to be helped and enter to the forum just to play to be "the smart guy".
Start a thread of your own instead of hijacking someone else's thread. Your reply to this thread will be ignored.
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.