| @@ 245-254 (lines=10) @@ | ||
| 242 | . ') AND (s.topicid=t.topic_id) '; |
|
| 243 | if ($topic != 0) { |
|
| 244 | if (!is_array($topic)) { |
|
| 245 | if ($checkRight) { |
|
| 246 | $topics = news_MygetItemIds('news_view'); |
|
| 247 | if (!in_array($topic, $topics)) { |
|
| 248 | return null; |
|
| 249 | } else { |
|
| 250 | $sql .= ' AND s.topicid=' . (int)$topic . ' AND (s.ihome=1 OR s.ihome=0)'; |
|
| 251 | } |
|
| 252 | } else { |
|
| 253 | $sql .= ' AND s.topicid=' . (int)$topic . ' AND (s.ihome=1 OR s.ihome=0)'; |
|
| 254 | } |
|
| 255 | } else { |
|
| 256 | if ($checkRight) { |
|
| 257 | $topics = news_MygetItemIds('news_view'); |
|
| @@ 1294-1303 (lines=10) @@ | ||
| 1291 | $sql = 'SELECT storyid FROM ' . $db->prefix('news_stories') . ' WHERE (published > 0 AND published <= ' . time() . ') AND (expired = 0 OR expired > ' . time() . ')'; |
|
| 1292 | if ($topic != 0) { |
|
| 1293 | if (!is_array($topic)) { |
|
| 1294 | if ($checkRight) { |
|
| 1295 | $topics = news_MygetItemIds('news_view'); |
|
| 1296 | if (!in_array($topic, $topics)) { |
|
| 1297 | return null; |
|
| 1298 | } else { |
|
| 1299 | $sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)'; |
|
| 1300 | } |
|
| 1301 | } else { |
|
| 1302 | $sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)'; |
|
| 1303 | } |
|
| 1304 | } else { |
|
| 1305 | if (count($topic) > 0) { |
|
| 1306 | $sql .= ' AND topicid IN (' . implode(',', $topic) . ')'; |
|