PDA

View Full Version : Content Preview (Based on Page Views)


alexhalliday
12-25-2004, 11:50 PM
Hey all,

I'm building a site (slowly! only got the license last week!) and i have an idea for a content preview (I will be integrating the vB with my own article system).

The basic idea is that if the user is a guest or awaiting conf they are able to view 10 content pages (threads, articles, photos etc.) before they are shown a "you are not logged in/ please register" page.

My idea was based upon the "disallow guests" thread (https://vborg.vbsupport.ru/showthread.php?t=59859), although I would only like this message to be shown only after 10 page views.

I'm guessing I will need to add to the script, like so:

if ($bbuserinfo['userid'] == 0 AND $previewpageviews >= 10 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))
{
print_no_permission();

My problem is how to increase the $previewpageviews bit.

I was having an idea to create a function that canbe included on content pages which increases the $previewpageviews value, this would then be stored in the sessionid. My problem is how to do this!!!

Thanks, lets hope we can do this, I can imagine people would be able to use this script.

Alex