本文整理汇总了PHP中Xoops\Core\Request::getWord方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getWord方法的具体用法?PHP Request::getWord怎么用?PHP Request::getWord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xoops\Core\Request
的用法示例。
在下文中一共展示了Request::getWord方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
public function search($queries, $andor, $limit, $start, $userid)
{
$xoops = Xoops::getInstance();
$alumni = Alumni::getInstance();
$myts = MyTextSanitizer::getInstance();
$by_cat = Request::getInt('by_cat', '');
$andor = Request::getWord('andor', 'AND');
$queries = array();
$query = Request::getString('query', '');
$start = Request::getInt('start', '0');
$helper = $xoops->getModuleHelper('alumni');
$module_id = $helper->getModule()->getVar('mid');
$listingHandler = $helper->getHandler('listing');
$groups = $xoops->getUserGroups();
$alumni_ids = $xoops->getHandlerGroupperm()->getItemIds('alumni_view', $groups, $module_id);
$all_ids = implode(', ', $alumni_ids);
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('valid', 1, '='));
// $criteria->add(new Criteria('date', time(), '<='));
$criteria->add(new Criteria('cid', '(' . $all_ids . ')', 'IN'));
if ($userid != 0) {
$criteria->add(new Criteria('usid', $userid, '='));
}
if ($by_cat) {
$criteria->add(new Criteria('cid', $by_cat, '='));
}
$queries = array($query);
$queries = implode('+', $queries);
$count = 0;
$i = 0;
$criteria->add(new Criteria('name', '%' . $queries . '%', 'LIKE'), 'AND');
$criteria->add(new Criteria('mname', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->add(new Criteria('lname', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->add(new Criteria('school', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->add(new Criteria('year', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->setLimit($limit);
$criteria->setSort('date');
$criteria->setOrder('DESC');
$criteria->setStart($start);
$numrows = $listingHandler->getCount();
$this_search = $listingHandler->getall($criteria);
$ret = array();
$k = 0;
foreach ($this_search as $obj) {
$ret[$k]['image'] = 'images/cat/default.gif';
$ret[$k]['link'] = 'listing.php?lid=' . $obj->getVar('lid') . '';
$ret[$k]['title'] = $obj->getVar('name') . ' ' . $obj->getVar('mname') . ' ' . $obj->getVar('lname') . ' --- ' . $obj->getVar('school') . '
--- ' . $obj->getVar('year');
$ret[$k]['time'] = $obj->getVar('date');
$ret[$k]['uid'] = $obj->getVar('usid');
$k++;
}
return $ret;
}
示例2: dirname
* @package core
* @since 2.0.0
* @author Kazumi Ono (AKA onokazu)
* @author Taiwen Jiang <phppp@users.sourceforge.net>
* @version $Id$
*/
include dirname(dirname(__DIR__)) . '/mainfile.php';
$search = Search::getInstance();
if (!$search->getConfig('enable_search')) {
header('Location: ' . XOOPS_URL . '/index.php');
exit;
}
$xoops = Xoops::getInstance();
$action = Request::getCmd('action', 'search');
$query = Request::getString('query', '');
$andor = Request::getWord('andor', 'AND');
$mid = Request::getInt('mid', 0);
$uid = Request::getInt('uid', 0);
$start = Request::getInt('start', 0);
$mids = Request::getArray('mids', array());
$queries = array();
if ($action === "results") {
if ($query == "") {
$xoops->redirect("index.php", 1, _MD_SEARCH_PLZENTER);
}
} else {
if ($action === "showall") {
if ($query == "" || empty($mid)) {
$xoops->redirect("index.php", 1, _MD_SEARCH_PLZENTER);
}
} else {
示例3: Criteria
if ($user_type == 'inactv') {
$criteria->add(new Criteria('level', 0, '='));
} elseif ($user_type == "actv") {
$criteria->add(new Criteria('level', 0, '>'));
}
$requete_search .= 'actif ou inactif : ' . $user_type . '<br />';
$requete_pagenav .= '&user_type=' . $user_type;
}
//$groups = empty($_REQUEST['selgroups']) ? array() : array_map("intval", $_REQUEST['selgroups']);
$validsort = array("uname", "email", "last_login", "user_regdate", "posts");
$sort = (string) Request::getWord('user_sort', 'user_regdate');
$sort = !in_array($sort, $validsort) ? "user_regdate" : $sort;
$requete_pagenav .= '&user_sort=' . $sort;
$requete_search .= 'order by : ' . $sort . '<br />';
$criteria->setSort($sort);
$order = (string) Request::getWord('user_order', 'DESC');
$requete_pagenav .= '&user_order=' . $order;
$requete_search .= 'tris : ' . $order . '<br />';
$criteria->setOrder($order);
$user_limit = $xoops->getModuleConfig('users_pager', 'system');
if (isset($_REQUEST['user_limit'])) {
$user_limit = $_REQUEST['user_limit'];
$requete_pagenav .= '&user_limit=' . htmlspecialchars($_REQUEST['user_limit']);
$requete_search .= 'limit : ' . $user_limit . '<br />';
} else {
$requete_pagenav .= '&user_limit=' . $xoops->getModuleConfig('users_pager', 'system');
$requete_search .= 'limit : ' . $user_limit . '<br />';
}
$start = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
if (isset($_REQUEST['selgroups'])) {
if ($_REQUEST['selgroups'] != 0) {
示例4: Criteria
if ($user_type === 'inactv') {
$criteria->add(new Criteria('level', 0, '='));
} elseif ($user_type === "actv") {
$criteria->add(new Criteria('level', 0, '>'));
}
$requete_search .= 'actif ou inactif : ' . $user_type . '<br />';
$requete_pagenav .= '&user_type=' . $user_type;
}
//$groups = empty($_REQUEST['selgroups']) ? array() : array_map("intval", $_REQUEST['selgroups']);
$validsort = array("uname", "email", "last_login", "user_regdate", "posts");
$sort = Request::getWord('user_sort', 'user_regdate');
$sort = !in_array($sort, $validsort) ? "user_regdate" : $sort;
$requete_pagenav .= '&user_sort=' . $sort;
$requete_search .= 'order by : ' . $sort . '<br />';
$criteria->setSort($sort);
$order = Request::getWord('user_order', 'DESC');
$requete_pagenav .= '&user_order=' . $order;
$requete_search .= 'tris : ' . $order . '<br />';
$criteria->setOrder($order);
$user_limit = $xoops->getModuleConfig('users_pager', 'system');
if (isset($_REQUEST['user_limit'])) {
$user_limit = $_REQUEST['user_limit'];
$requete_pagenav .= '&user_limit=' . $myts->htmlSpecialChars($_REQUEST['user_limit']);
$requete_search .= 'limit : ' . $user_limit . '<br />';
} else {
$requete_pagenav .= '&user_limit=' . $xoops->getModuleConfig('users_pager', 'system');
$requete_search .= 'limit : ' . $user_limit . '<br />';
}
$start = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0;
if (isset($_REQUEST['selgroups'])) {
if ($_REQUEST['selgroups'] != 0) {
示例5: dirname
/**
* Module Images
*
* @copyright XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @package Images
* @since 2.6.0
* @version $Id$
*/
include dirname(dirname(__DIR__)) . '/mainfile.php';
$xoops = Xoops::getInstance();
$helper = Images::getInstance();
$helper->loadLanguage('main');
$helper->loadLanguage('admin');
$op = Request::getCmd('op', 'list');
$target = Request::getWord('target', '');
$imgcat_id = Request::getInt('imgcat_id', 0);
$start = Request::getInt('start', 0);
if (empty($target)) {
exit('Target not set');
}
$groups = $xoops->getUserGroups();
$xoops->simpleHeader();
$xoopsTpl = new XoopsTpl();
$xoopsTpl->assign('sitename', htmlspecialchars($xoops->getConfig('sitename'), ENT_QUOTES));
$xoopsTpl->assign('target', htmlspecialchars($target, ENT_QUOTES));
switch ($op) {
case 'list':
default:
// Category Select form
$param = array('imgcat_id' => $imgcat_id, 'target' => $target);
示例6: testGetWord
/**
* @covers Xoops\Core\Request::getWord
*/
public function testGetWord()
{
$varname = 'RequestTest';
$_REQUEST[$varname] = 'Lorem';
$this->assertEquals('Lorem', Request::getWord($varname));
$_REQUEST[$varname] = 'Lorem ipsum 88 59';
$this->assertEquals('Loremipsum', Request::getWord($varname));
$_REQUEST[$varname] = '.99 Lorem_ipsum @%&';
$this->assertEquals('Lorem_ipsum', Request::getWord($varname));
//echo Request::getWord($varname);
}