| @@ 335-343 (lines=9) @@ | ||
| 332 | $sql = 'SELECT s.*, t.* FROM ' . $db->prefix('news_stories') . ' s, ' . $db->prefix('news_topics') . ' t WHERE (s.topicid=t.topic_id) AND (published > ' . $tdate . ' AND published < ' . time() . ') AND (expired > ' . time() . ' OR expired = 0) '; |
|
| 333 | ||
| 334 | if ((int)$topic != 0) { |
|
| 335 | if (!is_array($topic)) { |
|
| 336 | $sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)'; |
|
| 337 | } else { |
|
| 338 | if (count($topic) > 0) { |
|
| 339 | $sql .= ' AND topicid IN (' . implode(',', $topic) . ')'; |
|
| 340 | } else { |
|
| 341 | return null; |
|
| 342 | } |
|
| 343 | } |
|
| 344 | } else { |
|
| 345 | if ($checkRight) { |
|
| 346 | $topics = news_MygetItemIds('news_view'); |
|
| @@ 567-575 (lines=9) @@ | ||
| 564 | { |
|
| 565 | $myts = MyTextSanitizer::getInstance(); |
|
| 566 | $sql = 'SELECT topic_id, topic_title, topic_imgurl FROM ' . $this->table . ' WHERE '; |
|
| 567 | if (!is_array($topic)) { |
|
| 568 | $sql .= ' topic_id=' . (int)$topic; |
|
| 569 | } else { |
|
| 570 | if (count($topic) > 0) { |
|
| 571 | $sql .= ' topic_id IN (' . implode(',', $topic) . ')'; |
|
| 572 | } else { |
|
| 573 | return null; |
|
| 574 | } |
|
| 575 | } |
|
| 576 | $result = $this->db->query($sql); |
|
| 577 | while ($row = $this->db->fetchArray($result)) { |
|
| 578 | $topicstitles[$row['topic_id']] = array('title' => $myts->displayTarea($row['topic_title']), 'picture' => XOOPS_URL . '/uploads/news/image/' . $row['topic_imgurl']); |
|