Tentimes for cpg1.5.x - force guests to register after viewing 10 files Tentimes for cpg1.5.x - force guests to register after viewing 10 files
 

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

Tentimes for cpg1.5.x - force guests to register after viewing 10 files

Started by Timos-Welt, January 20, 2010, 03:27:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Timos-Welt

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 by user adiboy.

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_tentimes_v1.1.zip/download

paquets

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!

Timos-Welt

Found in your page's source code:
<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?

paquets

Thank you. I removed the "onload" portion of the body tag and now it works perfectly.
Great plugin, thanks again!

fabkow

I translated Tentimes to polish. In attachment is only one file 'polish.htm' from 'message' dir.

nickelas

Thank you for this plugin.
I had a problem installing it - do you have to install the image manipulation plugin first?
Human

Timos-Welt

Both shoudln't hurt each other. Please give me a link to your gallery.

nickelas

Human

Timos-Welt

There's no trace of any of the both plugins visible. Are both installed right now?

nickelas

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 require('./plugins/image_manipulation/init.inc.php');
Does it require this plugin to be installed first?
Human

Timos-Welt

Surely not, seems like an oversight. If you replace image_manipulation with tentimes, does it work?

nickelas

Human

EndlessQuest

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

Joe Carver

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:
//Create slideshow piclist, add script to page

Below that find:
    global $lang_display_image_php, $CONFIG, $thisplugin, $LINEBREAK;

Change to:
global  $USER, $lang_display_image_php, $CONFIG, $thisplugin, $LINEBREAK;

Find:
$lb_max = $CONFIG['plugin_lightbox_nfn_maxpics'];

Add directly below it:
if (!USER_ID) {
$lb_max = 10;
    }


Good Luck

EndlessQuest

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