Register After viewing 10 images or more. Register After viewing 10 images or more.
 

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

Register After viewing 10 images or more.

Started by adiboy, June 07, 2006, 08:24:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adiboy

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


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

}}
     
     
/////////////////////////////////////////////////////////////////////////////////////////////////////
Computer repair stoke on trent  :o http://sy2.com

barramyainc


jadmanx

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

Joachim Müller

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

jadmanx

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.

Nibbler

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

jadmanx

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

toy2666

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


dke

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?

Halfhidden

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

Nibbler


Halfhidden

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

Halfhidden

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

its2xs


mWelle

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.

paquets

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!