1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Filter 'visible to nobody' items in news RSS

This commit is contained in:
e107steved
2009-05-04 09:24:36 +00:00
parent 577d6bf00f
commit c5eb22e562

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss.php,v $
| $Revision: 1.10 $ | $Revision: 1.11 $
| $Date: 2008-12-13 12:34:53 $ | $Date: 2009-05-04 09:24:36 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -191,19 +191,23 @@ class rssCreate {
switch ($content_type) { switch ($content_type) {
case 'news' : case 'news' :
case 1: case 1:
if($topic_id && is_numeric($topic_id)){ if($topic_id && is_numeric($topic_id))
{
$topic = " AND news_category = ".intval($topic_id); $topic = " AND news_category = ".intval($topic_id);
}else{ }
else
{
$topic = ''; $topic = '';
} }
$path=''; $path='';
$render = ($pref['rss_othernews'] != 1) ? "AND n.news_render_type < 2" : ""; $render = ($pref['rss_othernews'] != 1) ? "AND n.news_render_type < 2" : "";
$nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
$this -> rssQuery = " $this -> rssQuery = "
SELECT n.*, u.user_id, u.user_name, u.user_email, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n SELECT n.*, u.user_id, u.user_name, u.user_email, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
LEFT JOIN #user AS u ON n.news_author = u.user_id LEFT JOIN #user AS u ON n.news_author = u.user_id
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") {$render} {$topic} ORDER BY news_datestamp DESC LIMIT 0,".$this -> limit; WHERE n.news_class IN (".USERCLASS_LIST.") AND NOT (n.news_class REGEXP ".$nobody_regexp.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") {$render} {$topic} ORDER BY news_datestamp DESC LIMIT 0,".$this -> limit;
$sql->db_Select_gen($this -> rssQuery); $sql->db_Select_gen($this -> rssQuery);
$tmp = $sql->db_getList(); $tmp = $sql->db_getList();
$this -> rssItems = array(); $this -> rssItems = array();