Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

To open a window for the visitor (?)

Quote Reply
To open a window for the visitor (?)
Hello,

There is a solution to open a window if the user is the 1000 visitors.

if visitor == 1000
Message: You are the 1000 visitors...

The cheaters should be avoided !

Utilistation : Plays...

An idea ?

Thank you for your answers.


Mick

Last edited by:

mick31: Nov 10, 2003, 5:25 AM
Quote Reply
Re: [mick31] To open a window for the visitor (?) In reply to
Could do something like;

<%write_visitor%>

Code:
sub {

my $count;
open(READIT,"counter.cnt") || return $!;
$count = <READIT>
close(READIT);

$count++;

open(WRITEIT,">counter.cnt") || return $!;
print WRITEIT $count;
close(WRITEIT);

unless ($count % 1000) {
return { is_special_visitor => 1 }
} else {
return { is_special_visitor => 0 }
}

}

Make sure at the top of your template you have;

<%write_visitor%>

This *WILL NOT* return anything.. its simply used to do the checking etc.

You can then use something like;

Code:
<%if is_special_visitor%>
... pop up HTML stuff
<%endif%>

This is untested.. but in theory it should work (on a not so high traffic site).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!