ads inside the pop up window ads inside the pop up window
 

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

ads inside the pop up window

Started by shumbora, August 18, 2006, 05:17:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shumbora

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

eruss

Quote from: shumbora 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

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

shumbora

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.

Sami

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

Gizmo

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

// 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 <!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

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


It should look like this


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

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

this can be marked as sloved !