WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

User Guest/Logged in

Version:
printPrint


User Guest/Logged in
barrykilby
Member
Avatar

Usergroup: Customer
Joined: Jun 30, 2003
Location: England
Total Topics: 7
Total Posts: 48
Posted 11/30/05 - 06:25 PM:
quote post
#1
is there a simple way to tell if a user if logged in or not in order to call a external script (perferibly runs before headers are output).. smiling face

i thought something like:

if ($thismember->usergroup == 1) { require "/my/script/here.php";} at the top of index.php may do the trick but doesnt seem to work right..?

would i be better putting it in the wrapper insted? confused

http://www.zeststudios.co.uk - Professional Website Development
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 12/03/05 - 12:27 AM:
quote post
#2
What you have is fine except that you have globalize a variable (like $thismember) to use it in template php (as mentioned in manual).

Note that 1 is the guest usergroup so you'll be including the script for guests only.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
barrykilby
Member
Avatar

Usergroup: Customer
Joined: Jun 30, 2003
Location: England
Total Topics: 7
Total Posts: 48
Posted 12/03/05 - 01:36 AM:
quote post
#3
ok.. i went with a different approach in the end..

i have integrated jp cache into wsn links by writing a small peace to read the cookie and then if they are a guest they get a copy of the site x hours old and if they are a logged in user it appends there session id to there cache file (so we don't get the logged in users seeing each others pages)

Then i can set that from 0 to sec to hours.. seems to work a treat on larger sites at reducing load time. It also seems to slot in fine with all the mod_rewrite etc ok too, so it saves having to do html generation etc

so rather then updating on a page edit/delete.. (not sure how to do that one yet) it just updates when the next cycle comes around


Edited by barrykilby on 12/03/05 - 01:41 AM

http://www.zeststudios.co.uk - Professional Website Development
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.