本文整理汇总了PHP中updatemoderate函数的典型用法代码示例。如果您正苦于以下问题:PHP updatemoderate函数的具体用法?PHP updatemoderate怎么用?PHP updatemoderate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatemoderate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
<?php
/**
* DiscuzX Convert
*
* $Id: stamp.php 15786 2010-08-27 00:27:21Z monkey $
*/
$table_target = $db_target->tablepre . 'common_moderate';
$table_target_thread = $db_target->tablepre . 'forum_thread';
$table_target_post = $db_target->tablepre . 'forum_post';
$db_target->query("TRUNCATE {$table_target}");
$query = $db_target->query("SELECT tid FROM {$table_target_thread} WHERE displayorder='-2'");
while ($row = $db_target->fetch_array($query)) {
updatemoderate('tid', $row['tid']);
}
$query = $db_target->query("SELECT pid FROM {$table_target_post} WHERE invisible='-2' AND first='0'");
while ($row = $db_target->fetch_array($query)) {
updatemoderate('pid', $row['pid']);
}
function updatemoderate($idtype, $ids)
{
global $table_target, $db_target;
$ids = is_array($ids) ? $ids : array($ids);
if (!$ids) {
return;
}
$time = time();
foreach ($ids as $id) {
$db_target->query("INSERT INTO {$table_target} (id,idtype,status,dateline) VALUES ('{$id}','{$idtype}','0','{$time}')");
}
}
示例2: showsubmit
}
showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="mod_setbg_all(\'validate\')">' . cplang('moderate_all_validate') . '</a> <a href="#all" onclick="mod_setbg_all(\'delete\')">' . cplang('moderate_all_delete') . '</a> <a href="#all" onclick="mod_setbg_all(\'ignore\')">' . cplang('moderate_all_ignore') . '</a> <a href="#all" onclick="mod_cancel_all();">' . cplang('moderate_all_cancel') . '</a>', $multipage, false);
showtablefooter();
showformfooter();
} else {
$moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array());
$validates = $deletes = $ignores = 0;
if (is_array($moderate)) {
foreach ($moderate as $cid => $act) {
$moderation[$act][] = $cid;
}
}
if ($moderation['validate']) {
$validates = C::t('portal_comment')->update($moderation['validate'], array('status' => '0'));
updatemoderate($idtype . '_cid', $moderation['validate'], 2);
}
if ($moderation['delete']) {
$validates = C::t('portal_comment')->delete($moderation['delete']);
updatemoderate($idtype . '_cid', $moderation['delete'], 2);
}
if ($moderation['ignore']) {
$validates = C::t('portal_comment')->update($ignore_cids, array('status' => '2'));
updatemoderate($idtype . '_cid', $moderation['ignore'], 1);
}
if ($_GET['fast']) {
echo callback_js($_GET['cid']);
exit;
} else {
cpmsg('moderate_' . $operation . '_succeed', "action=moderate&operation={$operation}&page={$page}&filter={$filter}&dateline={$_GET['dateline']}&username={$_GET['username']}&keyword={$_GET['keyword']}&catid={$_GET['catid']}&tpp={$_GET['tpp']}&showcensor={$showcensor}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'deletes' => $deletes));
}
}
示例3: blog_post
//.........这里部分代码省略.........
unset($uploads[$urlmd5]);
}
}
}
foreach ($uploads as $value) {
$picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
$message .= "<div class=\"uchome-message-pic\"><img src=\"$picurl\"><p>$value[title]</p></div>";
}
}
$ckmessage = preg_replace("/(\<div\>|\<\/div\>|\s|\ \;|\<br\>|\<p\>|\<\/p\>)+/is", '', $message);
if(empty($ckmessage)) {
return false;
}
if(checkperm('manageblog')) {
$blogarr['hot'] = intval($POST['hot']);
}
if($olds['blogid']) {
if($blogarr['catid'] != $olds['catid']) {
if($olds['catid']) {
C::t('home_blog_category')->update_num_by_catid(-1, $olds['catid'], true, true);
}
if($blogarr['catid']) {
C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']);
}
}
$blogid = $olds['blogid'];
C::t('home_blog')->update($blogid, $blogarr);
$fuids = array();
$blogarr['uid'] = $olds['uid'];
$blogarr['username'] = $olds['username'];
} else {
if($blogarr['catid']) {
C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']);
}
$blogarr['uid'] = $_G['uid'];
$blogarr['username'] = $_G['username'];
$blogarr['dateline'] = empty($POST['dateline'])?$_G['timestamp']:$POST['dateline'];
$blogid = C::t('home_blog')->insert($blogarr, true);
C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']));
C::t('common_member_field_home')->update($_G['uid'], array('recentnote'=>$POST['subject']));
}
$blogarr['blogid'] = $blogid;
$class_tag = new tag();
$POST['tag'] = $olds ? $class_tag->update_field($POST['tag'], $blogid, 'blogid') : $class_tag->add_tag($POST['tag'], $blogid, 'blogid');
$fieldarr = array(
'message' => $message,
'postip' => $_G['clientip'],
'target_ids' => $POST['target_ids'],
'tag' => $POST['tag']
);
if(!empty($titlepic)) {
$fieldarr['pic'] = $titlepic;
}
if($olds) {
C::t('home_blogfield')->update($blogid, $fieldarr);
} else {
$fieldarr['blogid'] = $blogid;
$fieldarr['uid'] = $blogarr['uid'];
C::t('home_blogfield')->insert($fieldarr);
}
if($isself && !$olds && $blog_status == 0) {
updatecreditbyaction('publishblog', 0, array('blogs' => 1));
include_once libfile('function/stat');
updatestat('blog');
}
if($olds['blogid'] && $blog_status == 1) {
updatecreditbyaction('publishblog', 0, array('blogs' => -1), '', -1);
include_once libfile('function/stat');
updatestat('blog');
}
if($POST['makefeed'] && $blog_status == 0) {
include_once libfile('function/feed');
feed_publish($blogid, 'blogid', $olds?0:1);
}
if(!empty($__G)) $_G = $__G;
if($blog_status == 1) {
updatemoderate('blogid', $blogid);
manage_addnotify('verifyblog');
}
return $blogarr;
}
示例4: lang
$share['title_template'] = lang('spacecp', 'share_image');
break;
case 'article':
$feed_hash_data = 'articleid' . $share['itemid'];
$share['title_template'] = lang('spacecp', 'share_article');
break;
case 'link':
$feed_hash_data = '';
break;
}
feed_add('share', '{actor} ' . $share['title_template'], array('hash_data' => $feed_hash_data), $share['body_template'], dunserialize($share['body_data']), $share['body_general'], array($share['image']), array($share['image_link']), '', '', '', 0, 0, '', $share['uid'], $share['username']);
}
updatemoderate('sid', $moderation['validate'], 2);
}
if (!empty($moderation['delete'])) {
require libfile('function/delete');
$shares = deleteshares($moderation['delete']);
$deletes = count($shares);
updatemoderate('sid', $moderation['delete'], 2);
}
if ($ignore_sids = dimplode($moderation['ignore'])) {
$ignores = C::t('home_share')->update($moderation['ignore'], array('status' => 2));
updatemoderate('sid', $moderation['ignore'], 1);
}
if ($_GET['fast']) {
echo callback_js($_GET['sid']);
exit;
} else {
cpmsg('moderate_shares_succeed', "action=moderate&operation=shares&page={$page}&filter={$filter}&dateline={$_GET['dateline']}&username={$_GET['username']}&keyword={$_GET['keyword']}&tpp={$_GET['tpp']}&showcensor={$showcensor}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'deletes' => $deletes));
}
}
示例5: updatemoderate
if ($_G['forum_auditstatuson']) {
if ($audit == 1) {
updatemoderate($isfirstpost ? 'tid' : 'pid', $isfirstpost ? $_G['tid'] : $pid, '2');
showmessage('auditstatuson_succeed', $redirecturl, $param);
} else {
updatemoderate($isfirstpost ? 'tid' : 'pid', $isfirstpost ? $_G['tid'] : $pid);
showmessage('audit_edit_succeed', '', $param);
}
} else {
if (!empty($_G['gp_delete']) && $isfirstpost) {
my_thread_log('delete', array('tid' => $_G['tid']));
showmessage('post_edit_delete_succeed', "forum.php?mod=forumdisplay&fid={$_G['fid']}", $param);
} elseif (!empty($_G['gp_delete'])) {
my_post_log('delete', array('pid' => $pid));
showmessage('post_edit_delete_succeed', "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_G['gp_page']}&extra={$extra}" . ($vid && $isfirstpost ? "&vid={$vid}" : ''), $param);
} else {
if ($isfirstpost && $modnewthreads) {
updatemoderate('tid', $_G['tid']);
showmessage('edit_newthread_mod_succeed', $redirecturl, $param);
} elseif (!$isfirstpost && $modnewreplies) {
updatemoderate('pid', $pid);
showmessage('edit_reply_mod_succeed', "forum.php?mod=forumdisplay&fid={$_G['fid']}", $param);
} else {
if ($pinvisible != -3) {
my_post_log('update', array('pid' => $pid));
}
showmessage('post_edit_succeed', $redirecturl, $param);
}
}
}
}
示例6: addportalarticlecomment
function addportalarticlecomment($id, $message, $idtype = 'aid')
{
global $_G;
$id = intval($id);
if (empty($id)) {
return 'comment_comment_noexist';
}
$message = getstr($message, $_G['group']['allowcommentarticle'], 0, 0, 1, 0);
if (strlen($message) < 2) {
return 'content_is_too_short';
}
$idtype = in_array($idtype, array('aid', 'topicid')) ? $idtype : 'aid';
$tablename = $idtype == 'aid' ? 'portal_article_title' : 'portal_topic';
$data = C::t($tablename)->fetch($id);
if (empty($data)) {
return 'comment_comment_noexist';
}
if ($data['allowcomment'] != 1) {
return 'comment_comment_notallowed';
}
$message = censor($message);
if (censormod($message)) {
$comment_status = 1;
} else {
$comment_status = 0;
}
$setarr = array('uid' => $_G['uid'], 'username' => $_G['username'], 'id' => $id, 'idtype' => $idtype, 'postip' => $_G['clientip'], 'dateline' => $_G['timestamp'], 'status' => $comment_status, 'message' => $message);
$pcid = C::t('portal_comment')->insert($setarr, true);
if ($comment_status == 1) {
updatemoderate($idtype . '_cid', $pcid);
$notifykey = $idtype == 'aid' ? 'verifyacommont' : 'verifytopiccommont';
manage_addnotify($notifykey);
}
$tablename = $idtype == 'aid' ? 'portal_article_count' : 'portal_topic';
C::t($tablename)->increase($id, array('commentnum' => 1));
C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED');
if ($data['uid'] != $_G['uid']) {
updatecreditbyaction('portalcomment', 0, array(), $idtype . $id);
}
return 'do_success';
}
示例7: updatemoderate
$displayorder = '-1';
break;
}
}
}
if ($displayorder < 0) {
if ($displayorder == '-2' && $first == 0) {
if (DB::affected_rows(DB::query("UPDATE " . DB::table($posttable) . " SET invisible = '{$displayorder}' WHERE pid = {$pid} AND invisible >= 0")) > 0) {
$xver >= 2 && updatemoderate('pid', $pid);
$posts_mod++;
}
} else {
if (DB::affected_rows(DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder = '{$displayorder}' WHERE tid = {$tid} and displayorder >= 0")) > 0) {
if ($displayorder == '-2') {
$threads_mod++;
$xver >= 2 && updatemoderate('tid', $tid);
}
$displayorder == '-1' && $threads_banned++;
}
}
}
$subject = preg_replace($array_find, $array_replace, addslashes($subject));
$message = preg_replace($array_find, $array_replace, addslashes($message));
if ($subject != addslashes($row['subject']) || $message != addslashes($row['message'])) {
if (DB::query("UPDATE " . DB::table($posttable) . " SET subject = '{$subject}', message = '{$message}' WHERE pid = {$pid}")) {
$convertedrows++;
}
}
$converted = 1;
}
$sql2 = "SELECT tid,subject from " . DB::table('forum_thread') . " where tid >= {$start} and tid <= {$end} AND displayorder = 0 {$sqlplus}";
示例8: getstr
C::t('common_member_field_home')->update($_G['uid'], $setarr);
if ($_POST['to_signhtml'] && $_G['group']['maxsigsize']) {
if ($_G['group']['maxsigsize'] < 200) {
$signhtml = getstr($_POST['message'], $_G['group']['maxsigsize'], 0, 0, 1);
$signhtml = preg_replace("/\\<br.*?\\>/i", ' ', $signhtml);
} else {
$signhtml = $message;
}
C::t('common_member_field_forum')->update($_G['uid'], array('sightml' => $signhtml));
}
if (helper_access::check_module('feed') && ckprivacy('doing', 'feed') && $doing_status == '0') {
$feedarr = array('appid' => '', 'icon' => 'doing', 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $_G['timestamp'], 'title_template' => lang('feed', 'feed_doing_title'), 'title_data' => serialize(array('message' => $message)), 'body_template' => '', 'body_data' => '', 'id' => $newdoid, 'idtype' => 'doid');
C::t('home_feed')->insert($feedarr);
}
if ($doing_status == '1') {
updatemoderate('doid', $newdoid);
manage_addnotify('verifydoing');
}
require_once libfile('function/stat');
updatestat('doing');
C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED');
if (!empty($_GET['fromcard'])) {
showmessage($message . lang('spacecp', 'card_update_doing'));
} else {
showmessage('do_success', dreferer(), array('doid' => $newdoid), $_GET['spacenote'] ? array('showmsg' => false) : array('header' => true));
}
} elseif (submitcheck('commentsubmit')) {
if (!checkperm('allowdoing')) {
showmessage('no_privilege_doing_comment');
}
cknewuser();
示例9: elseif
}
$query = DB::query("SELECT idtype, cid FROM ".DB::table('home_comment')." WHERE status='1'");
while($row = DB::fetch($query)) {
updatemoderate($row['idtype'].'_cid', $row['cid']);
}
$query = DB::query("SELECT aid FROM ".DB::table('portal_article_title')." WHERE status='1'");
while($row = DB::fetch($query)) {
updatemoderate('aid', $row['aid']);
}
$query = DB::query("SELECT cid FROM ".DB::table('portal_comment')." WHERE idtype='aid' AND status='1'");
while($row = DB::fetch($query)) {
updatemoderate('aid_cid', $row['cid']);
}
$query = DB::query("SELECT cid FROM ".DB::table('portal_comment')." WHERE idtype='topic' AND status='1'");
while($row = DB::fetch($query)) {
updatemoderate('topicid_cid', $row['cid']);
}
}
show_msg("Kiểm toán nâng cấp dữ liệu", "$theurl?step=data&op=$nextop");
} elseif($_GET['op'] == 'moderate_update') {
$nextop = 'founder';
if($first_to_2_5 && DB::fetch_first("SHOW TABLES LIKE '".DB::table('common_moderate')."'")) {
$tables = array(
'tid' => 'forum_thread_moderate',
'pid' => 'forum_post_moderate',
'blogid' => 'home_blog_moderate',
'picid' => 'home_pic_moderate',
'doid' => 'home_doing_moderate',
'sid' => 'home_share_moderate',
示例10: array
if (isset($_G['gp_' . $pm]) && $_G['gp_' . $pm] != '' && $post['authorid']) {
$pmlist[] = array('action' => 'modreplies_validate', 'notevar' => array('pid' => $post['pid'], 'tid' => $post['tid'], 'post' => dhtmlspecialchars(cutstr($post['message'], 30)), 'reason' => dhtmlspecialchars($_G['gp_' . $pm])), 'authorid' => $post['authorid']);
}
}
foreach ($threads as $tid => $thread) {
DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies+{$thread['posts']} {$thread['lastpostadd']} {$thread['attachadd']} WHERE tid='{$tid}'", 'UNBUFFERED');
}
foreach (array_unique($forums) as $fid) {
updateforumcount($fid);
}
if (!empty($pidarray)) {
DB::query("UPDATE " . DB::table(getposttable($posttable)) . " SET status='4' WHERE pid IN (0," . implode(',', $pidarray) . ") AND status='0' AND invisible='-2'");
DB::query("UPDATE " . DB::table(getposttable($posttable)) . " SET invisible='0' WHERE pid IN (0," . implode(',', $pidarray) . ")");
$validates = DB::affected_rows();
updatemodworks('MOD', $validates);
updatemoderate('pid', $pidarray, 2);
} else {
updatemodworks('MOD', 1);
}
}
if ($pmlist) {
foreach ($pmlist as $pm) {
notification_add($pm['authorid'], 'system', $pm['action'], $pm['notevar'], 1);
}
}
if ($_G['gp_fast']) {
echo callback_js($_G['gp_pid']);
exit;
} else {
cpmsg('moderate_replies_succeed', "action=moderate&operation=replies&page={$page}&filter={$filter}&modfid={$modfid}&posttableid={$posttable}&dateline={$_G['gp_dateline']}&username={$_G['gp_username']}&title={$_G['gp_title']}&ppp={$_G['gp_ppp']}&showcensor={$showcensor}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'recycles' => $recycles, 'deletes' => $deletes));
}
示例11: array
if ($article_status == 1) {
DB::update('portal_article_title', array('status' => '1'), array('aid' => $aid));
}
unset($contents[0]);
}
if ($contents) {
$inserts = array();
foreach ($contents as $key => $value) {
$value = trim($value);
$inserts[] = "('{$aid}', '" . (empty($pagetitle[$key - 1]) ? $_POST['pagetitle'] : $pagetitle[$key - 1]) . "', '{$value}', '" . ($pageorder + $key) . "', '{$_G['timestamp']}', '{$id}', '{$idtype}')";
}
DB::query("INSERT INTO " . DB::table('portal_article_content') . "\r\n\t\t\t(aid, title, content, pageorder, dateline, id, idtype)\r\n\t\t\tVALUES " . implode(',', $inserts));
DB::query('UPDATE ' . DB::table('portal_article_title') . " SET status = '{$article_status}', contents = contents+" . count($inserts) . " WHERE aid='{$aid}'");
}
if ($article_status == 1) {
updatemoderate('aid', $aid);
manage_addnotify('verifyarticle');
}
$newaids = array();
$_POST['attach_ids'] = explode(',', $_POST['attach_ids']);
foreach ($_POST['attach_ids'] as $newaid) {
$newaid = intval($newaid);
if ($newaid) {
$newaids[$newaid] = $newaid;
}
}
if ($newaids) {
DB::update('portal_attachment', array('aid' => $aid), "attachid IN (" . dimplode($newaids) . ") AND aid='0'");
}
DB::query("DELETE FROM " . DB::table('portal_article_related') . " WHERE aid='{$aid}' OR raid='{$aid}'");
if ($_POST['raids']) {
示例12: blog_post
//.........这里部分代码省略.........
if (!empty($POST['picids'])) {
$picids = array_keys($POST['picids']);
$query = DB::query("SELECT * FROM " . DB::table('home_pic') . " WHERE picid IN (" . dimplode($picids) . ") AND uid='{$_G['uid']}'");
while ($value = DB::fetch($query)) {
if (empty($titlepic) && $value['thumb']) {
$titlepic = getimgthumbname($value['filepath']);
$blogarr['picflag'] = $value['remote'] ? 2 : 1;
}
$uploads[$POST['picids'][$value['picid']]] = $value;
}
if (empty($titlepic) && $value) {
$titlepic = $value['filepath'];
$blogarr['picflag'] = $value['remote'] ? 2 : 1;
}
}
if ($uploads) {
preg_match_all("/\\[imgid\\=(\\d+)\\]/i", $message, $mathes);
if (!empty($mathes[1])) {
$searchs = $replaces = array();
foreach ($mathes[1] as $key => $value) {
if (!empty($uploads[$value])) {
$picurl = pic_get($uploads[$value]['filepath'], 'album', $uploads[$value]['thumb'], $uploads[$value]['remote'], 0);
$searchs[] = "[imgid={$value}]";
$replaces[] = "<img src=\"{$picurl}\">";
unset($uploads[$value]);
}
}
if ($searchs) {
$message = str_replace($searchs, $replaces, $message);
}
}
foreach ($uploads as $value) {
$picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
$message .= "<div class=\"uchome-message-pic\"><img src=\"{$picurl}\"><p>{$value['title']}</p></div>";
}
}
$ckmessage = preg_replace("/(\\<div\\>|\\<\\/div\\>|\\s|\\ \\;|\\<br\\>|\\<p\\>|\\<\\/p\\>)+/is", '', $message);
if (empty($ckmessage)) {
return false;
}
$message = addslashes($message);
if (checkperm('manageblog')) {
$blogarr['hot'] = intval($POST['hot']);
}
if ($olds['blogid']) {
if ($blogarr['catid'] != $olds['catid']) {
if ($olds['catid']) {
DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num-1 WHERE catid='{$olds['catid']}' AND num>0");
}
if ($blogarr['catid']) {
DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num+1 WHERE catid='{$blogarr['catid']}'");
}
}
$blogid = $olds['blogid'];
DB::update('home_blog', $blogarr, array('blogid' => $blogid));
$fuids = array();
$blogarr['uid'] = $olds['uid'];
$blogarr['username'] = $olds['username'];
} else {
if ($blogarr['catid']) {
DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num+1 WHERE catid='{$blogarr['catid']}'");
}
$blogarr['uid'] = $_G['uid'];
$blogarr['username'] = $_G['username'];
$blogarr['dateline'] = empty($POST['dateline']) ? $_G['timestamp'] : $POST['dateline'];
$blogid = DB::insert('home_blog', $blogarr, 1);
DB::update('common_member_status', array('lastpost' => $_G['timestamp']), array('uid' => $_G['uid']));
DB::update('common_member_field_home', array('recentnote' => $POST['subject']), array('uid' => $_G['uid']));
}
$blogarr['blogid'] = $blogid;
$POST['tag'] = $olds ? modblogtag($POST['tag'], $blogid) : addblogtag($POST['tag'], $blogid);
$fieldarr = array('message' => $message, 'postip' => $_G['clientip'], 'target_ids' => $POST['target_ids'], 'tag' => $POST['tag']);
if (!empty($titlepic)) {
$fieldarr['pic'] = $titlepic;
}
if ($olds) {
DB::update('home_blogfield', $fieldarr, array('blogid' => $blogid));
} else {
$fieldarr['blogid'] = $blogid;
$fieldarr['uid'] = $blogarr['uid'];
DB::insert('home_blogfield', $fieldarr);
}
if ($isself && !$olds && $blog_status == 0) {
updatecreditbyaction('publishblog', 0, array('blogs' => 1));
include_once libfile('function/stat');
updatestat('blog');
}
if ($POST['makefeed'] && $blog_status == 0) {
include_once libfile('function/feed');
feed_publish($blogid, 'blogid', $olds ? 0 : 1);
}
if (!empty($__G)) {
$_G = $__G;
}
if ($blog_status == 1) {
updatemoderate('blogid', $blogid);
manage_addnotify('verifyblog');
}
return $blogarr;
}
示例13: while
while ($row = $db_target->fetch_array($query)) {
updatemoderate('blogid', $row['blogid']);
}
$query = $db_target->query("SELECT doid FROM {$table_target_home_doing} WHERE status='1'");
while ($row = $db_target->fetch_array($query)) {
updatemoderate('doid', $row['doid']);
}
$query = $db_target->query("SELECT picid FROM {$table_target_home_pic} WHERE status='1'");
while ($row = $db_target->fetch_array($query)) {
updatemoderate('picid', $row['picid']);
}
$query = $db_target->query("SELECT sid FROM {$table_target_home_share} WHERE status='1'");
while ($row = $db_target->fetch_array($query)) {
updatemoderate('sid', $row['sid']);
}
$query = $db_target->query("SELECT idtype, cid FROM {$table_target_home_comment} WHERE status='1'");
while ($row = $db_target->fetch_array($query)) {
updatemoderate($row['idtype'] . '_cid', $row['cid']);
}
function updatemoderate($idtype, $ids)
{
global $table_target, $db_target;
$ids = is_array($ids) ? $ids : array($ids);
if (!$ids) {
return;
}
$time = time();
foreach ($ids as $id) {
$db_target->query("INSERT INTO {$table_target} (id,idtype,status,dateline) VALUES ('{$id}','{$idtype}','0','{$time}')");
}
}
示例14: showtablefooter
showtablefooter();
showformfooter();
} else {
$moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array());
$validates = $deletes = $ignores = 0;
$moderatedata = array();
if (is_array($moderate)) {
foreach ($moderate as $cid => $act) {
$moderation[$act][] = $cid;
$moderatedata[$act][$_G['gp_idtypes'][$cid]][] = $cid;
}
}
foreach ($moderatedata as $act => $typeids) {
foreach ($typeids as $idtype => $ids) {
$op = $act == 'ignore' ? 1 : 2;
updatemoderate($idtype . '_cid', $ids, $op);
}
}
if ($validate_cids = dimplode($moderation['validate'])) {
DB::update('home_comment', array('status' => '0'), "cid IN ({$validate_cids})");
$validates = DB::affected_rows();
}
if (!empty($moderation['delete'])) {
require_once libfile('function/delete');
$comments = deletecomments($moderation['delete']);
$deletes = count($comments);
}
if ($ignore_cids = dimplode($moderation['ignore'])) {
DB::update('home_comment', array('status' => '2'), "cid IN ({$ignore_cids})");
$ignores = DB::affected_rows();
}
示例15: add_comment
//.........这里部分代码省略.........
$comment_status = 0;
}
$setarr = array('uid' => $tospace['uid'], 'id' => $id, 'idtype' => $idtype, 'authorid' => $_G['uid'], 'author' => $_G['username'], 'dateline' => $_G['timestamp'], 'message' => $message, 'ip' => $_G['clientip'], 'port' => $_G['remoteport'], 'status' => $comment_status);
$cid = C::t('home_comment')->insert($setarr, true);
$action = 'comment';
$becomment = 'getcomment';
$note = $q_note = '';
$note_values = $q_values = array();
switch ($idtype) {
case 'uid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=wall&cid={$cid}";
$note_type = 'wall';
$note = 'wall';
$note_values = array('url' => $n_url);
$q_note = 'wall_reply';
$q_values = array('url' => $n_url);
if ($comment) {
$msg = 'note_wall_reply_success';
$magvalues = array('username' => $tospace['username']);
$becomment = '';
} else {
$msg = 'do_success';
$magvalues = array();
$becomment = 'getguestbook';
}
$action = 'guestbook';
break;
case 'picid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=album&picid={$id}&cid={$cid}";
$note_type = 'comment';
$note = 'pic_comment';
$note_values = array('url' => $n_url);
$q_note = 'pic_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
case 'blogid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=blog&id={$id}&cid={$cid}";
$note_type = 'comment';
$note = 'blog_comment';
$note_values = array('url' => $n_url, 'subject' => $blog['subject']);
$q_note = 'blog_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
case 'sid':
$n_url = "home.php?mod=space&uid={$tospace['uid']}&do=share&id={$id}&cid={$cid}";
$note_type = 'comment';
$note = 'share_comment';
$note_values = array('url' => $n_url);
$q_note = 'share_comment_reply';
$q_values = array('url' => $n_url);
$msg = 'do_success';
$magvalues = array();
break;
}
if (empty($comment)) {
if ($tospace['uid'] != $_G['uid']) {
if (ckprivacy('comment', 'feed')) {
require_once libfile('function/feed');
$fs['title_data']['hash_data'] = "{$idtype}{$id}";
feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
}
$note_values['from_id'] = $id;
$note_values['from_idtype'] = $idtype;
$note_values['url'] .= "&goto=new#comment_{$cid}_li";
notification_add($tospace['uid'], $note_type, $note, $note_values);
}
} elseif ($comment['authorid'] != $_G['uid']) {
notification_add($comment['authorid'], $note_type, $q_note, $q_values);
}
if ($comment_status == 1) {
updatemoderate($idtype . '_cid', $cid);
manage_addnotify('verifycommontes');
}
if ($stattype) {
include_once libfile('function/stat');
updatestat($stattype);
}
if ($tospace['uid'] != $_G['uid']) {
$needle = $id;
if ($idtype != 'uid') {
$needle = $idtype . $id;
} else {
$needle = $tospace['uid'];
}
updatecreditbyaction($action, 0, array(), $needle);
if ($becomment) {
if ($idtype == 'uid') {
$needle = $_G['uid'];
}
updatecreditbyaction($becomment, $tospace['uid'], array(), $needle);
}
}
C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED');
$magvalues['cid'] = $cid;
return array('cid' => $cid, 'msg' => $msg, 'magvalues' => $magvalues);
}