Want some help for guests

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785

Want some help for guests

Postby Algore » Sat Feb 17, 2007 5:28 pm

Want some help for guests


My forum is open forum ie. everyboby without logged in can view posts ....

But i want fields like Search :: Memberlist :: Usergroups :: Profile to be seen only to members logged in ie guest cant view them and if they click in anyone of them it will ask to login


Can anyone help
User avatar
Algore
Registered User
 
Posts: 292
Joined: Tue Oct 24, 2006 10:19 am

Postby stevemaury » Sat Feb 17, 2007 5:33 pm

In overall_header.tpl, sandwich the links you do not want guests to see between the switches:

<!-- BEGIN switch_user_logged_in -->
<!-- END switch_user_logged_in -->

These switches must be by themselves on their own separate lines.
Image
All unsolicited PMs will be ignored.

For hosting, try http://www.1and1.com/?k_id=15278953
User avatar
stevemaury
Support Team Member
Support Team Member
 
Posts: 29084
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.

Postby Algore » Sat Feb 17, 2007 5:39 pm

stevemaury wrote:In overall_header.tpl, sandwich the links you do not want guests to see between the switches:

<!-- BEGIN switch_user_logged_in -->
<!-- END switch_user_logged_in -->

These switches must be by themselves on their own separate lines.



what do u mean by sandwich the links

anyway what about others the other ones
User avatar
Algore
Registered User
 
Posts: 292
Joined: Tue Oct 24, 2006 10:19 am

Postby stevemaury » Sat Feb 17, 2007 5:45 pm

Like this, for example:

Code: Select all
<!-- BEGIN switch_user_logged_in -->

         <br />
         &nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp;

<!-- END switch_user_logged_in -->


That hides the Usergroups and Memberlist links. Do the same for whichever ones you want to hide.
Image
All unsolicited PMs will be ignored.

For hosting, try http://www.1and1.com/?k_id=15278953
User avatar
stevemaury
Support Team Member
Support Team Member
 
Posts: 29084
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.

Postby Algore » Sat Feb 17, 2007 6:23 pm

i dont want to actually hide them completely from guests but show them when they click memberlist or etc etc then it will ask the user/guest to log in first to view it
User avatar
Algore
Registered User
 
Posts: 292
Joined: Tue Oct 24, 2006 10:19 am

Re: Want some help for guests

Postby stevemaury » Sat Feb 17, 2007 6:40 pm

Algore wrote:But i want fields like Search :: Memberlist :: Usergroups :: Profile to be seen only to members logged in ie guest cant view them


OK, you want the links visible but they are redirected to a Message that tells them they must register?

You would do that in the applicable .php file. For example, for the Member list:


Code: Select all
#-----[ OPEN ]------------------------------------------
#

memberlist.php

#
#-----[ FIND ]------------------------------------------
#
 
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------
#

// Begin 'Restrict Access'
if ( !$userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
   
// End 'Restrict Access'


You can substitute some other message by either defining it as a $lang entry in the /languages/lang_english/lang_main.php file, or by editing the existing text associated with the existing $lang['Not_Authorised'] = entry in that file. Oh, and correct its spelling while you're there to "Authorized. :D

Proceed similarly for the other links
Image
All unsolicited PMs will be ignored.

For hosting, try http://www.1and1.com/?k_id=15278953
User avatar
stevemaury
Support Team Member
Support Team Member
 
Posts: 29084
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.

Postby Algore » Sat Feb 17, 2007 6:51 pm

// Begin 'Restrict Access'
if ( !$userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}

// End 'Restrict Access'


I got it but instead of Not_Authorised can it redirct to login page



and hpe these will help for rest also

pls solve the issue ...

thanks for helping me buddy
User avatar
Algore
Registered User
 
Posts: 292
Joined: Tue Oct 24, 2006 10:19 am

Postby Algore » Sat Feb 17, 2007 7:26 pm

pls kindly resolve the issue pls
User avatar
Algore
Registered User
 
Posts: 292
Joined: Tue Oct 24, 2006 10:19 am

Postby stevemaury » Sat Feb 17, 2007 7:29 pm

OK if I eat lunch first? There is a 6-hour bump rule in any event. Or, maybe I don't know the answer.

Good Luck with this.
Image
All unsolicited PMs will be ignored.

For hosting, try http://www.1and1.com/?k_id=15278953
User avatar
stevemaury
Support Team Member
Support Team Member
 
Posts: 29084
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.

Postby Noxwizard » Sat Feb 17, 2007 7:32 pm

You could just replace that line with a simple redirect:
Code: Select all
header( 'Location: http://www.yoursite.com/phpbb/login.php' );
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Hosting Services - The Business Helpdesk.com, Inc.
Do not contact me for private support.
User avatar
Noxwizard
Support Team Member
Support Team Member
 
Posts: 5752
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA

Postby Algore » Sat Feb 17, 2007 7:48 pm

thanks for the time it all worked


Great work once again
User avatar
Algore
Registered User
 
Posts: 292
Joined: Tue Oct 24, 2006 10:19 am

Postby nycdlmusckat » Sun Feb 18, 2007 2:43 am

Thanks for this thread guys!!!
nycdlmusckat
Registered User
 
Posts: 84
Joined: Wed Jul 28, 2004 6:49 pm


Return to 2.0.x Support Forum

Who is online

Users browsing this forum: No registered users and 11 guests