本文整理汇总了PHP中message::getInfoList方法的典型用法代码示例。如果您正苦于以下问题:PHP message::getInfoList方法的具体用法?PHP message::getInfoList怎么用?PHP message::getInfoList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::getInfoList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: message
require_once "../class/message.class.php";
require_once '../../useradmin/checklogin.php';
$objWebInit = new message();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
$objWebInit->db();
$user_id = $_SESSION['user_id'];
$strWhere = ' WHERE user_id = ' . $user_id . ' ';
if (!isset($_GET['page']) || $_GET['page'] == '') {
$_GET['page'] = $arrGPage['page'];
}
$arrData = $objWebInit->getInfoList($strWhere, ' ORDER BY submit_date DESC', ($_GET['page'] - 1) * $arrGPage['page_size'], $arrGPage['page_size']);
if ($arrData == "") {
$arrData = null;
}
//翻页跳转link
$strLink = '';
if (!empty($arrLink)) {
$strLink = implode('&', $arrLink);
}
$strPage = $objWebInit->makeInfoListPage($arrData['COUNT_ROWS'], $strLink);
unset($arrData['COUNT_ROWS']);
// 输出到模板
$arrMOutput["smarty_assign"]['arrData'] = $arrData;
$arrMOutput["smarty_assign"]['arrGState'] = $arrGState;
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['arrGState'] = $arrGState;
示例2: elseif
if (empty($_GET['sort'])) {
$strOrder = ' ORDER BY submit_date DESC';
} elseif ($_GET['sort'] == 1) {
$strOrder = ' ORDER BY topflag DESC,submit_date DESC';
} elseif ($_GET['sort'] == 2) {
$strOrder = ' ORDER BY recommendflag DESC,submit_date DESC';
} elseif ($_GET['sort'] == 3) {
$strOrder = ' ORDER BY ID DESC';
} elseif ($_GET['sort'] == 4) {
$strOrder = ' ORDER BY ID ASC';
}
$arrLink[] = 'sort=' . $_GET['sort'];
if (!isset($_GET['page']) || $_GET['page'] == '') {
$_GET['page'] = $arrGPage['page'];
}
$arrData = $objWebInit->getInfoList($strWhere, $strOrder, ($_GET['page'] - 1) * $arrGPage['page_size'], $arrGPage['page_size']);
//翻页跳转link
$strLink = '';
if (!empty($arrLink)) {
$strLink = implode('&', $arrLink);
}
$strPage = $objWebInit->makeInfoListPage($arrData['COUNT_ROWS'], $strLink);
unset($arrData['COUNT_ROWS']);
// 输出到模板
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['get'] = $_GET;
$arrMOutput["smarty_assign"]['FileCallPath'] = $arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['arrInfo'] = $arrData;
$arrMOutput["smarty_assign"]['arrGState'] = $arrGState;
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'index.htm';