예제 #1
0
	function delete()
	{
		if ($blogtextid = $this->existing['blogtextid'])
		{
			$db =& $this->registry->db;
			require_once(DIR . '/includes/blog_functions_log_error.php');

			if ($this->info['hard_delete'])
			{

				require_once(DIR . '/vb/search/indexcontroller/queue.php');
				vb_Search_Indexcontroller_Queue::indexQueue('vBBlog', 'BlogComment', 'delete', $blogtextid);

				$db->query_write("
					DELETE " . TABLE_PREFIX . "blog_text, " . TABLE_PREFIX . "blog_textparsed
					FROM " . TABLE_PREFIX . "blog_text
					LEFT JOIN " . TABLE_PREFIX . "blog_textparsed ON (" . TABLE_PREFIX . "blog_textparsed.blogtextid = " . TABLE_PREFIX . "blog_text.blogtextid)
					WHERE " . TABLE_PREFIX . "blog_text.blogtextid = $blogtextid
				");

				$db->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_deletionlog
					WHERE primaryid = $blogtextid AND type = 'blogtextid'
				");

				$db->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_moderation
					WHERE primaryid = $blogtextid AND type = 'blogtextid'
				");

				$db->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_hash
					WHERE blogtextid = " . intval($blogtextid) . " AND
						dateline > " . (TIMENOW - 300)
				);

				if (!$this->info['skip_moderator_log'])
				{
					blog_moderator_action($this->existing, 'comment_x_by_y_removed', array($this->existing['title'], $this->existing['username']));
				}
			}
			else
			{
				$this->set('state', 'deleted');
				$this->save();

				if (!$this->info['skip_moderator_log'])
				{
					blog_moderator_action($this->existing, 'comment_x_by_y_softdeleted', array($this->existing['title'], $this->existing['username']));
				}

				// soft delete
				// We have a DM for this
				$db->query_write("
					REPLACE INTO " . TABLE_PREFIX . "blog_deletionlog
						(primaryid, type, userid, username, reason, dateline)
					VALUES
						($blogtextid,
						'blogtextid',
						" . $this->registry->userinfo['userid'] . ",
						'" . $db->escape_string($this->registry->userinfo['username']) . "',
						'" . $db->escape_string($this->info['reason']) . "',
						" . TIMENOW . ")
				");

				$db->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_moderation
					WHERE primaryid = $blogtextid AND type = 'blogtextid'
				");
			}

			if (!$this->info['skip_build_blog_counters'])
			{
				build_blog_entry_counters($this->existing['blogid']);
				if (empty($this->info['blog']['userid']))
				{
					$bloginfo = fetch_bloginfo($this->existing['blogid']);
					build_blog_user_counters($bloginfo['userid']);
				}
				else
				{
					build_blog_user_counters($this->info['blog']['userid']);
				}
			}

			($hook = vBulletinHook::fetch_hook('blog_textdata_delete')) ? eval($hook) : false;
			return true;
		}

		return false;
	}
예제 #2
0
		$userdm->save();
		unset($userdm);
	}
	else
	{
		$db->query_write("
			UPDATE " . TABLE_PREFIX . "blog_user
			SET bloguserid = $destinfo[userid]
			WHERE bloguserid = $sourceinfo[userid]
		");
	}

	// Update required blog entries
	foreach (array_keys($blogs) AS $blogid)
	{
		build_blog_entry_counters($blogid);
	}

	// Update counters for destination user
	build_blog_user_counters($destinfo['userid']);
	build_blog_memberblogids($destinfo['userid']);
	build_blog_memberids($destinfo['userid']);
}

/*======================================================================*\
|| ####################################################################
|| # 
|| # SVN: $Revision: 17991 $
|| ####################################################################
\*======================================================================*/
?>
예제 #3
0
            $db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "blog_attachmentviews");
        }
        define('CP_REDIRECT', 'blog_admin.php');
        print_stop_message('updated_blog_attachments_successfully');
    }
}
if ($_REQUEST['do'] == 'updateentry') {
    $vbulletin->input->clean_array_gpc('r', array('cantview' => TYPE_BOOL, 'cantpost' => TYPE_BOOL));
    if (empty($vbulletin->GPC['perpage'])) {
        $vbulletin->GPC['perpage'] = 2000;
    }
    $finishat = $vbulletin->GPC['startat'] + $vbulletin->GPC['perpage'];
    echo '<p>' . $vbphrase['updating_blog_entries'] . '</p>';
    $blogs = $db->query_read("\r\n\t\tSELECT blogid\r\n\t\tFROM " . TABLE_PREFIX . "blog\r\n\t\tWHERE blogid >= " . $vbulletin->GPC['startat'] . " AND\r\n\t\tblogid < {$finishat}\r\n\t\tORDER BY blogid\r\n\t");
    while ($blog = $db->fetch_array($blogs)) {
        build_blog_entry_counters($blog['blogid'], $vbulletin->GPC['cantview'], $vbulletin->GPC['cantpost']);
        echo construct_phrase($vbphrase['processing_x'], $blog['blogid']) . "<br />\n";
        vbflush();
    }
    if ($checkmore = $db->query_first("SELECT blogid FROM " . TABLE_PREFIX . "blog WHERE blogid >= {$finishat} LIMIT 1")) {
        $args = array("do=updateentry", "startat={$finishat}", "pp=" . $vbulletin->GPC['perpage']);
        if ($vbulletin->GPC['cantview']) {
            $args[] = "cantview=1";
        }
        if ($vbulletin->GPC['cantpost']) {
            $args[] = "cantpost=1";
        }
        print_cp_redirect("blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . implode('&', $args));
        echo "<p><a href=\"blog_admin.php?" . $vbulletin->session->vars['sessionurl'] . implode('&amp;', $args) . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
    } else {
        define('CP_REDIRECT', 'blog_admin.php');
예제 #4
0
	/**
	*
	* @param	boolean	Do the query?
	*/
	function post_save_each($doquery = true)
	{
		build_blog_entry_counters($this->fetch_field('blogid'));

		($hook = vBulletinHook::fetch_hook('blog_trackbackdata_postsave')) ? eval($hook) : false;
	}