Exemple #1
0
 /**
  * Constructor
  *
  * Initializing the tabs, parsing it in the keyhighlighter object
  *
  * @param object $clipObj {@link SmartmediaClip object}
  */
 function SmartmediaTabs($clipObj)
 {
     // Make sure object is of correct type
     if (strtolower(get_class($clipObj)) != 'smartmediaclip') {
         return false;
     }
     $tab_i = 1;
     $this->_tabs_text = array();
     $highlight = true;
     if ($highlight && isset($_GET['keywords'])) {
         $myts =& MyTextSanitizer::getInstance();
         $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
         $h = new keyhighlighter($keywords, true, 'smartmedia_highlighter');
     }
     if ($clipObj->tab_text_1()) {
         $this->_tabs_text[$tab_i]['caption'] = $clipObj->tab_caption_1();
         $this->_tabs_text[$tab_i]['text'] = $clipObj->tab_text_1();
         if ($highlight && isset($_GET['keywords'])) {
             //	$this->_tabs_text[$tab_i]['caption'] = $h->highlight($this->_tabs_text[$tab_i]['caption']);
             $this->_tabs_text[$tab_i]['text'] = $h->highlight($this->_tabs_text[$tab_i]['text']);
         }
         $tab_i++;
     }
     if ($clipObj->tab_text_2()) {
         $this->_tabs_text[$tab_i]['caption'] = $clipObj->tab_caption_2();
         $this->_tabs_text[$tab_i]['text'] = $clipObj->tab_text_2();
         if ($highlight && isset($_GET['keywords'])) {
             //$this->_tabs_text[$tab_i]['caption'] = $h->highlight($this->_tabs_text[$tab_i]['caption']);
             $this->_tabs_text[$tab_i]['text'] = $h->highlight($this->_tabs_text[$tab_i]['text']);
         }
         $tab_i++;
     }
     if ($clipObj->tab_text_3()) {
         $this->_tabs_text[$tab_i]['caption'] = $clipObj->tab_caption_3();
         $this->_tabs_text[$tab_i]['text'] = $clipObj->tab_text_3();
         if ($highlight && isset($_GET['keywords'])) {
             //$this->_tabs_text[$tab_i]['caption'] = $h->highlight($this->_tabs_text[$tab_i]['caption']);
             $this->_tabs_text[$tab_i]['text'] = $h->highlight($this->_tabs_text[$tab_i]['text']);
         }
         $tab_i++;
     }
 }
Exemple #2
0
 /**
  * Format the clip information into an array
  *
  * This method puts each usefull informations of the clip into an array that will be used in
  * the module template
  *
  * @param int $categoryid category to which belong the parent folder of the clip
  * @return array array containing usfull informations of the clip
  */
 function toArray($categoryid, $max_title_length = 0, $forBlock = false)
 {
     $clip['clipid'] = $this->clipid();
     $clip['itemurl'] = $this->getItemUrl($categoryid);
     $clip['itemlink'] = $this->getItemLink($categoryid, $max_title_length);
     if ($forBlock) {
         return $clip;
     }
     $clip['duration'] = $this->duration();
     $clip['template'] = $this->renderTemplate();
     $clip['width'] = $this->width();
     $clip['height'] = $this->height();
     $clip['weight'] = $this->weight();
     $clip['counter'] = $this->counter();
     $clip['statusid'] = $this->statusid();
     $clip['autostart'] = $this->autostart();
     $clip['counter'] = $this->counter();
     if ($this->getVar('image_hr') != 'blank.png') {
         $clip['image_hr_path'] = smartmedia_getImageDir('clip', false) . $this->image_hr();
     } else {
         $clip['image_hr_path'] = false;
     }
     $smartConfig =& smartmedia_getModuleConfig();
     $clip['main_image_width'] = $smartConfig['main_image_width'];
     $clip['list_image_width'] = $smartConfig['list_image_width'];
     $clip['image_lr_path'] = smartmedia_getImageDir('clip', false) . $this->image_lr();
     $clip['file_hr_path'] = $this->file_hr();
     $clip['file_lr_path'] = $this->file_lr();
     $clip['file_hr_link'] = "<a href='" . $this->file_hr() . "' target='_blank'>" . _MD_SMEDIA_HIGH_RES_CLIP . "</a>";
     $clip['adminLinks'] = $this->adminLinks();
     $clip['title'] = $this->title();
     $clip['clean_title'] = $clip['title'];
     $clip['description'] = $this->description();
     $clip['meta_description'] = $this->meta_description();
     $clip['tab_caption_1'] = $this->tab_caption_1();
     $clip['tab_text_1'] = $this->tab_text_1();
     $clip['tab_caption_2'] = $this->tab_caption_2();
     $clip['tab_text_2'] = $this->tab_text_2();
     $clip['tab_caption_3'] = $this->tab_caption_3();
     $clip['tab_text_3'] = $this->tab_text_3();
     // Hightlighting searched words
     $highlight = true;
     if ($highlight && isset($_GET['keywords'])) {
         $myts =& MyTextSanitizer::getInstance();
         $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
         $h = new keyhighlighter($keywords, true, 'smartmedia_highlighter');
         $clip['title'] = $h->highlight($clip['title']);
         $clip['description'] = $h->highlight($clip['description']);
         $clip['tab_caption_1'] = $h->highlight($clip['tab_caption_1']);
         $clip['tab_text_1'] = $h->highlight($clip['tab_text_1']);
         $clip['tab_caption_2'] = $h->highlight($clip['tab_caption_2']);
         $clip['tab_text_2'] = $h->highlight($clip['tab_text_2']);
         $clip['tab_caption_3'] = $h->highlight($clip['tab_caption_3']);
         $clip['tab_text_3'] = $h->highlight($clip['tab_text_3']);
     }
     return $clip;
 }
Exemple #3
0
// Publicité
$xoopsTpl->assign('advertisement', news_getmoduleoption('advertisement'));
// ****************************************************************************************************************
function my_highlighter($matches)
{
    $color = news_getmoduleoption('highlightcolor');
    if (substr($color, 0, 1) != '#') {
        $color = '#' . $color;
    }
    return '<span style="font-weight: bolder; background-color: ' . $color . ';">' . $matches[0] . '</span>';
}
$highlight = false;
$highlight = news_getmoduleoption('keywordshighlight');
if ($highlight && isset($_GET['keywords'])) {
    $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
    $h = new keyhighlighter($keywords, true, 'my_highlighter');
    $story['text'] = $h->highlight($story['text']);
}
// ****************************************************************************************************************
$story['poster'] = $article->uname();
if ($story['poster']) {
    $story['posterid'] = $article->uid();
    $story['poster'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $story['posterid'] . '">' . $story['poster'] . '</a>';
    $tmp_user = new XoopsUser($article->uid());
    $story['poster_avatar'] = XOOPS_UPLOAD_URL . '/' . $tmp_user->getVar('user_avatar');
    $story['poster_signature'] = $tmp_user->getVar('user_sig');
    $story['poster_email'] = $tmp_user->getVar('email');
    $story['poster_url'] = $tmp_user->getVar('url');
    $story['poster_from'] = $tmp_user->getVar('user_from');
    unset($tmp_user);
} else {
Exemple #4
0
 /**
  * Format the folder information into an array
  *
  * This method puts each usefull informations of the folder into an array that will be used
  * in the modules template
  *
  * @return array array containing usfull informations of the folder
  */
 function toArray()
 {
     $folder['folderid'] = $this->folderid();
     $folder['categoryid'] = $this->categoryid();
     $folder['itemurl'] = $this->getItemUrl();
     $folder['itemlink'] = $this->getItemLink();
     $folder['weight'] = $this->weight();
     if ($this->getVar('image_hr') != 'blank.png') {
         $folder['image_hr_path'] = smartmedia_getImageDir('folder', false) . $this->image_hr();
     } else {
         $folder['image_hr_path'] = false;
     }
     $smartConfig =& smartmedia_getModuleConfig();
     $folder['main_image_width'] = $smartConfig['main_image_width'];
     $folder['list_image_width'] = $smartConfig['list_image_width'];
     $folder['image_lr_path'] = smartmedia_getImageDir('folder', false) . $this->image_lr();
     $folder['counter'] = $this->counter();
     $folder['adminLinks'] = $this->adminLinks();
     $folder['title'] = $this->title();
     $folder['clean_title'] = $folder['title'];
     $folder['short_title'] = $this->title();
     $folder['summary'] = $this->summary();
     $folder['description'] = $this->description();
     $folder['meta_description'] = $this->meta_description();
     // Hightlighting searched words
     $highlight = true;
     if ($highlight && isset($_GET['keywords'])) {
         $myts =& MyTextSanitizer::getInstance();
         $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
         $h = new keyhighlighter($keywords, true, 'smartmedia_highlighter');
         $folder['title'] = $h->highlight($folder['title']);
         $folder['summary'] = $h->highlight($folder['summary']);
         $folder['description'] = $h->highlight($folder['description']);
     }
     return $folder;
 }