Advanced search  


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.

Pages: [1]   Go Down

Author Topic: Modification to my CPG, cookie + popup script.  (Read 4276 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
Modification to my CPG, cookie + popup script.
« on: May 01, 2005, 02:37:27 am »

I'm looking for someone that will be able to modify my website / cpg + phpBB bridge, to fit the following need.

Here is my site:

It's based on the 'Fruity' theme, though it has been modified quite a bit, and it's also bridged with a phpBB2.

What I need is for a popup to occur on each unique visitor's 5th click, 10th click, 15th click, and so forth onto my gallery (displayimage.php).

I believe this could be done by setting a cookie / session with each unique visitor, and a counter that adds to the cookie, when the cookie counter reaches 5, it orders the first popup, when it reaches 10, it orders the second popup, when it reaches 15, it orders the third popup/etc.

I had some success coding this myself outside of CPG, however I'm not familiar enough with the way CPG works in order to have the variables passed correctly just after the body tag for a popup.  Here is an example of it working: - here's the code used:

Code: [Select]

if ($_SERVER['PHP_SELF'] == "/brent.php") {
if(!isset($_SESSION['c']) || !is_numeric($_SESSION['c'])){

Placing this code at the top of displayimage.php seems to set the cookie properly - however trying to execute the 'showPopup' within the html body is where it becomes a little more difficult.  On my test - brent.php page (as opposed to displayimage.php) - the following code works if inserted right below the opening body tag:

Code: [Select]
<? if($_POST['showPopup']){ ?>
<script> alert("hi"); </script>
<? } ?>

However, when I take that code and try to put it into displayimage.php, it won't work.  I believe the reason for this is that displayimage.php actually uses template.html's body.  This makes things difficult for me, because not only does that mean trying to write a coppermine-specific variable (like the one's inclosed like this - {GALLERY}) it also means only having that {MY_POPUPCODE} variable that would have to be written, only used in displayimage.php even though it has to exist within template.html.

So basically, half of the coding is done/solved, what I need is for someone to make it work in CPG! :P  Feel free to contact me by replying here, as I'll be checking if someone does, and please name your price.

« Last Edit: July 10, 2005, 12:39:58 pm by GauGau »
Pages: [1]   Go Up

Page created in 0.016 seconds with 20 queries.