コード例 #1
0
 function fetch()
 {
     parent::fetch();
     if (isset($_REQUEST['target'])) {
         $this->mNavi->addExtra('target', xoops_getrequest('target'));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
コード例 #2
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $image_display = $root->mContext->mRequest->getRequest('image_display');
     $imgcat_id = $root->mContext->mRequest->getRequest('imgcat_id');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     $option_field2 = $root->mContext->mRequest->getRequest('option_field2');
     $search = $root->mContext->mRequest->getRequest('search');
     if (isset($_REQUEST['image_display'])) {
         $this->mNavi->addExtra('image_display', xoops_getrequest('image_display'));
         $this->_mCriteria->add(new Criteria('image_display', xoops_getrequest('image_display')));
     }
     if (isset($_REQUEST['imgcat_id'])) {
         $this->mNavi->addExtra('imgcat_id', xoops_getrequest('imgcat_id'));
         $this->_mCriteria->add(new Criteria('imgcat_id', xoops_getrequest('imgcat_id')));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mNavi->addExtra('option_field', $option_field);
         $this->mOptionField = $option_field;
         if ($this->mOptionField == "visible") {
             $this->_mCriteria->add(new Criteria('image_display', '1'));
         } elseif ($this->mOptionField == "invisible") {
             $this->_mCriteria->add(new Criteria('image_display', '0'));
         } else {
             //all
         }
     }
     if (isset($_REQUEST['option_field2'])) {
         $this->mNavi->addExtra('option_field2', $option_field2);
         $this->mOptionField2 = $option_field2;
         if ($this->mOptionField2 == "gif") {
             $this->_mCriteria->add(new Criteria('image_mimetype', 'image/gif'));
         } elseif ($this->mOptionField2 == "png") {
             $this->_mCriteria->add(new Criteria('image_mimetype', 'image/png'));
         } elseif ($this->mOptionField2 == "jpeg") {
             $cri = new CriteriaCompo();
             $cri->add(new Criteria('image_mimetype', 'image/jpeg'));
             $cri->add(new Criteria('image_mimetype', 'image/pjpeg'), 'OR');
             $this->_mCriteria->add($cri);
         } else {
             //all
         }
     }
     //
     if (!empty($search)) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $this->_mCriteria->add(new Criteria('image_nicename', '%' . $this->mKeyword . '%', 'LIKE'));
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
     /*
     if (abs($this->mSort) != IMAGE_SORT_KEY_IMAGE_WEIGHT) {
     	$this->_mCriteria->addSort($this->mSortKeys[IMAGE_SORT_KEY_IMAGE_WEIGHT], $this->getOrder());
     }
     */
 }
コード例 #3
0
 function fetch()
 {
     parent::fetch();
     $this->mNavi->addExtra('target', xoops_getrequest('target'));
     if (isset($_REQUEST['imgcat_id'])) {
         $this->mNavi->addExtra('imgcat_id', xoops_getrequest('imgcat_id'));
         $this->_mCriteria->add(new Criteria('imgcat_id', array(XOBJ_DTYPE_INT, xoops_getrequest('imgcat_id'))));
     } else {
         $this->_mCriteria->add(new Criteria('imgcat_id', 0));
     }
     $this->_mCriteria->add(new Criteria('image_display', 1));
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
     if (abs($this->mSort) != IMAGE_SORT_KEY_IMAGE_WEIGHT) {
         $this->_mCriteria->addSort(IMAGE_SORT_KEY_IMAGE_WEIGHT, $this->getOrder());
     }
 }
コード例 #4
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $code = $root->mContext->mRequest->getRequest('code');
     $smile_url = $root->mContext->mRequest->getRequest('smile_url');
     $emotion = $root->mContext->mRequest->getRequest('emotion');
     $display = $root->mContext->mRequest->getRequest('display');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     $search = $root->mContext->mRequest->getRequest('search');
     if (isset($_REQUEST['code'])) {
         $this->mNavi->addExtra('code', xoops_getrequest('code'));
         $this->_mCriteria->add(new Criteria('code', xoops_getrequest('code')));
     }
     if (isset($_REQUEST['smile_url'])) {
         $this->mNavi->addExtra('smile_url', xoops_getrequest('smile_url'));
         $this->_mCriteria->add(new Criteria('smile_url', xoops_getrequest('smile_url')));
     }
     if (isset($_REQUEST['emotion'])) {
         $this->mNavi->addExtra('emotion', xoops_getrequest('emotion'));
         $this->_mCriteria->add(new Criteria('emotion', xoops_getrequest('emotion')));
     }
     if (isset($_REQUEST['display'])) {
         $this->mNavi->addExtra('display', xoops_getrequest('display'));
         $this->_mCriteria->add(new Criteria('display', xoops_getrequest('display')));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
         $this->mOptionField = $option_field;
         if ($this->mOptionField == "visible") {
             $this->_mCriteria->add(new Criteria('display', '1'));
         } elseif ($this->mOptionField == "invisible") {
             $this->_mCriteria->add(new Criteria('display', '0'));
         } else {
             //all
         }
     }
     //
     if (!empty($search)) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $search_criteria = new CriteriaCompo(new Criteria('code', '%' . $this->mKeyword . '%', 'LIKE'));
         $search_criteria->add(new Criteria('emotion', '%' . $this->mKeyword . '%', 'LIKE'), $condition = 'OR');
         $this->_mCriteria->add($search_criteria);
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }
コード例 #5
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $imgcat_name = $root->mContext->mRequest->getRequest('imgcat_name');
     $imgcat_display = $root->mContext->mRequest->getRequest('imgcat_display');
     $imgcat_type = $root->mContext->mRequest->getRequest('imgcat_type');
     $imgcat_storetype = $root->mContext->mRequest->getRequest('imgcat_storetype');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     $option_field2 = $root->mContext->mRequest->getRequest('option_field2');
     $search = $root->mContext->mRequest->getRequest('search');
     if (isset($_REQUEST['imgcat_name'])) {
         $this->mNavi->addExtra('imgcat_name', xoops_getrequest('imgcat_name'));
         $this->_mCriteria->add(new Criteria('imgcat_name', xoops_getrequest('imgcat_name')));
     }
     if (isset($_REQUEST['imgcat_display'])) {
         $this->mNavi->addExtra('imgcat_display', xoops_getrequest('imgcat_display'));
         $this->_mCriteria->add(new Criteria('imgcat_display', xoops_getrequest('imgcat_display')));
     }
     if (isset($_REQUEST['imgcat_type'])) {
         $this->mNavi->addExtra('imgcat_type', xoops_getrequest('imgcat_type'));
         $this->_mCriteria->add(new Criteria('imgcat_type', xoops_getrequest('imgcat_type')));
     }
     if (isset($_REQUEST['imgcat_storetype'])) {
         $this->mNavi->addExtra('imgcat_storetype', xoops_getrequest('imgcat_storetype'));
         $this->_mCriteria->add(new Criteria('imgcat_storetype', xoops_getrequest('imgcat_storetype')));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
         $this->mOptionField = $option_field;
         if ($this->mOptionField == "visible") {
             $this->_mCriteria->add(new Criteria('imgcat_display', xoops_getrequest('1')));
         } elseif ($this->mOptionField == "invisible") {
             $this->_mCriteria->add(new Criteria('imgcat_display', xoops_getrequest('0')));
         } else {
             //all
         }
     }
     if (isset($_REQUEST['option_field2'])) {
         $this->mNavi->addExtra('option_field2', xoops_getrequest('option_field2'));
         $this->mOptionField2 = $option_field2;
         if ($this->mOptionField2 == "file") {
             $this->_mCriteria->add(new Criteria('imgcat_storetype', xoops_getrequest('file')));
         } elseif ($this->mOptionField2 == "db") {
             $this->_mCriteria->add(new Criteria('imgcat_storetype', xoops_getrequest('db')));
         } else {
             //all
         }
     }
     //
     if (!empty($search)) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $this->_mCriteria->add(new Criteria('imgcat_name', '%' . $this->mKeyword . '%', 'LIKE'));
     }
     //
     // Set sort conditions.
     //
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
     if (abs($this->mSort) != IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT) {
         $this->_mCriteria->addSort($this->mSortKeys[IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT], $this->getOrder());
     }
 }
コード例 #6
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $mid = $root->mContext->mRequest->getRequest('mid');
     $side = $root->mContext->mRequest->getRequest('side');
     $weight = $root->mContext->mRequest->getRequest('weight');
     $block_type = $root->mContext->mRequest->getRequest('block_type');
     $c_type = $root->mContext->mRequest->getRequest('c_type');
     $dirname = $root->mContext->mRequest->getRequest('dirname');
     $search = $root->mContext->mRequest->getRequest('search');
     $option_field = $root->mContext->mRequest->getRequest('option_field');
     if (isset($_REQUEST['mid'])) {
         $this->mNavi->addExtra('mid', xoops_getrequest('mid'));
         $this->_mCriteria->add(new Criteria('mid', xoops_getrequest('mid')));
     }
     if (isset($_REQUEST['side'])) {
         $this->mNavi->addExtra('side', xoops_getrequest('side'));
         $this->_mCriteria->add(new Criteria('side', xoops_getrequest('side')));
     }
     if (isset($_REQUEST['weight'])) {
         $this->mNavi->addExtra('weight', xoops_getrequest('weight'));
         $this->_mCriteria->add(new Criteria('weight', xoops_getrequest('weight')));
     }
     if (isset($_REQUEST['block_type'])) {
         $this->mNavi->addExtra('block_type', xoops_getrequest('block_type'));
         $this->_mCriteria->add(new Criteria('block_type', xoops_getrequest('block_type')));
     }
     if (isset($_REQUEST['c_type'])) {
         $this->mNavi->addExtra('c_type', xoops_getrequest('c_type'));
         $this->_mCriteria->add(new Criteria('c_type', xoops_getrequest('c_type')));
     }
     if (isset($_REQUEST['dirname']) and !$_REQUEST['dirname'] == 0) {
         if (intval($dirname) == -1) {
             $this->_mCriteria->add(new Criteria('block_type', 'C'));
             $this->mModule = "cblock";
         } else {
             $this->_mCriteria->add(new Criteria('dirname', xoops_getrequest('dirname')));
             //wanikoo
             $handler =& xoops_gethandler('module');
             $this->mModule =& $handler->getByDirname($dirname);
         }
         $this->mNavi->addExtra('dirname', xoops_getrequest('dirname'));
     }
     if (isset($_REQUEST['search'])) {
         $this->mKeyword = $search;
         $this->mNavi->addExtra('search', $this->mKeyword);
         $this->_mCriteria->add(new Criteria('name', '%' . $this->mKeyword . '%', 'LIKE'));
     }
     if (isset($_REQUEST['option_field'])) {
         $this->mOptionField = $option_field;
         if ($this->mOptionField != "all") {
             $this->_mCriteria->add(new Criteria('side', intval($this->mOptionField)));
         }
         $this->mNavi->addExtra('option_field', $this->mOptionField);
     }
     //
     $this->_mCriteria->add(new Criteria('visible', $this->_getVisible()));
     $this->_mCriteria->add(new Criteria('isactive', 1));
     //
     // Set sort conditions.
     //
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
     //
     // If the sort key is mid, set c_type to second sort key for list display.
     //
     if (abs($this->mSort) == NEWBLOCKS_SORT_KEY_MID) {
         $this->_mCriteria->addSort('c_type', $this->getOrder());
     }
     if (abs($this->mSort) != NEWBLOCKS_SORT_KEY_SIDE) {
         $this->_mCriteria->addSort('side', $this->getOrder());
     }
     if (abs($this->mSort) != NEWBLOCKS_SORT_KEY_WEIGHT) {
         $this->_mCriteria->addSort('weight', $this->getOrder());
     }
 }
コード例 #7
0
 function fetch()
 {
     parent::fetch();
     $root =& XCube_Root::getSingleton();
     $com_modid = $root->mContext->mRequest->getRequest('com_modid');
     $dirname = $root->mContext->mRequest->getRequest('dirname');
     $com_icon = $root->mContext->mRequest->getRequest('com_icon');
     $com_uid = $root->mContext->mRequest->getRequest('com_uid');
     $com_ip = $root->mContext->mRequest->getRequest('com_ip');
     $com_status = $root->mContext->mRequest->getRequest('com_status');
     $keyword = $root->mContext->mRequest->getRequest('keyword');
     $search_field = $root->mContext->mRequest->getRequest('search_field');
     if (isset($_REQUEST['com_modid']) && intval(xoops_getrequest('com_modid')) > 0) {
         $this->mNavi->addExtra('com_modid', xoops_getrequest('com_modid'));
         $this->_mCriteria->add(new Criteria('com_modid', xoops_getrequest('com_modid')));
     } elseif (isset($_REQUEST['dirname'])) {
         $this->mNavi->addExtra('dirname', xoops_getrequest('dirname'));
         $handler =& xoops_gethandler('module');
         $module =& $handler->getByDirname(xoops_getrequest('dirname'));
         if (is_object($module)) {
             $this->_mCriteria->add(new Criteria('com_modid', $module->get('mid')));
         }
     }
     if (isset($_REQUEST['com_icon'])) {
         $this->mNavi->addExtra('com_icon', xoops_getrequest('com_icon'));
         $this->_mCriteria->add(new Criteria('com_icon', xoops_getrequest('com_icon')));
     }
     if (isset($_REQUEST['com_uid'])) {
         $this->mNavi->addExtra('com_uid', xoops_getrequest('com_uid'));
         $this->_mCriteria->add(new Criteria('com_uid', xoops_getrequest('com_uid')));
     }
     if (isset($_REQUEST['com_ip'])) {
         $this->mNavi->addExtra('com_ip', xoops_getrequest('com_ip'));
         $this->_mCriteria->add(new Criteria('com_ip', xoops_getrequest('com_ip')));
     }
     if (xoops_getrequest('com_status') > 0) {
         $this->mNavi->addExtra('com_status', xoops_getrequest('com_status'));
         $this->_mCriteria->add(new Criteria('com_status', xoops_getrequest('com_status')));
     }
     //wanikoo
     if (!empty($keyword) && isset($search_field)) {
         $this->mKeyword = $keyword;
         $this->mSearchField = $search_field;
         $this->mNavi->addExtra('keyword', $this->mKeyword);
         $this->mNavi->addExtra('search_field', $this->mSearchField);
         if ($this->mSearchField == "com_both") {
             //title or text ( OR condition )
             $search_criteria = new CriteriaCompo(new Criteria('com_title', '%' . $this->mKeyword . '%', 'LIKE'));
             $search_criteria->add(new Criteria('com_text', '%' . $this->mKeyword . '%', 'LIKE'), $condition = 'OR');
             $this->_mCriteria->add($search_criteria);
         } elseif ($this->mSearchField == "com_title") {
             //only search about title
             $this->_mCriteria->add(new Criteria('com_title', '%' . $this->mKeyword . '%', 'LIKE'));
         } elseif ($this->mSearchField == "com_text") {
             //only search about text
             $this->_mCriteria->add(new Criteria('com_text', '%' . $this->mKeyword . '%', 'LIKE'));
         } elseif ($this->mSearchField == "com_uid") {
             //search about uname
             if ($this->mKeyword != "guest") {
                 //in case of member
                 $cm_handler =& xoops_gethandler('member');
                 $cm_user =& $cm_handler->getUsers(new Criteria('uname', $this->mKeyword));
                 if (count($cm_user) == 1 && is_object($cm_user[0])) {
                     $cm_user_uid = $cm_user[0]->getVar('uid');
                     $this->_mCriteria->add(new Criteria('com_uid', $cm_user_uid));
                 } else {
                     //no match
                     $this->_mCriteria->add(new Criteria('com_uid', -1));
                 }
             } else {
                 //in case of guest, please customize keyword,"guest"
                 $this->_mCriteria->add(new Criteria('com_uid', 0));
             }
         } else {
             //default(only search about title)
             $this->_mCriteria->add(new Criteria('com_title', '%' . $this->mKeyword . '%', 'LIKE'));
         }
     }
     $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 }