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.
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:
Line 421 of postlist.php
// ---------------------------------------------------------------------
// We need to check and see if they have write privileges for this forum
$gsize = sizeof($Grouparray);
for ($i=0; $i <$gsize; $i++) {
if (ereg("-$Grouparray[$i]-",$CanWrite) ) {
$makepost = "yes";
break;
}
}
if (ereg("-3-",$CanWrite) ) {
$makepostlogged = "yes";
}
if ($makepost == "yes") {
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>";
}
else if ($makepostlogged == "yes"){
echo "<p class="small">You could post if you were <a href="login.php">logged in</a>
</p>";
echo "<img alt="*" src="$config[images]/greynewpost.gif" $images[newpost]>";
}
else {
echo "<img alt="*" src="$config[images]/greynewpost.gif" $images[newpost]>";
}