duplicate the online code/sql for the guest sections with a diff table name like onlineg or whatever....
Allow Guests In...
Collapse
X
-
this easy
i allow guest in the forums,chat,F.A.Q and downloads on my script
on every page if ac is not set dont check log
in order not to set ac i do thisCode:if(isset($ac)) { if(!is_signin($nid)) { echo trigger_error(signin); } }
http://siteurl.com/forum?view=main
---
not allow guest area
http://siteurl.com/forum?ac=main
so if the view variable is set the check log wont trigger unless the ac variable is set
.... if user didn't
sign in they will still be added to the online list there id will be 0
on my on line list i got
on my indexCode:echo "Viewing member that has been active for the last 5 minutes $s"; echo align(left); $mem = mysql_query("SELECT nick,place,url FROM mc_online"); while($info = mysql_fetch_array($mem)) { if($info[0]==0 || $info[0]=="") { echo " <a href=\"index.php?ac=profile&tid=$tid&who=$info[0]\">Guest</a>-$info[1]"."-$s <a href=\"$info[2]$tid\">Go there</a>$s-$s"; } else { $mood = mysql_fetch_array(mysql_query("SELECT mood,gender FROM mc_users WHERE id='".$info[0]."'")); $nick = callnick_nid($info[0]); echo "$mood[1] <a href=\"index.php?ac=profile&tid=$tid&who=$info[0]\">$nick</a>( $mood[0])-$info[1]".$s."<a href=\"$info[2]$tid\">Go there</a>$s-$s"; } }
i bet you dont understand meCode:add_online($nid,"main menu","index.php?tid="); $nick = callnick_tid($tid); echo align(left); if(!signin($tid)) { echo align(center); echo "Welcome guest$s"; echo "Please sign in are sign up $s"; echo "( <a href=\"mem.php?ac=signin\">Sign in</a> |"; echo " <a href=\"mem.php?ac=signup\">Sign up</a> )$s"; echo align(left); } else { echo align(center); $who = callnid_tid($tid); echo "sign in as "."<a href=\"?ac=profile&tid=$tid&who=$who\"> $nick</a> $s ---$s "; $item = mysql_fetch_array(mysql_query("SELECT value,nid FROM mc_general WHERE id='1'")); echo "[u]Announcement:[/u]$s".htmlspecialchars($item[0])."$s By: <a href=\"index.php?ac=profile&tid=$tid&who=$item[1]\">".callnick_nid($item[1])."</a>$ss --$s"; if(signin($tid)) { echo call_shoutbox($tid); }
R.M.C
----------
PHP Adovocate B)
Comment
-
yes but copy it and rename edit it so function is like addguest and the table points to a new guest_online table in sql... quite simple if you think about it, all the code you need is already in the script.Aha u mean advisitor function cn b used?[/b]
PS: mckeny, i understand what you mean. There are a few methods to do it. I like how the forum permissions work in the original unrealx script, you can allow guests, registered only, or special members.
Comment


Comment