RSS function displaying unapproved news

Report bugs and errors in this forum.

RSS function displaying unapproved news

Postby x-byte » Sat Dec 17, 2005 6:58 pm

I just noticed that the RSS function is publishing the unapproved news. How to stop this from happening?





Using: 2.5
x-byte
 
Posts: 170
Joined: Mon Nov 14, 2005 6:31 am

Postby FI-DD » Sat Dec 17, 2005 8:35 pm

I don't have the possibility to look at the code right now.



It has something to do with "hidden". (Search in show.news.php for "hidden" to see an example)



I try to solve this problem tomorrow evening. :)
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby FI-DD » Sun Dec 18, 2005 9:22 pm

Well, I just had a look in show.news.php and the code in question is this:

Code: Select all
   if (!$is_logged_in or $is_logged_in and $member['level'] == 4){

      $where[] = 'hidden = 0';

      $where[] = 'and';

   }




I guess, you only see the unapproved news because you are logged in. Ask someone who isn't logged in if he can see the unapproved news.

Or try to change the code above to

Code: Select all
   if (!$is_logged_in or $is_logged_in and $member['level'] >= 1){

      $where[] = 'hidden = 0';

      $where[] = 'and';

   }
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby x-byte » Mon Dec 19, 2005 1:42 am

Hmm.. it's the RSS that is sending out news that isn't approved.
x-byte
 
Posts: 170
Joined: Mon Nov 14, 2005 6:31 am

Postby FI-DD » Mon Dec 19, 2005 6:25 pm

I just tested it and it's exactly as I thought. Nobody sees the unapproved news in the RSS feed but those who are logged in.



And to let nobody see them (even those who are logged in) please change the code as I told you in the post above.



It perfectly worked for me.
User avatar
FI-DD
Admin
 
Posts: 2971
Joined: Thu Sep 22, 2005 11:27 am
Location: Germany

Postby x-byte » Mon Dec 19, 2005 9:01 pm

FI-DD wrote:I just tested it and it's exactly as I thought. Nobody sees the unapproved news in the RSS feed but those who are logged in.



And to let nobody see them (even those who are logged in) please change the code as I told you in the post above.



It perfectly worked for me.


Ok. Thanks for clearing it out. When I think of it, it's great. Then you get a feed whenever an article needs approval. :)
x-byte
 
Posts: 170
Joined: Mon Nov 14, 2005 6:31 am


Return to Bugs and errors



Who is online

Users browsing this forum: No registered users and 0 guests