本文整理汇总了PHP中saddslashes函数的典型用法代码示例。如果您正苦于以下问题:PHP saddslashes函数的具体用法?PHP saddslashes怎么用?PHP saddslashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了saddslashes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doIndex_BoxPost
public function doIndex_BoxPost()
{
$rc['login'] = bus('post')['login'];
$rc['password'] = bus('post')['password'];
$rc['groupId'] = intval(bus('post')['group']);
$rc['des'] = bus('post')['des'];
//addslashes()和stripslashes()
//监测空值
if (empty($rc['login']) || empty($rc['login'])) {
echo json_encode(['code' => -200, 'msg' => '用户名或密码空']);
exit;
}
//监测重复
$login = saddslashes($rc['login']);
$sql = "select count(*) from user where login = '{$login}'";
$num = sapp('db')->getone($sql);
if ($num) {
echo json_encode(['code' => -200, 'msg' => '该用户名存在']);
exit;
}
//hash
$rc['password'] = shamhash($rc['password']);
//--------------------------------------------------------
$rc = saddslashes($rc);
sapp('db')->autoExecute('user', $rc, 'INSERT');
//--------------------------------------------------------
echo json_encode(['code' => 200, 'msg' => '-']);
}
示例2: _init_input
function _init_input()
{
global $_G;
if (!MAGIC_QUOTES_GPC) {
$_GET = saddslashes($_GET);
$_POST = saddslashes($_POST);
$_COOKIE = saddslashes($_COOKIE);
$_FILES = saddslashes($_FILES);
}
$prelength = strlen($_G['config']['cookie']['cookiepre']);
foreach ($_COOKIE as $key => $value) {
if (substr($key, 0, $prelength) == $_G['config']['cookie']['cookiepre']) {
$_G['cookie'][substr($key, $prelength)] = $value;
}
}
$_G['inajax'] = empty($_GET['inajax']) ? 0 : intval($_GET['inajax']);
$_G['page'] = $_GET['page'] = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
if (substr($_G['setting']['attachmentdir'], 0, 2) == './') {
define('A_DIR', B_ROOT . $_G['setting']['attachmentdir']);
} else {
define('A_DIR', $_G['setting']['attachmentdir']);
}
if (empty($_G['setting']['attachmenturl']) && substr($_G['setting']['attachmentdir'], 0, 2) == './') {
$_G['setting']['attachmenturl'] = substr($_G['setting']['attachmentdir'], 2);
}
if (empty($_G['setting']['attachmenturl'])) {
$_G['setting']['attachmenturl'] = 'attachments';
}
// 外部調用帶絕對地址
define('A_URL', B_URL . '/' . $_G['setting']['attachmenturl']);
}
示例3: saddslashes
function saddslashes($string)
{
if (is_array($string)) {
foreach ($string as $key => $val) {
$string[$key] = saddslashes($val);
}
} else {
$string = addslashes($string);
}
return $string;
}
示例4: xmltag_close
function xmltag_close($parser, $tag)
{
$flag = false;
switch ($tag) {
case 'int':
case 'i4':
$value = intval(trim($this->xmlmessage->tag_content));
$flag = true;
break;
case 'double':
$value = (double) trim($this->xmlmessage->tag_content);
$flag = true;
break;
case 'string':
$value = $this->xmlmessage->tag_content;
$flag = true;
break;
case 'dateTime.iso8601':
$value = $this->convertDate($this->xmlmessage->tag_content);
$flag = true;
break;
case 'value':
if (trim($this->xmlmessage->tag_content) != '' || $this->xmlmessage->last_open == 'value') {
$value = (string) trim($this->xmlmessage->tag_content);
$flag = true;
}
break;
case 'boolean':
$value = (bool) trim($this->xmlmessage->tag_content);
$flag = true;
break;
case 'base64':
$value = saddslashes(base64_decode(trim($this->xmlmessage->tag_content)));
$flag = true;
break;
case 'data':
case 'struct':
$value = array_pop($this->xmlmessage->structs);
array_pop($this->xmlmessage->structTypes);
$flag = true;
break;
case 'member':
array_pop($this->xmlmessage->struct_name);
break;
case 'name':
$this->xmlmessage->struct_name[] = trim($this->xmlmessage->tag_content);
break;
case 'methodName':
$this->xmlmessage->methodname = trim($this->xmlmessage->tag_content);
break;
}
if ($flag) {
if (count($this->xmlmessage->structs) > 0) {
if ($this->xmlmessage->structTypes[count($this->xmlmessage->structTypes) - 1] == 'struct') {
$this->xmlmessage->structs[count($this->xmlmessage->structs) - 1][$this->xmlmessage->struct_name[count($this->xmlmessage->struct_name) - 1]] = $value;
} else {
$this->xmlmessage->structs[count($this->xmlmessage->structs) - 1][] = $value;
}
} else {
$this->xmlmessage->params[] = $value;
}
}
if (!in_array($tag, array('data', 'struct', 'member'))) {
$this->xmlmessage->tag_content = '';
}
}
示例5: while
//附件如何处理?
if ($value['haveattach']) {
$subquery = $_SGLOBAL['db']->query("SELECT * FROM {$tpre}attachments WHERE itemid='{$value['itemid']}'");
while ($subvalue = $_SGLOBAL['db']->fetch_array($subquery)) {
if (strexists($value['message'], $value['filepath']) || strexists($value['message'], $value['thumbpath'])) {
continue;
}
if ($subvalue['isimage']) {
//图片
$value['message'] .= "<div><img src=\"{$_SC[attachurl]}{$subvalue['filepath']}\"></div>";
} else {
$value['message'] .= "<div><strong>文件</strong>: <a href=\"{$_SC[attachurl]}{$subvalue['filepath']}\">{$subvalue['filename']}</a></div>";
}
}
}
$value = saddslashes($value);
$setarr = array('blogid' => $value['itemid'], 'uid' => $value['uid'], 'username' => $value['username'], 'subject' => $value['subject'], 'classid' => $value['itemtypeid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum'], 'dateline' => $value['dateline'], 'noreply' => empty($value['allowreply']) ? 1 : 0, 'friend' => $value['folder'] > 1 ? 1 : 0);
inserttable('blog', $setarr, 0, true);
$setarr = array('blogid' => $value['itemid'], 'message' => message_replace($value['message']), 'postip' => $value['postip']);
inserttable('blogfield', $setarr, 0, true);
}
show_next('图片主题数据');
} elseif ($_GET['step'] == 13) {
$msg = <<<EOF
\t<form method="post" action="convert.php">
\t<table>
\t<tr><td colspan="2">数据转换完成!<br><br>
\t最后,请输入你的用户名,系统将您设为UCenter Home的管理员!
\t</td></tr>
\t<tr><td>您的用户名</td><td><input type="text" name="username" value="" size="30"></td></tr>
\t<tr><td></td><td><input type="submit" name="opensubmit" value="设为管理员"></td></tr>
示例6: array_merge
}
include_once S_ROOT . './function/common.func.php';
@(include_once S_ROOT . './data/system/config.cache.php');
$_SCONFIG = array_merge($_SSCONFIG, $_SC);
//合并配置
extract($_SC);
if (!get_magic_quotes_gpc()) {
$_GET = saddslashes($_GET);
$_POST = saddslashes($_POST);
$_COOKIE = saddslashes($_COOKIE);
}
//COOKIE
$prelength = strlen($_SC['cookiepre']);
foreach ($_COOKIE as $key => $val) {
if (substr($key, 0, $prelength) == $_SC['cookiepre']) {
$_SCOOKIE[substr($key, $prelength)] = empty($magic_quote) ? saddslashes($val) : $val;
}
}
$mtime = explode(' ', microtime());
$_SGLOBAL['supe_starttime'] = $mtime[1] + $mtime[0];
$_SGLOBAL['timestamp'] = time();
$_SGLOBAL['inajax'] = empty($_GET['inajax']) ? 0 : intval($_GET['inajax']);
define('S_URL', $_SC['siteurl']);
define('B_URL', $_SC['bbsurl']);
if (!empty($_SC['bbsver'])) {
define('B_VER', $_SC['bbsver'] >= 5 ? 5 : $_SC['bbsver']);
}
if (!empty($headercharset)) {
header('Content-Type: text/html; charset=' . $_SC['charset']);
}
//ONLINE IP
示例7: synlogin
function synlogin($get, $post)
{
global $_SGLOBAL;
if (!API_SYNLOGIN) {
return API_RETURN_FORBIDDEN;
}
//note 同步登录 API 接口
obclean();
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
$cookietime = 31536000;
$uid = intval($get['uid']);
$query = $_SGLOBAL['db']->query("SELECT uid, username, password FROM " . tname('member') . " WHERE uid='{$uid}'");
if ($member = $_SGLOBAL['db']->fetch_array($query)) {
include_once S_ROOT . './source/function_space.php';
$member = saddslashes($member);
$space = insertsession($member);
//设置cookie
ssetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime);
}
ssetcookie('loginuser', $get['username'], $cookietime);
}
示例8: getstr
function getstr($string, $length, $in_slashes = 0, $out_slashes = 0, $censor = 0, $bbcode = 0, $html = 0)
{
global $_SC, $_SGLOBAL;
$string = trim($string);
if ($in_slashes) {
//传入的字符有slashes
$string = sstripslashes($string);
}
if ($html < 0) {
//去掉html标签
$string = preg_replace("/(\\<[^\\<]*\\>|\r|\n|\\s|\\[.+?\\])/is", ' ', $string);
$string = shtmlspecialchars($string);
} elseif ($html == 0) {
//转换html标签
$string = shtmlspecialchars($string);
}
if ($censor) {
//词语屏蔽
@(include_once S_ROOT . './data/data_censor.php');
if ($_SGLOBAL['censor']['banned'] && preg_match($_SGLOBAL['censor']['banned'], $string)) {
showmessage('information_contains_the_shielding_text');
} else {
$string = empty($_SGLOBAL['censor']['filter']) ? $string : @preg_replace($_SGLOBAL['censor']['filter']['find'], $_SGLOBAL['censor']['filter']['replace'], $string);
}
}
if ($length && strlen($string) > $length) {
//截断字符
$wordscut = '';
if (strtolower($_SC['charset']) == 'utf-8') {
//utf8编码
$n = 0;
$tn = 0;
$noc = 0;
while ($n < strlen($string)) {
$t = ord($string[$n]);
if ($t == 9 || $t == 10 || 32 <= $t && $t <= 126) {
$tn = 1;
$n++;
$noc++;
} elseif (194 <= $t && $t <= 223) {
$tn = 2;
$n += 2;
$noc += 2;
} elseif (224 <= $t && $t < 239) {
$tn = 3;
$n += 3;
$noc += 2;
} elseif (240 <= $t && $t <= 247) {
$tn = 4;
$n += 4;
$noc += 2;
} elseif (248 <= $t && $t <= 251) {
$tn = 5;
$n += 5;
$noc += 2;
} elseif ($t == 252 || $t == 253) {
$tn = 6;
$n += 6;
$noc += 2;
} else {
$n++;
}
if ($noc >= $length) {
break;
}
}
if ($noc > $length) {
$n -= $tn;
}
$wordscut = substr($string, 0, $n);
} else {
for ($i = 0; $i < $length - 1; $i++) {
if (ord($string[$i]) > 127) {
$wordscut .= $string[$i] . $string[$i + 1];
$i++;
} else {
$wordscut .= $string[$i];
}
}
}
$string = $wordscut;
}
if ($bbcode) {
include_once S_ROOT . './source/function_bbcode.php';
$string = bbcode($string, $bbcode);
}
if ($out_slashes) {
$string = saddslashes($string);
}
return trim($string);
}
示例9: uploadfile
function uploadfile($valuearr, $mid = 2, $itemid = 0, $havethumb = 1, $width = 100, $height = 100)
{
global $_G, $_SGLOBAL;
$setsqlarr = array();
$hash = getmodelhash($mid, $itemid);
if (!empty($valuearr)) {
foreach ($valuearr as $value) {
if (!preg_match("/^(img|flash|file)\$/i", $value['formtype'])) {
continue;
}
$filearr = $_FILES[$value['fieldname']];
if (!empty($filearr['name'])) {
$setsqlarr[$value['fieldname']] = array('fieldcomment' => $value['fieldcomment'], 'filepath' => '', 'error' => '', 'aid' => '');
if (empty($filearr['size']) || empty($filearr['tmp_name'])) {
//獲取上傳文件大小失敗,請選擇其他文件上傳
$setsqlarr[$value['fieldname']]['error'] = modelmsg('get_upload_size_error');
break;
}
$fileext = fileext($filearr['name']);
if ($value['fieldname'] == 'subjectimage') {
$newfilearr = loadClass('attach')->savelocalfile($filearr, array($width, $height), '', 1);
//標題圖片上傳
} else {
list($width, $height) = explode(',', $value['thumbsize']);
$newfilearr = loadClass('attach')->savelocalfile($filearr, array($width, $height), '', 1);
//自定義圖片上傳
}
if ($value['formtype'] == 'img') {
$attachinfo = @getimagesize(A_DIR . '/' . $newfilearr['file']);
if (empty($attachinfo) || $attachinfo[2] < 1 && $attachinfo[2] > 3) {
$setsqlarr[$value['fieldname']]['error'] = modelmsg('get_upload_size_error');
@unlink(A_DIR . '/' . $newfilearr['file']);
if ($newfilearr['thumb'] != $newfilearr['file']) {
@unlink(A_DIR . '/' . $newfilearr['thumb']);
}
break;
}
}
if (empty($newfilearr['file'])) {
//上傳文件失敗,請您稍後嘗試重新上傳
$setsqlarr[$value['fieldname']]['error'] = modelmsg('upload_error');
break;
}
//數據庫
$insertsqlarr = array('uid' => $_G['uid'], 'dateline' => $_G['timestamp'], 'filename' => saddslashes($filearr['name']), 'subject' => $value['fieldname'], 'attachtype' => $fileext, 'isimage' => in_array($fileext, array('jpg', 'jpeg', 'gif', 'png')) ? 1 : 0, 'size' => $filearr['size'], 'filepath' => $newfilearr['file'], 'thumbpath' => $newfilearr['thumb'], 'hash' => $hash);
$aid = inserttable('attachments', $insertsqlarr, 1);
$setsqlarr[$value['fieldname']]['filepath'] = $value['formtype'] != 'file' ? $newfilearr['file'] : $aid;
$setsqlarr[$value['fieldname']]['aid'] = $aid;
}
}
}
return $setsqlarr;
}
示例10: saddslashes
/**
* 用户输入转义
*/
function saddslashes($string)
{
if (!get_magic_quotes_gpc()) {
if (is_array($string)) {
foreach ($string as $key => $val) {
$string[$key] = saddslashes($val);
}
} else {
$string = addslashes($string);
}
}
return $string;
}
示例11: saveurlarr
function saveurlarr($msgarr, $varname)
{
global $_SGLOBAL;
global $thevalue, $_SCONFIG;
include_once S_ROOT . './function/upload.func.php';
$isimage = 0;
if ($varname == 'picarr') {
$isimage = 1;
}
if (!empty($msgarr[$varname]) && is_array($msgarr[$varname])) {
foreach ($msgarr[$varname] as $ukey => $url) {
if ($isimage) {
$patharr = saveremotefile($url, $_SCONFIG['thumbarray']['news']);
} else {
$patharr = saveremotefile($url, array(), 0);
}
$subject = strtolower(trim(substr($patharr['name'], 0, strrpos($patharr['name'], '.'))));
$msgarr['patharr'][] = array('uid' => $_SGLOBAL['supe_uid'], 'dateline' => $_SGLOBAL['timestamp'], 'catid' => $msgarr['importcatid'], 'itemid' => 0, 'filename' => saddslashes($patharr['name']), 'subject' => trim(shtmlspecialchars($subject)), 'attachtype' => $patharr['type'], 'type' => 'news', 'isimage' => in_array($patharr['type'], array('jpg', 'jpeg', 'gif', 'png')) ? 1 : 0, 'size' => $patharr['size'], 'filepath' => $patharr['file'], 'thumbpath' => $patharr['thumb'], 'isavailable' => 1, 'hash' => '');
if (!empty($patharr['file'])) {
$msgarr['message'] = str_replace($url, A_URL . '/' . $patharr['file'], $msgarr['message']);
$msgarr[$varname][$ukey] = str_replace($url, A_DIR . '/' . $patharr['file'], $msgarr[$varname][$ukey]);
}
}
}
return $msgarr;
}
示例12: showmessage
} else {
if (in_array($return, array(-1, -2, -3, -4))) {
showmessage('message_can_not_send' . abs($return));
} else {
showmessage('message_can_not_send');
}
}
}
} elseif ($_GET['op'] == 'ignore') {
if (submitcheck('ignoresubmit')) {
uc_pm_blackls_set($_SGLOBAL['supe_uid'], $_POST['ignorelist']);
showmessage('do_success', 'space.php?do=pm&view=ignore');
}
} else {
//新用户见习
cknewuser();
if (!checkperm('allowpm')) {
ckspacelog();
showmessage('no_privilege');
}
//发送
$friends = array();
if ($space['friendnum']) {
$query = $_SGLOBAL['db']->query("SELECT fuid AS uid, fusername AS username FROM " . tname('friend') . " WHERE uid={$_SGLOBAL['supe_uid']} AND status='1' ORDER BY num DESC, dateline DESC LIMIT 0,100");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$value['username'] = saddslashes($value['username']);
$friends[] = $value;
}
}
}
include_once template("cp_pm");
示例13: preg_replace
$comment['ip'] = preg_replace("/^(\\d{1,3})\\.(\\d{1,3})\\.\\d{1,3}\\.\\d{1,3}\$/", "\$1.\$2.*.*", $comment['ip']);
$html = '<div id="cid_{cid}_' . $comment['floornum'] . '_title" class="old_title"><span class="author">' . $_G['setting']['sitename'];
if (!$comment['hidelocation']) {
$html .= $comment['iplocation'] != 'LAN' ? $comment['iplocation'] : $lang['mars'];
}
$html .= $lang['visitor'];
if (!empty($comment['authorid']) && !$comment['hideauthor']) {
$html .= " [{$comment['author']}] ";
}
if (!$comment['hideip']) {
$html .= " ({$comment['ip']}) ";
}
$html .= $lang['from_the_original_note'] . '</span><span class="color_red">' . $comment['floornum'] . '</span></div>';
$comment['message'] = str_replace('<div class="new"', $html . '<div id="cid_{cid}_' . $comment['floornum'] . '_detail" class="detail"', $comment['message']);
$comment['message'] = '<div id="cid_{cid}_' . $comment['floornum'] . '" class="old">' . $comment['message'] . '</div>';
$comment['message'] = saddslashes($comment['message']);
$_POST['message'] = $comment['message'] . $_POST['commentmessage'];
}
//回複詞語屏蔽
$_POST['commentmessage'] = censor($_POST['commentmessage']);
$shopuid = getshopuid($type);
$subtype = !empty($commentscorestr) ? '1' : '0';
$setsqlarr = array('itemid' => $itemid, 'type' => $type, 'uid' => $item['uid'], 'authorid' => $_G['uid'], 'author' => $_G['username'], 'ip' => $_G['clientip'], 'dateline' => $_G['timestamp'], 'subject' => '', 'message' => $_POST['commentmessage'], 'floornum' => $comment['floornum'], 'hideauthor' => $_POST['hideauthor'], 'hideip' => $_POST['hideip'], 'hidelocation' => $_POST['hidelocation'], 'firstcid' => $comment['firstcid'], 'upcid' => $upcid, 'shopuid' => $shopuid, 'status' => 1, 'isprivate' => $isprivate, 'subtype' => $subtype);
$cid = inserttable('spacecomments', $setsqlarr, 1);
if ($cid && !empty($commentscorestr)) {
$commentscore = $score = 0;
$commentscorearr = array();
for ($i = 1; $i <= 8; $i++) {
if (strpos($commentscorestr, '1' . $i . '@')) {
$commentscore = substr($commentscorestr, strpos($commentscorestr, '@1' . $i . '@') + 4, 1);
if (is_numeric($commentscore) && $commentscore <= 5 && $commentscore > 0) {
示例14: feed_publish
//.........这里部分代码省略.........
$setarr['body_template'] = '<b>{subject}</b><br>' . cplang('mtag') . ': {mtag}<br>{summary}';
$setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'mtag' => "<a href=\"space.php?do=mtag&tagid={$value['tagid']}\">{$mtag['tagname']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
}
}
break;
case 'pid':
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('poll') . " WHERE pid='{$id}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
//
$setarr['icon'] = 'poll';
$setarr['id'] = $value['pid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['hot'] = $value['hot'];
//ϸ
$url = "space.php?uid={$value['uid']}&do=poll&pid={$value['pid']}";
$setarr['title_template'] = cplang('feed_poll');
$setarr['body_template'] = '<a href="{url}"><strong>{subject}</strong></a>{option}';
$optionstr = '';
$opquery = $_SGLOBAL['db']->query("SELECT * FROM " . tname("polloption") . " WHERE pid='{$value['pid']}' LIMIT 0,2");
while ($opt = $_SGLOBAL['db']->fetch_array($opquery)) {
$optionstr .= '<br><input type="' . ($value['maxchoice'] > 1 ? 'checkbox' : 'radio') . '" disabled name="poll_' . $opt['oid'] . '"/>' . $opt['option'];
}
$setarr['body_data'] = array('url' => $url, 'subject' => $value['subject'], 'option' => $optionstr);
$setarr['body_general'] = $value['percredit'] ? cplang('reward_info', array($value['percredit'])) : '';
}
break;
case 'eventid':
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('event') . " WHERE eventid='{$id}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
//
$setarr['icon'] = 'event';
$setarr['id'] = $value['eventid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['hot'] = $value['hot'];
//ϸ
$url = "space.php?do=event&id={$value['eventid']}";
$setarr['title_template'] = cplang('event_add');
$setarr['body_template'] = cplang('event_feed_info');
$setarr['body_data'] = array('title' => "<a href=\"{$url}\">{$value['title']}</a>", 'country' => $value['country'], 'province' => $value['province'], 'city' => $value['city'], 'location' => $value['location'], 'starttime' => sgmdate('m-d H:i', $value['starttime']), 'endtime' => sgmdate('m-d H:i', $value['endtime']));
//
if ($value['poster']) {
$setarr['image_1'] = pic_get($value['poster'], $value['thumb'], $value['remote']);
$setarr['image_1_link'] = $url;
}
}
break;
case 'sid':
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('share') . " WHERE sid='{$id}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
//
$setarr['icon'] = 'share';
$setarr['id'] = $value['sid'];
$setarr['idtype'] = $idtype;
$setarr['uid'] = $value['uid'];
$setarr['username'] = $value['username'];
$setarr['dateline'] = $value['dateline'];
$setarr['hot'] = $value['hot'];
//ϸ
$url = "space.php?uid={$value['uid']}&do=share&id={$value['sid']}";
$setarr['title_template'] = '{actor} ' . $value['title_template'];
$setarr['body_template'] = $value['body_template'];
$setarr['body_data'] = $value['body_data'];
$setarr['body_general'] = $value['body_general'];
$setarr['image_1'] = $value['image'];
$setarr['image_1_link'] = $value['image_link'];
}
break;
}
if ($setarr['icon']) {
$setarr['appid'] = UC_APPID;
//ݴ
$setarr['title_data'] = serialize($setarr['title_data']);
// groups ת
if ($idtype != 'sid') {
$setarr['body_data'] = serialize($setarr['body_data']);
// groups ת
}
$setarr['hash_template'] = md5($setarr['title_template'] . "\t" . $setarr['body_template']);
//ϲhash
$setarr['hash_data'] = md5($setarr['title_template'] . "\t" . $setarr['title_data'] . "\t" . $setarr['body_template'] . "\t" . $setarr['body_data']);
//ϲhash
$setarr = saddslashes($setarr);
$feedid = 0;
if (!$add && $setarr['id']) {
$query = $_SGLOBAL['db']->query("SELECT feedid FROM " . tname('feed') . " WHERE id='{$id}' AND idtype='{$idtype}'");
$feedid = $_SGLOBAL['db']->result($query, 0);
}
if ($feedid) {
updatetable('feed', $setarr, array('feedid' => $feedid));
} else {
inserttable('feed', $setarr);
}
}
}
示例15: array
$failingmail = array();
foreach ($mails as $key => $value) {
$value = trim($value);
if (empty($value) || !isemail($value)) {
$failingmail[] = $value;
continue;
}
if ($reward['credit']) {
//计算积分扣减积分
$credit = intval($reward['credit']) * ($invitenum + 1);
if (!isemail($value) || $reward['credit'] && $credit > $space['credit']) {
$failingmail[] = $value;
continue;
}
$code = strtolower(random(6));
$setarr = array('uid' => $_SGLOBAL['supe_uid'], 'code' => $code, 'email' => saddslashes($value), 'type' => 1);
$id = inserttable('invite', $setarr, 1);
if ($id) {
$mailvar[4] = "{$siteurl}invite.php?{$id}{$code}{$inviteapp}";
// $mailvar[4] = "http://openid.enjoyoung.cn/account/new?{$id}{$code}{$inviteapp}&renturn_to=uchome";
createmail($value, $mailvar);
$invitenum++;
} else {
$failingmail[] = $value;
}
} else {
$mailvar[4] = "{$siteurl}invite.php?u={$space['uid']}&c={$invite_code}{$inviteapp}";
// $mailvar[4] = "http://openid.enjoyoung.cn/account/new?u=$space[uid]&c=$invite_code{$inviteapp}&renturn_to=uchome";
if ($appid) {
$mailvar[6] = $appinfo['appname'];
}