本文整理汇总了PHP中getdotstring函数的典型用法代码示例。如果您正苦于以下问题:PHP getdotstring函数的具体用法?PHP getdotstring怎么用?PHP getdotstring使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getdotstring函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: helplist
function helplist($num, $id = '', $aids = "", $orderby = "aid asc")
{
if (is_numeric($id)) {
$wherestr[] = "typeid = " . $id;
} elseif (is_array($id)) {
$ids = getdotstring($id, 'int');
$wherestr[] = "typeid in ({$ids})";
} elseif (is_string($id) && (strexists($id, ',') || strexists($id, '|'))) {
if (strexists($id, ',')) {
$ids = getdotstring($id, 'int');
} else {
$ids = getdotstring(explode('|', $ids), 'int');
}
$wherestr[] = "typeid in ({$ids})";
} else {
$wherestr[] = "";
}
if (!empty($aids)) {
$aids = getdotstring($aids, 'int');
$wherestr[] = "aid in ({$ids})";
}
$num = GetNum($num);
$wheresql = implode(' AND ', $wherestr);
//条件汇总
$articleobj = new TableClass('article', 'aid');
$articlearray = $articleobj->getdata($num, $wheresql, $orderby, 'aid,typeid,title');
return $articlearray;
}
示例2: del
/**
* 删除指定ID信息
*
* @param unknown_type $id
* @return unknown
*/
function del($id, $uname = "", $other = "")
{
if (is_numeric($id)) {
$wherestr[] = $this->idname . " = " . $id;
} elseif (is_array($id)) {
$ids = getdotstring($id, 'int');
$wherestr[] = $this->idname . " in ({$ids})";
} elseif (is_string($id) && (strexists($id, ',') || strexists($id, '|'))) {
if (strexists($id, ',')) {
$ids = getdotstring($id, 'int');
} else {
$ids = getdotstring(explode('|', $ids), 'int');
}
$wherestr[] = $this->idname . " in ({$ids})";
} else {
return lang('ID_format_error');
}
if ($uname != "") {
$wherestr[] = "uname = '" . $uname . "'";
}
if ($other != "") {
$wherestr[] = $other;
}
$wheresql = implode(' AND ', $wherestr);
//条件汇总
$this->db->query("delete from {$this->table} where " . $wheresql);
return "OK";
}
示例3: getscopestring
}
$scopestring = getscopestring('readperm', $_POST['readperm']);
if ($scopestring) {
$blockcodearr[] = $scopestring;
}
$scopestring = getscopestring('downloads', $_POST['downloads']);
if ($scopestring) {
$blockcodearr[] = $scopestring;
}
if (!empty($_POST['t_fid'])) {
$blockcodearr[] = 't_fid/' . implode(',', $_POST['t_fid']);
}
if (!empty($_POST['t_typeid'])) {
$blockcodearr[] = 't_typeid/' . implode(',', $_POST['t_typeid']);
}
$_POST['t_authorid'] = getdotstring($_POST['t_authorid'], 'int');
if (!empty($_POST['t_authorid'])) {
$blockcodearr[] = 't_authorid/' . $_POST['authorid'];
}
if (!empty($_POST['t_dateline'])) {
$blockcodearr[] = 't_dateline/' . $_POST['t_dateline'];
}
if (!empty($_POST['t_lastpost'])) {
$blockcodearr[] = 't_lastpost/' . $_POST['t_lastpost'];
}
$scopestring = getscopestring('t_readperm', $_POST['t_readperm']);
if ($scopestring) {
$blockcodearr[] = $scopestring;
}
$scopestring = getscopestring('t_price', $_POST['t_price']);
if ($scopestring) {
示例4: runsql
function runsql($paramarr, $bbsdb = '', $returncount = 0, $multicachekey = '')
{
global $_G, $_SGLOBAL, $_SBLOCK;
//處理SQL
$sqlstring = getblocksql($paramarr['sql']);
//初始化
$listcount = 1;
//連接數據庫
//$thedb = empty($bbsdb)?$_SGLOBAL['db']:$bbsdb;
//分頁
if (!empty($paramarr['perpage'])) {
$countsql = '';
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)WHERE(.+?)ORDER', 2, 3);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)WHERE(.+?)LIMIT', 2, 3);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)WHERE(.+?)$', 2, 3);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)ORDER', 2, -1);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)LIMIT', 2, -1);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)$', 2, -1);
}
if (!empty($countsql)) {
if ($returncount > 0) {
//需要更新計數緩存時
$listcount = DB::result_first($countsql);
return $listcount;
} else {
//無需更新緩存時
$listcount = intval(unserialize($_SBLOCK[$multicachekey]['value']));
}
if ($listcount) {
$paramarr['perpage'] = intval($paramarr['perpage']);
if (empty($paramarr['perpage'])) {
$paramarr['perpage'] = 20;
}
if (empty($_G['page'])) {
$_G['page'] = 1;
}
$_G['page'] = intval($_G['page']);
if ($_G['page'] < 1) {
$_G['page'] = 1;
}
$start = ($_G['page'] - 1) * $paramarr['perpage'];
//SQL文
$sqlstring = preg_replace("/ LIMIT(.+?)\$/is", '', $sqlstring);
$sqlstring .= ' LIMIT ' . $start . ',' . $paramarr['perpage'];
}
}
} elseif (!empty($paramarr['limit'])) {
$paramarr['limit'] = getdotstring($paramarr['limit'], 'int', true, array(), 1, false);
if ($paramarr['limit']) {
//SQL文
$sqlstring = preg_replace("/ LIMIT(.+?)\$/is", '', $sqlstring);
$sqlstring .= ' LIMIT ' . $paramarr['limit'];
}
}
return array($sqlstring, $listcount);
}
示例5: runsql
function runsql($paramarr, $bbsdb = '')
{
global $_SGLOBAL, $_SGET;
//处理SQL
$sqlstring = getblocksql($paramarr['sql']);
//初始化
$listcount = 1;
//连接数据库
$thedb = empty($bbsdb) ? $_SGLOBAL['db'] : $bbsdb;
//分页
if (!empty($paramarr['perpage'])) {
$countsql = '';
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)WHERE(.+?)ORDER', 2, 3);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)WHERE(.+?)LIMIT', 2, 3);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)WHERE(.+?)$', 2, 3);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)ORDER', 2, -1);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)LIMIT', 2, -1);
}
if (empty($countsql)) {
$countsql = getcountsql($sqlstring, 'SELECT(.+?)FROM(.+?)$', 2, -1);
}
if (!empty($countsql)) {
$query = $thedb->query($countsql);
$listcount = $thedb->result($query, 0);
if ($listcount) {
$paramarr['perpage'] = intval($paramarr['perpage']);
if (empty($paramarr['perpage'])) {
$paramarr['perpage'] = 20;
}
if (empty($_SGET['page'])) {
$_SGET['page'] = 1;
}
$_SGET['page'] = intval($_SGET['page']);
if ($_SGET['page'] < 1) {
$_SGET['page'] = 1;
}
$start = ($_SGET['page'] - 1) * $paramarr['perpage'];
//SQL文
$sqlstring = preg_replace("/ LIMIT(.+?)\$/is", '', $sqlstring);
$sqlstring .= ' LIMIT ' . $start . ',' . $paramarr['perpage'];
}
}
} elseif (!empty($paramarr['limit'])) {
$paramarr['limit'] = getdotstring($paramarr['limit'], 'int', true, array(), 1, false);
if ($paramarr['limit']) {
//SQL文
$sqlstring = preg_replace("/ LIMIT(.+?)\$/is", '', $sqlstring);
$sqlstring .= ' LIMIT ' . $paramarr['limit'];
}
}
return array($sqlstring, $listcount);
}
示例6: intval
$dateline = !empty($_GET['dateline']) ? intval($_GET['dateline']) : 0;
$updatetime = !empty($_GET['updatetime']) ? intval($_GET['updatetime']) : 0;
$start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
$limit = !empty($_GET['limit']) ? intval($_GET['limit']) : 10;
$friendnum[] = empty($_GET['startfriendnum']) ? 0 : intval($_GET['startfriendnum']);
$friendnum[] = empty($_GET['endfriendnum']) ? 0 : intval($_GET['endfriendnum']);
$viewnum[] = empty($_GET['startviewnum']) ? 0 : intval($_GET['startviewnum']);
$viewnum[] = empty($_GET['endviewnum']) ? 0 : intval($_GET['endviewnum']);
$credit[] = empty($_GET['startcredit']) ? 0 : intval($_GET['startcredit']);
$credit[] = empty($_GET['endcredit']) ? 0 : intval($_GET['endcredit']);
$uids = getdotstring($uid, 'int');
if($uids) $wherearr[] = 'uid IN ('.$uids.')';
if($dateline) $wherearr[] = "dateline>'".($_SGLOBAL['timestamp']-$dateline)."'";
if($updatetime) $wherearr[] = "updatetime>'".($_SGLOBAL['timestamp']-$updatetime)."'";
$friendnumstr = getscopequery('friendnum', $friendnum);
if($friendnumstr) $wherearr[] = $friendnumstr;
$viewnumstr = getscopequery('viewnum', $viewnum);
if($viewnumstr) $wherearr[] = $viewnumstr;
$creditstr = getscopequery('credit', $credit);
if($creditstr) $wherearr[] = $creditstr;
if(isset($_GET['avatar'])) {
$wherearr[] = "avatar='".(empty($_GET['avatar']) ? 0 : intval($_GET['avatar']))."'";
示例7: in
$wherestro[] = "uname='" . $_USERS['uname'] . "'";
$wherestro[] = "oid in(" . $oids . ")";
if (!empty($wherestro)) {
$wheresqlo = implode(' AND ', $wherestro);
}
//条件汇总
$dataarray = $o->getdata("", $wheresqlo, "", "oid,uid,uname,goodsurl,goodsname,goodsprice,goodsnum,goodssite,siteurl,orderweight");
//计算商品总价格和总重量
$countmoney = $countweight = 0;
$tempoids = array();
foreach ($dataarray as $value) {
$tempoids[] = $value['oid'];
$countmoney += $value['goodsprice'] * $value['goodsnum'];
$countweight += $value['orderweight'];
}
$ids = getdotstring($tempoids, 'int');
$auth = $ids . "\t" . $countmoney . "\t" . $countweight;
$LOCKDATA = cookie_authcode($auth, 'ENCODE');
//加密数据
//print_r($dataarray);
//获取地区信息
$areaobj = new TableClass('area', 'aid');
$areaarray = $areaobj->getdata('', 'state=1');
//获取用户地址
$addressobj = new TableClass('address', 'aid');
$addressarray = $addressobj->getdata('', "uname='" . $_USERS['uname'] . "'", "def desc,aid desc");
//获取优惠卷
include_once INC_PATH . "/coupon.class.php";
$couponobj = CouponClass::init();
$wherestrc[] = "uname='" . $_USERS['uname'] . "'";
$wherestrc[] = "endtime >= " . time();
示例8: joinid
function joinid($id)
{
//ID处理
if (is_numeric($id)) {
$wherestr = "gid = '{$id}'";
} elseif (is_array($id)) {
$ids = getdotstring($id, 'int');
$wherestr = "gid in ({$ids})";
} elseif (is_string($id) && (strexists($id, ',') || strexists($id, '|'))) {
if (strexists($id, ',')) {
$ids = getdotstring($id, 'int');
} else {
$tempids = explode('|', $id);
$ids = getdotstring($tempids, 'int');
}
$wherestr = "gid in ({$ids})";
} else {
return '';
}
return $wherestr;
}
示例9: isset
//总信息数
$pagesize = 20;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$dataarray = $Table->getdata("{$offset},{$pagesize}", $wheresql, $orderstr);
//获取团购数据
//print_r($dataarray);
//包含后台模板文件
include "tpl/admin_list.htm";
} elseif ($action == "updatestate" && !empty($ids)) {
//更改状态
$state = GetNum($state);
$ids = getdotstring(explode('|', $ids));
$wheresqlarr = "adminid in({$ids})";
editstate($Table->table, "state", $wheresqlarr, $state);
//更改状态操作
exit("1");
} elseif ($action == "del" && !empty($did)) {
//执行删除操作
$did = GetNum($did);
$info = $Table->del($did);
if ($info == "OK") {
showmsg("删除成功!", PHP_SELF);
} else {
showmsg($info, PHP_SELF);
}
} elseif ($action == "dels") {
if (empty($delids)) {
示例10: tname
$sql['from'] = ', ' . tname('album') . ' a ';
if ($groupids) {
$sql['from'] .= ', ' . tname('space') . ' s ';
$wherearr[] = "s.groupid IN({$groupids})";
$wherearr[] = "p.uid = s.uid";
}
$wherearr[] = "a.friend='0' AND a.albumid=p.albumid";
$picids = getdotstring($_POST['network'][$key]['picid'], 'int');
if ($picids) {
$wherearr[] = 'p.picid IN (' . $picids . ')';
}
$albumids = getdotstring($_POST['network'][$key]['albumid'], 'int');
if ($albumids) {
$wherearr[] = 'p.albumid IN (' . $albumids . ')';
}
$uids = getdotstring($_POST['network'][$key]['uid'], 'int');
if ($uids) {
$wherearr[] = 'p.uid IN (' . $uids . ')';
}
if ($wherearr) {
$sql['where'] = 'WHERE ' . implode(' AND ', $wherearr);
}
$sql['order'] = 'ORDER BY p.dateline DESC';
$sql['limit'] = getlimit($_POST['network'][$key]['start'], $_POST['network'][$key]['limit']);
break;
}
$sqlstring = implode(' ', $sql);
$_POST['network'][$key]['sql'] = $sqlstring;
$network[$key] = $_POST['network'][$key];
} else {
$network[$key] = array();
示例11: showmessage
showmessage('block_thread_code_sql');
}
$_POST['sql'] = getblocksql($_POST['sql']);
$blockcodearr[] = 'sql/' . rawurlencode($_POST['sql']);
} else {
//向导模式
if ($_POST['setaid']) {
//指定id
$_POST['id'] = getdotstring($_POST['id'], 'int');
if (empty($_POST['aid'])) {
showmessage('block_announcement_code_aid');
} else {
$blockcodearr[] = 'id/' . $_POST['id'];
}
} else {
$_POST['author'] = getdotstring($_POST['author'], 'char', false, array(), 0);
if (!empty($_POST['author'])) {
$blockcodearr[] = 'author/' . rawurlencode($_POST['author']);
}
}
$orderarr = array();
if ($_POST['order']) {
foreach ($_POST['order'] as $okey => $order) {
if (!empty($order)) {
$sc = $_POST['sc'][$okey];
if (!empty($sc)) {
$sc = ' ' . $sc;
}
$orderarr[] = $order . $sc;
}
}
示例12: getdotstring
$s[$val['goodsseller']] = $val['sendprice'];
}
} else {
$s[$val['goodsseller']] = $val['sendprice'];
}
}
$countdata = $Cart->countmoney($dataarray);
//生成校验数据
$ids = getdotstring($gids, 'int');
$auth = $ids . "\t" . $countdata['totalmoney'];
$paydata = cookie_authcode($auth, 'ENCODE');
include template('payconfirm');
//包含输出指定模板
} else {
//处理提交信息
@(list($ids, $totalmoney) = explode("\t", cookie_authcode($__PAYDATA, 'DECODE')));
if ($ids == getdotstring($gids, 'int') and !empty($ids)) {
$tempids = $ids;
} else {
exit(lang('Data_exception'));
}
//处理扣费和订单转移并且记录日志操作
$info = $Cart->carttoorder($tempids);
if ($info == 'OK') {
print "<script language='javascript'>alert(" . lang('Submitted_successfully') . ");</script>";
jumpurl(url("m.php"));
} else {
print "<script language='javascript'>alert('" . $info . "');</script>";
jumpurl(url("m.php"));
}
}
示例13: getscopestring
}
$scopestring = getscopestring('goodrate', $_POST['goodrate']);
if ($scopestring) {
$blockcodearr[] = $scopestring;
}
$scopestring = getscopestring('badrate', $_POST['badrate']);
if ($scopestring) {
$blockcodearr[] = $scopestring;
}
if (!empty($_POST['digest'])) {
$blockcodearr[] = 'digest/' . implode(',', $_POST['digest']);
}
if (!empty($_POST['top'])) {
$blockcodearr[] = 'top/' . implode(',', $_POST['top']);
}
$_POST['haveattach'] = getdotstring($_POST['haveattach'], 'int');
if (!empty($_POST['haveattach'])) {
$blockcodearr[] = 'haveattach/' . $_POST['haveattach'];
}
if (!empty($_POST['showspacename'])) {
$blockcodearr[] = 'showspacename/1';
}
if (!empty($_POST['showgroupname'])) {
$blockcodearr[] = 'showgroupname/1';
}
}
$orderarr = array();
if ($_POST['order']) {
foreach ($_POST['order'] as $okey => $order) {
if (!empty($order)) {
$sc = $_POST['sc'][$okey];
示例14: getblocksql
}
$_POST['sql'] = getblocksql($_POST['sql']);
$blockcodearr[] = 'sql/' . rawurlencode($_POST['sql']);
} else {
//向导模式
if ($_POST['setuid']) {
//指定tid
$_POST['uid'] = getdotstring($_POST['uid'], 'int');
if (empty($_POST['uid'])) {
showmessage('block_member_code_uid');
} else {
$blockcodearr[] = 'uid/' . $_POST['uid'];
}
} else {
if (!empty($_POST['groupid'])) {
$_POST['groupid'] = getdotstring($_POST['groupid'], 'int');
if (!empty($_POST['groupid'])) {
$blockcodearr[] = 'groupid/' . $_POST['groupid'];
}
}
if (!empty($_POST['regdate'])) {
$blockcodearr[] = 'regdate/' . $_POST['regdate'];
}
if (!empty($_POST['lastvisit'])) {
$blockcodearr[] = 'lastvisit/' . $_POST['lastvisit'];
}
if (!empty($_POST['lastpost'])) {
$blockcodearr[] = 'lastpost/' . $_POST['lastpost'];
}
$scopestring = getscopestring('posts', $_POST['posts']);
if ($scopestring) {
示例15: TableClass
$Table = new TableClass("order", "oid");
AjaxHead();
//禁止页面缓存
set_time_limit(0);
if (!empty($type) || !empty($oid)) {
if (!empty($oid)) {
if (is_numeric($oid)) {
$wherestr[] = "oid" . " = " . $oid;
} elseif (is_array($oid)) {
$ids = getdotstring($oid, 'int');
$wherestr[] = "oid" . " in ({$ids})";
} elseif (is_string($oid) && (strexists($oid, ',') || strexists($oid, '|'))) {
if (strexists($oid, ',')) {
$ids = getdotstring($oid, 'int');
} else {
$ids = getdotstring(explode('|', $ids), 'int');
}
$wherestr[] = "oid" . " in ({$ids})";
} else {
exit("ID格式错误");
}
} elseif (!empty($type)) {
if ($type == "all") {
} elseif ($type == "idlist") {
if (GetNum($startid) and GetNum($endid)) {
$wherestr[] = "oid >={$startid}";
$wherestr[] = "oid <={$endid}";
} else {
showmsg("ID范围必须填写!", PHP_SELF);
}
} elseif ($type == "timelist") {