Status
Not open for further replies.

D@rekills4

Member
17
2011
1
0
Ok, when anyone who is not registered who is not logged in, when they click on any of the forums, instead of hiding threads to them from that section, I want them to be redirected to the login page.....

Any ways to do this or any mods?
 
8 comments
for vb3**

Go to admin cp>style manager>all style options>place in your header Code:
Code:
<if condition="$bbuserinfo['usergroupid'] == 1">
<meta HTTP-EQUIV="REFRESH" content="X; url=http://www.yourforum*********register.php">
</if>

Replace X with how many seconds you want the unregistered to view your board.
Replace "yourforum" with your site name.
Press save and all done!



for vb4**

Code:
<vb:if condition="THIS_SCRIPT != 'register'" AND condition="$bbuserinfo['userid'] == 0">
	<meta HTTP-EQUIV="REFRESH" content="15; url=http://yoursite.com/register.php">
</vb:if>
Paste this block in the headinclude template just after the rest of the meta tags in the top of the form. With this hack, if you have a visitor to your site checking things out, they will be redirected to the registration form in 15 seconds using this code. To change the time of the redirect change 15 to what ever.
 
I dont know anything about SMF, but look into the template system, search for "register" (that means only guests will be able to see it) and thake the code from there..

Lets say for example it can be something like <ifguest><a href="register.php>Register</a></ifguest>

Just take that code and modify it like:
Code:
<ifguest><meta HTTP-EQUIV="REFRESH" content="X; url=http://www.yourforum*********register.php"></ifguest>

And then place it in the header alongside the other meta tags.

Although this does not what OP requested, it just refreshes the page after X second, works on any html page.
 
Now to the OP's request:
Open the template forumhome_forumbit_level1_nopost
find:
Code:
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>

replace that bit with:
Code:
<if condition="$bbuserinfo['usergroupid'] == 1"><a href="register.php">$forum[title]</a></if><if condition="$bbuserinfo['usergroupid'] == 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20"><a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a></if>

Should do the trick. Although guests will still be able to visit through a direct link.
(I know, it's messy using all the usergroup id's, but i don't remember the short code off my head.)

edit. yeah, now that i think of it, a simple "else" would do the job! :P
 
for vb3**

Go to admin cp>style manager>all style options>place in your header Code:
Code:
<if condition="$bbuserinfo['usergroupid'] == 1">
<meta HTTP-EQUIV="REFRESH" content="X; url=http://www.yourforum*********register.php">
</if>
Replace X with how many seconds you want the unregistered to view your board.
Replace "yourforum" with your site name.
Press save and all done!



for vb4**

Code:
<vb:if condition="THIS_SCRIPT != 'register'" AND condition="$bbuserinfo['userid'] == 0">
    <meta HTTP-EQUIV="REFRESH" content="15; url=http://yoursite.com/register.php">
</vb:if>
Paste this block in the headinclude template just after the rest of the meta tags in the top of the form. With this hack, if you have a visitor to your site checking things out, they will be redirected to the registration form in 15 seconds using this code. To change the time of the redirect change 15 to what ever.




Sorry but this thing directly redirects users to the login page....
I want them to be redirected when they click on any forum or thread...
Except the ones in the Announcements section....
 
My solution does what you ask for. It just does it on every forum.
You can add another <if condition... to limit the forum id's, but it will become a little more complicated.
 
Status
Not open for further replies.
Back
Top