本文整理汇总了PHP中cn_substrR函数的典型用法代码示例。如果您正苦于以下问题:PHP cn_substrR函数的具体用法?PHP cn_substrR怎么用?PHP cn_substrR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cn_substrR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowMsg
if ($subject == '') {
ShowMsg("请填写信息标题!", "-1");
exit;
}
$msg = CheckUserID($msgtoid, "用户名", false);
if ($msg != 'ok') {
ShowMsg($msg, "-1");
exit;
}
$row = $dsql->GetOne("SELECT * FROM `#@__member` WHERE userid LIKE '{$msgtoid}' ");
if (!is_array($row)) {
ShowMsg("你指定的用户不存在,不能发送信息!", "-1");
exit;
}
$subject = cn_substrR(HtmlReplace($subject, 1), 60);
$message = cn_substrR(HtmlReplace($message, 0), 1024);
$sendtime = $writetime = time();
//发给收件人(收件人可管理)
$inquery1 = "INSERT INTO `#@__member_pms` (`floginid`,`fromid`,`toid`,`tologinid`,`folder`,`subject`,`sendtime`,`writetime`,`hasview`,`isadmin`,`message`)\r\n VALUES ('{$cfg_ml->M_LoginID}','{$cfg_ml->M_ID}','{$row['mid']}','{$row['userid']}','inbox','{$subject}','{$sendtime}','{$writetime}','0','0','{$message}'); ";
//保留到自己的发件箱(自己可管理)
$inquery2 = "INSERT INTO `#@__member_pms` (`floginid`,`fromid`,`toid`,`tologinid`,`folder`,`subject`,`sendtime`,`writetime`,`hasview`,`isadmin`,`message`)\r\n VALUES ('{$cfg_ml->M_LoginID}','{$cfg_ml->M_ID}','{$row['mid']}','{$row['userid']}','outbox','{$subject}','{$sendtime}','{$writetime}','0','0','{$message}'); ";
$dsql->ExecuteNoneQuery($inquery1);
$dsql->ExecuteNoneQuery($inquery2);
ShowMsg("成功发送一条信息!", "pm.php?dopost=outbox");
exit;
} else {
if ($dopost == 'del') {
$ids = preg_replace("#[^0-9,]#", "", $ids);
if ($folder == 'inbox') {
$boxsql = "SELECT * FROM `#@__member_pms` WHERE id IN({$ids}) AND folder LIKE 'inbox' AND toid='{$cfg_ml->M_ID}'";
$dsql->SetQuery($boxsql);
示例2: ResetVdValue
if (strtolower($vdcode) != $svali || $svali == '') {
ResetVdValue();
ShowMsg('验证码错误!', '-1');
exit;
}
$uidnum = intval($uidnum);
if (empty($uidnum)) {
ShowMsg('参数错误!', '-1');
exit;
}
if (strlen($msg) < 6) {
ShowMsg('你的留言内容太短!', '-1');
exit;
}
$uname = HtmlReplace($uname, 1);
$msg = cn_substrR(HtmlReplace($msg), 2048);
if ($cfg_ml->M_UserName != '' && $cfg_ml->M_ID != $uidnum) {
$gid = $cfg_ml->M_UserName;
} else {
$gid = '';
}
$inquery = "INSERT INTO `#@__member_guestbook`(mid,gid,msg,uname,ip,dtime)\r\n VALUES ('{$uidnum}','{$gid}','{$msg}','{$uname}','" . GetIP() . "'," . time() . "); ";
$dsql->ExecuteNoneQuery($inquery);
ShowMsg('成功提交你的留言!', "index.php?uid={$uid}&action=guestbook");
exit;
} else {
if ($action == 'newfriend') {
CheckRank(0, 0);
if ($_vars['mid'] == $cfg_ml->M_ID) {
ShowMsg("你不能加自己为好友!", "index.php?uid=" . $uid);
exit;
示例3: isset
$action = isset($action) ? trim($action) : '';
if (!$cfg_ml->IsLogin()) {
ShowMsg("未登录前不充许该操作!", "-1");
exit;
}
if ($id < 1) {
ShowMsg("错误,未定义的操作!", "-1");
exit;
}
if ($action == "save") {
$svali = GetCkVdValue();
if (strtolower($vdcode) != $svali || $svali == "") {
ShowMsg("认证码错误!", "-1");
exit;
}
$subject = cn_substrR(trim(HtmlReplace($subject), 2), 80);
$text = preg_replace("#<(iframe|script)#i", "", $text);
if (CountStrLen($text) < 3 || CountStrLen($text) > 1000) {
ShowMsg("内容字数应该在3-1000个汉字!", "-1");
exit;
}
if (preg_match("#{$cfg_notallowstr}#", $subject) || preg_match("#{$cfg_notallowstr}#", $text)) {
ShowMsg("含有非法字符!", "-1");
exit;
}
$subject = preg_replace("/{$cfg_replacestr}/", "***", $subject);
$text = preg_replace("/{$cfg_replacestr}/", "***", $text);
$userip = GetIP();
$SetQuery = "INSERT INTO #@__group_guestbook(gid,title,uname,userid,stime,message,ip) ";
$SetQuery .= "VALUES('{$id}','{$subject}','" . $cfg_ml->M_UserName . "','" . $cfg_ml->M_ID . "','" . time() . "','{$text}','{$userip}');";
if ($db->ExecuteNoneQuery($SetQuery)) {
示例4: CheckCatalog
<?php
//AJAX窗体结束
} else {
if ($dopost == 'quickEditSave') {
require_once DEDEADMIN . '/inc/inc_archives_functions.php';
//权限检测
if (!TestPurview('a_Edit')) {
if (TestPurview('a_AccEdit')) {
CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!");
} else {
CheckArcAdmin($aid, $cuserLogin->getUserID());
}
}
$title = dede_htmlspecialchars(cn_substrR($title, $cfg_title_maxlen));
$shorttitle = cn_substrR($shorttitle, 36);
$keywords = trim(cn_substrR($keywords, 60));
if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) {
$arcrank = -1;
}
$adminid = $cuserLogin->getUserID();
//属性处理
$flag = isset($flags) ? join(',', $flags) : '';
if (!empty($flag)) {
if (preg_match("#p#", $oldflag)) {
$flag .= ',p';
}
if (preg_match("#j#", $oldflag)) {
$flag .= ',j';
}
}
/*
示例5: ShowMsg
if (@filesize($_FILES['spacelogo']['tmp_name']) > $maxlength) {
ShowMsg("你上传的Logo文件超过了系统限制大小:{$cfg_max_face} K!", '-1');
exit;
}
//删除旧图片(防止文件扩展名不同,如:原来的是gif,后来的是jpg)
if (eregi("\\.(jpg|gif|png)\$", $oldspacelogo) && file_exists($cfg_basedir . $oldspacelogo)) {
@unlink($cfg_basedir . $oldspacelogo);
}
//上传新工图片
$spacelogo = MemberUploads('spacelogo', '', $cfg_ml->M_ID, 'image', 'mylogo', 200, 50);
} else {
$spacelogo = $oldspacelogo;
}
$pagesize = intval($pagesize);
$spacename = cn_substrR(HtmlReplace($spacename, 2), 50);
$sign = cn_substrR(HtmlReplace($sign), 100);
$spacenews = HtmlReplace($spacenews, -1);
$query = "update `#@__member_space` set `pagesize` = '{$pagesize}',`spacename`='{$spacename}' , spacelogo='{$spacelogo}', `sign` = '{$sign}' ,`spacenews`='{$spacenews}' where mid='{$cfg_ml->M_ID}' ";
$dsql->ExecuteNoneQuery($query);
if ($cfg_ml->M_Spacesta >= 0) {
$dsql->ExecuteNoneQuery("update `#@__member` set spacesta=1 where mid='{$cfg_ml->M_ID}' And spacesta < 1 ");
}
ShowMsg('成功更新空间信息!', 'edit_space_info.php');
exit;
} else {
$row = $dsql->GetOne("select * from `#@__member_space` where mid='" . $cfg_ml->M_ID . "'");
if (!is_array($row)) {
$inquery = "Insert Into `#@__member_space`(`mid` ,`pagesize` ,`matt` ,`spacename` ,`spacelogo` , `sign` ,`spacenews`)\r\n\t\t\t Values('{$cfg_ml->M_ID}', '10', '0', '{$cfg_ml->M_UserName}的空间', '', '', ''); ";
$row['spacename'] = '';
$row['sign'] = '';
$row['pagesize'] = 10;
示例6: dirname
* 圈子分类设置
*
* @version $Id: group_store.php 1 15:34 2011-1-21 tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('group_Store');
require_once DEDEINC . '/datalistcp.class.php';
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$id = isset($id) && is_numeric($id) ? $id : 0;
$action = isset($action) ? trim($action) : '';
if ($action == "add") {
$storename = cn_substrR(HtmlReplace($storename, 2), 20);
$tops = preg_replace("#[^0-9]#", "", $tops);
$orders = preg_replace("#[^0-9]#", "", $orders);
if ($tops < 1) {
$tops = 0;
}
if ($orders < 1) {
$orders = 0;
}
if (empty($storename)) {
$msg = "错误,分类名不能为空!";
} else {
$db->ExecuteNoneQuery("INSERT INTO #@__store_groups(storename,tops,orders) VALUES('" . $storename . "','" . $tops . "','" . $orders . "');");
$msg = "成功添加分类";
}
} else {
示例7: ShowMsg
if ($rs['c'] >= $cfg_group_max && $cfg_group_max > 0) {
ShowMsg("超过创建圈子最大数{$cfg_group_max}个!.", "-1");
exit;
}
$title = "创建圈子";
/*------------
function SaveGroupinfo();
--------------*/
if ($action == "save") {
$groupname = cn_substrR($groupname, 16);
if (strlen($groupname) < 2 || strlen($groupname) > 20) {
ShowMsg("圈子名称过短!,在2-8个字内.", "-1");
exit;
}
$storeid = preg_replace("#[^0-9]#", "", $store);
$description = cn_substrR(HtmlReplace($des, -1), 100);
//var_dump($description);exit;
if (strlen($description) < 5 || strlen($description) > 200) {
ShowMsg("圈子说明在5-100个字符范围内!.", "-1");
exit;
}
$row = $db->GetOne("SELECT tops FROM #@__store_groups WHERE storeid='{$storeid}'");
if ($row['tops'] > 0) {
$rootstoreid = $row['tops'];
} else {
$rootstoreid = $storeid;
}
//处理上传的缩略图
$litpic = MemberUploads('litpic', '', $cfg_ml->M_ID, 'image', '', 100, 70, FALSE);
if ($litpic != '') {
SaveUploadInfo($title, $litpic, 1);
示例8: cn_substrR
}
//文档的默认状态
if ($cInfos['arcsta'] == 0) {
$ismake = 0;
$arcrank = 0;
} else {
if ($cInfos['arcsta'] == 1) {
$ismake = -1;
$arcrank = 0;
} else {
$ismake = 0;
$arcrank = -1;
}
}
//对保存的内容进行处理
$title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
$writer = cn_substrR(HtmlReplace($writer, 1), 20);
if (empty($description)) {
$description = '';
}
$description = cn_substrR(HtmlReplace($description, 1), 250);
$keywords = cn_substrR(HtmlReplace($tags, 1), 30);
$mid = $cfg_ml->M_ID;
$isadmin = $cfg_ml->fields['matt'] == 10 ? true : false;
//处理上传的缩略图
$litpic = MemberUploads('litpic', $oldlitpic, $mid, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, false, $isadmin);
if ($litpic != '') {
SaveUploadInfo($title, $litpic, 1);
} else {
$litpic = $oldlitpic;
}
示例9: GetIP
}
$ip = GetIP();
$dtime = time();
$uname = trimMsg($uname);
$email = trimMsg($email);
$homepage = trimMsg($homepage);
$homepage = preg_replace("#http:\\/\\/#", '', $homepage);
$qq = trimMsg($qq);
$msg = trimMsg(cn_substrR($msg, 1024), 1);
$tid = empty($tid) ? 0 : intval($tid);
$reid = empty($reid) ? 0 : intval($reid);
if ($msg == '' || $uname == '') {
showMsg('你的姓名和留言内容不能为空!', '-1');
exit;
}
$title = HtmlReplace(cn_substrR($title, 60), 1);
if ($title == '') {
$title = '无标题';
}
if ($reid != 0) {
$row = $dsql->GetOne("SELECT msg FROM `#@__guestbook` WHERE id='{$reid}' ");
$msg = "<div class=\\'rebox\\'>" . addslashes($row['msg']) . "</div>\n" . $msg;
}
$query = "INSERT INTO `#@__guestbook`(title,tid,mid,uname,email,homepage,qq,face,msg,ip,dtime,ischeck)\r\n VALUES ('{$title}','{$tid}','{$g_mid}','{$uname}','{$email}','{$homepage}','{$qq}','{$img}','{$msg}','{$ip}','{$dtime}','{$needCheck}'); ";
$dsql->ExecuteNoneQuery($query);
$gid = $dsql->GetLastID();
if ($needCheck == 1) {
require_once DEDEINC . "/oxwindow.class.php";
$msg = "\r\n <font color='red'><b>成功发送或回复留言!</b></font> <a href='guestbook.php' style='font-size:14px;font-weight:bold'><u>我已经知道了,点击此返回>></u></a>";
$wintitle = "留言发布成功提示";
$wecome_info = "留言发布成功:";
示例10: isset
$paytype = isset($paytype) && is_numeric($paytype) ? $paytype : 0;
$pid = isset($pid) && is_numeric($pid) ? $pid : 0;
if ($paytype < 1) {
ShowMsg("请选择支付方式!", "-1");
exit;
}
if ($pid < 1) {
ShowMsg("请选择配送方式!", "-1");
exit;
}
$address = cn_substrR(trim($address), 200);
$des = cn_substrR($des, 100);
$postname = cn_substrR(trim($postname), 15);
$tel = ereg_replace("[^-0-9,\\/\\| ]", "", $tel);
$zip = ereg_replace("[^0-9]", "", $zip);
$email = cn_substrR($email, 255);
if (empty($tel)) {
ShowMsg("请填写正确的收货人联系电话!", "-1");
exit;
}
if ($zip < 1 || $zip > 999999) {
ShowMsg("请填写正确的收货人邮政编码!", "-1");
exit;
}
//确认用户登录信息
if ($cfg_ml->IsLogin()) {
$userid = $cfg_ml->M_ID;
} else {
$username = trim($username);
$password = trim($password);
if (empty($username) || $password) {
示例11: ShowMsg
if ($job == 'check' && $g_isadmin) {
$dsql->ExecuteNoneQuery(" UPDATE `#@__guestbook` SET ischeck=1 WHERE id='{$id}' ");
ShowMsg("成功审核一条留言!", $GUEST_BOOK_POS);
exit;
} else {
if ($job == 'editok') {
$remsg = trim($remsg);
if ($remsg != '') {
//管理员回复不过滤HTML
if ($g_isadmin) {
$msg = "<div class=\\'rebox\\'>" . $msg . "</div>\n" . $remsg;
//$remsg <br><font color=red>管理员回复:</font>
} else {
$row = $dsql->GetOne("SELECT msg From `#@__guestbook` WHERE id='{$id}' ");
$oldmsg = "<div class=\\'rebox\\'>" . addslashes($row['msg']) . "</div>\n";
$remsg = trimMsg(cn_substrR($remsg, 1024), 1);
$msg = $oldmsg . $remsg;
}
}
$dsql->ExecuteNoneQuery("UPDATE `#@__guestbook` SET `msg`='{$msg}', `posttime`='" . time() . "' WHERE id='{$id}' ");
ShowMsg("成功更改或回复一条留言!", $GUEST_BOOK_POS);
exit;
}
}
}
if ($g_isadmin) {
$row = $dsql->GetOne("SELECT * FROM `#@__guestbook` WHERE id='{$id}'");
require_once DEDETEMPLATE . '/plus/guestbook-admin.htm';
} else {
$row = $dsql->GetOne("SELECT id,title FROM `#@__guestbook` WHERE id='{$id}'");
require_once DEDETEMPLATE . '/plus/guestbook-user.htm';
示例12: dirname
<?php
require_once dirname(__FILE__) . "/config.php";
CheckPurview('member_Pm');
if (!isset($action)) {
$action = '';
}
if ($action == "post") {
$floginid = 'admin';
$fromid = 0;
$toid = 0;
$tologinid = 0;
$sendtime = time();
$writetime = time();
$subject = cn_substrR(HtmlReplace($subject), 70);
$message = cn_substrR(HtmlReplace($message), 1000);
if (!isset($subject) || empty($subject)) {
ShowMsg('短信标题不能为空!', '-1');
exit;
} else {
if (!isset($message) || empty($message)) {
ShowMsg('请填写短信内容!', '-1');
exit;
}
}
#api{{
if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) {
uc_pm_send(0, '', $subject, $message);
ShowMsg('短信已成功发送', '-1');
exit;
}
示例13: time
if (empty($subject)) {
$msg = "请填写公告标题!";
} else {
if (empty($notice) || CountStrLen($notice > 100)) {
$msg = "请填写规定长度的公告内容!";
} else {
$SetQuery = "UPDATE #@__group_notice SET title='{$subject}',notice='{$notice}',stime='" . time() . "',ip='{$userip}' WHERE id='{$nid}';";
$db->ExecuteNoneQuery($SetQuery);
$msg = "已经更改公告!";
}
}
ShowMsg($msg, '');
} else {
if ($action == "add") {
$notice = eregi_replace("<(iframe|script)", "", $notice);
$subject = cn_substrR(HtmlReplace($subject, 2), 80);
$userip = GetIP();
if (empty($subject)) {
$msg = "请填写公告标题!";
} else {
if (empty($notice) || CountStrLen($notice > 100)) {
$msg = "请填写规定长度的公告内容!";
} else {
$SetQuery = "INSERT INTO #@__group_notice(uname,userid,title,notice,stime,gid,ip) VALUES('" . $cfg_ml->M_UserName . "','" . $cfg_ml->M_ID . "','" . $subject . "','" . $notice . "','" . time() . "','{$id}','" . $userip . "');";
$db->ExecuteNoneQuery($SetQuery);
$msg = "已经更改公告!";
}
}
ShowMsg($msg, '');
}
}
示例14: ShowMsg
if ($cInfos['issend'] != 1 || $cInfos['ispart'] != 0 || $cInfos['channeltype'] != $channelid || $cInfos['cissend'] != 1) {
ShowMsg("你所选择的栏目不支持投稿!", "-1");
exit;
}
//文档的默认状态
if ($cInfos['arcsta'] == 0) {
$arcrank = 0;
} else {
if ($cInfos['arcsta'] == 1) {
$arcrank = 0;
} else {
$arcrank = -1;
}
}
//对保存的内容进行处理
$title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
$mid = $cfg_ml->M_ID;
//处理上传的缩略图
$litpic = MemberUploads('litpic', $oldlitpic, $mid, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, false);
if ($litpic != '') {
SaveUploadInfo($title, $litpic, 1);
} else {
$litpic = $oldlitpic;
}
//分析处理附加表数据
$inadd_f = '';
if (!empty($dede_addonfields)) {
$addonfields = explode(';', $dede_addonfields);
if (is_array($addonfields)) {
foreach ($addonfields as $v) {
if ($v == '') {
示例15: ShowMsg
$groupuid = $row['uid'];
$groupisindex = $row['isindex'];
$groupsmalltype = $row['smalltype'];
if ($cfg_ml->M_ID != $groupuid) {
ShowMsg("该圈子不在你的管辖范围内!", "-1");
exit;
}
//编译小分类成数组
$smalltypes = @explode(",", $row['smalltype']);
if (!isset($action)) {
$action = '';
}
if ($action == "save") {
$groupname = cn_substrR($groupname, 75);
$storeid = ereg_replace("[^0-9]", "", $store);
$description = cn_substrR($des, 100);
$row = $db->GetOne("SELECT tops FROM #@__store_groups WHERE storeid='{$storeid}'");
if ($row['tops'] > 0) {
$rootstoreid = $row['tops'];
} else {
$rootstoreid = $storeid;
}
//处理上传的缩略图
$litpic = MemberUploads('litpic', '', $cfg_ml->M_ID, 'image', '', 100, 70, false);
if ($litpic != '') {
SaveUploadInfo($groupname, $litpic, 1);
}
$inQuery = "UPDATE #@__groups SET groupname='" . $groupname . "',des='" . $description . "',groupimg='" . $litpic . "',rootstoreid='{$rootstoreid}',storeid='{$storeid}' WHERE groupid='{$id}' AND uid='" . $cfg_ml->M_ID . "';";
$db->SetQuery($inQuery);
if (!$db->ExecuteNoneQuery()) {
echo $db->GetError();