本文整理汇总了PHP中log_moderator_action函数的典型用法代码示例。如果您正苦于以下问题:PHP log_moderator_action函数的具体用法?PHP log_moderator_action怎么用?PHP log_moderator_action使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_moderator_action函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: array
}
$attachcount++;
if (!$foruminfo['allowposting']) {
$error = $vbphrase['this_forum_is_not_accepting_new_attachments'];
$errors[] = array('filename' => $attachment['name'], 'error' => $error);
} else {
if ($vbulletin->options['attachlimit'] and $attachcount > $vbulletin->options['attachlimit']) {
$error = construct_phrase($vbphrase['you_may_only_attach_x_files_per_post'], $vbulletin->options['attachlimit']);
$errors[] = array('filename' => $attachment['name'], 'error' => $error);
} else {
if ($attachmentid = $upload->process_upload($attachment)) {
if ($vbulletin->userinfo['userid'] != $postinfo['userid'] and can_moderate($threadinfo['forumid'], 'caneditposts')) {
$postinfo['attachmentid'] =& $attachmentid;
$postinfo['forumid'] =& $foruminfo['forumid'];
require_once DIR . '/includes/functions_log_error.php';
log_moderator_action($postinfo, 'attachment_uploaded');
}
} else {
$attachcount--;
}
if ($error = $upload->fetch_error()) {
$errors[] = array('filename' => is_array($attachment) ? $attachment['name'] : $attachment, 'error' => $error);
}
}
}
}
($hook = vBulletinHook::fetch_hook('newattachment_attach')) ? eval($hook) : false;
if (!empty($errors)) {
$errorlist = '';
foreach ($errors as $error) {
$filename = htmlspecialchars_uni($error['filename']);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:newattachment.php
示例2: ON
// Validate Messages
$messages = $db->query_read_slave("\n\t\tSELECT gm.gmid, gm.state, gm.groupid, gm.dateline, gm.postuserid, gm.postusername,\n\t\t\tsocialgroup.name AS group_name, socialgroup.creatoruserid\n\t\tFROM " . TABLE_PREFIX . "groupmessage AS gm\n\t\tLEFT JOIN " . TABLE_PREFIX . "socialgroup AS socialgroup ON (socialgroup.groupid = gm.groupid)\n\t\tWHERE gmid IN ({$messageids})\n\t\t\tAND state = 'deleted'\n\t");
while ($message = $db->fetch_array($messages)) {
$message['is_group_owner'] = $message['creatoruserid'] == $vbulletin->userinfo['userid'];
$messagearray["{$message['gmid']}"] = $message;
$grouplist["{$message['groupid']}"] = true;
}
if (empty($messagearray)) {
standard_error(fetch_error('you_did_not_select_any_valid_messages'));
}
$db->query_write("\n\t\tDELETE FROM " . TABLE_PREFIX . "deletionlog\n\t\tWHERE type = 'groupmessage' AND\n\t\t\tprimaryid IN(" . implode(',', array_keys($messagearray)) . ")\n\t");
$db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "groupmessage\n\t\tSET state = 'visible'\n\t\tWHERE gmid IN(" . implode(',', array_keys($messagearray)) . ")\n\t");
foreach ($grouplist as $groupid => $foo) {
build_group_counters($groupid);
}
foreach ($messagearray as $message) {
if (!$message['is_group_owner']) {
log_moderator_action($message, 'gm_by_x_for_y_undeleted', array($message['postusername'], $message['group_name']));
}
}
// empty cookie
setcookie('vbulletin_inlinegmessage', '', TIMENOW - 3600, '/');
($hook = vBulletinHook::fetch_hook('group_inlinemod_undelete')) ? eval($hook) : false;
eval(print_standard_redirect('redirect_inline_undeletedmessages', true, $forceredirect));
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 09:39, Wed Nov 5th 2008
|| # SVN: $Revision: 27889 $
|| ####################################################################
\*======================================================================*/
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:group_inlinemod.php
示例3: insert_moderator_log
function insert_moderator_log()
{
if ($this->modlog) {
require_once DIR . '/includes/functions_log_error.php';
$threadid = intval(($tid = $this->fetch_field('threadid')) ? $tid : $this->info['thread']['threadid']);
$forumid = intval(($fid = $this->fetch_field('forumid')) ? $fid : $this->info['forum']['forumid']);
if (can_moderate($forumid)) {
foreach ($this->modlog as $entry) {
$entry['forumid'] = $forumid;
$entry['threadid'] = $threadid;
log_moderator_action($entry, $entry['type'], $entry['action']);
}
}
$this->modlog = array();
}
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:16,代码来源:class_dm_threadpost.php
示例4: verify_post_check
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));
// Fetch the existing reputation for this user given by our current user if there is one.
$query = $db->query("\n\t\tSELECT r.*, u.username\n\t\tFROM " . TABLE_PREFIX . "reputation r\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=r.adduid)\n\t\tWHERE rid = '" . $mybb->get_input('rid', MyBB::INPUT_INT) . "'\n\t");
$existing_reputation = $db->fetch_array($query);
// Only administrators, super moderators, as well as users who gave a specifc vote can delete one.
if ($mybb->usergroup['issupermod'] != 1 && ($mybb->usergroup['candeletereputations'] != 1 || $existing_reputation['adduid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0)) {
error_no_permission();
}
// Delete the specified reputation
$db->delete_query("reputation", "uid='{$uid}' AND rid='" . $mybb->get_input('rid', MyBB::INPUT_INT) . "'");
// Recount the reputation of this user - keep it in sync.
$query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
$reputation_value = $db->fetch_field($query, "reputation_count");
// Create moderator log
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->sprintf($lang->delete_reputation_log, $existing_reputation['username'], $existing_reputation['adduid']));
$db->update_query("users", array('reputation' => (int) $reputation_value), "uid='{$uid}'");
redirect("reputation.php?uid={$uid}", $lang->vote_deleted_message);
}
// Otherwise, show a listing of reputations for the given user.
if (!$mybb->input['action']) {
if ($mybb->usergroup['canviewprofiles'] == 0) {
// Reputation page is a part of a profile
error_no_permission();
}
// Set display group to their user group if they don't have a display group.
if (!$user['displaygroup']) {
$user['displaygroup'] = $user['usergroup'];
}
// Fetch display group properties.
$displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image', 'usereputationsystem');
开发者ID:styv300,项目名称:ToRepublic2.5,代码行数:31,代码来源:reputation.php
示例5: array
if ($existing_ban) {
$update_array = array('gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->get_input('liftafter')), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($banreason));
$db->update_query('banned', $update_array, "uid='{$user['uid']}'");
} else {
$insert_array = array('uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => (int) $user['usergroup'], 'oldadditionalgroups' => (string) $user['additionalgroups'], 'olddisplaygroup' => (int) $user['displaygroup'], 'admin' => (int) $mybb->user['uid'], 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->get_input('liftafter')), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($banreason));
$db->insert_query('banned', $insert_array);
}
// Move the user to the banned group
$update_array = array('usergroup' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'displaygroup' => 0, 'additionalgroups' => '');
$db->update_query('users', $update_array, "uid = {$user['uid']}");
$cache->update_banned();
// Log edit or add ban
if ($existing_ban) {
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user_ban);
} else {
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->banned_user);
}
$plugins->run_hooks("modcp_do_banuser_end");
if ($existing_ban) {
redirect("modcp.php?action=banning", $lang->redirect_banuser_updated);
} else {
redirect("modcp.php?action=banning", $lang->redirect_banuser);
}
} else {
$mybb->input['action'] = "banuser";
}
}
if ($mybb->input['action'] == "banuser") {
add_breadcrumb($lang->mcp_nav_banning, "modcp.php?action=banning");
if ($mybb->usergroup['canbanusers'] == 0) {
error_no_permission();
开发者ID:olada,项目名称:mybbintegrator,代码行数:31,代码来源:modcp.php
示例6: datamanager_init
$socialgroupmemberdm = datamanager_init('SocialGroupMember', $vbulletin);
$vbulletin->GPC['ids'][] = 0;
$ids = implode(', ', $vbulletin->GPC['ids']);
$invites = $vbulletin->db->query_read("\n\t\t\tSELECT * FROM " . TABLE_PREFIX . "socialgroupmember\n\t\t\tWHERE groupid = " . $group['groupid'] . " AND userid IN({$ids})" . ($_POST['do'] == 'cancelinvites' ? " AND type = 'invited'" : ''));
while ($invite = $vbulletin->db->fetch_array($invites)) {
($hook = vBulletinHook::fetch_hook('group_kickmember')) ? eval($hook) : false;
if ($invite['userid'] != $group['creatoruserid']) {
$socialgroupmemberdm->set_existing($invite);
$socialgroupmemberdm->delete();
}
}
unset($socialgroupmemberdm);
}
if (!$group['is_owner'] and can_moderate(0, 'candeletesocialgroups')) {
require_once DIR . '/includes/functions_log_error.php';
log_moderator_action($group, 'social_group_x_members_managed', array($group['name']));
}
if ($group['members'] - sizeof($ids) <= 1 and $_REQUEST['do'] == 'kickmembers') {
$vbulletin->url = 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'groupid=' . $group['groupid'];
} else {
$vbulletin->url = 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'do=manage' . ($_REQUEST['do'] == 'kickmembers' ? 'members' : '') . '&groupid=' . $group['groupid'];
}
($hook = vBulletinHook::fetch_hook('group_kickmember_complete')) ? eval($hook) : false;
$phrase = $_POST['do'] == 'cancelinvites' ? 'successfully_removed_invites' : 'successfully_kicked_members';
eval(print_standard_redirect($phrase));
}
// #######################################################################
if ($_POST['do'] == 'pendingmembers') {
if (!fetch_socialgroup_modperm('caninvitemoderatemembers', $group)) {
print_no_permission();
}
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:group.php
示例7: eval
if (TIMENOW + $vbulletin->GPC['timeout'] * 86400 >= 2147483647) {
// maximuim size of a 32 bit integer
eval(standard_error(fetch_error('maxpolltimeout')));
}
$poll->set('question', $vbulletin->GPC['pollquestion']);
$poll->set('active', $vbulletin->GPC['closepoll'] ? 0 : 1);
$poll->set('timeout', $vbulletin->GPC['timeout']);
// only let a poll go from public to private, not the other way about
if ($pollinfo['public']) {
$poll->set('public', $vbulletin->GPC['public']);
}
($hook = vBulletinHook::fetch_hook('poll_update_process')) ? eval($hook) : false;
$poll->save();
$pollinfo['threadid'] = $threadinfo['threadid'];
require_once DIR . '/includes/functions_log_error.php';
log_moderator_action($pollinfo, 'poll_edited');
($hook = vBulletinHook::fetch_hook('poll_update_complete')) ? eval($hook) : false;
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t={$threadinfo['threadid']}";
eval(print_standard_redirect('redirect_editthanks'));
}
// ############################### start show results without vote ###############################
if ($_REQUEST['do'] == 'showresults') {
if (!$pollinfo['pollid']) {
eval(standard_error(fetch_error('invalidid', $vbphrase['poll'], $vbulletin->options['contactuslink'])));
}
($hook = vBulletinHook::fetch_hook('poll_results_start')) ? eval($hook) : false;
$counter = 1;
$pollbits = '';
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$pollinfo['question'] = $bbcode_parser->parse(unhtmlspecialchars($pollinfo['question']), $foruminfo['forumid'], 1);
$splitoptions = explode('|||', $pollinfo['options']);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:poll.php
示例8: datamanager_init
} else {
$hard_delete = false;
}
$dataman =& datamanager_init('PictureComment', $vbulletin, ERRTYPE_STANDARD);
$dataman->set_existing($commentinfo);
if ($pictureuser = fetch_userinfo($pictureinfo['userid'])) {
$dataman->set_info('pictureuser', $pictureuser);
}
$dataman->set_info('pictureinfo', $pictureinfo);
$dataman->set_info('hard_delete', $hard_delete);
$dataman->set_info('reason', $vbulletin->GPC['reason']);
$dataman->delete();
unset($dataman);
if ($comentinfo['postuserid'] != $vbulletin->userinfo['userid'] and (can_moderate(0, 'candeletepicturecomments') or can_moderate(0, 'canremovepicturecomments'))) {
require_once DIR . '/includes/functions_log_error.php';
log_moderator_action($pictureinfo, $hard_delete ? 'pc_by_x_on_y_removed' : 'pc_by_x_on_y_soft_deleted', array($commentinfo['postusername'], fetch_trimmed_title($pictureinfo['caption'], 50)));
}
print_standard_redirect('picturecomment_deleted');
} else {
print_standard_redirect('picturecomment_nodelete');
}
}
// ############################### start retrieve ip ###############################
if ($_REQUEST['do'] == 'viewip') {
// check moderator permissions for getting ip
if (!can_moderate(0, 'canviewips')) {
print_no_permission();
}
if (!$commentinfo['commentid']) {
standard_error(fetch_error('invalidid', $vbphrase['comment'], $vbulletin->options['contactuslink']));
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:picturecomment.php
示例9: delete_thread
$modlogdata['tid'] = $tid;
if ($firstpost) {
if ($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads")) {
delete_thread($tid);
mark_reports($tid, "thread");
log_moderator_action($modlogdata, $lang->thread_deleted);
redirect(get_forum_link($fid), $lang->redirect_threaddeleted);
} else {
error_no_permission();
}
} else {
if ($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts")) {
// Select the first post before this
delete_post($pid, $tid);
mark_reports($pid, "post");
log_moderator_action($modlogdata, $lang->post_deleted);
$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline <= '{$post['dateline']}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "desc"));
$next_post = $db->fetch_array($query);
if ($next_post['pid']) {
$redirect = get_post_link($next_post['pid'], $tid) . "#pid{$next_post['pid']}";
} else {
$redirect = get_thread_link($tid);
}
redirect($redirect, $lang->redirect_postdeleted);
} else {
error_no_permission();
}
}
} else {
error($lang->redirect_nodelete);
}
开发者ID:slothly,项目名称:mybb,代码行数:31,代码来源:editpost.php
示例10: unset
$merge_thread->save();
if ($vbulletin->GPC['redirect'] == 'expires') {
$db->query_write("\n\t\t\t\tINSERT INTO " . TABLE_PREFIX . "threadredirect\n\t\t\t\t\t(threadid, expires)\n\t\t\t\tVALUES\n\t\t\t\t\t({$mergethreadinfo['threadid']}, {$expires})\n\t\t\t");
}
} else {
// remove remnants of merge thread
$merge_thread->delete(false, true, NULL, false);
}
unset($merge_thread);
build_thread_counters($threadinfo['threadid']);
build_forum_counters($threadinfo['forumid']);
if ($mergethreadinfo['forumid'] != $threadinfo['forumid']) {
build_forum_counters($mergethreadinfo['forumid']);
}
vB_ActivityStream_Populate_Forum_Thread::rebuild_thread(array($threadinfo['threadid'], $mergethreadinfo['threadid']));
log_moderator_action($threadinfo, 'thread_merged_with_x', $mergethreadinfo['title']);
($hook = vBulletinHook::fetch_hook('threadmanage_merge_complete')) ? eval($hook) : false;
$vbulletin->url = fetch_seo_url('thread', $threadinfo);
print_standard_redirect('redirect_mergethread');
}
// ############################### start stick / unstick thread ###############################
if ($_POST['do'] == 'stick') {
if ($threadinfo['isdeleted'] and !can_moderate($threadinfo['forumid'], 'candeleteposts') or !$threadinfo['visible'] and !can_moderate($threadinfo['forumid'], 'canmoderateposts')) {
if (can_moderate($threadinfo['forumid'])) {
print_no_permission();
} else {
eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink'])));
}
}
if (!can_moderate($threadinfo['forumid'], 'canmanagethreads')) {
print_no_permission();
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:postings.php
示例11: IN
$db->query_write("\n\t\tUPDATE " . TABLE_PREFIX . "groupmessage\n\t\tSET state = 'visible'\n\t\tWHERE gmid IN(" . implode(',', array_keys($messagearray)) . ")\n\t");
foreach (array_keys($messagearray) as $gmid) {
vB_Search_Indexcontroller_Queue::indexQueue('vBForum', 'SocialGroupMessage', 'index', $gmid, null, null);
}
foreach (array_keys($discussionlist) as $discussionid) {
build_discussion_counters($discussionid);
}
foreach (array_keys($grouplist) as $groupid) {
build_group_counters($groupid);
}
foreach ($messagearray as $message) {
if (!$message['is_group_owner']) {
if ($message['firstpost']) {
log_moderator_action($message, 'discussion_by_x_for_y_undeleted', array($message['postusername'], $message['group_name']));
} else {
log_moderator_action($message, 'gm_by_x_in_y_for_z_undeleted', array($message['postusername'], $message['discussion_name'], $message['group_name']));
}
}
}
// empty cookie
setcookie($inline_cookie, '', TIMENOW - 3600, '/');
($hook = vBulletinHook::fetch_hook('group_inlinemod_undelete')) ? eval($hook) : false;
if ($inline_discussion) {
print_standard_redirect('redirect_inline_undeleteddiscussions', true, $forceredirect);
} else {
print_standard_redirect('redirect_inline_undeletedmessages', true, $forceredirect);
}
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:group_inlinemod.php
示例12: pre_delete
/**
* pre_delete function - extend if the contenttype needs to do anything
*
* @param array list of deleted attachment ids to delete
* @param boolean verify permission to delete
*
* @return boolean
*/
public function pre_delete($list, $checkperms = true)
{
@ignore_user_abort(true);
// init lists
$this->lists = array(
'grouplist' => array(),
);
if ($checkperms)
{
// Verify that we have permission to view these attachmentids
$attachmultiple = new vB_Attachment_Display_Multiple($this->registry);
$attachments = $attachmultiple->fetch_results("a.attachmentid IN (" . implode(", ", $list) . ")");
if (count($list) != count($attachments))
{
return false;
}
}
$ids = $this->registry->db->query_read("
SELECT
a.attachmentid, a.userid, IF(a.contentid = 0, 1, 0) AS inprogress, a.caption,
sg.name, sg.groupid, IF(sg.creatoruserid = {$this->registry->userinfo['userid']}, 1, 0) AS is_owner,
user.username
FROM " . TABLE_PREFIX . "attachment AS a
LEFT JOIN " . TABLE_PREFIX . "socialgroup AS sg ON (a.contentid = sg.groupid)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (a.userid = user.userid)
WHERE
a.attachmentid IN (" . implode(", ", $list) . ")
");
while ($id = $this->registry->db->fetch_array($ids))
{
if ($checkperms AND !$id['inprogress'] AND $id['userid'] != $this->registry->userinfo['userid'] AND !fetch_socialgroup_modperm('canremovepicture', $id))
{
return false;
}
if ($id['groupid'])
{
$this->lists['grouplist']["{$id['groupid']}"]["{$id['attachmentid']}"] = 1;
if ($this->log)
{
if (!$id['is_owner'] AND $id['userid'] != $this->registry->userinfo['userid'])
{
// TODO : What does $picture want and fix modlog display in the admincp as it does not filter attachmentid properly on contenttype
$picture = array();
require_once(DIR . '/includes/functions_log_error.php');
log_moderator_action($picture, 'social_group_picture_x_in_y_removed', array(fetch_trimmed_title($id['caption'], 50), $id['name']));
}
}
}
}
return true;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:64,代码来源:socialgroup.php
示例13: shoutboxUnban
/**
* Delete ban
*/
function shoutboxUnban()
{
global $mybb, $db, $lang;
if (isset($mybb->input['id']) && isset($mybb->input['token'])) {
$lang->load('dvz_reports');
verify_post_check($mybb->input['token']);
$id = $db->escape_string($mybb->input['id']);
$data = $db->write_query("select " . TABLE_PREFIX . "dvz_reports_banned.uid, " . TABLE_PREFIX . "dvz_reports_banned.id, " . TABLE_PREFIX . "users.username\r\n from " . TABLE_PREFIX . "dvz_reports_banned\r\n JOIN " . TABLE_PREFIX . "users ON " . TABLE_PREFIX . "dvz_reports_banned.uid = " . TABLE_PREFIX . "users.uid\r\n WHERE " . TABLE_PREFIX . "dvz_reports_banned.id = '{$id}';");
//Validate ban existance
if ($data->num_rows === 0) {
redirect('modcp.php?action=shoutbox_banned');
die;
}
$data = $data->fetch_assoc();
//Delete ban and log action
$db->delete_query('dvz_reports_banned', 'id=' . $id);
//Log action
$logdata = array('uid' => htmlspecialchars_uni($data['uid']), 'username' => htmlspecialchars_uni($data['username']));
log_moderator_action($logdata, $lang->unban_user);
redirect('modcp.php?action=shoutbox_banned');
die;
}
//Redirect
redirect('modcp.php?action=shoutbox_banned');
die;
}
开发者ID:noxwyll,项目名称:dvz_shoutbox_pvt,代码行数:29,代码来源:dvz_reports.php
示例14: pre_delete
/**
* pre_delete function - extend if the contenttype needs to do anything
*
* @param array list of deleted attachment ids to delete
* @param boolean verify permission to delete
*
* @return boolean
*/
public function pre_delete($list, $checkperms = true)
{
@ignore_user_abort(true);
// init lists
$this->lists = array(
'bloglist' => array(),
);
if ($checkperms)
{
// Verify that we have permission to view these attachmentids
$attachmultiple = new vB_Attachment_Display_Multiple($this->registry);
$attachments = $attachmultiple->fetch_results("a.attachmentid IN (" . implode(", ", $list) . ")");
if (count($list) != count($attachments))
{
return false;
}
}
$replaced = array();
$ids = $this->registry->db->query_read("
SELECT
a.attachmentid, a.userid, IF(a.contentid = 0, 1, 0) AS inprogress,
blog.blogid, blog.firstblogtextid, blog.dateline AS blog_dateline, blog.state, blog.postedby_userid,
bu.memberids, bu.memberblogids,
gm.permissions AS grouppermissions,
user.membergroupids, user.usergroupid, user.infractiongroupids,
blog_deletionlog.moddelete AS del_moddelete, blog_deletionlog.userid AS del_userid, blog_deletionlog.username AS del_username, blog_deletionlog.reason AS del_reason
FROM " . TABLE_PREFIX . "attachment AS a
LEFT JOIN " . TABLE_PREFIX . "blog AS blog ON (blog.blogid = a.contentid)
LEFT JOIN " . TABLE_PREFIX . "blog_user AS bu ON (bu.bloguserid = blog.userid)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = blog.userid)
LEFT JOIN " . TABLE_PREFIX . "blog_groupmembership AS gm ON (blog.userid = gm.bloguserid AND gm.userid = " . $this->registry->userinfo['userid'] . ")
LEFT JOIN " . TABLE_PREFIX . "blog_deletionlog AS blog_deletionlog ON (blog.blogid = blog_deletionlog.primaryid AND blog_deletionlog.type = 'blogid')
WHERE
a.attachmentid IN (" . implode(", ", $list) . ")
");
while ($id = $this->registry->db->fetch_array($ids))
{
cache_permissions($id, false);
if ($checkperms AND !$id['inprogress'] AND !fetch_entry_perm('edit', $id))
{
return false;
}
if ($id['blogid'])
{
$this->lists['bloglist']["{$id['blogid']}"]++;
if ($this->log)
{
if (($this->registry->userinfo['permissions']['genericoptions'] & $this->registry->bf_ugp_genericoptions['showeditedby']) AND $id['p_dateline'] < (TIMENOW - ($this->registry->options['noeditedbytime'] * 60)))
{
if (empty($replaced["$id[firstblogtextid]"]))
{
/*insert query*/
$this->registry->db->query_write("
REPLACE INTO " . TABLE_PREFIX . "blog_editlog
(blogtextid, userid, username, dateline)
VALUES
(
$id[firstblogtextid],
" . $this->registry->userinfo['userid'] . ",
'" . $this->registry->db->escape_string($this->registry->userinfo['username']) . "',
" . TIMENOW . "
)
");
$replaced["$id[firstblogtextid]"] = true;
}
}
if (!is_member_of_blog($this->registry->userinfo, $id) AND can_moderate_blog('caneditentries'))
{
$bloginfo = array(
'blogid' => $id['blogid'],
'attachmentid' => $id['attachmentid'],
);
require_once(DIR . '/includes/blog_functions_log_error.php');
log_moderator_action($bloginfo, 'attachment_removed');
}
}
}
}
return true;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:94,代码来源:blogentry.php
示例15: error
if (count($pids) < 1) {
error($lang->error_inline_nopostsselected);
}
if (!is_moderator_by_pids($pids)) {
error_no_permission();
}
// Get threads which are associated with the posts
$tids = array();
$options = array('order_by' => 'dateline', 'order_dir' => 'asc');
$query = $db->simple_select("posts", "DISTINCT tid", "pid IN (" . implode(',', $pids) . ")", $options);
while ($row = $db->fetch_array($query)) {
$tids[] = $row['tid'];
}
$ret = $custommod->execute(intval($mybb->input['action']), $tids, $pids);
$lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']);
log_moderator_action($modlogdata, $lang->custom_tool);
if ($mybb->input['inlinetype'] == 'search') {
clearinline($mybb->input['searchid'], 'search');
$lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb->input['url']);
redirect($return_url, $lang->redirect_customtool_search);
} else {
clearinline($tid, 'thread');
if ($ret == 'forum') {
$lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']);
moderation_redirect(get_forum_link($fid), $lang->redirect_customtool_forum);
} else {
$lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
moderation_redirect(get_thread_link($tid), $lang->redirect_customtool_thread);
}
}
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:31,代码来源:moderation.php
示例16: replyban_run
function replyban_run()
{
global $db, $mybb, $lang, $templates, $theme, $headerinclude, $header, $footer, $replyban, $moderation;
$lang->load("replyban");
if ($mybb->input['action'] != "replyban" && $mybb->input['action'] != "do_replyban" && $mybb->input['action'] != "liftreplyban") {
return;
}
if ($mybb->input['action'] == "replyban") {
$tid = $mybb->get_input('tid', MyBB::INPUT_INT);
$thread = get_thread($tid);
if (!is_moderator($thread['fid'], "canmanagethreads")) {
error_no_permission();
}
if (!$thread['tid']) {
error($lang->error_invalidthread);
}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$lang->reply_bans_for = $lang->sprintf($lang->reply_bans_for, $thread['subject']);
check_forum_password($thread['fid']);
build_forum_breadcrumb($thread['fid']);
add_breadcrumb($thread['subject'], get_thread_link($thread['tid']));
add_breadcrumb($lang->reply_bans);
$query = $db->query("\r\n\t\t\tSELECT r.*, u.username\r\n\t\t\tFROM " . TABLE_PREFIX . "replybans r\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (r.uid=u.uid)\r\n\t\t\tWHERE r.tid='{$thread['tid']}'\r\n\t\t\tORDER BY r.dateline DESC\r\n\t\t");
while ($ban = $db->fetch_array($query)) {
$ban['reason'] = htmlspecialchars_uni($ban['reason']);
$ban['username'] = build_profile_link($ban['username'], $ban['uid']);
if ($ban['lifted'] == 0) {
$ban['lifted'] = $lang->permanent;
} else {
$ban['lifted'] = my_date('relative', $ban['lifted'], '', 2);
}
$alt_bg = alt_trow();
eval("\$ban_bit .= \"" . $templates->get("moderation_replyban_bit") . "\";");
}
if (!$ban_bit) {
eval("\$ban_bit = \"" . $templates->get("moderation_replyban_no_bans") . "\";");
}
// Generate the banned times dropdown
$liftlist = '';
$bantimes = fetch_ban_times();
foreach ($bantimes as $time => $title) {
$selected = '';
if (isset($banned['bantime']) && $banned['bantime'] == $time) {
$selected = " selected=\"selected\"";
}
$thattime = '';
if ($time != '---') {
$dateline = TIME_NOW;
if (isset($banned['dateline'])) {
$dateline = $banned['dateline'];
}
$thatime = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time, $dateline));
$thattime = " ({$thatime})";
}
eval("\$liftlist .= \"" . $templates->get("moderation_replyban_liftlist") . "\";");
}
eval("\$replyban = \"" . $templates->get("moderation_replyban") . "\";");
output_page($replyban);
}
if ($mybb->input['action'] == "do_replyban" && $mybb->request_method == "post") {
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));
$tid = $mybb->get_input('tid', MyBB::INPUT_INT);
$thread = get_thread($tid);
if (!is_moderator($thread['fid'], "canmanagethreads")) {
error_no_permission();
}
if (!$thread['tid']) {
error($lang->error_invalidthread);
}
$user = get_user_by_username($mybb->input['username'], array('fields' => array('username')));
if (!$user['uid']) {
error($lang->error_invaliduser);
}
$mybb->input['reason'] = $mybb->get_input('reason');
if (!trim($mybb->input['reason'])) {
error($lang->error_missing_reason);
}
$query = $db->simple_select('replybans', 'rid', "uid='{$user['uid']}' AND tid='{$thread['tid']}'");
$existingban = $db->fetch_field($query, 'rid');
if ($existingban > 0) {
error($lang->error_alreadybanned);
}
if ($mybb->get_input('liftban') == '---') {
$lifted = 0;
} else {
$lifted = ban_date2timestamp($mybb->get_input('liftban'), 0);
}
$reason = my_substr($mybb->input['reason'], 0, 240);
$insert_array = array('uid' => $user['uid'], 'tid' => $thread['tid'], 'dateline' => TIME_NOW, 'reason' => $db->escape_string($reason), 'lifted' => $db->escape_string($lifted));
$db->insert_query('replybans', $insert_array);
log_moderator_action(array("tid" => $thread['tid'], "fid" => $thread['fid'], "uid" => $user['uid'], "username" => $user['username']), $lang->user_reply_banned);
moderation_redirect("moderation.php?action=replyban&tid={$thread['tid']}", $lang->redirect_user_banned_replying);
}
if ($mybb->input['action'] == "liftreplyban") {
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));
$rid = $mybb->get_input('rid', MyBB::INPUT_INT);
$query = $db->simple_select("replybans", "*", "rid='{$rid}'");
$ban = $db->fetch_array($query);
//.........这里部分代码省略.........
开发者ID:andarms,项目名称:python-gaming.com,代码行数:101,代码来源:replyban.php
示例17: insert_thread
/**
* Insert a thread into the database.
*
* @return array Array of new thread details, tid and visibility.
*/
function insert_thread()
{
global $db, $mybb, $plugins, $cache, $lang;
// Yes, validating is required.
if (!$this->get_validated()) {
die("The thread needs to be validated before inserting it into the DB.");
}
if (count($this->get_errors()) > 0) {
die("The thread is not valid.");
}
$thread =& $this->data;
// Fetch the forum this thread is being made in
$forum = get_forum($thread['fid']);
// This thread is being saved as a draft.
if ($thread['savedraft']) {
$visible = -2;
} else {
$forumpermissions = forum_permissions($thread['fid'], $thread['uid']);
// Decide on the visibility of this post.
if ($forumpermissions['modthreads'] == 1 && !is_moderator($thread['fid'], "", $thread['uid'])) {
$visible = 0;
} else {
$visible = 1;
}
// Are posts from this user being moderated? Change visibility
if ($mybb->user['uid'] == $thread['uid'] && $mybb->user['moderateposts'] == 1) {
$visible = 0;
}
}
// Have a post ID but not a thread ID - fetch thread ID
if (!empty($thread['pid']) && !$thread['tid']) {
$query = $db->simple_select("posts", "tid", "pid='{$thread['pid']}");
$thread['tid'] = $db->fetch_field($query, "tid");
}
if (isset($thread['pid']) && $thread['pid'] > 0) {
$query = $db->simple_select("posts", "pid", "pid='{$thread['pid']}' AND uid='{$thread['uid']}' AND visible='-2'");
$draft_check = $db->fetch_field($query, "pid");
} else {
$draft_check = false;
}
// Are we updating a post which is already a draft? Perhaps changing it into a visible post?
if ($draft_check) {
$this->thread_insert_data = array("subject" => $db->escape_string($thread['subject']), "icon" => (int) $thread['icon'], "username" => $db->escape_string($thread['username']), "dateline" => (int) $thread['dateline'], "lastpost" => (int) $thread['dateline'], "lastposter" => $db->escape_string($thread['username']), "visible" => $visible);
$plugins->run_hooks("datahandler_post_insert_thread", $this);
$db->update_query("threads", $this->thread_insert_data, "tid='{$thread['tid']}'");
$this->post_insert_data = array("subject" => $db->escape_string($thread['subject']), "icon" => (int) $thread['icon'], "username" => $db->escape_string($thread['username']), "dateline" => (int) $thread['dateline'], "message" => $db->escape_string($thread['message']), "ipaddress" => $db->escape_binary(my_inet_pton(get_ip())), "includesig" => $thread['options']['signature'], "smilieoff" => $thread['options']['disablesmilies'], "visible" => $visible);
$plugins->run_hooks("datahandler_post_insert_thread_post", $this);
$db->update_query("posts", $this->post_insert_data, "pid='{$thread['pid']}'");
$this->tid = $thread['tid'];
$this->pid = $thread['pid'];
} else {
$this->thread_insert_data = array("fid" => $thread['fid'], "subject" => $db->escape_string($thread['subject']), "prefix" => (int) $thread['prefix'], "icon" => (int) $thread['icon'], "uid" => $thread['uid'], "username" => $db->escape_string($thread['username']), "dateline" => (int) $thread['dateline'], "lastpost" => (int) $thread['dateline'], "lastposter" => $db->escape_string($thread['username']), "views" => 0, "replies" => 0, "visible" => $visible, "notes" => '');
$plugins->run_hooks("datahandler_post_insert_thread", $this);
$this->tid = $db->insert_query("threads", $this->thread_insert_data);
$this->post_insert_data = array("tid" => $this->tid, "fid" => $thread['fid'], "subject" => $db->escape_string($thread['subject']), "icon" => (int) $thread['icon'], "uid" => $thread['uid'], "username" => $db->escape_string($thread['username']), "dateline" => (int) $thread['dateline'], "message" => $db->escape_string($thread['message']), "ipaddress" => $db->escape_binary(my_inet_pton(get_ip())), "includesig" => $thread['options']['signature'], "smilieoff" => $thread['options']['disablesmilies'], "visible" => $visible);
$plugins->run_hooks("datahandler_post_insert_thread_post", $this);
$this->pid = $db->insert_query("posts", $this->post_insert_data);
// Now that we have the post id for this first post, update the threads table.
$firstpostup = array("firstpost" => $this->pid);
$db->update_query("threads", $firstpostup, "tid='{$this->tid}'");
}
// If we're not saving a draft there are some things we need to check now
if (!$thread['savedraft']) {
if ($thread['options']['subscriptionmethod'] != "" && $thread['uid'] > 0) {
switch ($thread['options']['subscriptionmethod']) {
case "pm":
$notification = 2;
break;
case "email":
$notification = 1;
break;
default:
$notification = 0;
}
require_once MYBB_ROOT . "inc/functions_user.php";
|
请发表评论