Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
calendar_open_closeCalendar 
How to hide News block to guests?
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
How to hide News block to guests?
PostPosted: 11/02/2006 8:08 AM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
usaCa.gif
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
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: How to hide News block to guests?
PostPosted: 11/02/2006 10:49 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
peace.gif
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">&nbsp;{L_NEWS}&nbsp;</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">&nbsp;{L_NEWS}&nbsp;</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...

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:04 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
usaCa.gif
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
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:15 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
peace.gif
It seems to be working correctly.  This is what I see on your Test board...



munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:16 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
peace.gif
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...



munky2
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:20 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
usaCa.gif
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
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:21 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
usaCa.gif
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...



munky2


I will try that out, thank you!
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:37 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
peace.gif
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']){

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:40 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 3:24 PM
Location: Denver, PA
usaCa.gif
Thank you very much! Worked like a charm.  banana
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: How to hide News block to guests?
PostPosted: 11/02/2006 11:45 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:24 PM
Location: St Pete, FL
peace.gif
As always, you are quite welcome...

banana
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group

Page generation time: 0.0917s (PHP: 54% - SQL: 46%) - SQL queries: 57 - GZIP disabled - Debug on