8 require_once( CH_DIRECTORY_PATH_ROOT .
'templates/tmpl_' .
$GLOBALS[
'tmpl'] .
'/scripts/ChTemplSearchResultText.php');
9 require_once( CH_DIRECTORY_PATH_CLASSES .
'ChWsbPaginate.php' );
10 require_once(
'ChPollModule.php' );
23 parent::__construct();
46 $this -> aCurrent = array (
50 'title' =>
'_ch_polls',
51 'table' => $this -> oPollObject -> _oDb -> sTablePrefix .
'data',
53 'ownFields' => array(
'id_poll',
'poll_question',
'poll_answers',
'poll_date'),
54 'searchFields' => array(
'poll_question',
'poll_answers',
'poll_tags',
'poll_categories'),
59 'table' =>
'Profiles',
60 'mainField' =>
'id_profile',
62 'joinFields' => array(
'NickName'),
66 'restriction' => array (
67 'activeStatus' => array(
'value'=>
'active',
'field'=>
'poll_status',
'operator'=>
'='),
68 'approvalStatus' => array(
'value'=>
'1',
'field'=>
'poll_approval',
'operator'=>
'='),
69 'tag' => array(
'value'=>
'',
'field'=>
'poll_tags',
'operator'=>
'against',
'paramName'=>
'tag'),
70 'category' => array(
'value'=>
'',
'field'=>
'poll_categories',
'operator'=>
'against',
'paramName'=>
'categoryUri'),
71 'owner' => array(
'value'=>
'',
'field'=>
'id_profile',
'operator'=>
'=',
'paramName'=>
'userID'),
72 'featured' => array(
'value'=>
'',
'field'=>
'poll_featured',
'operator'=>
'='),
73 'unfeatured' => array(
'value'=>
'',
'field'=>
'poll_featured',
'operator'=>
'='),
74 'my' => array(
'value'=>
'',
'field'=>
'id_profile',
'operator'=>
'='),
75 'calendar-min' => array(
'value' =>
"",
'field' =>
'poll_date',
'operator' =>
'>=',
'no_quote_value' =>
true),
76 'calendar-max' => array(
'value' =>
"",
'field' =>
'poll_date',
'operator' =>
'<=',
'no_quote_value' =>
true),
77 'allow_view' => array(
'value' =>
"",
'field' =>
'allow_view_to',
'operator' =>
'in'),
80 'paginate' => array(
'perPage' => 6,
'page' => 1,
'totalNum' => 10,
'totalPages' => 1),
89 $sCode = parent::displayResultBlock();
90 return !
empty(
$sCode) ? $this->oPollObject->_oTemplate->parseHtmlByName(
'default_margin.html', array(
'content' =>
$sCode)) :
$sCode;
100 $aData[
'poll_ago'] =
time() - $aData[
'poll_date'];
101 $sOutputHtml = $this -> oPollObject -> getPollBlock($aData);
113 $sInitSection = $this -> oPollObject -> getInitPollPage(
false);
115 if (isset($this->aCurrent[
'rss']) && $this->aCurrent[
'rss'][
'link'])
116 $aCaptionMenu =
'<div class="dbTopMenu"><div class="notActive notActiveIcon" style="background-image:url('.getTemplateIcon(
'rss.png').
')"><a target="_blank" class="top_members_menu" href="' . $this->aCurrent[
'rss'][
'link'] . (
false === strpos($this->aCurrent[
'rss'][
'link'],
'?') ?
'?' :
'&') .
'rss=1">' .
_t(
'RSS') .
'</a></div></div>';
118 if (!isset($_POST[
'searchMode'],
$_GET[
'searchMode']))
119 $sCode =
'<div id="page_block_'.$this->id.
'">'.
$sCode.
'<div class="clear_both"></div></div>';
122 $sCssStyles = $this -> oPollObject -> _oTemplate -> addCss(
'main.css',
true);
124 return $sCssStyles . $sInitSection .
$sCode;
134 switch($this->aCurrent[
'sorting']) {
136 $aSql[
'order'] =
" ORDER BY `poll_rate` DESC";
140 $aSql[
'order'] =
" ORDER BY `poll_date` DESC";
144 $aSql[
'order'] =
" ORDER BY `poll_rate_count` DESC";
153 $sModulePath = isset($aParams[
'module_path']) && !
empty($aParams[
'module_path']) ? $aParams[
'module_path'] :
false;
156 'count' => $this -> aCurrent[
'paginate'][
'totalNum'],
157 'per_page' => $this -> aCurrent[
'paginate'][
'perPage'],
158 'page' => $this -> aCurrent[
'paginate'][
'page'],
165 $aParameters[
'settings'][
'on_change_page'] =
'return !loadDynamicBlock(' . $this ->
id .
', \'searchKeywordContent.php?searchMode=ajax§ion[]=' . $this -> aCurrent[
'name'] .
'&keyword=' . rawurlencode(
$_REQUEST[
'keyword']) . $aLinkAddon[
'params'] .
'&page={page}&per_page={per_page}\');';
166 $aParameters[
'settings'][
'on_change_per_page'] =
'return !loadDynamicBlock(' . $this ->
id .
', \'searchKeywordContent.php?searchMode=ajax§ion[]=' . $this -> aCurrent[
'name'] .
'&keyword=' . rawurlencode(
$_REQUEST[
'keyword']) . $aLinkAddon[
'params'] .
'&page=1&per_page=\' + this.value);';
174 $sPaginate =
'<div class="clear_both"></div>' . $oPaginate -> getPaginate();