Exemple #1
0
function smartsection_search($queryarray, $andor, $limit, $offset, $userid)
{
    include_once XOOPS_ROOT_PATH . '/modules/smartsection/include/functions.php';
    $ret = array();
    if (!isset($smartsection_item_handler)) {
        $smartsection_item_handler = xoops_getmodulehandler('item', 'smartsection');
    }
    if ($queryarray == '' || count($queryarray) == 0) {
        $keywords = '';
        $hightlight_key = '';
    } else {
        $keywords = implode('+', $queryarray);
        $hightlight_key = "&keywords=" . $keywords;
    }
    $itemsObj =& $smartsection_item_handler->getItemsFromSearch($queryarray, $andor, $limit, $offset, $userid);
    $withCategoryPath = smartsection_getConfig('catpath_search');
    foreach ($itemsObj as $result) {
        $item['image'] = "images/item_icon.gif";
        $item['link'] = "item.php?itemid=" . $result['id'] . $hightlight_key;
        if ($withCategoryPath) {
            $item['title'] = $result['categoryPath'] . $result['title'];
        } else {
            $item['title'] = "" . $result['title'];
        }
        $item['time'] = $result['datesub'];
        $item['uid'] = $result['uid'];
        $ret[] = $item;
        unset($item);
    }
    return $ret;
}
Exemple #2
0
// tags support
if (smartsection_tag_module_included()) {
    include_once XOOPS_ROOT_PATH . "/modules/tag/include/tagbar.php";
    $xoopsTpl->assign('tagbar', tagBar($itemid, $catid = 0));
}
/**
 * Generating meta information for this page
 */
$smartsection_metagen = new SmartsectionMetagen($itemObj->getVar('title'), $itemObj->getVar('meta_keywords', 'n'), $itemObj->getVar('meta_description', 'n'), $itemObj->getCategoryPath());
$smartsection_metagen->createMetaTags();
//SmartObject Rating feature
if (file_exists(XOOPS_ROOT_PATH . '/modules/smartobject/include/rating.rate.php')) {
    include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/rating.rate.php';
}
// Include the comments if the selected ITEM supports comments
if ($itemObj->cancomment() == 1 || !$xoopsModuleConfig['commentatarticlelevel'] && smartsection_getConfig('com_rule') != 0) {
    include_once XOOPS_ROOT_PATH . "/include/comment_view.php";
    // Problem with url_rewrite and posting comments :
    $xoopsTpl->assign(array('editcomment_link' => SMARTSECTION_URL . 'comment_edit.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra, 'deletecomment_link' => SMARTSECTION_URL . 'comment_delete.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra, 'replycomment_link' => SMARTSECTION_URL . 'comment_reply.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra));
    $xoopsTpl->_tpl_vars['commentsnav'] = str_replace("self.location.href='", "self.location.href='" . SMARTSECTION_URL, $xoopsTpl->_tpl_vars['commentsnav']);
}
$xoopsTpl->assign('rating_enabled', $xoopsModuleConfig['rating_enabled']);
$newGroupsArray = array();
$newGroupsArray[0] = 'None';
foreach ($groups as $key => $value) {
    $newGroupsArray[$key] = $value;
}
//code to include smartie
/*if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
	include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
		$xoopsTpl->assign('smarttie',1);
Exemple #3
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 #4
0
$pdf->SetCreator($pdf_config['creator']);
$pdf->SetTitle($pdf_data['title']);
$pdf->SetAuthor($pdf_config['url']);
$pdf->SetSubject($pdf_data['author']);
$out = $pdf_config['url'] . ', ' . $pdf_data['author'] . ', ' . $pdf_data['title'] . ', ' . $pdf_data['subtitle'] . ', ' . $pdf_data['subsubtitle'];
$pdf->SetKeywords($out);
$pdf->SetAutoPageBreak(true, 25);
$pdf->SetMargins($pdf_config['margin']['left'], $pdf_config['margin']['top'], $pdf_config['margin']['right']);
$pdf->Open();
//First page
$pdf->AddPage();
$pdf->SetXY(24, 25);
$pdf->SetTextColor(10, 60, 160);
$pdf->SetFont($pdf_config['font']['slogan']['family'], $pdf_config['font']['slogan']['style'], $pdf_config['font']['slogan']['size']);
$pdf->WriteHTML($pdf_config['slogan'], $pdf_config['scale']);
$pdf_config['logo']['path'] = smartsection_getConfig('printlogourl');
$pdf->Line(25, 30, 190, 30);
$pdf->SetXY(25, 35);
$pdf->SetFont($pdf_config['font']['title']['family'], $pdf_config['font']['title']['style'], $pdf_config['font']['title']['size']);
$pdf->WriteHTML($pdf_data['title'], $pdf_config['scale']);
if ($pdf_data['subtitle'] != '') {
    $pdf->WriteHTML($puff, $pdf_config['scale']);
    $pdf->SetFont($pdf_config['font']['subtitle']['family'], $pdf_config['font']['subtitle']['style'], $pdf_config['font']['subtitle']['size']);
    $pdf->WriteHTML($pdf_data['subtitle'], $pdf_config['scale']);
}
if ($pdf_data['subsubtitle'] != '') {
    $pdf->WriteHTML($puff, $pdf_config['scale']);
    $pdf->SetFont($pdf_config['font']['subsubtitle']['family'], $pdf_config['font']['subsubtitle']['style'], $pdf_config['font']['subsubtitle']['size']);
    $pdf->WriteHTML($pdf_data['subsubtitle'], $pdf_config['scale']);
}
$pdf->WriteHTML($puff, $pdf_config['scale']);
Exemple #5
0
        exit;
        break;
    case 'add':
    default:
        global $xoopsUser, $myts;
        $xoopsOption['template_main'] = 'smartsection_submit.html';
        include_once XOOPS_ROOT_PATH . "/header.php";
        include_once "footer.php";
        $name = $xoopsUser ? ucwords($xoopsUser->getVar("uname")) : 'Anonymous';
        $notifypub = 1;
        $xoopsTpl->assign('module_home', smartsection_module_home());
        if (isset($_GET['op']) && $_GET['op'] == 'clone') {
            $xoopsTpl->assign('categoryPath', _MD_SSECTION_CLONE);
            $xoopsTpl->assign('lang_intro_title', _MD_SSECTION_CLONE);
        } elseif ($itemid) {
            $xoopsTpl->assign('categoryPath', _MD_SSECTION_EDIT_ARTICLE);
            $xoopsTpl->assign('lang_intro_title', _MD_SSECTION_EDIT_ARTICLE);
            //For RISQ
            $xoopsTpl->assign('lang_intro_text', '');
            //$xoopsTpl->assign('lang_intro_text', $myts->displayTarea(smartsection_getConfig('submitintromsg')));
        } else {
            $xoopsTpl->assign('categoryPath', _MD_SSECTION_SUB_SNEWNAME);
            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SSECTION_SUB_SNEWNAME, ucwords($xoopsModule->name())));
            //For RISQ
            $xoopsTpl->assign('lang_intro_text', smartsection_getConfig('submitintromsg'));
            //$xoopsTpl->assign('lang_intro_text', $myts->displayTarea(smartsection_getConfig('submitintromsg')));
        }
        include_once SMARTSECTION_ROOT_PATH . 'include/submit.inc.php';
        include_once XOOPS_ROOT_PATH . '/footer.php';
        break;
}
Exemple #6
0
            $item['categorylink'] = "<a href='" . XOOPS_URL . "/modules/smartsection/category.php?categoryid=" . $itemsObj[$i]->categoryid() . "'>" . $allcategories[$itemsObj[$i]->categoryid()]->name() . "</a>";
            $item['who_when'] = $itemsObj[$i]->getWhoAndWhen($users);
            $xoopsTpl->append('items', $item);
        }
    }
}
/// sizeof($items);exit;
// Language constants
$xoopsTpl->assign(array('lang_on' => _MD_SSECTION_ON, 'lang_postedby' => _MD_SSECTION_POSTEDBY, 'lang_total' => isset($totalItemsOnPage) ? $totalItemsOnPage : '', 'lang_title' => _MD_SSECTION_TITLE, 'lang_datesub' => _MD_SSECTION_DATESUB, 'lang_hits' => _MD_SSECTION_HITS));
$xoopsTpl->assign('title_and_welcome', $xoopsModuleConfig['title_and_welcome']);
//SHINE ADDED DEBUG mainintro txt
$xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['indexwelcomemsg'], 1));
$xoopsTpl->assign('sectionname', $smartsection_moduleName);
$xoopsTpl->assign('whereInSection', $smartsection_moduleName);
$xoopsTpl->assign('module_home', smartsection_module_home(false));
$indexfooter = smartsection_getConfig('indexfooter');
$indexfooter = $myts->displayTarea($indexfooter, 1);
$xoopsTpl->assign('indexfooter', $indexfooter);
$xoopsTpl->assign('lang_category_summary', _MD_SSECTION_INDEX_CATEGORIES_SUMMARY);
$xoopsTpl->assign('lang_category_summary_info', _MD_SSECTION_INDEX_CATEGORIES_SUMMARY_INFO);
$xoopsTpl->assign('lang_items_title', _MD_SSECTION_INDEX_ITEMS);
$xoopsTpl->assign('lang_items_info', _MD_SSECTION_INDEX_ITEMS_INFO);
$xoopsTpl->assign('index_page', true);
// Category Navigation Bar
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', '');
if ($xoopsModuleConfig['useimagenavpage'] == 1) {
    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
} else {
    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
}