Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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.

Sponsored Links
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 rockon rockon


- Allen wavey
- What Drives You?
Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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
Offline
Joined: Oct 2001
Posts: 8
LK,
Thanks for doing this. I am unable to find the following code in ubb_forum_summary.cg:.

Code
$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
Code
$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
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Oops, you're right.
It should be:
Code
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.

Sponsored Links
Joined: Mar 2004
Posts: 58
Member
Member
Offline
Joined: Mar 2004
Posts: 58
Kewl hack, it looks like my board even loads faster now
Thanks thumbsup

Joined: Mar 2004
Posts: 58
Member
Member
Offline
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
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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 wink


- Allen wavey
- What Drives You?
Joined: Mar 2004
Posts: 58
Member
Member
Offline
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

Sponsored Links
Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Untested:
Open public_forum_summary.pl.
Find in sub CategoryStrip:
Code
	return qq~
Replace with:
Code
$abcdefg = qq~
Find:
Code
} # end CategoryStrip
Add ABOVE:
Code
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
Offline
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
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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
Offline
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 smile

Joined: Dec 2003
Posts: 49
User
User
Offline
Joined: Dec 2003
Posts: 49
Quote
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
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Try the following:
in public_common.pl, find: (TWICE)
Code
			next FORUM if $vars_forums{$f}->[3] ne "On";
Add below:
Code
			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:
Code
			next FORUM if $f == 3;

Joined: Dec 2003
Posts: 49
User
User
Offline
Joined: Dec 2003
Posts: 49
Wow. That works beautifully. Thanks! thumbsup

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
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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
Offline
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
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
That's odd... Try the following in ubb_lib.cgi:
Find:
Code
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:
Code
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
Offline
Joined: Dec 2003
Posts: 49
Works great! Thanks again!

Joined: Mar 2004
Posts: 58
Member
Member
Offline
Joined: Mar 2004
Posts: 58
Quote
Originally posted by LK:

Try the following:
in public_common.pl, find: (TWICE)
Code
			next FORUM if $vars_forums{$f}->[3] ne "On";
Add below:
Code
			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:
Code
			next FORUM if $f == 3;
One small problem is that it hides the forum from admins too

Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)