Exemple #1
0
 function toArray($item_page_id = -1, $max_char_title = 0)
 {
     global $xoopsModuleConfig, $xoopsUser;
     $item = array();
     $item['id'] = $this->itemid();
     $item['categoryid'] = $this->categoryid();
     $item['categoryPath'] = $this->getCategoryPath(smartsection_getConfig('linkedPath'));
     $item['categoryname'] = $this->getCategoryName();
     $item['title'] = $this->title();
     $item['clean_title'] = $this->title();
     $item['itemurl'] = $this->getItemUrl();
     $item['titlelink'] = $this->getItemLink(false, $max_char_title);
     $item['summary'] = $this->summary();
     $item['display_summary'] = $this->getVar('display_summary');
     $item['meta_keywords'] = $this->meta_keywords();
     $item['meta_description'] = $this->meta_description();
     $item['short_url'] = $this->short_url();
     if ($this->showPartial_view()) {
         $body = smartsection_getConfig('partial_view_text');
     } else {
         $body = $this->body();
     }
     $item['body'] = $body;
     $item['maintext'] = $this->buildmaintext($item_page_id, $body);
     if ($this->image() != 'blank.png') {
         $item['image_path'] = smartsection_getImageDir('item', false) . $this->image();
     } else {
         $item['image_path'] = '';
     }
     $item['posterName'] = $this->posterName();
     $item['itemid'] = $this->itemid();
     $item['counter'] = $this->counter();
     $item['cancomment'] = $this->cancomment();
     $item['comments'] = $this->comments();
     $item['datesub'] = $this->datesub();
     $item['adminlink'] = $this->getAdminLinks();
     // Hightlighting searched words
     $highlight = true;
     if ($highlight && isset($_GET['keywords'])) {
         $myts =& MyTextSanitizer::getInstance();
         $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
         $h = new SmartsectionKeyhighlighter($keywords, true, 'smartsection_highlighter');
         $item['title'] = $h->highlight($item['title']);
         $item['summary'] = $h->highlight($item['summary']);
         $item['maintext'] = $h->highlight($item['maintext']);
     }
     return $item;
 }
Exemple #2
0
 function toArray($item_page_id = -1)
 {
     $item = array();
     $item['id'] = $this->itemid();
     $item['categoryid'] = $this->categoryid();
     $item['title'] = $this->title();
     $item['itemurl'] = $this->getItemUrl();
     $item['titlelink'] = $this->getItemLink();
     $item['summary'] = $this->summary();
     $item['maintext'] = $this->buildmaintext($item_page_id);
     $item['body'] = $this->body();
     if ($this->image() != 'blank.png') {
         $item['image_path'] = ss_getImageDir('item', false) . $this->image();
     } else {
         $item['image_path'] = '';
     }
     $item['posterName'] = $this->posterName();
     $item['titlelink'] = "<a href='" . SMARTSECTION_URL . "item.php?itemid=" . $this->itemid() . "'>" . $this->title() . "</a>";
     $item['itemid'] = $this->itemid();
     $item['counter'] = $this->counter();
     $item['cancomment'] = $this->cancomment();
     $item['comments'] = $this->comments();
     $item['datesub'] = $this->datesub();
     $item['adminlink'] = ss_getAdminLinks($this->itemid());
     // Hightlighting searched words
     $highlight = true;
     if ($highlight && isset($_GET['keywords'])) {
         $myts =& MyTextSanitizer::getInstance();
         $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
         $h = new SmartsectionKeyhighlighter($keywords, true, 'smartsection_highlighter');
         $item['title'] = $h->highlight($item['title']);
         $item['summary'] = $h->highlight($item['summary']);
         $item['maintext'] = $h->highlight($item['maintext']);
     }
     return $item;
 }