php forum
php mysql forum
php mysql smarty
 
Topic Options
#209213 - 03/20/01 12:41 PM "you could post if you were logged in"
The Team Offline
Moderator

Registered: 08/11/00
Posts: 182
Loc: yes
I'm trying to pull together a small hack that would diplay a msg to users that they could post to a forum if they where logged in. The problem that some of my new users are having is posting when they are not yet registered or logged in. They don't realise that they need to be logged in in order to post.<br /><br />I think I have this hack working well, but I would appreciate anyone who is more familiar with W3T to give it a quick peak. The only potential problem I see with my hack is how forum groups posting priveleges are treated. I presume that "-3-" means general users. Anyway, here it is:<br /><br /><pre><br /><br />Line 421 of postlist.php<br /><br />// ---------------------------------------------------------------------<br />// We need to check and see if they have write privileges for this forum<br /> $gsize = sizeof($Grouparray);<br /> for ($i=0; $i <$gsize; $i++) {<br /> if (ereg("-$Grouparray[$i]-",$CanWrite) ) {<br /> $makepost = "yes";<br /> break;<br /> }<br /> }<br /><br /> if (ereg("-3-",$CanWrite) ) {<br /> $makepostlogged = "yes";<br /> }<br /><br /> if ($makepost == "yes") {<br /> echo "<a href=\"$config[phpurl]/newpost.php?Cat=$Cat&Board=$Board&page=$page&view=$view&sb=$sb&o=$o\"><img $images[newpost] src=\"$config[images]/newpost.gif\" alt=\"$lang[MAKE_A_NEW]\" border=0></a>";<br /> }<br /> else if ($makepostlogged == "yes"){<br /> echo "<p class=\"small\">You could post if you were <a href=\"login.php\">logged in</a><br /></p>";<br /> echo "<img alt=\"*\" src=\"$config[images]/greynewpost.gif\" $images[newpost]>";<br /> }<br /> else {<br /> echo "<img alt=\"*\" src=\"$config[images]/greynewpost.gif\" $images[newpost]>";<br /> }<br /></pre><br /><br />

Top
#209214 - 03/20/01 03:13 PM Re: "you could post if you were logged in" [Re: Anonymous]
Jockox3 Offline
User

Registered: 01/15/01
Posts: 32
Loc: Oxford, United Kingdom
Q. How do you know who they would be if they were logged in? ISTM that without that you cannot accurately check whether they would have write privs or not.<br /><br />Jock<br /><br />

Top
#209215 - 03/20/01 08:48 PM Re: "you could post if you were logged in" [Re: charliebrown]
The Team Offline
Moderator

Registered: 08/11/00
Posts: 182
Loc: yes
The hack first figures out if a "general" user would be alowed to post in x forum if logged in. It is then instructed to displays a notice or not based on this.<br /><br />-e<br /><br />

Top


Who's Online
0 registered (), 24 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Spell Check [beta]
by Bill B
Today at 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
Today at 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
Today at 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
Today at 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks