forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Timos-Welt on January 20, 2010, 03:27:34 pm

Title: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: Timos-Welt on January 20, 2010, 03:27:34 pm
If this plugin is installed, a visitor will be able to view 10 files per day and then will be forced to register or log in. All is done via javascript, so search engine spiders will have no problem to index the gallery pages.

Requirements:
- registration of new users must be allowed
- visitor must have javascript enabled in browser

This plugin was inspired by a mod for cpg1.4.x (http://forum.coppermine-gallery.net/index.php/topic,32399.0.html) by user adiboy.

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_tentimes_v1.1.zip/download
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: paquets on June 15, 2010, 01:18:00 am
Hi Timos,

Thank you for this plugin.

It works perfectly on most browsers but for some reason Safari 5.0 on Mac seems to disregard it completely. My gallery is http://adpharm.net

any idea what could be the issue?

Thank you!
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: Timos-Welt on June 15, 2010, 07:38:09 am
Found in your page's source code:
Code: [Select]
<body onLoad="javascript:__utmSetVar('<?php echo $_SERVER['REMOTE_ADDR']; ?>')">
There seems to be another javascript on your page that doesn't work. Watch the error console/log of your browser. The line above won't work at all inside of CPG1.5.x. Did you install any 1.4.x plugins?
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: paquets on June 15, 2010, 12:09:45 pm
Thank you. I removed the "onload" portion of the body tag and now it works perfectly.
Great plugin, thanks again!
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: fabkow on May 17, 2011, 09:59:20 pm
I translated Tentimes to polish. In attachment is only one file 'polish.htm' from 'message' dir.
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: nickelas on July 08, 2011, 08:50:18 am
Thank you for this plugin.
I had a problem installing it - do you have to install the image manipulation plugin (http://forum.coppermine-gallery.net/index.php/topic,62875.0.html) first?
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: Timos-Welt on July 08, 2011, 08:55:24 am
Both shoudln't hurt each other. Please give me a link to your gallery.
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: nickelas on July 20, 2011, 12:40:18 pm
Both shoudln't hurt each other. Please give me a link to your gallery.
Uppsalabilder (http://uppsalafoto.se/galleri/)
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: Timos-Welt on July 20, 2011, 01:33:47 pm
There's no trace of any of the both plugins visible. Are both installed right now?
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: nickelas on August 03, 2011, 07:13:17 pm
Thanks for your answer, I have not installed the mentioned plugins. I get an error at my plugins-page when I have tentimes in the plugins-folder.
Looking at configuration.php it says
Code: [Select]
require('./plugins/image_manipulation/init.inc.php');Does it require this plugin to be installed first?
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: Timos-Welt on August 03, 2011, 08:39:55 pm
Surely not, seems like an oversight. If you replace image_manipulation with tentimes, does it work?
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: nickelas on August 04, 2011, 10:25:03 pm
I commented out the line and now it works as expected
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: EndlessQuest on October 18, 2011, 11:55:20 am
I had the same issue, and commenting out worked for me as well.

I also have the Lightbox notes for net plugin installed and the tentimes plugin does count pictures shown in the slide show, but the slideshow continues. Only after the slideshow is finished, the message to register or login is displayed.

Is there a way to interrupt the slideshow and display the message?

Already I tried to change the order of the plugins, but this has no effect.

Gallery: http://www.richards-fotos.nl/coppermine/index.php
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: Joe Carver on October 19, 2011, 12:38:34 am
The two slideshows work very differently. One plugin does not "know" about the other in this case.

You could try to modify the LightBox plugin to ten views.

This is untested and I can't support any issues that might happen.
Make a backup first.

Modify the file plugins/lightbox_notes_for_net/codebase.php as follows.

Find the section:
Code: [Select]
//Create slideshow piclist, add script to page
Below that find:
Code: [Select]
    global $lang_display_image_php, $CONFIG, $thisplugin, $LINEBREAK;
Change to:
Code: [Select]
global  $USER, $lang_display_image_php, $CONFIG, $thisplugin, $LINEBREAK;
Find:
Code: [Select]
$lb_max = $CONFIG['plugin_lightbox_nfn_maxpics'];
Add directly below it:
Code: [Select]
if (!USER_ID) {
$lb_max = 10;
    }

Good Luck
Title: Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
Post by: EndlessQuest on October 23, 2011, 12:18:33 pm
Hi Joe,

thanks a lot for your detailed response. I`m a bit of a newbie at this stuff, so I`ll first have a look at the code of the Lightbox plugin and see if I can find out what to do where. I`ll let you know if it works (and if I can find it :D) It`s an interesting challenge for me