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: ads inside the pop up window  (Read 3367 times)

0 Members and 1 Guest are viewing this topic.

shumbora

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
ads inside the pop up window
« on: August 18, 2006, 05:17:34 am »

im really sorry if this question has been asked be4. but i've been combing the forums for the past 2 hrs with no luck, my question is this i would like for the pop up window to display ads on top of the full size image. im sure this is as simple as inserting the proper code i just dont know where to insert it. i've looked in the displayimage.php to see if i could put it there but i might as be reading chines because i have no idea what any of that stuff means....
any comments will be greatly appreciated
« Last Edit: August 18, 2006, 07:22:39 pm by GauGau »
Logged

eruss

  • Supporter
  • Coppermine frequent poster
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 105
Re: ads inside the pop up window
« Reply #1 on: August 18, 2006, 05:31:20 am »

im really sorry if this question has been asked be4. but i've been combing the forums for the past 2 hrs with no luck, my question is this i would like for the pop up window to display ads on top of the full size image. im sure this is as simple as inserting the proper code i just dont know where to insert it. i've looked in the displayimage.php to see if i could put it there but i might as be reading chines because i have no idea what any of that stuff means....
any comments will be greatly appreciated

Start here:
http://forum.coppermine-gallery.net/index.php?topic=31138.0
Logged

shumbora

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: ads inside the pop up window
« Reply #2 on: August 18, 2006, 06:34:24 am »

copy the entire function theme_display_fullsize_pic from themes/sample/theme.php to the theme.php you're actually using and modfiy it there to your needs
well i pretty much did what that post said but when uploaded the new theme.php i got a syntax error which i really was not  susprised by. i really dont want to sound like a dumb a55 but its an inescapable side affect of what im going to say next.. i still dont undrestand what im i supposed to do here.
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: ads inside the pop up window
« Reply #3 on: August 18, 2006, 07:45:16 am »

zip up your theme.php and add it to this thread by using additional options
we will look in to it  :)
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: ads inside the pop up window
« Reply #4 on: August 18, 2006, 01:26:42 pm »

My guess for your error is that you didn't copy all the code from the sample>theme.php (understandable, it's long). So copy this and paste it into your theme.php
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>
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <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
}

In the second section where it starts
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" this is the code that creates the popup window (it's basic html like any other webpage).

After the </script> and before the <table> tags, add this code and edit it to suit your needs
Code: [Select]
<table>
  <tr>
    <td>
       put your ad here
    </td>
  </tr>
</table>

It should look like this

Code: [Select]
...
    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>

<table>
  <tr>
    <td>
       put your ad here
    </td>
  </tr>
</table>

    <table>
      <tr>
            <td>
          <div id="content">
...
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

shumbora

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: ads inside the pop up window
« Reply #5 on: August 18, 2006, 06:11:30 pm »

Gizmo you Freaking Rock dude, your code worked flawlessly. thanks alot bro i really appreciate your help.

this can be marked as sloved !
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.