Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Tentimes for cpg1.5.x - force guests to register after viewing 10 files  (Read 30468 times)

0 Members and 1 Guest are viewing this topic.

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 808
    • 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
« Last Edit: June 15, 2010, 07:38:39 am by Timos-Welt »
Logged

paquets

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59

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

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 808
    • Timos-Welt

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?
Logged

paquets

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59

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

fabkow

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

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

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114

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

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 808
    • Timos-Welt

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

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114

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

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 808
    • Timos-Welt

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

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
« Reply #9 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?
Logged
Human

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 808
    • Timos-Welt

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

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
« Reply #11 on: August 04, 2011, 10:25:03 pm »

I commented out the line and now it works as expected
Logged
Human

EndlessQuest

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
« Reply #12 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
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
« Reply #13 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

EndlessQuest

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: Tentimes for cpg1.5.x - force guests to register after viewing 10 files
« Reply #14 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
Logged
Pages: [1]   Go Up
 

Page created in 0.043 seconds with 20 queries.