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(
'ChSpyModule.php' );
23 parent::__construct();
46 $this -> aCurrent = array (
51 'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'data',
53 'ownFields' => array(
'id',
'sender_id',
'lang_key',
'params',
'date'),
58 'table' =>
'Profiles',
59 'mainField' =>
'sender_id',
61 'joinFields' => array(
'NickName'),
65 'restriction' => array (
66 'global' => array(
'value'=>
'',
'field'=>
'',
'operator'=>
'='),
67 'friends' => array(
'value' =>
'',
'field' =>
'friend_id',
'operator'=>
'=',
'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'friends_data'),
68 'no_my' => array(
'value'=>
'',
'field'=>
'sender_id',
'operator'=>
'<>',
'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'data'),
69 'over_id' => array(
'value'=>
'',
'field'=>
'id',
'operator'=>
'>',
'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'data'),
70 'type' => array(
'value'=>
'',
'field'=>
'type',
'operator'=>
'=',
'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'data'),
71 'only_me' => array(
'value'=>
'',
'field'=>
'recipient_id',
'operator'=>
'=',
'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'data'),
72 'viewed' => array(
'value'=>
'',
'field'=>
'viewed',
'operator'=>
'in',
'table' => $this -> oSpyObject -> _oDb -> sTablePrefix .
'data'),
75 'paginate' => array(
'perPage' => $this -> oSpyObject -> _oConfig -> iPerPage,
'page' => 1,
'totalNum' => 10,
'totalPages' => 1),
91 if(isset($aParams[
'module_path']) && !
empty($aParams[
'module_path']))
96 $sScript = isset($aParams[
'on_change_page']) && !
empty($aParams[
'on_change_page']) ? $aParams[
'on_change_page'] :
null;
99 'count' => $this -> aCurrent[
'paginate'][
'totalNum'],
100 'per_page' => $this -> aCurrent[
'paginate'][
'perPage'],
101 'page' => $this -> aCurrent[
'paginate'][
'page'],
102 'page_url' =>
$sModulePath .
'&page={page}&per_page={per_page}',
103 'on_change_page' => $sScript,
104 'on_change_per_page' =>
null
108 return '<div class="clear_both"></div>' . $oPaginate -> getSimplePaginate(
null, -1, -1,
false);
120 if( isset($this->aCurrent[
'paginate'][
'unlimit']) ) {
122 }
else if( isset($this->aCurrent[
'paginate'][
'limit']) ){
123 return 'LIMIT ' . $this->aCurrent[
'paginate'][
'limit'];
124 }
else if (isset($this->aCurrent[
'paginate'])) {
125 $sqlFrom = ( $this->aCurrent[
'paginate'][
'page'] - 1 ) * $this->aCurrent[
'paginate'][
'perPage'];
126 $sqlTo = $this->aCurrent[
'paginate'][
'perPage'];
127 return 'LIMIT ' . $sqlFrom .
', '.$sqlTo;