Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2002
Posts: 105
ehm
Offline
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 105
I can see on this forum here that the "Most Forums Only Appear to Members " thread apears only if I'm not logged in.
Any tip how can I do it?
Thank you

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I call those "teaser forums" to entice users who aren't logged in to register.

I've written a "how-to" document here in our How To/Site Help Library forum.

Hope that helps.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'll add this....

Because I thin you posted this topic at the infopop community forum.

The "teaser forum" thing... keeps the forums hidden from users who aren't logged in.

I think you wanted users not logged in to be able to view the postlist.php page... but not view posts? Is that what you wanted?

That could be done by modifing showflat.php and showthreaded.php to not allow unregistered users to view.

Let me know if that's what you had in mind and I'll write that up.

Joined: Oct 2002
Posts: 105
ehm
Offline
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 105
you are doulbe right.
I post at infopop yes, but then, loking here I found that "teaser forum" and I tought it could at least solve part of my problem.
Now, if I still can have that changes you wrote on 'showflat.php' and 'showthreaded.php' would be perfect. Is it that hard to change? Do I have to have .php knowloge or not?
Any way I will check your post about 'teaser forum' and sorry to ask a question before look for the awnser. I hate when I do it.
Thank you
Elton

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No real PHP knowledge is needed, if you can follow instructions and do some copy and paste with text files.

OK - backup these files first so you can go back if something goes wrong. You'll also need to put original files back if you need "official" Infopop support.

Modify at your own peril is the saying.... but this is fairly safe.
code:

In your showflat.php file.....

Find this:

// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Display, U_Groups,... [:"red"]edited for length[/]
$Username = $user['U_Username'];

$html = new html;



BELOW it, add this:

// ------------------
// Block anon users from viewing posts - by JoshPet
if (!$Username) {
$html -> not_right($ubbt_lang['NO_AUTH'],$Cat);
}


In you showthreaded.php file......


Find this:

// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Display, U_Groups,... [:"red"]edited for length[/]
$Username = $user['U_Username'];


BELOW it, add this:


// ------------------
// Block anon users from viewing posts - by JoshPet
if (!$Username) {
$html -> not_right($ubbt_lang['NO_AUTH'],$Cat);
}




That should do it.

Then allow those forums to be read by the "Guest" group. It will let them view the list of posts.... but when they click to view a thread, if they are not logged in, they will receive the error page telling them that they must be logged in.. etc.


I haven't tested... but this should work fine.... let me know how it works out for ya.

Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
... [:"red"]edited for length[/]

Joined: Oct 2002
Posts: 105
ehm
Offline
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 105
I got error
Fatal error: Call to a member function on a non-object in .../forum/showthreaded.php on line 176

I change back and the error is gone, (but the function also is gone )
I checked the sintax with my poor PHP knolodge and looks fine for me, so there is another issue ?

Did I mention I'm using 6.1.1 Threaded ?

Last edited by eltonm; 12/05/2002 1:29 PM.
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
It's probably complaining because there's no "html" object. Try making this change in showthreaded.php:

code:
// ------------------
// Block anon users from viewing posts - by JoshPet
if (!$Username) {
[:"red"]$html = new html;[/]
$html -> not_right($ubbt_lang['NO_AUTH'],$Cat);
}


Joined: Oct 2002
Posts: 105
ehm
Offline
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 105
It's working
THank you.
I understand it wont happen on the non thread (flat) show, since that included is there one line before, am I right?
Thank you

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Yes, you're right. showflat.php already has the $html = new html;

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ah good catch Dave. Showflat already had it. Forgot to notice that showthreaded didn't.

Thanks.

And yes Dave.... I edited the length just for you so you wouldn't yell at me for "wide posting again". LOL

Last edited by JoshPet; 12/05/2002 8:25 PM.

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
hatter
hatter
USA
Posts: 69
Joined: January 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
Morgan 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)