|
Joined: Sep 2001
Posts: 672
Member
|
Member
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 # 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? # 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!
|
|
|
|
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
Joined: Sep 2001
Posts: 672 |
not in 6.3 it isnt
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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
Joined: Sep 2001
Posts: 672 |
well i got it to work, but not well with the cache
|
|
|
|
Joined: Sep 2001
Posts: 672
Member
|
Member
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
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
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
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
it is a built-in class available on all pages. <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
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
|
|
|
|
Joined: Sep 2001
Posts: 672
Member
|
Member
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
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
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
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
then use ip-is-loggedin as the class
|
|
|
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
nice, works very flawlessely
|
|
|
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: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|