function getRestriction() { $sWhereSQL = parent::getRestriction(); $oMain = $this->getAdsMain(); if (isset($this->aCurrent['third_restr']) && $this->aCurrent['third_restr'] != '') { $sWhereSQL .= " AND {$this->aCurrent['third_restr']} "; } if (isset($this->aCurrent['custom_filter1']) && $this->aCurrent['custom_filter1'] != '') { $sWhereSQL .= " AND {$this->aCurrent['custom_filter1']} "; } if (isset($this->aCurrent['custom_filter2']) && $this->aCurrent['custom_filter2'] != '') { $sWhereSQL .= " AND {$this->aCurrent['custom_filter2']} "; } $bSpec = isAdmin(); $sSign = "<"; $sTimeCheck = " AND UNIX_TIMESTAMP() - `{$oMain->_oConfig->sSQLPostsTable}`.`LifeTime`*24*60*60 __sign__ `{$oMain->_oConfig->sSQLPostsTable}`.`DateTime`"; switch ($this->aCurrent['second_restr']) { case 'expired': $sSign = ">"; $bSpec = FALSE; break; case 'manage': $sSign = "<"; $bSpec = FALSE; break; case 'outtime': $sTimeCheck = ""; break; } if (!$bSpec) { $sWhereSQL .= str_replace('__sign__', $sSign, $sTimeCheck); } return $sWhereSQL; }
function BxBlogsSearchUnit($oBlogObject = null) { $this->bShowCheckboxes = false; $this->bAdminMode = false; $oMain = $this->getBlogsMain(); $this->iIconSize = $oMain->iIconSize; $this->iThumbSize = $oMain->iThumbSize; $this->iBigThumbSize = $oMain->iBigThumbSize; $this->iImgSize = $oMain->iImgSize; if ($oMain->isAdmin()) { $this->bAdminMode = true; //$this->bShowCheckboxes = true; } $this->sHomeUrl = $oMain->_oConfig->getHomeUrl(); $this->sHomePath = $oMain->_oConfig->getHomePath(); $this->aPermalinks = array('param' => 'permalinks_blogs', 'enabled' => array('file' => 'blogs/entry/{uri}', 'category' => 'blogs/posts/{ownerName}/category/{uri}', 'member' => 'blogs/posts/{ownerName}', 'tag' => 'blogs/tag/{uri}', 'browseAll' => 'blogs/', 'admin_file' => 'blogs/entry/{uri}', 'admin_category' => 'blogs/posts/{ownerName}/category/{uri}', 'admin_member' => 'blogs/posts/{ownerName}', 'admin_tag' => 'blogs/tag/{uri}', 'admin_browseAll' => 'blogs/', 'last_posts' => 'blogs/all_posts/', 'popular_posts' => 'blogs/popular_posts/', 'top_posts' => 'blogs/top_posts/'), 'disabled' => array('file' => 'blogs.php?action=show_member_post&post_id={id}', 'category' => 'blogs.php?action=show_member_blog&ownerID={ownerId}&category={id}', 'member' => 'blogs.php?action=show_member_blog&ownerID={ownerId}', 'tag' => 'blogs.php?action=search_by_tag&tagKey={uri}', 'browseAll' => 'blogs.php', 'admin_file' => 'blogs.php?action=show_member_post&post_id={id}', 'admin_category' => 'blogs.php?action=show_member_blog&ownerID={ownerId}&category={id}', 'admin_member' => 'blogs.php?action=show_member_blog&ownerID={ownerId}', 'admin_tag' => 'blogs.php?action=search_by_tag&tagKey={uri}', 'admin_browseAll' => 'blogs.php', 'last_posts' => 'blogs.php?action=all_posts', 'popular_posts' => 'blogs.php?action=popular_posts', 'top_posts' => 'blogs.php?action=top_posts')); if (!$oBlogObject) { $oBlogObject = BxDolModule::getInstance('BxBlogsModule'); } if ($this->bAdminMode || is_object($oBlogObject) && ($oBlogObject->isAllowedApprove() || $oBlogObject->isAllowedPostEdit(-1) || $oBlogObject->isAllowedPostDelete(-1))) { $this->aCurrent['restriction']['activeStatus'] = ''; } parent::BxBaseSearchResultText(); $this->iPostViewType = 4; $this->sSearchedTag = ''; }
function displayResultBlock() { $sResult = parent::displayResultBlock(); if (empty($sResult)) { $sResult = MsgBox(_t('_Empty')); } return $sResult; }
function BxOSiSearchUnit(&$oConfig, $_oTemplate = null) { $this->_oConfig = $oConfig; $this->sHomePath = $this->_oConfig->getHomePath(); $this->sHomeUrl = $this->_oConfig->getHomeUrl(); $this->aPermalinks = array('param' => 'permalinks_osi', 'enabled' => array('file' => ''), 'disabled' => array('file' => '')); $this->bShowCheckboxes = false; if (isAdmin() || isModerator()) { $this->aCurrent['restriction']['status'] = ''; $this->bShowCheckboxes = true; } parent::BxBaseSearchResultText(); $this->oOsiTemplate = $_oTemplate; }
function getRestriction() { $sWhereSQL = parent::getRestriction(); $oMain = $this->getAdsMain(); /*if (isset($this->aCurrent['second_restr']) && $this->aCurrent['second_restr'] == 'toptoday') { $sWhereSQL .= " AND DATE(FROM_UNIXTIME(`{$oMain->_oConfig->sSQLPostsTable}`.`DateTime`)) = CURDATE() "; }*/ if (isset($this->aCurrent['third_restr']) && $this->aCurrent['third_restr'] != '') { $sWhereSQL .= " AND {$this->aCurrent['third_restr']} "; } if (isset($this->aCurrent['custom_filter1']) && $this->aCurrent['custom_filter1'] != '') { $sWhereSQL .= " AND {$this->aCurrent['custom_filter1']} "; } if (isset($this->aCurrent['custom_filter2']) && $this->aCurrent['custom_filter2'] != '') { $sWhereSQL .= " AND {$this->aCurrent['custom_filter2']} "; } //if (isAdmin() == false) { if ($this->aCurrent['second_restr'] != 'manage' && isAdmin() == false) { $sWhereSQL .= " AND UNIX_TIMESTAMP() - `{$oMain->_oConfig->sSQLPostsTable}`.`LifeTime`*24*60*60 < `{$oMain->_oConfig->sSQLPostsTable}`.`DateTime`"; } return $sWhereSQL; }
/** * Class constructor ; */ function __construct($oSpyObject = null) { // call the parent constructor ; parent::__construct(); if (!$oSpyObject) { $this->oSpyObject = BxDolModule::getInstance('BxSpyModule'); } else { $this->oSpyObject = $oSpyObject; } // init some needed db table's fields ; /* main settings for shared modules ownFields - fields which will be got from main table ($this->aCurrent['table']) searchFields - fields which using for full text key search join - array of join tables join array ( 'type' - type of join 'table' - join table 'mainField' - field from main table for 'on' condition 'onField' - field from joining table for 'on' condition 'joinFields' - array of fields from joining table ) */ $this->aCurrent = array('name' => 'spy', 'title' => '_bx_spy', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'data', 'ownFields' => array('id', 'sender_id', 'lang_key', 'params', 'date'), 'join' => array('profile' => array('type' => 'left', 'table' => 'Profiles', 'mainField' => 'sender_id', 'onField' => 'ID', 'joinFields' => array('NickName'))), 'restriction' => array('global' => array('value' => '', 'field' => '', 'operator' => '='), 'friends' => array('value' => '', 'field' => 'friend_id', 'operator' => '=', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'friends_data'), 'no_my' => array('value' => '', 'field' => 'sender_id', 'operator' => '<>', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'data'), 'over_id' => array('value' => '', 'field' => 'id', 'operator' => '>', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'data'), 'type' => array('value' => '', 'field' => 'type', 'operator' => '=', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'data'), 'only_me' => array('value' => '', 'field' => 'recipient_id', 'operator' => '=', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'data'), 'viewed' => array('value' => '', 'field' => 'viewed', 'operator' => 'in', 'table' => $this->oSpyObject->_oDb->sTablePrefix . 'data')), 'paginate' => array('perPage' => $this->oSpyObject->_oConfig->iPerPage, 'page' => 1, 'totalNum' => 10, 'totalPages' => 1), 'sorting' => 'last', 'view' => 'full', 'ident' => 'id'); }
/** * Class constructor ; */ function BxPollSearch($oPollObject = null) { // call the parent constructor ; parent::BxTemplSearchResultText(); if (!$oPollObject) { $this->oPollObject = BxDolModule::getInstance('BxPollModule'); } else { $this->oPollObject = $oPollObject; } // init some needed db table's fields ; /* main settings for shared modules ownFields - fields which will be got from main table ($this->aCurrent['table']) searchFields - fields which using for full text key search join - array of join tables join array ( 'type' - type of join 'table' - join table 'mainField' - field from main table for 'on' condition 'onField' - field from joining table for 'on' condition 'joinFields' - array of fields from joining table ) */ $this->aCurrent = array('name' => 'poll', 'title' => '_bx_polls', 'table' => $this->oPollObject->_oDb->sTablePrefix . 'data', 'ownFields' => array('id_poll', 'poll_question', 'poll_answers', 'poll_date'), 'searchFields' => array('poll_question', 'poll_answers', 'poll_tags', 'poll_categories'), 'join' => array('profile' => array('type' => 'left', 'table' => 'Profiles', 'mainField' => 'id_profile', 'onField' => 'ID', 'joinFields' => array('NickName'))), 'restriction' => array('activeStatus' => array('value' => 'active', 'field' => 'poll_status', 'operator' => '='), 'approvalStatus' => array('value' => '1', 'field' => 'poll_approval', 'operator' => '='), 'tag' => array('value' => '', 'field' => 'poll_tags', 'operator' => 'against', 'paramName' => 'tag'), 'category' => array('value' => '', 'field' => 'poll_categories', 'operator' => 'against', 'paramName' => 'categoryUri'), 'owner' => array('value' => '', 'field' => 'id_profile', 'operator' => '=', 'paramName' => 'userID'), 'featured' => array('value' => '', 'field' => 'poll_featured', 'operator' => '='), 'unfeatured' => array('value' => '', 'field' => 'poll_featured', 'operator' => '='), 'my' => array('value' => '', 'field' => 'id_profile', 'operator' => '='), 'calendar-min' => array('value' => "", 'field' => 'poll_date', 'operator' => '>=', 'no_quote_value' => true), 'calendar-max' => array('value' => "", 'field' => 'poll_date', 'operator' => '<=', 'no_quote_value' => true), 'allow_view' => array('value' => "", 'field' => 'allow_view_to', 'operator' => 'in')), 'paginate' => array('perPage' => 6, 'page' => 1, 'totalNum' => 10, 'totalPages' => 1), 'sorting' => 'last', 'view' => 'full', 'ident' => 'id_poll'); }
function displayResultBlock() { $sCode = parent::displayResultBlock(); return !empty($sCode) ? $this->oPollObject->_oTemplate->parseHtmlByName('default_margin.html', array('content' => $sCode)) : $sCode; }
function addCustomParts() { parent::addCustomParts(); $this->_oModule->_oTemplate->addCss(array('view.css')); }