本文整理汇总了PHP中cpmsg_error函数的典型用法代码示例。如果您正苦于以下问题:PHP cpmsg_error函数的具体用法?PHP cpmsg_error怎么用?PHP cpmsg_error使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpmsg_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkcloudstatus
function checkcloudstatus($showMessage = true)
{
global $_G;
$res = false;
$cloudStatus = $_G['setting']['cloud_status'];
$site_id = $_G['setting']['my_siteid'];
$site_key = $_G['setting']['my_sitekey'];
if ($site_id && $site_key) {
switch ($cloudStatus) {
case 1:
$res = 'cloud';
break;
case 2:
$res = 'unconfirmed';
break;
default:
$res = 'upgrade';
}
} elseif (!$cloudStatus && !$site_id && !$site_key) {
$res = 'register';
} elseif ($showMessage) {
if (defined('IN_ADMINCP')) {
cpmsg_error('cloud_status_error');
} else {
showmessage('cloud_status_error');
}
}
return $res;
}
示例2: article_edit
function article_edit()
{
global $_G;
include_once libfile('function/portalcp');
include_once libfile('function/spacecp');
include_once libfile('function/home');
require_once libfile('function/forumlist');
pload('F:spider');
if ($_GET['submit']) {
$setarr = $_GET['set'];
if (check_uid($setarr['uid']) == 'no') {
cpmsg_error(milu_lang('user_no_exists'));
}
$pick_common_set = get_pick_set();
$pid = intval($_GET['pid']);
$p_arr = get_pick_info($pid);
$setarr['portal_cid'] = $_GET['portal'];
$setarr['forum_fid'] = $_GET['forums'];
$setarr['forum_typeid'] = $_GET['threadtypeid'];
$setarr['blog_big_cid'] = $_GET['blog'];
$setarr['blog_small_cid'] = $_GET['classid'];
$setarr['title'] = getstr(trim($setarr['title']), 80, 1, 1);
if (strlen($setarr['title']) < 1) {
cpmsg_error(milu_lang('title_no_empty'));
}
if (empty($setarr['summary'])) {
$setarr['summary'] = portalcp_get_summary(stripslashes($_GET['message']));
}
$set_arr['summary'] = addslashes($setarr['summary']);
$setarr['public_time'] = strtotime($setarr['public_time']);
$setarr['from'] = dhtmlspecialchars($setarr['from']);
$setarr['article_tag'] = dhtmlspecialchars($setarr['article_tag']);
$setarr['fromurl'] = str_replace('&', '&', dhtmlspecialchars($setarr['fromurl']));
$aid = intval($_GET['aid']);
$pid = intval($_GET['pid']);
$status = intval($_GET['status']);
$relatedarr = array();
if ($_GET['raids']) {
$relatedarr = array_map('intval', $_GET['raids']);
$relatedarr = array_unique($relatedarr);
$relatedarr = array_filter($relatedarr);
$setarr['raids'] = serialize($relatedarr);
}
$setarr['tag'] = article_make_tag($_GET['tag']);
$setarr['last_modify'] = $_G['timestamp'];
$user_info = get_user_info($setarr['uid']);
$setarr['username'] = $user_info['username'];
$article_arr = $setarr;
DB::update('strayer_article_title', paddslashes($setarr), array('aid' => $aid));
$article_arr['is_download_img'] = $setarr['is_download_img'];
$article_arr['is_water_img'] = $setarr['is_water_img'];
$setarr = array();
$content = $_GET['message'];
if (!$_GET['is_bbs']) {
$regexp = '/(###NextPage(\\[title=(.*?)\\])?###)+/';
preg_match_all($regexp, $content, $arr);
$contents = preg_split($regexp, $content);
DB::delete('strayer_article_content', "aid='{$aid}'");
foreach ($contents as $k => $v) {
$v = dstripslashes($v);
$setarr['content'] = trim($v);
$setarr['pageorder'] = $k + 1;
$setarr['aid'] = $aid;
$setarr['dateline'] = $_G['timestamp'];
$article_arr['content_arr'][$k] = $setarr;
DB::insert("strayer_article_content", paddslashes($setarr), true);
}
} else {
//如果是带回复的
$setarr['content'] = trim($content);
$setarr = dstripslashes($setarr);
DB::update("strayer_article_content", paddslashes($setarr), array('aid' => $aid, 'pageorder' => 1));
}
//var_dump($aid);exit();
$setarr = array();
$article_view_url = '';
if ($_GET['public_flag']) {
$select = $_GET['select'];
$article_arr['is_bbs'] = $_GET['is_bbs'];
$article_arr['contents'] = $article_arr['is_bbs'] ? 1 : count($contents);
$article_arr['content'] = dstripslashes(clear_ad_html($_GET['message']));
$article_arr['public_reply_seq'] = $p_arr['public_reply_seq'];
$article_arr['is_public_reply'] = $p_arr['is_public_reply'];
$article_arr['reply_uid'] = $p_arr['reply_uid'];
$article_arr['is_page_public'] = $p_arr['is_page_public'];
if ($p_arr['is_word_replace'] == 1) {
//同义词替换
if ($article_arr['is_bbs'] != 1 && $article_arr['contents'] > 0) {
//有几页的文章
$article_arr['content_arr'] = article_words_replace($article_arr['content_arr']);
}
$article_arr['content'] = article_words_replace($article_arr['content']);
$article_arr['title'] = article_words_replace($article_arr['title']);
if ($article_arr['reply']) {
$article_arr['reply'] = article_words_replace($article_arr['reply']);
}
}
$article_arr['content'] = str_replace("###NextPage###", "<\\br>", $article_arr['content']);
$arr['content'] = htmlspecialchars_decode($arr['content'], ENT_QUOTES);
$arr['content'] = format_html($arr['content']);
//.........这里部分代码省略.........
示例3: cpmsg_error
if (!$massid) {
cpmsg_error('wechat:mass_not_exist');
}
$msg = C::t('#wechat#mobile_wechat_masssend')->fetch($massid);
if (!$msg) {
cpmsg_error('wechat:mass_not_exist');
}
if ($msg['type'] == 'media' && $msg['created_at'] + 86400 * 3 < TIMESTAMP) {
cpmsg_error('wechat:mass_send_expire');
}
$res = $wechat_client->sendMassMsg($msg);
if ($res) {
C::t('#wechat#mobile_wechat_masssend')->update($massid, array('msg_id' => $res['msg_id'], 'sent_at' => TIMESTAMP));
$updatedata = array('receiveEvent::masssendjobfinish' => array('plugin' => 'wechat', 'include' => 'response.class.php', 'class' => 'WSQResponse', 'method' => 'masssendFinish'));
$responsehook = WeChatHook::updateResponse($updatedata);
cpmsg('wechat:mass_sent_succ', PMODURL, 'succeed');
} else {
cpmsg_error($wechat_client->error());
}
} else {
if (submitcheck('delsubmit')) {
$massid = intval($_GET['massid']);
$msg = C::t('#wechat#mobile_wechat_masssend')->fetch($massid);
if (!$msg) {
cpmsg_error('wechat:mass_not_exist');
}
C::t('#wechat#mobile_wechat_masssend')->delete($massid);
cpmsg('wechat:mass_oper_succ', PMODURL, 'succeed');
}
}
}
示例4: cplang
$forumselect = "<select name=\"%s\">\n<option value=\"\"> > " . cplang('select') . "</option><option value=\"\"> </option>" . str_replace('%', '%%', forumselect(FALSE, 0, 0, TRUE)) . '</select>';
shownav('forum', 'forums_merge');
showsubmenu('forums_merge');
showformheader('forums&operation=merge');
showtableheader();
showsetting('forums_merge_source', '', '', sprintf($forumselect, 'source'));
showsetting('forums_merge_target', '', '', sprintf($forumselect, 'target'));
showsubmit('mergesubmit');
showtablefooter();
showformfooter();
} else {
if (C::t('forum_forum')->check_forum_exists(array($source, $target)) != 2) {
cpmsg_error('forums_nonexistence');
}
if (C::t('forum_forum')->fetch_forum_num('', $source)) {
cpmsg_error('forums_merge_source_sub_notnull');
}
C::t('forum_thread')->update_by_fid($source, array('fid' => $target));
loadcache('posttableids');
$posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0');
foreach ($posttableids as $id) {
C::t('forum_post')->update_fid_by_fid($id, $source, $target);
}
$sourceforum = C::t('forum_forum')->fetch_info_by_fid($source);
$targetforum = C::t('forum_forum')->fetch_info_by_fid($target);
$sourcethreadtypes = (array) dunserialize($sourceforum['threadtypes']);
$targethreadtypes = (array) dunserialize($targetforum['threadtypes']);
$targethreadtypes['types'] = array_merge((array) $targethreadtypes['types'], (array) $sourcethreadtypes['types']);
$targethreadtypes['icons'] = array_merge((array) $targethreadtypes['icons'], (array) $sourcethreadtypes['icons']);
C::t('forum_forum')->update($target, array('threads' => $targetforum['threads'] + $sourceforum['threads'], 'posts' => $targetforum['posts'] + $sourceforum['posts']));
C::t('forum_forumfield')->update($target, array('threadtypes' => serialize($targethreadtypes)));
示例5: showsubmit
showsubmit('permsubmit', 'submit', 'del');
showtablefooter();
showformfooter();
} else {
$users = array();
if (!empty($_G['gp_newuser'])) {
$value = DB::fetch_first("SELECT uid FROM " . DB::table('common_member') . " WHERE username='{$_G['gp_newuser']}'");
if ($value) {
$user = array();
$user['uid'] = $value['uid'];
$user['allowmanage'] = $_G['gp_newallowmanage'] ? 1 : 0;
$user['allowrecommend'] = $_G['gp_newallowrecommend'] ? 1 : 0;
$user['needverify'] = $_G['gp_newneedverify'] ? 1 : 0;
$users[] = $user;
} else {
cpmsg_error($_G['gp_newuser'] . cplang('block_has_no_allowauthorizedblock'), dreferer());
}
}
if (is_array($_G['gp_perm'])) {
foreach ($_G['gp_perm'] as $uid => $value) {
if (empty($_G['gp_delete']) || !in_array($uid, $_G['gp_delete'])) {
$user = array();
$user['allowmanage'] = $_G['gp_allowmanage'][$uid] ? 1 : 0;
$user['allowrecommend'] = $_G['gp_allowrecommend'][$uid] ? 1 : 0;
$user['needverify'] = $_G['gp_needverify'][$uid] ? 1 : 0;
if ($value['allowmanage'] != $user['allowmanage'] || $value['allowrecommend'] != $user['allowrecommend'] || $value['needverify'] != $user['needverify']) {
$user['uid'] = intval($uid);
$users[] = $user;
}
}
}
示例6: cpmsg_error
cpmsg_error($langs['error_bid']);
}
$setarr['bid'] = $brand['bid'];
$setarr['uid'] = $brand[uid];
$setarr['username'] = $brand[username];
if ($albumid) {
C::t('#sanree_brand#sanree_brand_album')->update($albumid, $setarr);
} else {
$picdata = array();
if ($_FILES['pic']) {
if ($_FILES['pic']['error'] == 0) {
$picdata = mypic_save($_FILES['pic'], $albumid);
}
}
if (empty($picdata['filepath'])) {
cpmsg_error($langs['error_pictip']);
}
$setarr['pic'] = $picdata['filepath'];
$setarr['dateline'] = TIMESTAMP;
$albumid = C::t('#sanree_brand#sanree_brand_album')->insert($setarr, TRUE);
fixalbumpic($catid, $setarr);
}
if (intval($_G['sr_istop']) == 1) {
$data = C::t('#sanree_brand#sanree_brand_album')->get_by_albumid($albumid);
C::t('#sanree_brand#sanree_brand_album_category')->update($data['catid'], array('pic' => $data['pic']));
}
cpmsg($langs['succeed'], $gotourl . 'album', 'succeed');
} else {
showsubmenu($menustr);
showtableheader('', 'nobottom');
showtablerow('', array(), array('<ul class="tab1">' . '<li><a href="' . ADMINSCRIPT . '?action=plugins&operation=config&act=album_category&identifier=sanree_brand&pmod=admincp"><span>' . $langs['albumcate'] . '</span></a></li>' . '<li class="current"><a href="' . ADMINSCRIPT . '?action=plugins&operation=config&act=album&identifier=sanree_brand&pmod=admincp"><span>' . $langs['piclist'] . '</span></a></li></ul>'));
示例7: cpheader
@set_time_limit(600);
cpheader();
if (empty($admincp) || !is_object($admincp)) {
exit('Access Denied');
}
$adminscript = ADMINSCRIPT;
$cloudDomain = 'http://cp.discuz.qq.com';
$utilService = Cloud::loadClass('Service_Util');
$appService = Cloud::loadClass('Service_App');
$cloudClient = Cloud::loadClass('Service_Client_Cloud');
try {
$cloudstatus = $appService->checkCloudStatus();
} catch (Cloud_Service_AppException $e) {
if ($operation == 'doctor' || $operation == 'siteinfo') {
} else {
cpmsg_error('cloud_status_error');
}
}
$forceOpen = !empty($_GET['force_open']) ? true : false;
if (!$operation || $operation == 'open') {
if ($cloudstatus == 'cloud' && !$forceOpen) {
cpmsg('cloud_turnto_applist', '', 'succeed', array(), '<p class="marginbot"><a href="###" onclick="top.location = \'' . ADMINSCRIPT . '?frames=yes&action=cloud&operation=applist\'" class="lightlink">' . cplang('message_redirect') . '</a></p><script type="text/JavaScript">setTimeout("top.location = \'' . ADMINSCRIPT . '?frames=yes&action=cloud&operation=applist\'", 3000);</script>');
} else {
if ($_GET['getConfirmInfo']) {
ajaxshowheader();
ajaxshowfooter();
}
$step = max(1, intval($_GET['step']));
$type = $cloudstatus == 'upgrade' ? 'upgrade' : 'open';
if ($step == 1) {
$utilService->generateUniqueId();
示例8: cpmsg_error
cpmsg_error($langs['error_nametip']);
}
if ($diystyleid < 1) {
$count = C::t('#sanree_brand#sanree_brand_diystyle')->count_by_where(" AND name='{$name}'");
} else {
$count = C::t('#sanree_brand#sanree_brand_diystyle')->count_by_where(" AND name='{$name}' AND diystyleid <> '{$diystyleid}'");
}
if ($count > 0) {
cpmsg_error($langs['ishavename']);
}
if (!isstylename($name)) {
cpmsg_error($langs['errorstylename']);
}
$content = dhtmlspecialchars(trim($_G['sr_content']));
if (empty($content)) {
cpmsg_error($langs['error_stylecontenttip']);
}
$setarr['name'] = $name;
$setarr['content'] = $content;
$setarr['displayorder'] = intval(trim($_G['sr_displayorder']));
$setarr['status'] = intval(trim($_G['sr_status']));
if ($diystyleid) {
C::t('#sanree_brand#sanree_brand_diystyle')->srupdate($diystyleid, $setarr, 'issys<>1');
} else {
$setarr['dateline'] = TIMESTAMP;
$setarr['uid'] = $_G[uid];
$setarr['username'] = $_G[username];
C::t('#sanree_brand#sanree_brand_diystyle')->insert($setarr);
}
diystyle();
cpmsg($langs['succeed'], $gotourl . 'diystyle', 'succeed');
示例9: article_batch
function article_batch()
{
global $_G;
$aid_arr = $_GET['aid'];
$is_public_del = $_GET['is_public_del'];
if (!VIP) {
$today_arr = dunserialize(pick_common_get('', 'pick_today'));
if ($today_arr['day'] != date('md', $_G['timestamp'])) {
$c_set['pick_today'] = array();
pick_common_set($c_set);
} else {
$article_public_num = $today_arr['article_public_num'];
if ($article_public_num > 10000) {
cpmsg_error(milu_lang('article_public_limit', array('n' => 10000)));
}
}
}
extract($_GET);
extract($set);
$public_start_time = strtotime($public_start_time);
$public_end_time = strtotime($public_end_time);
$args_arr = array('optype', 'pid', 'is_public_del', 'article_public_sort', 'is_public_del', 'public_start_time', 'public_end_time', 'status', 's', 'ordersc', 'orderby', 'time_public', 'portal', 'forums', 'threadtypeid', 'blog', 'perpage', 'oparea', 'article_batch_num', 'move_pid', 'p');
$args_url = '';
foreach ($args_arr as $k => $v) {
$args_url .= '&' . $v . '=' . ${$v};
}
//$args_url .= '&myac='
//echo $args_url;exit();
$from_url = PICK_GO . "picker_manage&myac=article_manage&finished=1" . $args_url;
if ($_GET['finished']) {
cpmsg(milu_lang('run_finsh'), $from_url, 'succeed');
}
if (!$_GET['confirmed']) {
$article_batch_num = $setrr['article_batch_num'] = $article_batch_num ? $article_batch_num : 15;
pick_common_set($setrr);
if (!$optype) {
cpmsg_error(milu_lang('must_select_optype'));
}
if ($oparea == 'selected') {
if (!$aid_arr) {
cpmsg_error(milu_lang('must_select_data'));
}
$aid_str = base64_encode(serialize($aid_arr));
$total = count($aid_arr);
} else {
if ($oparea == 'all') {
$total = article_count($pid, $status, array('s' => $s));
}
}
pcpmsg_loading(milu_lang('bat_import_article', array('a' => $article_batch_num, 't' => $total)), $from_url, 'loadingform', '', '<div id="percent">0%</div>', FALSE);
$ajax_url = "admin.php?" . PICK_GO . "picker_manage&myac=ajax_func&inajax=1&af=" . $myac . "&tpl=no&confirmed=1&oparea={$oparea}&aid={$aid_str}" . $args_url;
$finsh_url = "admin.php?" . PICK_GO . "picker_manage&myac=article_manage&finished=1" . $args_url;
//echo $ajax_url;exit();
echo pick_loading($ajax_url, $finsh_url, $total, array('bat_num' => $article_batch_num));
} else {
ob_end_clean();
$total = intval($_GET['total']);
$pp = intval($_GET['pp']);
$pid = intval($_GET['pid']);
$currow = intval($_GET['currow']);
$oparea = $_GET['oparea'];
$public_sort = $_GET['public_sort'];
$public_sort = $public_sort == 1 ? 'asc' : 'desc';
if ($oparea == 'selected') {
$aid_arr = unserialize(base64_decode($aid));
$where = $optype == 'timing_delete' ? " AND t.id IN (" . dimplode($aid_arr) . ") " : " AND aid IN (" . dimplode($aid_arr) . ") ";
} else {
if ($oparea == 'all') {
$where = $optype == 'timing_delete' ? " AND a.title like '%" . $_GET['s'] . "%' " : " AND title like '%" . $_GET['s'] . "%' ";
}
}
$aid_arr = array();
if ($is_public_del == 1 && ($optype == 'move_portal' || $optype == 'move_forums' || $optype == 'move_blog') || $optype == 'delete') {
$currow = 0;
}
if ($optype == 'timing_delete') {
$query = DB::query("SELECT a.aid,t.id, t.data_id FROM " . DB::table('strayer_timing') . " t Inner Join " . DB::table('strayer_article_title') . " a ON a.aid = t.data_id WHERE t.pid='{$pid}' {$where} ORDER by t.data_id LIMIT {$currow},{$pp}");
while ($rs = DB::fetch($query)) {
if ($rs['aid']) {
DB::update('strayer_article_title', array('status' => 1), array('aid' => $rs['aid']));
}
$aid_arr[] = $rs['id'];
}
} else {
$query = DB::query("SELECT aid FROM " . DB::table('strayer_article_title') . " WHERE pid='{$pid}' {$where} ORDER by dateline " . $public_sort . " LIMIT {$currow},{$pp}");
while ($rs = DB::fetch($query)) {
$aid_arr[] = $rs['aid'];
}
}
if ($optype == 'move_portal' || $optype == 'move_forums' || $optype == 'move_blog') {
article_import($_GET['optype'], array('aid' => $aid_arr));
} else {
$action = 'article_' . $optype;
$action($aid_arr, $pid);
}
if ($currow + $pp > $total) {
echo 'TRUE';
exit;
}
echo 'GO';
//.........这里部分代码省略.........
示例10: foreach
foreach ($likekeys as $k) {
$_GET[$k] = dhtmlspecialchars($_GET[$k]);
}
$wherearr = $results['wherearr'];
$mpurl .= '&' . implode('&', $results['urls']);
$wherearr[] = $operation == 'jscall' ? "blocktype='1'" : "blocktype='0'";
if ($_GET['permname']) {
$bids = '';
$uid = ($uid = C::t('common_member')->fetch_uid_by_username($_GET['permname'])) ? $uid : C::t('common_member_archive')->fetch_uid_by_username($_GET['permname']);
if ($uid) {
$bids = array_keys(C::t('common_block_permission')->fetch_all_by_uid($uid));
}
if ($bids = dimplode($bids)) {
$wherearr[] = 'bid IN (' . $bids . ')';
} else {
cpmsg_error($_GET['permname'] . cplang('block_the_username_has_not_block'));
}
$mpurl .= '&permname=' . $_GET['permname'];
}
$wheresql = empty($wherearr) ? '1' : implode(' AND ', $wherearr);
$wheresql = str_replace(array('bid', 'blockclass', ' name', 'blocktype', 'targettplname'), array('b.bid', 'b.blockclass', ' b.name', 'b.blocktype', 'tb.targettplname'), $wheresql);
$orders = getorders(array('bid', 'dateline'), 'bid');
$ordersql = $orders['sql'];
if ($orders['urls']) {
$mpurl .= '&' . implode('&', $orders['urls']);
}
$orderby = array($_GET['orderby'] => ' selected');
$ordersc = array($_GET['ordersc'] => ' selected');
$perpage = empty($_GET['perpage']) ? 0 : intval($_GET['perpage']);
if (!in_array($perpage, array(10, 20, 50, 100))) {
$perpage = 20;
示例11: rules_import
function rules_import()
{
global $_G, $header_config, $head_url;
$data['header'] = pick_header_output($header_config, $head_url);
$submit = $_GET['addsubmit'];
$update_flag = $_GET['update_flag'];
num_limit('strayer_rules', 3000, 's_num_limit');
if ($submit) {
$rules_code = $_GET['rules_code'];
if ($rules_code) {
$data = $rules_code;
} else {
$file_name = str_iconv($_FILES['rules_file']['tmp_name']);
$fp = fopen($file_name, 'r');
$data = fread($fp, $_FILES['rules_file']['size']);
}
$arr = pimportfile($data);
//采集器名称为空,则对将当前的时间戳做为采集器文件名
if (empty($arr['rules_name'])) {
$arr['rules_name'] = $_G['timestamp'];
}
unset($arr['rid'], $arr['version']);
//销毁采集器记录的ID与 版本号
$arr = daddslashes($arr);
//对值重新addslashes操作
if ($arr['pick']['pid']) {
cpmsg_error(milu_lang('import_error2', array('url' => PICK_GO)));
}
if (!$arr['rules_hash']) {
cpmsg_error(milu_lang('rules_error_data'));
}
$check = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('strayer_rules') . " WHERE rules_hash='{$arr['rules_hash']}'"), 0);
if ($check && !$update_flag) {
if (!$rules_code) {
$rules_code = $data;
}
cpmsg(milu_lang('cover_notice') . '?<input type="hidden" value="' . dstripslashes($data) . '" name="rules_code">', PICK_GO . 'system_rules&myac=rules_import&pid=' . $pid . '&addsubmit=1&update_flag=1', 'form');
}
$arr = get_table_field_name('strayer_rules', $arr);
unset($arr['rid']);
//去掉主键
if ($update_flag) {
$rules_hash = $arr['rules_hash'];
rules_update($rules_hash);
unset($arr['rules_hash']);
DB::update('strayer_rules', $arr, array('rules_hash' => $rules_hash));
} else {
DB::insert('strayer_rules', $arr, TRUE);
}
del_search_index(2);
cpmsg(milu_lang('import_finsh'), PICK_GO . "system_rules&myac=rules_list", 'succeed');
}
return $data;
}
示例12: num_limit
function num_limit($table_name, $limit_num, $lang)
{
$f_num = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table($table_name)), 0);
if (!VIP && $f_num > $limit_num) {
cpmsg_error(milu_lang($lang, array('n' => $limit_num)));
}
}
示例13: chkformtitle
function chkformtitle($fid, $setconfig = NULL)
{
global $_G;
$config = isset($setconfig) ? $setconfig : $_G['cache']['plugin']['sanree_brand'];
$forumdat = C::t('#sanree_brand#forum_forum')->fetch_info_by_fid($fid);
$forumname = $forumdat['name'];
$haveforumtitle = trim($config['haveforumtitle']);
if (strpos($forumname, $haveforumtitle) === false || empty($haveforumtitle)) {
$warningforumtitle = srlang('warningforumtitle');
$warningforumtitle = str_replace('{haveforumtitle}', $haveforumtitle, $warningforumtitle);
if (defined('IN_ADMINCP')) {
cpmsg_error($warningforumtitle);
} else {
showmessage($warningforumtitle);
}
}
}
示例14: paddslashes
$setarr['reply_is_extend'] = 0;
}
$setarr = paddslashes($setarr);
$data_info = get_pick_info();
if ($data_info['cron_day'] == 0) {
$data_info['cron_day'] = -1;
}
//数据库中的字段类型为未签署,导致没法小于0
if ($data_info['cron_minute'] != $setarr['cron_minute'] || $data_info['cron_hour'] != $setarr['cron_hour'] || $data_info['cron_day'] != $setarr['cron_day'] || $data_info['cron_weekday'] != $setarr['cron_weekday']) {
//计划任务修改时,把下次执行时间清空
save_syscache('pick_run', TIMESTAMP);
$setarr['lastrun'] = $setarr['nextrun'] = 0;
}
DB::update('strayer_picker', $setarr, array('pid' => $pid));
$url = PICK_GO . 'picker_manage';
} else {
$msg = milu_lang('add');
$setarr = paddslashes($setarr);
$setarr['picker_hash'] = create_hash();
$pid = DB::insert('strayer_picker', $setarr, TRUE);
}
$url = PICK_GO . 'picker_manage&myaction=edit_pick&pid=' . $pid . '&step=' . $_GET['step'];
if (!$pid) {
cpmsg_error($msg . milu_lang('fail'));
}
cpmsg(milu_lang('pick_op_finsh', array('msg' => $msg)), $url, 'succeed');
}
if (!$info['jump_num']) {
$info['jump_num'] = $pick_config['pick_num'];
}
include template('milu_pick:picker_edit');
示例15: cpmsg_error
cpmsg_error($langs['error_nametip']);
}
$setarr['name'] = $name;
$setarr['cateid'] = $cateid;
$setarr['keywords'] = dhtmlspecialchars(trim($_G['sr_keywords']));
$setarr['description'] = dhtmlspecialchars(trim($_G['sr_description']));
$setarr['status'] = intval(trim($_G['sr_status']));
$setarr['displayorder'] = intval(trim($_G['sr_displayorder']));
$setarr['syngroupid'] = intval(trim($_G['sr_syngroupid']));
$user = dhtmlspecialchars(trim($_G['sr_user']));
if ($user) {
$t = C::t('#sanree_brand#xcommon_member')->fetch_uid_by_username($user);
if ($t) {
$setarr['uid'] = $t;
} else {
cpmsg_error($langs['error_nouser']);
}
}
if ($cateid) {
C::t('#sanree_brand#sanree_brand_category')->update($cateid, $setarr);
} else {
$setarr['dateline'] = TIMESTAMP;
C::t('#sanree_brand#sanree_brand_category')->insert($setarr);
}
sanreeupdatecache('category');
cpmsg($langs['succeed'], $gotourl . 'list', 'succeed');
} else {
showsubmenu($menustr);
if ($cateid > 0) {
$menustr = $langs['editcate'];
$result = C::t('#sanree_brand#sanree_brand_category')->get_by_cateid($cateid);