コード例 #1
0
ファイル: Application.php プロジェクト: allysha/Loggix
 /**
  * Set Entry Items
  *
  * @param  array $item
  * @uses   getCategoryArray
  * @uses   getCategoryIdArray
  * @uses   smiley
  * @return array $item
  */
 public function setEntryItems($item)
 {
     global $pathToIndex, $lang, $module;
     $item['id'] = intval($item['id']);
     $item['date'] = $item['date'];
     $item['title'] = htmlspecialchars($item['title']);
     $item['comment'] = $item['comment'];
     $item['tag'] = '';
     if (isset($_GET['id'])) {
         foreach ($this->getTagArray() as $row) {
             $item['tag'] .= in_array($row[0], $this->getTagIdArray()) ? '<a href="' . $pathToIndex . '/index.php?t=' . $row[0] . '&amp;ex=1">' . htmlspecialchars($row[1]) . '</a> ' : '';
         }
     }
     // Apply Smiley
     $item['comment'] = $this->setSmiley($item['comment']);
     $item['comment'] = str_replace('href="./data', 'href="' . $pathToIndex . '/data', $item['comment']);
     $item['comment'] = str_replace('src="./data', 'src="' . $pathToIndex . '/data', $item['comment']);
     $item['comment'] = str_replace('src="./theme/images', 'src="' . $pathToIndex . '/theme/images', $item['comment']);
     // Apply plugin filter
     $item['comment'] = $this->plugin->applyFilters('entry-content', $item['comment']);
     // Visitor's comments
     if (class_exists('Loggix_Module_Comment')) {
         $aComment = new Loggix_Module_Comment();
         $item['comments'] = $aComment->getCommentStatus($item);
         $module['LM']['comment']['list'] = $aComment->getCommentList($item);
     }
     // Trackback
     if (class_exists('Loggix_Module_Trackback')) {
         $aTrackback = new Loggix_Module_Trackback();
         $item['trackbacks'] = $aTrackback->getTrackbackStatus($item);
         $module['LM']['trackback']['uri'] = $aTrackback->getTrackbackUri($item);
         $module['LM']['trackback']['list'] = $aTrackback->getTrackbackList($item);
     }
     // RSS
     if (class_exists('Loggix_Module_Rss')) {
         $aRss = new Loggix_Module_Rss();
         $item['comment'] = $aRss->toEnclosure($item['comment']);
     }
     return $item;
 }