Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
I was looking into a quick hack to only allow logged in users to view each forum announcement. Guests will see nothing, logged in users will see whats supposed to be there.

I know its in ubb_forum, and this is what I have by default

Code
	# get forum record
@this_forum = &GetForumRecord($in{f});
chomp($this_forum[15]); # <- sort option (new)

chomp($this_forum[16]) if $this_forum[16]; # <- new forum intro/announcement

$this_forum[16] = "" unless $this_forum[16];
I need to place this line of code somewhere I think, but Im having a hard to figuring it out?

Code
	# user must be logged in!
unless ($username ne '') {
&StandardHTML(qq!$vars_wordlets_err{not_logged_in}

<a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=login">$vars_wordlets{login_now}</a> $vars_wordlets{or} <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=agree">$vars_wordlets{register_title}</a>!);
}
Any help would be greatly appreciated! wink

Sponsored Links
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
&RequireUserLogin; is your friend.


UBB.classic: Love it or hate it, it was mine.
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
not in 6.3 it isnt tipsy

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
*whispers to Charles*
you want to tell him to upgrade, or shall I?

Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
well i got it to work, but not well with the cache

Sponsored Links
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
I mean, is there any reason why the forum summary announcement works flawlessly with the cache and the individual forum ann, dont?

By that I mean, if you are a guest, it wont show the ann. Then if you log in, and go back to that forum it still wont show. If you wait 4-5 min and go into the forum, then it will. Cache problem. Any solutions?

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
why aren't you just using class="ip-is-loggedin"

Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
I dunno, I dont even have that class. What benefit would that do me? Which file? Is that a built in class then obviously Im not aware of?

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
it is a built-in class available on all pages.

Code
<div class="ip-is-loggedin">You are logged in</div>
<div class="ip-is-notloggedin">You are not logged in, please register</div>
That way you won't even need to worry about the cache

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
lol, I just noticed it's what you are using for your forum summary.



It's a good idea, I actually did that a couple weeks ago

Sponsored Links
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
Well if u use that in ubb_forum.cgi, wont that disable them from even viewing the forum?

Im still confused...I can show you the if statement I wrote to disable guests from seeing forum announcements

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
you don't need any hacks, or anything. just enclose whatever you want to show only to members in that div.

Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
That works, but it doesnt. See its reversed. It shows for guests and not the users. I want it to show for the users, and not the guests.

But ya, I like that way if we can tweeak it wink

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
then use ip-is-loggedin as the class tipsy

Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
nice, works very flawlessely laugh


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)