|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Modification Name: Hide Private Forums Author(s): LK Description: Hides the private forums (from forum summary), only if you have access to those forums you can see them. All-new code (nothing in common with the previous 6.5 version, besides the concept), now supports ultimatebb.php. Almost untested though. Demo: none Requirements: UBB 6.7, may work with others with little changes. Download Link: https://www.ubbdev.com/ubb/upload/00004463/hide67.txt Credits: Originally by wwb95 Note: it doesn't support password-enabled forums.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
thank you! I can finally use a private forum on my personal site now 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Updated ultimatebb.php (global $profile, chop), ubb_lib (make it repetitive in case you have more than 1 private forum)
|
|
|
|
Joined: Oct 2001
Posts: 8
Lurker
|
Lurker
Joined: Oct 2001
Posts: 8 |
LK, Thanks for doing this. I am unable to find the following code in ubb_forum_summary.cg:. $msg_icon2 = qq!<img src="$vars_config{NonCGIURL}/icons/icon1.gif" align="middle" border="0" alt="$vars_wordlets_img{alt_icon} 1" /> !; } else { The closest I can find is the following $msg_icon2 = qq!<img src="$vars_config{NonCGIURL}/icons/icon1.gif" align="middle" border="0" alt="$vars_wordlets_img{alt_icon} 1" /> !; } I went back to my unmodded 6.7.2 file and still can't find it in there. Any ideas?
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Oops, you're right. It should be: Find: =====
$msg_icon = ''; $msg_icon2 = qq!<img src="$vars_config{NonCGIURL}/icons/icon1.gif" align="middle" border="0" alt="$vars_wordlets_img{alt_icon} 1" /> !;
Add below: ==========
$priv1="<?php echo Privates($x,""; $priv2=""); ?>"; } else { $priv1 = ''; $priv2 = ''; (updating txt file as we speak) Note that msg_icon and msg_icon2 should be indeed one after the other, since about 10 lines above there is another instance of $msg_icon = '' and $msg_icon2 = ..., but they have another variable ($last_post_number) between them.
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Kewl hack, it looks like my board even loads faster now Thanks 
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Would it be possible to hide the wings as well? it looks weird for the members to see a wing with no rooms
And I just noticed that the rooms you set to be hidden still shows under the Hop To menu (even if you are logged out)
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
By wings, you mean categories? If so you can just put the private forums in another category.
Hop To: I'll fix it if there is a need.
The point of this hack is not that they won't know you have private forums, but that they won't be disturbed by that forum every time they go to Forum Summary. I don't know of anyone who actually uses the Hop To menu, so it doesn't really matter.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
one guy on the beta team does, I haven't seen him in ages 
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Yes by wings I ment categories, sorry, I did put it on another category just that when you have allot of staff rooms then you get a pretty big wing so was just wondering if it's possible to hide the categories too.
Thanks
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Untested: Open public_forum_summary.pl. Find in sub CategoryStrip: Replace with: Find: Add ABOVE: if ($catarray->[2] eq "NUMBER") { return '<?php echo Privates(NUMBER2,"'.UBBCGI::escape($abcdefg) . '"); ?>'; } else { return $abcdefg; } Now replace NUMBER with your private category number (click on the category, the number after "category=" is the category number), and replace NUMBER2 with a number of one of your hidden forums.
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Ok just tested it If you set one room for mods and one for admins and log in as admin then it's fine
When you log as a mod then the room you see is merged with the category above, when you log as a member the only thing it shows is that : Forum Topics Posts Last Post
line at the bottom of the last displayed category
And thanks LK
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
1) You should change NUMBER2 to the number the mods can see. 2) That's odd.. What do you mean by "that line at the bottom of the last displayed category"? can I see a screenshot?
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Sorry I choosed the wrong number for the NUMBER2, it fixed both issues , now it just shows this when you are logged out http://img.photobucket.com/albums/v111/tigerboy/softwares/cap2.jpg That is my last public category on my board and there's nothing beneath it (except for a hidden wing which is working fine) The icon legend red X is not related, but somehow this gray line with the "0"'s started to appear after adding this mod (maybe something with my style settings?) , and this line at the bottom appeared after adding your modifications for the hidden wing (but both things shows only when you are logged out) And another thing I hope it's ok to ask here, is it possible to set a different new posts icon for just one forum? for example on ubbdev something else instead of this lightbulb to appear on the new posts column next to just one forum (I know there's an option for this on the Style Sheets I create but it doesn't change anything) Thanks again 
|
|
|
|
Joined: Dec 2003
Posts: 49
User
|
User
Joined: Dec 2003
Posts: 49 |
Originally posted by LK:
By wings, you mean categories? If so you can just put the private forums in another category.
Hop To: I'll fix it if there is a need.
The point of this hack is not that they won't know you have private forums, but that they won't be disturbed by that forum every time they go to Forum Summary. I don't know of anyone who actually uses the Hop To menu, so it doesn't really matter.
Actually, I have a secret forum that I'd like to keep secret. How would I hide the forum from "hop to."
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Try the following: in public_common.pl, find: ( TWICE) next FORUM if $vars_forums{$f}->[3] ne "On"; Add below: next FORUM if $f == NUMBER; Replace NUMBER with the number of the forum you'd like to hide, for example if you'd like to hide forum 3 add:
|
|
|
|
Joined: Dec 2003
Posts: 49
User
|
User
Joined: Dec 2003
Posts: 49 |
Wow. That works beautifully. Thanks! I did notice one other thing that happens with this hack. When I'm logged out, I can see a 0 directly below the Recent Visitors row. It doesn't show when I'm logged in as an Admin (and can see the hidden forum) or as one of my dummy accounts (who can't see the forum) - just when I'm not logged in at all. http://www.legionworld.net/cgi-bin/ultimatebb.cgi
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Where is the hidden forum located (if I could see it)? Is it under "Science Police Headquarters"?
|
|
|
|
Joined: Dec 2003
Posts: 49
User
|
User
Joined: Dec 2003
Posts: 49 |
It's forum #6, so it shows above "Encyclopedia Galactica."
I can give you the log in details to one of my dummy accounts and give it permission to the forum, if you need it.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
That's odd... Try the following in ubb_lib.cgi: Find: sub check_private_access2 { my (@profile, $Moderator); &RequireVars("$vars_config{VariablesPath}/vars_mods.cgi");
# since forum is private, user must be logged in
# $_[0]: forum number # $_[1]: forum password (blank, if none)
if (!$username) { return 0; } Repalce with: sub check_private_access2 { my (@profile, $Moderator); &RequireVars("$vars_config{VariablesPath}/vars_mods.cgi");
# since forum is private, user must be logged in
# $_[0]: forum number # $_[1]: forum password (blank, if none)
if (!$username) { return ""; }
|
|
|
|
Joined: Dec 2003
Posts: 49
User
|
User
Joined: Dec 2003
Posts: 49 |
Works great! Thanks again!
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Originally posted by LK: Try the following: in public_common.pl, find: ( TWICE) next FORUM if $vars_forums{$f}->[3] ne "On"; Add below: next FORUM if $f == NUMBER; Replace NUMBER with the number of the forum you'd like to hide, for example if you'd like to hide forum 3 add: One small problem is that it hides the forum from admins too
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
There's nothing (simple) to do against it, since it is cached, so whatever the average user sees, so does the administrator.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|