本文整理汇总了PHP中censor函数的典型用法代码示例。如果您正苦于以下问题:PHP censor函数的具体用法?PHP censor怎么用?PHP censor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了censor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _userReportType
private function _userReportType($res, $rtype, $rid, $message)
{
global $_G;
if ($rtype == 'post') {
$tid = UserReport::getTidByPid($rid);
}
$fid = intval($_GET['fid']);
$uid = intval($_GET['uid']);
$message = WebUtils::t(rawurldecode($message));
$default_url = array('user' => 'home.php?mod=space&uid=', 'post' => 'forum.php?mod=redirect&goto=findpost&ptid=' . $tid . '&pid=', 'thread' => 'forum.php?mod=viewthread&tid=', 'group' => 'forum.php?mod=group&fid=', 'album' => 'home.php?mod=space&do=album&uid=' . $uid . '&id=', 'blog' => 'home.php?mod=space&do=blog&uid=' . $uid . '&id=', 'pic' => 'home.php?mod=space&do=album&uid=' . $uid . '&picid=');
$url = '';
if ($rid && !empty($default_url[$rtype])) {
$url = $default_url[$rtype] . intval($rid);
} else {
$url = addslashes(dhtmlspecialchars(base64_decode($_GET['url'])));
$url = preg_match("/^http[s]?:\\/\\/[^\\[\"']+\$/i", trim($url)) ? trim($url) : '';
}
if (empty($url)) {
$res = $this->makeErrorInfo($res, 'report_parameters_invalid');
} else {
$urlkey = md5($url);
$message = censor(cutstr(dhtmlspecialchars(trim($message)), 200, ''));
$message = $_G['username'] . ' : ' . rtrim($message, "\\");
if ($reportid = C::t('common_report')->fetch_by_urlkey($urlkey)) {
C::t('common_report')->update_num($reportid, $message);
} else {
$data = array('url' => $url, 'urlkey' => $urlkey, 'uid' => $_G['uid'], 'username' => $_G['username'], 'message' => $message, 'dateline' => TIMESTAMP);
if ($fid) {
$data['fid'] = $fid;
}
C::t('common_report')->insert($data);
$report_receive = unserialize($_G['setting']['report_receive']);
$moderators = array();
if ($report_receive['adminuser']) {
foreach ($report_receive['adminuser'] as $touid) {
notification_add($touid, 'report', 'new_report', array('from_id' => 1, 'from_idtype' => 'newreport'), 1);
}
}
if ($fid && $rtype == 'post') {
foreach (C::t('forum_moderator')->fetch_all_by_fid($fid, false) as $row) {
$moderators[] = $row['uid'];
}
if ($report_receive['supmoderator']) {
$moderators = array_unique(array_merge($moderators, $report_receive['supmoderator']));
}
foreach ($moderators as $touid) {
$touid != $_G['uid'] && !in_array($touid, $report_receive) && notification_add($touid, 'report', 'new_post_report', array('fid' => $fid, 'from_id' => 1, 'from_idtype' => 'newreport'), 1);
}
}
}
$params['noError'] = 1;
$res = $this->makeErrorInfo($res, 'report_succeed', $params);
}
return $res;
}
示例2: music_upload
function music_upload($file_name, &$space_left)
{
global $database, $url, $user;
// SET KEY VARIABLES
$file_maxsize = $user->level_info['level_music_maxsize'];
$file_exts = explode(",", str_replace(" ", "", strtolower($user->level_info['level_music_exts'])));
$file_types = explode(",", str_replace(" ", "", strtolower($user->level_info['level_music_mimes'])));
$new_music = new se_upload();
$new_music->new_upload($file_name, $file_maxsize, $file_exts, $file_types);
// CHECK SPACE LEFT
if ($new_music->file_size > $space_left) {
$new_music->is_error = 4000087;
} else {
$space_left = $space_left - $file_filesize;
}
if (!$new_music->is_error) {
// GENERATE TITLE
$myId3 = new ID3($file_dest);
if ($myId3->getInfo()) {
$id3_artist = trim($myId3->getArtist());
$id3_title = trim($myId3->getTitle());
if ($id3_artist && $id3_title) {
$music_title = $id3_artist . ' - ' . $id3_title;
}
}
if (!trim($music_title)) {
$music_title = $new_music->file_name;
}
$music_title = security(censor($music_title));
// INSERT ROW INTO MUSIC TABLE
$time = time();
$track_num = $database->database_fetch_array($database->database_query("SELECT music_track_num as track FROM se_music WHERE music_user_id = '{$this->user_id}' ORDER BY music_track_num DESC LIMIT 1"));
$track_num = $track_num['track'] + 1;
$database->database_query("\r\n INSERT INTO se_music\r\n (\r\n music_user_id,\r\n music_track_num,\r\n music_date,\r\n music_title,\r\n music_ext,\r\n music_filesize\r\n )\r\n VALUES\r\n (\r\n '{$this->user_id}',\r\n '{$track_num}',\r\n '{$time}',\r\n '{$music_title}',\r\n '{$new_music->file_ext}',\r\n '{$new_music->file_size}'\r\n )\r\n ");
$music_id = $database->database_insert_id();
// MOVE UPLOADED FILE
$file_dest = $url->url_userdir($user->user_info[user_id]) . $music_id . "." . $new_music->file_ext;
$new_music->upload_file($file_dest);
}
// RETURN AND DELETE FROM DATABASE IF ERROR
if ($new_music->is_error) {
if ($music_id) {
$database->database_query("DELETE FROM se_music WHERE music_id='{$music_id}' && music_user_id='{$this->user_id}'");
}
if ($file_dest) {
@unlink($file_dest);
}
return array('is_error' => $new_music->is_error);
}
// RETURN FILE STATS
return array('music_id' => $music_id, 'music_ext' => $new_music->file_ext, 'music_filesize' => $new_music->file_size, 'music_title' => $music_title);
}
示例3: mobcent_threadsort_validator
function mobcent_threadsort_validator($sortoption, $pid)
{
global $_G, $var;
$postaction = $_G['tid'] && $pid ? "edit&tid={$_G['tid']}&pid={$pid}" : 'newthread';
$_G['forum_optiondata'] = array();
foreach ($_G['forum_checkoption'] as $var => $option) {
if ($_G['forum_checkoption'][$var]['required'] && ($sortoption[$var] === '' && $_G['forum_checkoption'][$var]['type'] != 'number')) {
return array('message' => 'threadtype_required_invalid', 'params' => array('{typetitle}' => $_G['forum_checkoption'][$var]['title']));
//showmessage('threadtype_required_invalid', "forum.php?mod=post&action=$postaction&fid=$_G[fid]&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title']));
} elseif ($sortoption[$var] && ($_G['forum_checkoption'][$var]['type'] == 'number' && !is_numeric($sortoption[$var]) || $_G['forum_checkoption'][$var]['type'] == 'email' && !isemail($sortoption[$var]))) {
return array('message' => 'threadtype_required_invalid', 'params' => array('{typetitle}' => $_G['forum_checkoption'][$var]['title']));
//showmessage('threadtype_format_invalid', "forum.php?mod=post&action=$postaction&fid=$_G[fid]&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title']));
} elseif ($sortoption[$var] && $_G['forum_checkoption'][$var]['maxlength'] && strlen($sortoption[$var]) > $_G['forum_checkoption'][$var]['maxlength']) {
return array('message' => 'threadtype_toolong_invalid', 'params' => array('{typetitle}' => $_G['forum_checkoption'][$var]['title']));
// showmessage('threadtype_toolong_invalid', "forum.php?mod=post&action=$postaction&fid=$_G[fid]&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title']));
} elseif ($sortoption[$var] && ($_G['forum_checkoption'][$var]['maxnum'] && $sortoption[$var] > $_G['forum_checkoption'][$var]['maxnum'] || $_G['forum_checkoption'][$var]['minnum'] && $sortoption[$var] < $_G['forum_checkoption'][$var]['minnum'])) {
return array('message' => 'threadtype_num_invalid', 'params' => array('{typetitle}' => $_G['forum_checkoption'][$var]['title']));
// showmessage('threadtype_num_invalid', "forum.php?mod=post&action=$postaction&fid=$_G[fid]&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title']));
} elseif ($sortoption[$var] && $_G['forum_checkoption'][$var]['unchangeable'] && !($_G['tid'] && $pid)) {
return array('message' => 'threadtype_unchangeable_invalid', 'params' => array('{typetitle}' => $_G['forum_checkoption'][$var]['title']));
//showmessage('threadtype_unchangeable_invalid', "forum.php?mod=post&action=$postaction&fid=$_G[fid]&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title']));
} elseif ($sortoption[$var] && $_G['forum_checkoption'][$var]['type'] == 'select') {
if ($_G['forum_optionlist'][$_G['forum_checkoption'][$var]['optionid']]['choices'][$sortoption[$var]]['level'] != 1) {
//判断下拉选择项的必填项是否填写,如果为多级连动选择客户端会发不出去帖子,注释此行
//return array('message'=>'threadtype_select_invalid','params'=>array('{typetitle}' => $_G['forum_checkoption'][$var]['title']));
// showmessage('threadtype_select_invalid', "forum.php?mod=post&action=$postaction&fid=$_G[fid]&sortid=".$_G['forum_selectsortid'], array('typetitle' => $_G['forum_checkoption'][$var]['title']));
}
}
if ($_G['forum_checkoption'][$var]['type'] == 'checkbox') {
$sortoption[$var] = $sortoption[$var] ? implode("\t", $sortoption[$var]) : '';
} elseif ($_G['forum_checkoption'][$var]['type'] == 'url') {
$sortoption[$var] = $sortoption[$var] ? substr(strtolower($sortoption[$var]), 0, 4) == 'www.' ? 'http://' . $sortoption[$var] : $sortoption[$var] : '';
}
if ($_G['forum_checkoption'][$var]['type'] == 'image') {
if ($sortoption[$var]['aid']) {
$_GET['attachnew'][$sortoption[$var]['aid']] = $sortoption[$var];
}
$sortoption[$var] = serialize($sortoption[$var]);
} elseif ($_G['forum_checkoption'][$var]['type'] == 'select') {
$sortoption[$var] = censor(trim($sortoption[$var]));
} else {
$sortoption[$var] = dhtmlspecialchars(censor(trim($sortoption[$var])));
}
$_G['forum_optiondata'][$_G['forum_checkoption'][$var]['optionid']] = $sortoption[$var];
}
return $_G['forum_optiondata'];
}
示例4: add_tag
public function add_tag($tags, $itemid, $idtype = 'tid', $returnarray = 0)
{
if ($tags == '' || !in_array($idtype, array('', 'tid', 'blogid', 'uid'))) {
return;
}
$tags = str_replace(array(chr(0xa3) . chr(0xac), chr(0xa1) . chr(0x41), chr(0xef) . chr(0xbc) . chr(0x8c)), ',', censor($tags));
if (strexists($tags, ',')) {
$tagarray = array_unique(explode(',', $tags));
} else {
$langcore = lang('core');
$tags = str_replace($langcore['fullblankspace'], ' ', $tags);
$tagarray = array_unique(explode(' ', $tags));
}
$tagcount = 0;
foreach ($tagarray as $tagname) {
$tagname = trim($tagname);
if (preg_match('/^([\\x7f-\\xff_-]|\\w|\\s){3,20}$/', $tagname)) {
$status = $idtype != 'uid' ? 0 : 3;
$result = C::t('common_tag')->get_bytagname($tagname, $idtype);
if ($result['tagid']) {
if ($result['status'] == $status) {
$tagid = $result['tagid'];
}
} else {
$tagid = C::t('common_tag')->insert($tagname, $status);
}
if ($tagid) {
if ($itemid) {
C::t('common_tagitem')->replace($tagid, $itemid, $idtype);
}
$tagcount++;
if (!$returnarray) {
$return .= $tagid . ',' . $tagname . "\t";
} else {
$return[$tagid] = $tagname;
}
}
if ($tagcount > 4) {
unset($tagarray);
break;
}
}
}
return $return;
}
示例5: elseif
$database->database_query("DELETE FROM se_notifys WHERE notify_user_id='{$user->user_info['user_id']}' AND notify_notifytype_id='1' AND notify_object_id='{$owner->user_info['user_id']}'");
$status = "remove";
$result = 914;
} elseif ($task == "cancel_do") {
$user->user_friend_remove($owner->user_info['user_id']);
$database->database_query("DELETE FROM se_notifys WHERE notify_user_id='{$owner->user_info['user_id']}' AND notify_notifytype_id='1' AND notify_object_id='{$user->user_info['user_id']}'");
$status = "remove";
$result = 920;
} elseif ($task == "remove_do") {
$user->user_friend_remove($owner->user_info['user_id']);
$status = "add";
$result = 890;
} elseif ($task == "add_do") {
$friend_type = $_POST['friend_type'];
$friend_type_other = censor($_POST['friend_type_other']);
$friend_explain = censor($_POST['friend_explain']);
if (count($connection_types) == 0) {
$friend_type = "";
}
if ($setting['setting_connection_other'] == 0) {
$friend_type_other = "";
}
if ($setting['setting_connection_explain'] == 0) {
$friend_explain = "";
}
if ($friend_type == "other_friendtype") {
$friend_type = "";
}
if (trim($friend_type_other) != "") {
$friend_type = $friend_type_other;
}
示例6: libfile
require_once libfile('function/spacecp');
if (!$_G['collection']['ctid']) {
showmessage('collection_permission_deny');
}
$waittime = interval_check('post');
if ($waittime > 0) {
showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true));
}
$memberrate = C::t('forum_collectioncomment')->fetch_rate_by_ctid_uid($_G['collection']['ctid'], $_G['uid']);
if (!trim($_GET['message']) && (!$memberrate && !$_GET['ratescore'] || $memberrate)) {
showmessage('collection_edit_checkentire');
}
if ($_G['setting']['maxpostsize'] && strlen($_GET['message']) > $_G['setting']['maxpostsize']) {
showmessage('post_message_toolong', '', array('maxpostsize' => $_G['setting']['maxpostsize']));
}
$newcomment = array('ctid' => $_G['collection']['ctid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'message' => censor($_GET['message']), 'dateline' => $_G['timestamp'], 'useip' => $_G['clientip']);
if (!$memberrate) {
$newcomment['rate'] = $_GET['ratescore'];
} else {
$_GET['ratescore'] = 0;
}
C::t('forum_collectioncomment')->insert($newcomment);
C::t('forum_collection')->update_by_ctid($_G['collection']['ctid'], 0, 0, 1, 0, $_GET['ratescore'], $_G['collection']['ratenum']);
if ($_G['collection']['uid'] != $_G['uid']) {
notification_add($_G['collection']['uid'], "system", 'collection_becommented', array('from_id' => $_G['collection']['ctid'], 'from_idtype' => 'collectioncomment', 'ctid' => $_G['collection']['ctid'], 'collectionname' => $_G['collection']['name']), 1);
}
C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED');
showmessage('collection_comment_succ', $tid ? 'forum.php?mod=viewthread&tid=' . $tid : dreferer());
} elseif ($op == 'del') {
if (!submitcheck('formhash')) {
showmessage('undefined_action', NULL);
示例7: die
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**************************************************************************/
if (!defined('SCOUT_NUKE')) {
die("You have accessed this page illegally, please go use the main menu");
}
$level = $check['level'];
$frontsql = $data->select_query("frontpage", "ORDER BY pos ASC");
$content = "";
while ($item = $data->fetch_array($frontsql)) {
if ($item['type'] == 0) {
if (get_auth($item['item'], 1) == 1) {
$pagesql = $data->select_query("static_content", "WHERE id = '{$item['item']}' AND trash=0");
$stuff = $data->fetch_array($pagesql);
$content .= "<div class=\"frontpage\">" . censor($stuff['content']) . "</div>";
}
} elseif ($item['type'] == 1) {
$funsql = $data->select_query("functions", "where id = '{$item['item']}'");
$stuff = $data->fetch_array($funsql);
if (get_auth($stuff['code'], 0) == 1) {
if (file_exists($stuff['code'] . $phpex)) {
include $stuff['code'] . $phpex;
}
if ($dbpage == true && isset($pagename) && $pagename != "" && $pagename != "frontpage") {
$content .= "<div class=\"frontpage\">" . get_temp($pagename, $pagenum) . "</div>";
}
}
}
$content .= "<br />";
}
示例8: showmessage
showmessage('operating_too_fast', '', 1, array($waittime));
}
cknewuser();
if ($touid) {
if (isblacklist($touid)) {
showmessage('is_blacklist');
}
}
if (submitcheck('pmsubmit')) {
checklowerlimit('sendpm');
$username = empty($_POST['username']) ? '' : $_POST['username'];
$message = (!empty($_POST['messageappend']) ? $_POST['messageappend'] . "\n" : '') . trim($_POST['message']);
if (empty($message)) {
showmessage('unable_to_send_air_news');
}
$message = censor($message);
loadcache(array('smilies', 'smileytypes'));
foreach ($_G['cache']['smilies']['replacearray'] as $key => $smiley) {
$_G['cache']['smilies']['replacearray'][$key] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$key]]['directory'] . '/' . $smiley . '[/img]';
}
$message = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], $message);
$subject = '';
$return = 0;
if ($touid) {
$return = uc_pm_send($_G['uid'], $touid, $subject, $message, 1, $pmid, 0);
} elseif ($username) {
$newusers = array();
$users = daddslashes(explode(',', dstripslashes($username)));
if ($users) {
$query = DB::query('SELECT uid, username FROM ' . DB::table('common_member') . " WHERE username IN (" . dimplode($users) . ')');
while ($value = DB::fetch($query)) {
示例9: cpmsg
cpmsg('members_email_illegal', '', 'error');
} elseif ($ucresult == -5) {
cpmsg('members_email_domain_illegal', '', 'error');
} elseif ($ucresult == -6) {
cpmsg('members_email_duplicate', '', 'error');
}
}
if ($_GET['clearavatar']) {
C::t('common_member' . $tableext)->update($_GET['uid'], array('avatarstatus' => 0));
uc_user_deleteavatar($uid);
}
$creditsnew = intval($creditsnew);
$regdatenew = strtotime($_GET['regdatenew']);
$lastvisitnew = strtotime($_GET['lastvisitnew']);
$secquesadd = $_GET['clearquestion'] ? ", secques=''" : '';
$signaturenew = censor($_GET['signaturenew']);
$sigstatusnew = $signaturenew ? 1 : 0;
$sightmlnew = discuzcode($signaturenew, 1, 0, 0, 0, $member['allowsigbbcode'] ? $member['allowcusbbcode'] ? 2 : 1 : 0, $member['allowsigimgcode'], 0);
$oltimenew = round($_GET['totalnew'] / 60);
$fieldadd = '';
$fieldarr = array();
include_once libfile('function/profile');
foreach ($_POST as $field_key => $field_val) {
if (isset($fields[$field_key]) && (profile_check($field_key, $field_val) || $_G['adminid'] == 1)) {
$fieldarr[$field_key] = $field_val;
}
}
if ($_GET['deletefile'] && is_array($_GET['deletefile'])) {
foreach ($_GET['deletefile'] as $key => $value) {
if (isset($fields[$key]) && $_G['cache']['profilesetting'][$key]['formtype'] == 'file') {
@unlink(getglobal('setting/attachdir') . './profile/' . $member[$key]);
示例10: dhtmlspecialchars
$taobaonew = dhtmlspecialchars($taobaonew);
$alipaynew = dhtmlspecialchars($alipaynew);
$nicknamenew = $allownickname ? cutstr(censor(dhtmlspecialchars($nicknamenew)), 30) : '';
$cstatusadd = $allowcstatus ? ', customstatus=\'' . cutstr(censor(dhtmlspecialchars($cstatusnew)), 30) . '\'' : '';
$gendernew = empty($gendernew) ? 0 : intval($gendernew);
$locationnew = cutstr(censor(dhtmlspecialchars($locationnew)), 30);
if ($maxsigsize) {
if (strlen($signaturenew) > $maxsigsize) {
showmessage('profile_sig_toolong');
}
} else {
$signaturenew = '';
}
$signaturenew = censor($signaturenew);
$sigstatusnew = $signaturenew ? 1 : 0;
$bionew = censor(dhtmlspecialchars($bionew));
$sightmlnew = discuzcode(stripslashes($signaturenew), 1, 0, 0, 0, $allowsigbbcode, $allowsigimgcode, 0, 0, 1);
$biohtmlnew = discuzcode(stripslashes($bionew), 1, 0, 0, 0, $allowbiobbcode, $allowbioimgcode, 0, 0, 1);
if ($member['msn'][1]) {
if (strpos(strtolower($sightmlnew), '[imme]') !== FALSE) {
$sightmlnew = str_replace('[imme]', "<imme><a target='_blank' href='http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=" . $member['msn'][1] . "@apps.messenger.live.com&mkt=zh-cn' title='MSN'><img style='vertical-align:middle' src='http://messenger.services.live.com/users/" . $member['msn'][1] . "@apps.messenger.live.com/presenceimage?mkt=zh-cn' width='16' height='16' /></a></imme>", $sightmlnew);
}
if (strpos(strtolower($biohtmlnew), '[imme]') !== FALSE) {
$biohtmlnew = str_replace('[imme]', "<imme><a target='_blank' href='http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=" . $member['msn'][1] . "@apps.messenger.live.com&mkt=zh-cn' title='MSN'><img style='vertical-align:middle' src='http://messenger.services.live.com/users/" . $member['msn'][1] . "@apps.messenger.live.com/presenceimage?mkt=zh-cn' width='16' height='16' /></a></imme>", $biohtmlnew);
}
}
$sightmlnew = addslashes($sightmlnew);
$biohtmlnew = addslashes($biohtmlnew);
$membersql = "gender='{$gendernew}', bday='{$bdaynew}', sigstatus='{$sigstatusnew}'";
$memberfieldsql = "nickname='{$nicknamenew}', site='{$sitenew}', location='{$locationnew}', icq='{$icqnew}', qq='{$qqnew}', yahoo='{$yahoonew}', msn='{$msnnew}', taobao='{$taobaonew}', alipay='{$alipaynew}', bio='{$biohtmlnew}', sightml='{$sightmlnew}' {$cstatusadd}";
if ($_DCACHE['fields_required'] || $_DCACHE['fields_optional']) {
示例11: intval
C::t('forum_post')->increase_rate_by_pid('tid:' . $_G['tid'], $_GET['pid'], $rate, $ratetimes);
if ($post['first']) {
$threadrate = intval(@($post['rate'] + $rate) / abs($post['rate'] + $rate));
C::t('forum_thread')->update($_G['tid'], array('rate' => $threadrate));
}
require_once libfile('function/discuzcode');
$sqlvalues = $comma = '';
$sqlreason = censor(trim($_GET['reason']));
$sqlreason = cutstr(dhtmlspecialchars($sqlreason), 40, '.');
foreach ($creditsarray as $id => $addcredits) {
$insertarr = array('pid' => $_GET['pid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'extcredits' => $id, 'dateline' => $_G['timestamp'], 'score' => $addcredits, 'reason' => $sqlreason);
C::t('forum_ratelog')->insert($insertarr);
}
include_once libfile('function/post');
$_G['forum']['threadcaches'] && @deletethreadcaches($_G['tid']);
$reason = dhtmlspecialchars(censor(trim($reason)));
if ($sendreasonpm) {
$ratescore = $slash = '';
foreach ($creditsarray as $id => $addcredits) {
$ratescore .= $slash . $_G['setting']['extcredits'][$id]['title'] . ' ' . ($addcredits > 0 ? '+' . $addcredits : $addcredits) . ' ' . $_G['setting']['extcredits'][$id]['unit'];
$slash = ' / ';
}
sendreasonpm($post, 'rate_reason', array('tid' => $thread['tid'], 'pid' => $_GET['pid'], 'subject' => $thread['subject'], 'ratescore' => $ratescore, 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'rate'));
}
$logs = array();
foreach ($creditsarray as $id => $addcredits) {
$logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['adminid']}\t{$post['author']}\t{$id}\t{$addcredits}\t{$_G['tid']}\t{$thread['subject']}\t{$reason}");
}
update_threadpartake($post['tid']);
C::t('forum_postcache')->delete($_GET['pid']);
writelog('ratelog', $logs);
示例12: before_editpost
public function before_editpost($parameters)
{
global $_G;
$sortid = $parameters['sortid'];
$isfirstpost = $this->post['first'] ? 1 : 0;
if ($isfirstpost) {
$parameters['typeid'] = isset($this->forum['threadtypes']['types'][$parameters['typeid']]) ? $parameters['typeid'] : 0;
if (!$this->forum['ismoderator'] && !empty($this->forum['threadtypes']['moderators'][$this->thread['typeid']])) {
$parameters['typeid'] = $this->thread['typeid'];
}
$parameters['sortid'] = isset($this->forum['threadsorts']['types'][$parameters['sortid']]) ? $parameters['sortid'] : 0;
$typeexpiration = intval($_GET['typeexpiration']);
if (!$parameters['typeid'] && $this->forum['threadtypes']['required'] && !$this->thread['special']) {
showmessage('post_type_isnull');
}
if ($this->forum['threadsorts']['types'][$sortid] && $_G['forum_checkoption']) {
$_G['forum_optiondata'] = threadsort_validator($_GET['typeoption'], $this->post['pid']);
}
$this->param['threadimageaid'] = 0;
$this->param['threadimage'] = array();
if ($this->forum['threadsorts']['types'][$parameters['sortid']] && $_G['forum_optiondata'] && is_array($_G['forum_optiondata'])) {
$sql = $separator = $filedname = $valuelist = '';
foreach ($_G['forum_optiondata'] as $optionid => $value) {
$value = censor(daddslashes($value));
if ($_G['forum_optionlist'][$optionid]['type'] == 'image') {
$identifier = $_G['forum_optionlist'][$optionid]['identifier'];
$newsortaid = intval($_GET['typeoption'][$identifier]['aid']);
if ($newsortaid && $_GET['oldsortaid'][$identifier] && $newsortaid != $_GET['oldsortaid'][$identifier]) {
$attach = C::t('forum_attachment_n')->fetch('tid:' . $this->thread['tid'], $_GET['oldsortaid'][$identifier]);
C::t('forum_attachment')->delete($_GET['oldsortaid'][$identifier]);
C::t('forum_attachment_n')->delete('tid:' . $this->thread['tid'], $_GET['oldsortaid'][$identifier]);
dunlink($attach);
$this->param['threadimageaid'] = $newsortaid;
convertunusedattach($newsortaid, $this->thread['tid'], $this->post['pid']);
}
} else {
if ($_G['forum_optionlist'][$optionid]['type'] == 'face') {
$identifier = $_G['forum_optionlist'][$optionid]['identifier'];
$newsortaid = intval($_GET['typeoption'][$identifier]['aid']);
if ($newsortaid && $_GET['oldsortaid'][$identifier] && $newsortaid != $_GET['oldsortaid'][$identifier]) {
$attach = C::t('forum_attachment_n')->fetch('tid:' . $this->thread['tid'], $_GET['oldsortaid'][$identifier]);
C::t('forum_attachment')->delete($_GET['oldsortaid'][$identifier]);
C::t('forum_attachment_n')->delete('tid:' . $this->thread['tid'], $_GET['oldsortaid'][$identifier]);
dunlink($attach);
$this->param['threadimageaid'] = $newsortaid;
convertunusedattach($newsortaid, $this->thread['tid'], $this->post['pid']);
}
}
}
if ($_G['forum_optionlist'][$optionid]['unchangeable']) {
continue;
}
if (($_G['forum_optionlist'][$optionid]['search'] || in_array($_G['forum_optionlist'][$optionid]['type'], array('radio', 'select', 'number'))) && $value) {
$filedname .= $separator . $_G['forum_optionlist'][$optionid]['identifier'];
$valuelist .= $separator . "'{$value}'";
$sql .= $separator . $_G['forum_optionlist'][$optionid]['identifier'] . "='{$value}'";
$separator = ' ,';
}
C::t('forum_typeoptionvar')->update_by_tid($this->thread['tid'], array('value' => $value, 'sortid' => $parameters['sortid']), false, false, $optionid);
}
if ($typeexpiration) {
C::t('forum_typeoptionvar')->update_by_tid($this->thread['tid'], array('expiration' => TIMESTAMP + $typeexpiration), false, false, null, $parameters['sortid']);
}
if ($sql || $filedname && $valuelist) {
if (C::t('forum_optionvalue')->fetch_all_tid($parameters['sortid'], "WHERE tid='" . $this->thread['tid'] . "'")) {
if ($sql) {
C::t('forum_optionvalue')->update($parameters['sortid'], $this->thread['tid'], $this->forum['fid'], $sql);
}
} elseif ($filedname && $valuelist) {
C::t('forum_optionvalue')->insert($parameters['sortid'], "({$filedname}, tid, fid) VALUES ({$valuelist}, '" . $this->thread['tid'] . "', '" . $this->forum['fid'] . "')");
}
}
}
}
}
示例13: random
}
if ($groupbanner) {
$groupbanner = '<input type="checkbox" class="checkbox" name="deletebanner" value="yes" /> ' . $lang['delete'] . '<br /><img src="' . $groupbanner . '?' . random(6) . '" />';
}
showsetting('groups_editgroup_icon', 'iconnew', '', 'file', '', 0, $groupicon);
showsetting('groups_editgroup_banner', 'bannernew', '', 'file', '', 0, $groupbanner);
showsubmit('editsubmit');
showtablefooter();
showformfooter();
} else {
$_GET['jointypenew'] = intval($_GET['jointypenew']);
$_GET['fupnew'] = intval($_GET['fupnew']);
$_GET['gviewpermnew'] = intval($_GET['gviewpermnew']);
require_once libfile('function/discuzcode');
$_GET['descriptionnew'] = discuzcode(dhtmlspecialchars(censor(trim($_GET['descriptionnew']))), 0, 0, 0, 0, 1, 1, 0, 0, 1);
$_GET['namenew'] = dhtmlspecialchars(censor(trim($_GET['namenew'])));
$icondata = array();
$iconnew = upload_icon_banner($group, $_FILES['iconnew'], 'icon');
$bannernew = upload_icon_banner($group, $_FILES['bannernew'], 'banner');
if ($iconnew) {
$icondata['icon'] = $iconnew;
}
if ($bannernew) {
$icondata['banner'] = $bannernew;
}
if ($_GET['deleteicon']) {
@unlink($_G['setting']['attachurl'] . 'group/' . $group['icon']);
$icondata['icon'] = '';
}
if ($_GET['deletebanner']) {
@unlink($_G['setting']['attachurl'] . 'group/' . $group['banner']);
示例14: array
C::t('home_feed')->update($picid, array('hot' => $_POST['hot']), 'picid');
}
showmessage('do_success', dreferer());
}
} elseif ($_GET['op'] == 'saveforumphoto') {
if (submitcheck('savephotosubmit')) {
$aid = intval($_GET['aid']);
$albumid = intval($_POST['albumid']);
if (!$aid) {
showmessage('parameters_error');
}
$attach = C::t('forum_attachment_n')->fetch('aid:' . $aid, $aid);
if (empty($attach) || $attach['uid'] != $_G['uid'] || !$attach['isimage']) {
showmessage('parameters_error');
}
if ($albumid) {
$album = C::t('home_album')->fetch($albumid, $_G['uid']);
if (empty($album)) {
showmessage('album_does_not_exist');
}
} else {
$album = array('albumid' => 0);
}
$picdata = array('albumid' => $album['albumid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $attach['dateline'], 'postip' => $_G['clientip'], 'port' => $_G['remoteport'], 'filename' => censor($attach['filename']), 'title' => censor(cutstr(dhtmlspecialchars($attach['description']), 100)), 'type' => fileext($attach['attachment']), 'size' => $attach['filesize'], 'filepath' => $attach['attachment'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote'] + 2);
$picid = C::t('home_pic')->insert($picdata, 1);
showmessage('do_success', dreferer(), array('picid' => $picid), array('showdialog' => true, 'showmsg' => true, 'closetime' => true));
} else {
$albumlist = C::t('home_album')->fetch_all_by_uid($_G['uid'], 'updatetime');
}
}
include_once template("home/spacecp_album");
示例15: getblockhtml
//.........这里部分代码省略.........
$op .= lang('space', 'wall_edit', array('cid' => $value['cid']));
}
if ($value['authorid'] == $_G['uid'] || $space['self'] || checkperm('managecomment')) {
$op .= lang('space', 'wall_del', array('cid' => $value['cid']));
}
if ($value['authorid'] != $_G['uid'] && ($value['idtype'] != 'uid' || $space['self'])) {
$op .= lang('space', 'wall_reply', array('cid' => $value['cid']));
}
$moderate_need = $value['status'] == 1 ? lang('template', 'moderate_need') : '';
$date = dgmdate($value['dateline'], 'u');
$replacearr = array('author' => $author, 'author_avatar' => $author_avatar, 'moderated' => $moderate_need, 'cid' => $value['cid'], 'message' => $value['message'], 'date' => $date, 'op' => $op);
$html .= lang('space', 'wall_li', $replacearr);
}
if (!empty($walllist)) {
$html .= lang('space', 'wall_more', array('uid' => $uid));
}
$html .= '</div>';
$html = lang('space', 'wall_form', array('uid' => $uid, 'FORMHASH' => FORMHASH)) . '<hr class="da mtm m0">' . $html;
$titlemore = '<span class="y xw0"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'all') . '</a></span>';
break;
case 'group':
$do = $blockname;
$view = 'groupthread';
require_once libfile('function/group');
$grouplist = mygrouplist($uid, 'lastupdate', array('f.name', 'ff.icon'), $shownum);
if (empty($grouplist)) {
$grouplist = array();
}
foreach ($grouplist as $groupid => $group) {
$group['groupid'] = $groupid;
$html .= lang('space', 'group_li', $group);
}
$html = '<ul class="ml mls cl">' . $html . '</ul>';
break;
case 'music':
if (!empty($parameters['mp3list'])) {
$authcode = substr(md5($_G['authkey'] . $uid), 6, 16);
$view = $_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile'] ? '&view=admin' : '';
$querystring = urlencode("home.php?mod=space&uid={$uid}&do=index&op=getmusiclist&hash={$authcode}{$view}&t=" . TIMESTAMP);
$swfurl = STATICURL . 'image/common/mp3player.swf?config=' . $querystring;
if (empty($parameters['config']['height']) && $parameters['config']['height'] !== 0) {
$parameters['config']['height'] = '200px';
} else {
$parameters['config']['height'] .= 'px';
}
$html = "<script language=\"javascript\" type=\"text/javascript\">document.write(AC_FL_RunContent('id', 'mp3player', 'name', 'mp3player', 'devicefont', 'false', 'width', '100%', 'height', '" . $parameters['config']['height'] . "', 'src', '{$swfurl}', 'menu', 'false', 'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent'));</script>";
} else {
$html = lang('space', 'music_no_content');
}
$html = '<div class="ml mls cl">' . $html . '</div>';
break;
default:
if ($space['self']) {
$_G['space_group'] = $_G['group'];
} elseif (empty($_G['space_group'])) {
$_G['space_group'] = DB::fetch_first("SELECT * FROM " . DB::table('common_usergroup_field') . " WHERE groupid='{$space['groupid']}'");
}
require_once libfile('function/discuzcode');
if ($_G['space_group']['allowspacediyimgcode']) {
if (empty($_G['cache']['smilies']['loaded'])) {
loadcache(array('smilies', 'smileytypes'));
foreach ($_G['cache']['smilies']['replacearray'] as $skey => $smiley) {
$_G['cache']['smilies']['replacearray'][$skey] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'] . '/' . $smiley . '[/img]';
}
$_G['cache']['smilies']['loaded'] = 1;
}
$parameters['content'] = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], censor(trim($parameters['content'])));
}
if ($_G['space_group']['allowspacediybbcode'] || $_G['space_group']['allowspacediyimgcode'] || $_G['space_group']['allowspacediyhtml']) {
$parameters['content'] = discuzcode($parameters['content'], 1, 0, 1, 0, $_G['space_group']['allowspacediybbcode'], $_G['space_group']['allowspacediyimgcode'], $_G['space_group']['allowspacediyhtml']);
} else {
$parameters['content'] = dhtmlspecialchars($parameters['content']);
}
$parameters['content'] = nl2br($parameters['content']);
if (empty($parameters['content'])) {
$parameters['content'] = lang('space', $blockname);
}
$html .= $parameters['content'];
break;
}
if ($_G['setting']['allowviewuserthread'] === false && $blockname == 'thread') {
$html = '';
} else {
if (isset($parameters['title'])) {
if (empty($parameters['title'])) {
$title = '';
} else {
$view = $view === false ? '' : ($view == '' ? '&view=me' : '&view=' . $view);
$bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . '">' . stripslashes($parameters['title']) . '</a>' : stripslashes($parameters['title']);
$title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
}
} else {
$view = $view === false ? '' : ($view == '' ? '&view=me' : '&view=' . $view);
$bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . '">' . getblockdata($blockname) . '</a>' : getblockdata($blockname);
$title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
}
$html = $title . '<' . $contenttagname . ' id="' . $blockname . '_content" class="content' . $contentclassname . '">' . $html . '</' . $contenttagname . '>';
}
return $html;
}