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

Author Topic: Register After viewing 10 images or more.  (Read 27451 times)

0 Members and 1 Guest are viewing this topic.

adiboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Computer repair stoke on trent
Register After viewing 10 images or more.
« on: June 07, 2006, 08:24:21 pm »

ok admin please more this mod as i could not find the place to post this mod i did go and red the post about where to post it and that you will move it. please move it and delete the above messange and let me knwo where it has been moved. thanks


All this code does is lets people view a 10 images and then they have to register or wait for an other 24 hours. I am not the best php programer so if you think you can improve the code please do so.


<< Instollation >>
should work with version 1.4.x

Open displayimage.php

Find $picture = theme_html_picture();


Replace with


Code: [Select]
///10 images view hack for Coppermine Photo Gallery V 1.4.x //////////////////////////////////////////


//number of images that can be viewed before having to register
    $viewimages=10;
   
    //your register messange
    $message = "<p align='center'><a href='register.php'><font size='5'>Please register<br> or login <br> to view all the files </font></a></p>";
   
   
   
      $set=0;
      //checking if the user is loged in.
    if(USER_ID){
     $picture = theme_html_picture();
   
    //when user logsin reset cookie
    setcookie("viewcount", "0");
    }
     
     else {
           
         //checking how many files have been viewed
if($_COOKIE["viewcount"] < $viewimages){

//adding one to the cookie
$set=$_COOKIE["viewcount"]+1;

//setting the cookie
setcookie("viewcount", $set, time()+86400); 
//printing the image
    $picture = theme_html_picture();
     
}
else{
//printing the message
$picture = $message ;

}}
     
     
/////////////////////////////////////////////////////////////////////////////////////////////////////
« Last Edit: June 07, 2006, 09:23:07 pm by Nibbler »
Logged
Computer repair stoke on trent  :o http://sy2.com

barramyainc

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 5
    • British Wrestling Pictures
Re: Register After viewing 10 images or more.
« Reply #1 on: August 23, 2006, 10:52:27 pm »

Yey this works :)

Thanks very much
Logged

jadmanx

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Register After viewing 10 images or more.
« Reply #2 on: October 10, 2006, 09:15:16 pm »

how can i make that google and co. can see all pics only real user can see 10 pics and than must register ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Register After viewing 10 images or more.
« Reply #3 on: October 11, 2006, 12:33:10 am »

Not at all. I recommend reading up how spiders and the www work.
Logged

jadmanx

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Register After viewing 10 images or more.
« Reply #4 on: October 11, 2006, 11:19:20 am »

i have install the hack but i become the message on open a pic
Not Found

The requested URL /displayimage-3-0.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Logged

Nibbler

  • Guest
Re: Register After viewing 10 images or more.
« Reply #5 on: October 11, 2006, 01:22:22 pm »

Disable the SEF urls plugin. This is not related to this mod.
Logged

jadmanx

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Register After viewing 10 images or more.
« Reply #6 on: October 13, 2006, 05:53:16 pm »

hihi than i downt need the "Register After viewing 10 images or more" whan i Disable the SEF urls plugin than no user come from google and my traffic is down ...

Add SEF urls plugin support
and "google and co. can see all pics" function
that must be great !!!!!!!!!!!!!!!!!!!!!!!!!!
Logged

toy2666

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Register After viewing 10 images or more.
« Reply #7 on: December 19, 2006, 03:52:10 am »

Nice script, thanks!

It is possible to also block the slide show to guest? Even after 10 pictures, you can press the slide show button and see all the pics.

Thanks
Logged

@till@

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Register After viewing 10 images or more.
« Reply #8 on: October 13, 2007, 10:19:17 pm »

Thanks
Logged

dke

  • Guest
Re: Register After viewing 10 images or more.
« Reply #9 on: February 26, 2008, 02:42:39 pm »

Nice modification but is it possible to make this restriction certain categories/albums of choice so that parts of the gallery can be viewed by guests surpassing the 10 limit?
Logged

Halfhidden

  • Guest
Re: Register After viewing 10 images or more.
« Reply #10 on: March 03, 2008, 03:58:42 pm »

I've bridged Coppermine with phpbb3 will this mod still work for me please.
Regards,
Steff
Logged

Nibbler

  • Guest
Re: Register After viewing 10 images or more.
« Reply #11 on: March 03, 2008, 04:09:24 pm »

No reason why it shouldn't.
Logged

Halfhidden

  • Guest
Re: Register After viewing 10 images or more.
« Reply #12 on: March 03, 2008, 04:10:28 pm »

Thanks Nibbler I'll give it a shot and post the out come.
Regards,
Steff
Logged

Halfhidden

  • Guest
Re: Register After viewing 10 images or more.
« Reply #13 on: March 03, 2008, 04:24:02 pm »

Yep! works a treat. but the login message is in blue and almost the same shade as the theme I'm using in Coppermine. From the line:
//your register messange
    $message = "<p align='center'><a href='register.php'><font size='5'>Please register<br> or login <br> to view all the files </font></a></p>";
Could you tell me where the text colour would be please? I'd like to change it to black or white.
Regards,
Steff
Logged

its2xs

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Register After viewing 10 images or more.
« Reply #14 on: February 16, 2009, 03:23:30 pm »

thank you adiboy
works a treat ;D
Logged

mWelle

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Register After viewing 10 images or more.
« Reply #15 on: June 08, 2009, 10:17:33 am »

very good mod. how i can this modeficated for to the groups?

there are 3 usergroups, one unregistered, registered and power.

the possible number of views, I would like to use the registered group.
Logged

paquets

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Register After viewing 10 images or more.
« Reply #16 on: August 21, 2009, 05:50:59 pm »

Very cool mod.
Is it possible to have it work with a function that would record ip addresses instead of having it work with a cookie? Users just can delete the cookie to view another 10 images. And so on...

Thanks again for a very useful mod!
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 20 queries.