Need to remove a few things from sight on my site

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
Locked
User avatar
cvtrig
Registered User
Posts: 14
Joined: Mon Oct 08, 2007 9:54 am

Need to remove a few things from sight on my site

Post by cvtrig » Thu Oct 11, 2007 9:30 am

I am modding a forum very heavily mainly for security and visibility reasons. I have a few concerns that I can not find answers to on this forum, google, on in the phpbb 2 book, Maybe some thoughtful experts can help me.

1) Once users log in, all I want them to see is the forums that I create for them to see, I don’t want them to see “Who is Online”, how can I remove this from view except for administrators? Is this in the index_body.tpl?

2) How do I remove all menu items from the overall_header.tpl for users not logged in, the only thing I want an anonymous user to see is the header picture and the login & password fields. I have blocked access to all other php files already.

3) Remove Forum Index from home page for users not logged in. I have already added the Anonymous User MOD from being able to view the Index. This is mostly cosmetic, not mission critical but would be nice to be able to do.

Many thanks in advance.

cvtrig
You can teach anyone to paint. You cannot teach anyone to be an artist. That's a quality of mind, a love of the magic of life.

Millard Sheets, 1977

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

Re: Need to remove a few things from sight on my site

Post by RMcGirr83 » Thu Oct 11, 2007 10:52 am

cvtrig wrote: 1) Once users log in, all I want them to see is the forums that I create for them to see, I don’t want them to see “Who is Online”, how can I remove this from view except for administrators? Is this in the index_body.tpl?
open includes/page_header.php

FIND

Code: Select all

else
{
	$template->assign_block_vars('switch_user_logged_in', array());

	if ( !empty($userdata['user_popup_pm']) )
	{
		$template->assign_block_vars('switch_enable_pm_popup', array());
	}
}
AFTER ADD

Code: Select all

// here we made a switch for Admins only
if ( $userdata['user_level'] == ADMIN)
{
	$template->assign_block_vars('switch_user_is_admin', array());
}
which makes a new switch you can use anywhere on your forum. So let's hide the statistics block from everyone except Admins.

OPEN templates/xxx/index_body.tpl

FIND

Code: Select all

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr> 
	<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
  </tr>
  <tr> 
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
	<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
	</td>
  </tr>
  <tr> 
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
  </tr>
</table>

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
	<td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>
BEFORE ADD

Code: Select all

<!-- BEGIN switch_user_is_admin -->
AFTER ADD

Code: Select all

<!-- END switch_user_is_admin -->
2) How do I remove all menu items from the overall_header.tpl for users not logged in, the only thing I want an anonymous user to see is the header picture and the login & password fields. I have blocked access to all other php files already.
open templates/xxx/overall_header.tpl

FIND

Code: Select all

&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a>&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&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;
BEFORE ADD

Code: Select all

<!-- BEGIN switch_user_logged_in -->
AFTER ADD

Code: Select all

<!-- END switch_user_logged_in -->
FIND

Code: Select all

&nbsp;<a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a>&nbsp; &nbsp;<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>&nbsp; 
BEFORE ADD

Code: Select all

<!-- BEGIN switch_user_logged_in -->
AFTER ADD

Code: Select all

<!-- END switch_user_logged_in -->
3) Remove Forum Index from home page for users not logged in. I have already added the Anonymous User MOD from being able to view the Index. This is mostly cosmetic, not mission critical but would be nice to be able to do.
Not sure what it is you are asking...sorry.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
cvtrig
Registered User
Posts: 14
Joined: Mon Oct 08, 2007 9:54 am

Re: Need to remove a few things from sight on my site

Post by cvtrig » Thu Oct 11, 2007 4:12 pm

That worked great!

I took the recommendation for #2 a little further and put it just after the definition for the page so that only the login and password prompts appear. Nothing else. I was staring at this same block of text last night before posting wondering what was I missing to make this work. This works great for my site. Thanks SO MUCH!

The only thing left now is the Forum Index link. It's more of an eyesore than anything.

On the left hand side of the page on most any phpBB forum, even this one there is a link for "Board Index" or "Forum Index", this shows up on every page through out the site.

For users who are not logged in who see this link on my page it does nothing other than put them back to the login.php page. Since it does nothing I'd like to remove it for users who are not logged in.

I can't attach a screenshot and the forum is not online yet.
You can teach anyone to paint. You cannot teach anyone to be an artist. That's a quality of mind, a love of the magic of life.

Millard Sheets, 1977

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

Re: Need to remove a few things from sight on my site

Post by RMcGirr83 » Thu Oct 11, 2007 5:14 pm

The link you are talking about is set at the beginning of several files

index_body.tpl, viewtopic_body.tpl, viewforum_body.tpl, memberlist_body.tpl, etc....to remove it from guests view just look for something similar to this...from index_body.tpl

Code: Select all

<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
and put before it

Code: Select all

<!-- BEGIN switch_user_logged_in -->
and after it

Code: Select all

<!-- END switch_user_logged_in -->
you have to do this to each file where you want the link removed for guests.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
cvtrig
Registered User
Posts: 14
Joined: Mon Oct 08, 2007 9:54 am

Re: Need to remove a few things from sight on my site

Post by cvtrig » Thu Oct 11, 2007 5:31 pm

ok, my hardened 36 year old brain is getting it.

the <!-- BEGIN switch_user_logged_in -->

and

the <!-- END....

can be used anywhere I need the fields to be only visible by users logged in and anonymous viewers are out of luck.

THANKS SO MUCH!

I learned something today!!!

Really this is a big thing in my crazy 12 hour days.

cvtrig
Last edited by cvtrig on Mon Oct 15, 2007 12:19 am, edited 1 time in total.
You can teach anyone to paint. You cannot teach anyone to be an artist. That's a quality of mind, a love of the magic of life.

Millard Sheets, 1977

User avatar
jwunderly
Registered User
Posts: 5740
Joined: Sun Mar 30, 2003 2:18 pm
Location: Easton, PA (in the groove)

Re: Need to remove a few things from sight on my site

Post by jwunderly » Thu Oct 11, 2007 8:49 pm

cvtrig wrote:the <!-- BEGIN switch_user_logged_in --> and the <!-- END.... can be used anywhere I need the fields to be only visible by users logged in and anonymous viewers are out of luck.
FYI - the switches each have to be on a separate line.
John (A cranky old man. "Looking for an echo ...")
using any control-panel install/update is like shooting yourself in the foot. It won't kill you, but you're really going to hobble around until it heals.
Using the wrong tools (Front Page, DreamWeaver) gives the same results
Do not PM me for Support!

User avatar
cvtrig
Registered User
Posts: 14
Joined: Mon Oct 08, 2007 9:54 am

Re: Need to remove a few things from sight on my site

Post by cvtrig » Mon Oct 15, 2007 12:18 am

Yes, I know.

Thank you for being so literal.
You can teach anyone to paint. You cannot teach anyone to be an artist. That's a quality of mind, a love of the magic of life.

Millard Sheets, 1977

Locked

Return to “2.0.x Support Forum”