View Full Version : Announcement Permissions?
SFishy
06-27-2002, 04:09 AM
I'm wondering...
Is there a way to make it so that ONLY members can view announcements? I like to have my boards open to guests for reading, but I'd like announcements just to be for members.
Anyone?
Thanks!
Logician
06-27-2002, 05:39 AM
edit forumdisplay.php, find:
if ($announcement=$DB_site->query_first("SELECT announcementid,startdate,title,user.username,user. userid,user.usertitle,user.customtitle
Before that add:
if ($bbuserinfo[userid]>0) {
find:
$doneannouncements = 1;
After that add:
}
That's it.. Enjoy..
SFishy
06-27-2002, 06:30 AM
Logician,
Thank you SO much...works perfect and is exactly what I needed!
SFishy
06-27-2002, 04:32 PM
Hey Logician, or anyone ;)...
Is it possible to modify announcement.php so that the announcement will still show up in forumdisplay.php (in the list), but when a non-registered user clicks on it, it will give them the "no permission" screen? I'd like it to still be shown, just not viewable by non-members... make sense?
Thanks!
Amy
Xenon
06-27-2002, 04:41 PM
easy to do:
open announcement.php
find:
if (!$getperms[canview]) {
eval("standarderror(\"".gettemplate("error_nopermission")."\");");
exit;
}
after that add this:
if ($bbuserinfo[userid]==0) {
eval("standarderror(\"".gettemplate("error_nopermission")."\");");
exit;
}
SFishy
06-27-2002, 05:02 PM
Xenon,
That didn't work... It shows up in the list, and for a registered member works fine, but for a guest I get a weird template... not the typical error template, but a template that is mostly blank (header and footer info is there, jump-to box is there, but no permission error message). The no permissions template works fine in other areas.
Any ideas?
Xenon
06-27-2002, 05:07 PM
hmm *wondering* its original code of the vb225 as you can se the line above
try to replace
eval("standarderror(\"".gettemplate("error_nopermission")."\");");
with
show_nopermission();
Edit: lool, thats a bug in the original vb-files
will report it on vb.com
SFishy
06-27-2002, 05:25 PM
Thanks Xenon... I got it working and your reply just confirmed what I did was right! ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.