 | How to hide News block to guests? |  |
Posted: 11/02/2006 8:08 AM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
|

|
|
|
|
 |
Hey Nightrider, I installed the News Block Mod to my forum and would like to make the contents of the news to be hidden to guests. I have tried to find this answer elsewhere as I am sure I am not the only one that wanted it hidden but have not had any luck yet. Do you think you can help me accomplish this?
Thank you!
FTM |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 10:49 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
|

|
|
|
|
 |
To hide the News block from guests you can place the following before and after the added code for the News Block. I'm sure you will find the code in the index_body.tpl file for each template installed on your board:
| Code:
|
<!-- BEGIN switch_user_logged_in -->
<!-- END switch_user_logged_in -->
|
So if this is the code for your News Block in your index_body.tpl file:
| Code:
|
<!-- BEGIN show_news -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thCornerL" height="25" nowrap="nowrap"> {L_NEWS} </th>
</tr>
<tr>
<td class="row1" width="100%"><span class="gen"><p align="center">{NEWS_BLOCK}</p></span></td>
</tr>
</table><br />
<!-- END show_news -->
|
It would look something like this when you are done:
| Code:
|
<!-- BEGIN switch_user_logged_in -->
<!-- BEGIN show_news -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thCornerL" height="25" nowrap="nowrap"> {L_NEWS} </th>
</tr>
<tr>
<td class="row1" width="100%"><span class="gen"><p align="center">{NEWS_BLOCK}</p></span></td>
</tr>
</table><br />
<!-- END show_news -->
<!-- END switch_user_logged_in -->
|
Once you make this change, only logged in members will be able to see the News Block. Make sure you create good backups of all files that you modify just in case something goes wrong...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:04 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
|

|
|
|
|
 |
edit;
I tried this on the test board and it's working too good. Even I can't see the news block now, lol. Any idea's? |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:15 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
|

|
|
|
|
 |
It seems to be working correctly. This is what I see on your Test board...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:16 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
|

|
|
|
|
 |
You probably want to hide the entire News block for guests though. They shouldn't even see a blank News block like this. The entire block should not display at all if you placed the code around the entire news block table...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:20 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
|

|
|
|
|
 |
| No, I am trying to do this to the "site news" that is at the top of the forum, not the last 10 active topics at the bottom. |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:21 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
|

|
|
|
|
 |
| Nightrider wrote:
|
You probably want to hide the entire News block for guests though. They shouldn't even see a blank News block like this. The entire block should not display at all if you placed the code around the entire news block table...
|
I will try that out, thank you! |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:37 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
|

|
|
|
|
 |
Ok, since there is already some switching controls coded for both the News and Last 10 Active Topics, then the code I provided conflicts with it. So I made the following change in your includes/page_header.php file and it worked correctly:
Ok, do this:
OPEN
includes/page_header.php
FIND
| Code:
|
|
if($board_config['news_status'] == "1"){
|
REPLACE WITH
| Code:
|
|
if($board_config['news_status'] == "1" && $userdata['session_logged_in']){
|
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:40 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
|

|
|
|
|
 |
Thank you very much! Worked like a charm.  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: How to hide News block to guests? |  |
Posted: 11/02/2006 11:45 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
|

|
|
|
|
 |
As always, you are quite welcome...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Information |  |
|