Notifications
Clear all

wpForo 1.x.x [Solved] Can I load the LOGIN page by default if not logged in?

5 Posts
4 Users
4 Reactions
1,856 Views
Posts: 3
Topic starter
(@kwit)
Active Member
Joined: 8 years ago

I'd link to have a FORUM link on the top-right of my site. When clicked, if the user is not logged in, it should take them to the LOGIN tag but if logged in, it should just load the main forum categories tab. 

Is there a way to do this within the settings or do I need custom-code?

Thanks,

 

4 Replies
Robert
Posts: 10518
Admin
(@robert)
Support Team
Joined: 8 years ago

I'm sorry but I don't have solution for this. This is a custom development, there is no an easy way to do this.

BlackRaz
Posts: 406
Admin
(@blackraz)
Contributor
Joined: 7 years ago

Hi Dear KW Web & IT Consultant,

Thank you for using wpForo Forum
Please take a look at this
URL:   http://www.screencast.com/t/JyXKjViRtdV

 

Posts: 6
(@pepi1025)
Active Member
Joined: 7 years ago

Just write two new lines into index.php.

change this:

if($template == 'search'){
include( wpftpl('search.php') );

to this:

if ( !is_user_logged_in() ){
include( wpftpl('login.php') );
}elseif($template == 'search'){
include( wpftpl('search.php') );

Posts: 3
Topic starter
(@kwit)
Active Member
Joined: 8 years ago

@Robert - You gave up too easily 🙂

@blackraz - Excellent solution and works easily. How did you come across that query solution?

@pepi1025 - Thanks, but I did no attempt to use your code based solution as blackraz's solution worked with just a url query edit