PDA

View Full Version : Users awaiting confirmation not allowed to view threads


Boofo
03-21-2003, 05:05 AM
The following code does not allow guests to view actual threads (just thread titles). I want to expand this to include some other usergroups. (It's from PPN's guestview thread hack.)

if (!$forum['allowguestpostview'] && !$bbuserinfo['userid']) {
eval("standarderror(\"".gettemplate("error_noguestviewpost")."\");");
exit;
}

Will the following code also not allow users awaiting registration confirmation to view threads as well (or am I missing something or doing something wrong here)?

if (in_array($bbuserinfo['usergroupid'], array(1, 3, 4, 8)) && !$forum['allowguestpostview'] && !$bbuserinfo['userid']) {
eval("standarderror(\"".gettemplate("error_noguestviewpost")."\");");
exit;
}

Boofo
03-23-2003, 12:21 AM
Here is the code that I came up with to work for this:

if (!$forum['allowguestpostview'] && !$bbuserinfo['userid']) {
eval("standarderror(\"".gettemplate("error_noguestviewpost")."\");");
} else if (!$forum['allowguestpostview'] && in_array($bbuserinfo['usergroupid'], array(3, 4))) {
eval("standarderror(\"".gettemplate("error_nowaitviewpost")."\");");
exit;
}

It works but I need to know if there is a cleaner way to do this. Anyone?

Smoothie
03-23-2003, 01:36 AM
I see you use vbHome.... Teck has a great hack over at TW that does exactly this.

Boofo
03-23-2003, 02:02 AM
That's the one we couldn't get to work, remember? I think you even looked at the code and we couldn't figure out why it wasn't working. I went this route since Teck wasn't going to help me figure it out. ;)

Smoothie
03-23-2003, 07:05 AM
ah, yes. I do now. Is a shame. It's a great hack. Have it installed on my forums. Guests, UAEC can view thread titles, but not posts.

Boofo
03-23-2003, 07:15 AM
This one works just like that with the code I added above now. It is only on a per forum basis (not usergroups or individual users) but it works like I needed it to. ;)