|
@@ 223-232 (lines=10) @@
|
| 220 |
|
$sql = 'SELECT s.*, t.* FROM ' . $db->prefix('news_stories') . ' s, ' . $db->prefix('news_topics') . ' t WHERE (s.published > 0 AND s.published <= ' . time() . ') AND (s.expired = 0 OR s.expired > ' . time() . ') AND (s.topicid=t.topic_id) '; |
| 221 |
|
if ($topic != 0) { |
| 222 |
|
if (!is_array($topic)) { |
| 223 |
|
if ($checkRight) { |
| 224 |
|
$topics = news_MygetItemIds('news_view'); |
| 225 |
|
if (!in_array($topic, $topics)) { |
| 226 |
|
return null; |
| 227 |
|
} else { |
| 228 |
|
$sql .= ' AND s.topicid=' . (int)$topic . ' AND (s.ihome=1 OR s.ihome=0)'; |
| 229 |
|
} |
| 230 |
|
} else { |
| 231 |
|
$sql .= ' AND s.topicid=' . (int)$topic . ' AND (s.ihome=1 OR s.ihome=0)'; |
| 232 |
|
} |
| 233 |
|
} else { |
| 234 |
|
if ($checkRight) { |
| 235 |
|
$topics = news_MygetItemIds('news_view'); |
|
@@ 1165-1174 (lines=10) @@
|
| 1162 |
|
$sql = 'SELECT storyid FROM ' . $db->prefix('news_stories') . ' WHERE (published > 0 AND published <= ' . time() . ') AND (expired = 0 OR expired > ' . time() . ')'; |
| 1163 |
|
if ($topic != 0) { |
| 1164 |
|
if (!is_array($topic)) { |
| 1165 |
|
if ($checkRight) { |
| 1166 |
|
$topics = news_MygetItemIds('news_view'); |
| 1167 |
|
if (!in_array($topic, $topics)) { |
| 1168 |
|
return null; |
| 1169 |
|
} else { |
| 1170 |
|
$sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)'; |
| 1171 |
|
} |
| 1172 |
|
} else { |
| 1173 |
|
$sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)'; |
| 1174 |
|
} |
| 1175 |
|
} else { |
| 1176 |
|
if (count($topic) > 0) { |
| 1177 |
|
$sql .= ' AND topicid IN (' . implode(',', $topic) . ')'; |