Hide [ Profile | PM | WWW | AIM ] from guest?

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
User avatar
Sassy
Registered User
Posts: 95
Joined: Sat Aug 31, 2002 6:13 am

Hide [ Profile | PM | WWW | AIM ] from guest?

Post by Sassy » Sat Oct 07, 2006 1:30 am

How can I remove [ Profile | PM | WWW | AIM ] panel from Guest users?

I tried to use the tags below, but ends up even registered users wont be able to see it.
<!-- BEGIN switch_user_logged_in -->
<!-- END switch_user_logged_in -->



What am I doing wrong?

Code: Select all

<td valign="middle" nowrap="nowrap">{postrow.POSTER_ONLINE_STATUS_IMG} <!-- BEGIN switch_user_logged_in --> {postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WEBLOG_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG} {postrow.EBAY_IMG} 
				  <script language="JavaScript" type="text/javascript"><!-- 

if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
		document.write(' {postrow.ICQ_IMG}');
	else
		document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');
				
				//--></script><noscript>{postrow.ICQ_IMG}</noscript> <!-- END switch_user_logged_in --></td>

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51882
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf » Sat Oct 07, 2006 1:41 am

Hmmm.... but a switch is a group variable. You are nesting a group variable within the postrow group variable. I do not believe that will work. You will need to create a postrow.switch_user_logged_in as a new subgroup under postrow.

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath » Sat Oct 07, 2006 4:49 am

For the viewtopic part, you need to open your viewtopic.php file and find the variables being set... something like

$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");

and before that add...

if ( $userdata['user_id'] != ANONYMOUS )
{

then after the line that starts like
$yim = ( ( $postrow[$i]['user_yim'] )

add
}


for the other things, profile, etc... open memberlist.php, includes/usercp_viewprofile.php and add at the top, after the variable intialization etc...

if ( !$userdata['session_logged_in'] )
{
$redirect = "memberlist.$phpEx";
$redirect .= ( isset($_REQUEST['type']) ) ? '&mode=' . $_REQUEST['mode'] : '';
header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
}

[example for memberlist... alter the redirect for viewprofile etc]

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw » Sat Oct 07, 2006 8:53 am

Zarath wrote: For the viewtopic part, you need to open your viewtopic.php file and find the variables being set... something like

$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");

and before that add...

if ( $userdata['user_id'] != ANONYMOUS )
{

then after the line that starts like
$yim = ( ( $postrow[$i]['user_yim'] )

add
}


for the other things, profile, etc... open memberlist.php, includes/usercp_viewprofile.php and add at the top, after the variable intialization etc...

if ( !$userdata['session_logged_in'] )
{
$redirect = "memberlist.$phpEx";
$redirect .= ( isset($_REQUEST['type']) ) ? '&mode=' . $_REQUEST['mode'] : '';
header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
}

[example for memberlist... alter the redirect for viewprofile etc]


Following the coding standards, you should use $HTTP_GET_VARS / $HTTP_POST_VARS and redirect(), that can be found in functions.php :)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath » Sat Oct 07, 2006 1:03 pm

Yeah, you should... but I didn't write it up, I just copied it from an old mod I did (that did the same thing she was asking for). ;)

Just delete that line entirely
$redirect .= ( isset($_REQUEST['type']) ) ? '&mode=' . $_REQUEST['mode'] : '';

Doesn't even do anything... heh.


Although the difference between redirect and header location is nil. They both do the same thing, but for Coding Standard's sake...

redirect("login.$phpEx?redirect=$redirect", true);
instead of
header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));

User avatar
Sassy
Registered User
Posts: 95
Joined: Sat Aug 31, 2002 6:13 am

Post by Sassy » Sat Oct 07, 2006 3:30 pm

Ok, now im really confused
lol

This redirects users to a login page if they click on the buttons?

I was looking to just hide it from guest, so search engines rank would go higher instead of indexing double content each time they are directed to the login page. also wanted to hide the members "www" button from post and profile for guest users, because the search engine will leave my site and start indexing the members "www".

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sat Oct 07, 2006 4:35 pm

Wouldn't it be simpler to just do this?

In viewtopic.php find

Code: Select all

	if ( $poster_id != ANONYMOUS )
	{
		$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");
	
IN LINE FIND

Code: Select all

if ( $poster_id != ANONYMOUS )
REPLACE WITH

Code: Select all

if ( $userdata['session_logged_in'] )
then if the user isn't signed in they won't see the images for buttons on the bottom.

User avatar
Sassy
Registered User
Posts: 95
Joined: Sat Aug 31, 2002 6:13 am

Post by Sassy » Sat Oct 07, 2006 5:23 pm

wow that worked!

Thank you all for helping me with this subject.

I do have one more request, how would i be able to remove the "www" link in the profile?

I just want to remove the www link and not block the whole profile it self.
Is there a simple way to do this?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sat Oct 07, 2006 5:40 pm

Remove it as in get rid of it...or remove it as in hiding it from all eyes...or removing as in using it for something else...or.....? lol

User avatar
Sassy
Registered User
Posts: 95
Joined: Sat Aug 31, 2002 6:13 am

Post by Sassy » Sat Oct 07, 2006 5:56 pm

Remove as in just hiding from guest users lol

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sat Oct 07, 2006 5:59 pm

You want to remove the www link or entry in the profile for guest users? Hide it in the viewing of someones profile?

User avatar
Sassy
Registered User
Posts: 95
Joined: Sat Aug 31, 2002 6:13 am

Post by Sassy » Sat Oct 07, 2006 6:59 pm

just the www entry

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sat Oct 07, 2006 7:42 pm

The easiest way is to open your profile_add_body.tpl and remove

Code: Select all

	<tr> 
	  <td class="row1"><span class="gen">{L_WEBSITE}:</span></td>
	  <td class="row2"> 
		<input type="text" class="post" style="width: 200px"  name="website" size="25" maxlength="255" value="{WEBSITE}" />
	  </td>
	</tr>
No one will then be able to enter a website address...then in profile_view_body.tpl

remove

Code: Select all

		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_WEBSITE}:&nbsp;</span></td>
		  <td><span class="gen"><b>{WWW}</b></span></td>
		</tr>
to get rid of the www when viewing someones profile

User avatar
Sassy
Registered User
Posts: 95
Joined: Sat Aug 31, 2002 6:13 am

Post by Sassy » Sat Oct 07, 2006 7:52 pm

I was hoping there was a easy way to just hide it from guest users, so search engines does not leave my page when indexing.

But since there no easy way of doing it, ill just have to deal with it.
Thanks for your help tho
:)

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sat Oct 07, 2006 8:10 pm

You can also use

Code: Select all


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

around those sections in those files to hide the entries as well.

Post Reply

Return to “[2.0.x] MOD Requests”