本文整理汇总了PHP中ShowMsg函数的典型用法代码示例。如果您正苦于以下问题:PHP ShowMsg函数的具体用法?PHP ShowMsg怎么用?PHP ShowMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ShowMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckRank
function CheckRank($rank = 0, $money = 0)
{
global $cfg_ml, $cfg_memberurl;
if (!$cfg_ml->IsLogin()) {
header("Location:{$cfg_memberurl}/login.php?gourl=" . urlencode(GetCurUrl()));
exit;
} else {
if ($cfg_ml->M_Rank < $rank) {
$needname = "";
if ($cfg_ml->M_Rank == 0) {
$row = $dsql->GetOne("Select membername From #@__arcrank where rank='{$rank}'");
$myname = "普通会员";
$needname = $row['membername'];
} else {
$dsql->SetQuery("Select membername From #@__arcrank where rank='{$rank}' Or rank='" . $cfg_ml->M_Rank . "' order by rank desc");
$dsql->Execute();
$row = $dsql->GetObject();
$needname = $row->membername;
if ($row = $dsql->GetObject()) {
$myname = $row->membername;
} else {
$myname = "普通会员";
}
}
ShowMsg("对不起,需要:<span style='font-size:11pt;color:red'>{$needname}</span> 才能访问本页面。<br>你目前的等级是:<span style='font-size:11pt;color:red'>{$myname}</span> 。", "-1", 0, 5000);
exit;
} else {
if ($cfg_ml->M_Money < $money) {
ShowMsg("对不起,需要花费金币:<span style='font-size:11pt;color:red'>{$money}</span> 才能访问本页面。<br>你目前拥有的金币是:<span style='font-size:11pt;color:red'>" . $cfg_ml->M_Money . "</span> 。", "-1", 0, 5000);
exit;
}
}
}
}
示例2: ac_addpl
function ac_addpl()
{
// 引入全局对象(当前用户的相关信息)
global $cfg_ml;
// 如果当前没有用户处于登录状态,不允许发表评论
if (!$cfg_ml->M_ID) {
ShowMsg("请先登录,再发表评论", -1, 0, 2000);
return;
}
$title = request('title', '');
$content = request('content', '');
$movieid = request('movieid', '');
$addtime = time();
$userid = $cfg_ml->M_ID;
if ($title == "" || $content == "") {
ShowMsg("对不起,请先输入评论内容", -1, 0, 2000);
return;
}
// 调用Model执行添加操作
$res = $this->Model('mpinglun')->add_pl($userid, $title, $content, $addtime, $movieid);
if ($res) {
// ShowMsg("添加评论 成功", -1, 0, 2000);
ShowMsg("添加评论 成功", "?c=pinglun&a=listpl&aid={$movieid}", 0, 1500);
} else {
ShowMsg("添加评论 失败", -1, 0, 2000);
}
}
示例3: ac_save
function ac_save()
{
global $cfg_soft_lang;
$data[0]['pic'] = request('pic1', '');
$data[1]['pic'] = request('pic2', '');
$data[2]['pic'] = request('pic3', '');
$data[0]['url'] = request('url1', '');
$data[1]['url'] = request('url2', '');
$data[2]['url'] = request('url3', '');
$data[0]['description'] = request('description1', '');
$data[1]['description'] = request('description2', '');
$data[2]['description'] = request('description3', '');
$mpath = DEDEASK . "/data/cache/slide.inc";
if ($cfg_soft_lang == 'utf-8') {
$data = AutoCharset($data, 'utf-8', 'gb2312');
$data = serialize($data);
$data = gb2utf8($data);
} else {
$data = serialize($data);
}
$configstr = "<" . "?php\r\n\$data = '" . $data . "';";
file_put_contents($mpath, $configstr);
ShowMsg('修改幻灯片成功', '?ct=slide');
exit;
}
示例4: checkRole
/**
*
* @name checkRole
* @param String $action
* @package 检查用户自己的权限
* @return true or false
*/
public function checkRole($action)
{
global $router, $match;
$res = parent::acl_myRole($action);
if ($res == false) {
ShowMsg(parent::_Lang("error_permission"), $router->url('admin_index'));
}
}
示例5: success_db
function success_db($buyid)
{
global $dsql, $cfg_ml, $r3_Amt;
$money = floor($r3_Amt);
//获取订单信息,检查订单的有效性
$row = $dsql->GetOne("Select * From #@__member_operation where buyid='{$buyid}' ");
if (!is_array($row) || $row['sta'] == 2) {
if (isset($row['sta'])) {
ShowMsg($row['oldinfo'], "javascript:;");
exit;
} else {
ShowMsg('订单不存在!', "javascript:;");
exit;
}
}
if ($money != $row['money']) {
ShowMsg('交易信息被篡!', "javascript:;");
exit;
}
$mid = $row['mid'];
$pid = $row['pid'];
//更新交易状态为已付款
$dsql->ExecuteNoneQuery("Update #@__member_operation set sta=1 where buyid='{$buyid}' ");
//-------------------------------------------
//会员产品
//-------------------------------------------
if ($row['product'] == 'member') {
$row = $dsql->GetOne(" Select rank,exptime From #@__member_type where aid='{$row['pid']}' ");
$rank = $row['rank'];
$exptime = $row['exptime'];
$equery = " Update #@__member set\r\n\t\t\t\t\t\t\t\tmembertype='{$rank}',exptime='{$exptime}',uptime='" . time() . "' where mid='{$mid}' ";
$dsql->ExecuteNoneQuery($equery);
//更新交易状态为已关闭
$dsql->ExecuteNoneQuery(" Update #@__member_operation set sta=2,oldinfo='会员升级成功!' where buyid='{$buyid}' ");
} else {
if ($row['product'] == 'card') {
$row = $dsql->GetOne("Select cardid From #@__moneycard_record where ctid='{$pid}' And isexp='0' ");
//如果找不到某种类型的卡,直接为用户增加金币
if (!is_array($row)) {
$nrow = $dsql->GetOne("Select num From #@__moneycard_type where tid='{$pid}' ");
$dnum = $nrow['num'];
$equery = " Update #@__member set money=money+" . $dnum . " where mid='{$mid}' ";
$dsql->ExecuteNoneQuery($equery);
//更新交易状态为已关闭
$dsql->ExecuteNoneQuery(" Update #@__member_operation set sta=2,oldinfo='直接充值了 {$dnum} 金币到帐号!' where buyid='{$buyid}' ");
exit;
} else {
$cardid = $row['cardid'];
$dsql->ExecuteNoneQuery(" Update #@__moneycard_record set uid='{$mid}',isexp='1',utime='" . time() . "' where cardid='{$cardid}' ");
//更新交易状态为已关闭
$dsql->ExecuteNoneQuery(" Update #@__member_operation set sta=2,oldinfo='充值密码:{$cardid}' where buyid='{$buyid}' ");
}
}
}
return NULL;
}
示例6: GetDb
function GetDb()
{
global $db;
global $dbaddr, $dbuser, $dbpwd, $dbname;
if (null == $db) {
$db = new db_sql();
ShowMsg("create new db");
$db->connect($dbaddr, $dbuser, $dbpwd, $dbname);
ShowMsg("create new db ok");
}
return $db;
}
示例7: CheckCatalog
function CheckCatalog($cid, $msg)
{
global $cfg_admin_channel, $admin_catalogs;
if ($cfg_admin_channel == 'all' || TestAdmin()) {
return true;
}
if (!in_array($cid, $admin_catalogs)) {
ShowMsg(" {$msg} <br/><br/><a href='javascript:history.go(-1);'>点击此返回上一页>></a>", 'javascript:;');
exit;
}
return true;
}
示例8: checkauth
function checkauth()
{
global $yiqi_db;
global $adminuserinfo;
$pagename = end(explode("/", $_SERVER["PHP_SELF"]));
$sql = "select * from yiqi_regular where value like '{$pagename}%' limit 1";
$regularinfo = $yiqi_db->get_row(CheckSql($sql));
$userregular = explode("|", $adminuserinfo->regular);
if (!checkregular($regularinfo->rid)) {
ShowMsg("您没有权限访问此页", "back");
exit;
}
}
示例9: ac_index
function ac_index()
{
$asktypes = $this->type->get_alltype();
//当前位置
$nav = $GLOBALS['cfg_ask_position'] . '<a href="#">全部分类</a>';
if (!count($asktypes) > 0) {
ShowMsg('目前还没有分类,请浏览其他内容!', '-1');
exit;
}
//设定变量值
$GLOBALS['nav'] = $nav;
$GLOBALS['asktypes'] = $asktypes;
//载入模板
$this->SetTemplate('type.htm');
$this->Display();
}
示例10: __construct
public function __construct($stdClass = null)
{
global $router, $match;
$this->Session = new SC();
$this->Session->StartSession();
parent::__construct($stdClass);
$this->stdClass = $stdClass;
$res = true;
if (!in_array($this->stdClass, unserialize(WEB_ICORE_ACTION))) {
$res = $this->IsLogin();
}
if ($res == false) {
$this->ajax = 1;
ShowMsg(parent::_CLang("error_nologin"), $router->url('icore_login'));
}
}
示例11: sendmail
function sendmail($email, $mailtitle, $mailbody)
{
global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail, $cfg_webname;
if ($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) {
$mailtype = 'HTML';
require_once DEDEINC . '/mail.class.php';
$smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
$smtp->debug = false;
if (!$smtp->smtp_sockopen($cfg_smtp_server)) {
ShowMsg('邮件发送失败,请联系管理员', '-1');
exit;
}
$smtp->sendmail($email, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
} else {
@mail($email, $mailtitle, $mailbody, $headers);
}
}
示例12: _FilterAll
/**
* 过滤不相关内容
*
* @access public
* @param string $fk 过滤键
* @param string $svar 过滤值
* @return string
*/
function _FilterAll($fk, &$svar)
{
global $cfg_notallowstr, $cfg_replacestr;
if (is_array($svar)) {
foreach ($svar as $_k => $_v) {
$svar[$_k] = _FilterAll($fk, $_v);
}
} else {
if ($cfg_notallowstr != '' && preg_match("#" . $cfg_notallowstr . "#i", $svar)) {
ShowMsg(" {$fk} has not allow words!", '-1');
exit;
}
if ($cfg_replacestr != '') {
$svar = preg_replace('/' . $cfg_replacestr . '/i', "***", $svar);
}
}
return $svar;
}
示例13: __construct
/**
* php5构造函数
*
* @access public
* @param string $keyword 关键词
* @param string $templet 模板
* @return void
*/
function __construct($keyword, $templet)
{
global $dsql;
$this->Templet = $templet;
$this->Tag = $keyword;
$this->dsql = $dsql;
$this->dtp = new DedeTagParse();
$this->dtp->SetRefObj($this);
$this->dtp->SetNameSpace("dede", "{", "}");
$this->dtp2 = new DedeTagParse();
$this->dtp2->SetNameSpace("field", "[", "]");
$this->TypeLink = new TypeLink(0);
$this->Fields['tag'] = $keyword;
$this->Fields['title'] = $keyword;
$this->TempletsFile = '';
//设置一些全局参数的值
foreach ($GLOBALS['PubFields'] as $k => $v) {
$this->Fields[$k] = $v;
}
//读取Tag信息
if ($this->Tag != '') {
$this->TagInfos = $this->dsql->GetOne("Select * From `#@__tagindex` where tag like '{$this->Tag}' ");
if (!is_array($this->TagInfos)) {
$fullsearch = $GLOBALS['cfg_phpurl'] . "/search.php?keyword=" . $this->Tag . "&searchtype=titlekeyword";
$msg = "系统无此标签,可能已经移除!<br /><br />你还可以尝试通过搜索程序去搜索这个关键字:<a href='{$fullsearch}'>前往搜索>></a>";
ShowMsg($msg, "-1");
exit;
}
}
//初始化模板
$tempfile = $GLOBALS['cfg_basedir'] . $GLOBALS['cfg_templets_dir'] . "/" . $GLOBALS['cfg_df_style'] . '/' . $this->Templet;
if (!file_exists($tempfile) || !is_file($tempfile)) {
echo "模板文件不存在,无法解析文档!";
exit;
}
$this->dtp->LoadTemplate($tempfile);
$this->TempletsFile = preg_replace("#^" . $GLOBALS['cfg_basedir'] . "#", '', $tempfile);
}
示例14: ac_view
function ac_view()
{
$mid = request('mid', '');
$mid = is_numeric($mid) ? $mid : 0;
$row = $this->dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$mid}' ");
if (is_array($row)) {
/** 提问数 **/
$asknum = $this->dsql->GetOne("SELECT COUNT(id) as dd FROM `#@__ask` WHERE uid='{$mid}'");
$asknum = empty($asknum['dd']) ? 0 : $asknum['dd'];
/** 回答数 **/
$answernum = $this->dsql->GetOne("SELECT COUNT(id) as dd FROM `#@__askanswer` WHERE uid='{$mid}'");
$answernum = empty($answernum['dd']) ? 0 : $answernum['dd'];
/** 采纳率 **/
$adoptnum = $this->dsql->GetOne("SELECT COUNT(id) as dd FROM `#@__askanswer` WHERE uid='{$mid}' AND ifanswer = 1");
if (empty($adoptnum['dd'])) {
$adoptrate = 0;
} else {
$adoptrate = $adoptnum['dd'] / $answernum * 100;
}
/** 查询会员签名 **/
$moodmsg = $this->dsql->GetOne("SELECT * FROM #@__member_msg WHERE mid='{$mid}' ORDER BY dtime desc");
//头像
if (empty($row['face'])) {
$row['face'] = $row['sex'] == '女' ? "static/images/dfgirl.png" : "static/images/dfboy.png";
}
} else {
ShowMsg('不存在该用户!', '-1');
exit;
}
$GLOBALS['row'] = $row;
$GLOBALS['moodmsg'] = $moodmsg;
$this->SetVar('asknum', $asknum);
$this->SetVar('answernum', $answernum);
$this->SetVar('adoptrate', $adoptrate);
$this->SetTemplet('member_person.htm');
$this->Display();
}
示例15: count
$total = count($commentcount);
$take = 20;
$skip = ($curpage - 1) * $take;
$totalpage = (int) ($total % $take == 0 ? $total / $take : $total / $take + 1);
$commentlist = $commentdata->TakeCommentsList($skip, $take);
$action = $_POST["action"];
if ($action == "delete") {
$idarr = $_POST["chk"];
if (count($idarr) > 0) {
foreach ($idarr as $id) {
if (is_numeric($id)) {
$sql = "DELETE FROM yiqi_comments WHERE cid = '{$id}' limit 1";
$yiqi_db->query(CheckSql($sql));
}
}
ShowMsg("指定留言删除成功");
}
}
$adminpagetitle = "留言列表";
include "admin.header.php";
?>
<div class="main_body">
<form action="comments.php" method="post">
<table class="inputform" cellpadding="1" cellspacing="1">
<tr style="background:#f6f6f6;"><td class="w10"></td><td class="w20">标题</td><td class="w20">留言人姓名</td><td class="w20">联系方式</td><td class="w20">留言时间</td><td class="w10">相关操作</td></tr>
<?php
if (count($commentlist) > 0) {
foreach ($commentlist as $comment) {
echo "<tr>" . "<td><input id=\"slt{$comment->cid}\" type=\"checkbox\" name=\"chk[]\" value=\"{$comment->cid}\" /></td>" . "<td><a href=\"comment-info.php?cid={$comment->cid}\">{$comment->title}</a></td>" . "<td>{$comment->name}</td>" . "<td>{$comment->contact}</td>" . "<td>{$comment->adddate}</td>" . "<td><a href=\"comment-info.php?cid={$comment->cid}\">查看</a></td>" . "</tr>";
}
}