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 ;
}}
/////////////////////////////////////////////////////////////////////////////////////////////////////
Yey this works :)
Thanks very much
how can i make that google and co. can see all pics only real user can see 10 pics and than must register ?
Not at all. I recommend reading up how spiders and the www work.
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.
Disable the SEF urls plugin. This is not related to this mod.
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 !!!!!!!!!!!!!!!!!!!!!!!!!!
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
Thanks
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?
I've bridged Coppermine with phpbb3 will this mod still work for me please.
Regards,
Steff
No reason why it shouldn't.
Thanks Nibbler I'll give it a shot and post the out come.
Regards,
Steff
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
thank you adiboy
works a treat ;D
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.
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!