コード例 #1
0
		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 $
|| ####################################################################
\*======================================================================*/
?>
コード例 #2
0
ファイル: blog_usercp.php プロジェクト: hungnv0789/vhtm
	if (!$_POST['confirm'])
	{
		$_REQUEST['do'] = 'groups';
	}
	else
	{
		$db->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_groupmembership
			WHERE
				bloguserid = $inviteinfo[bloguserid]
					AND
				userid = " . $vbulletin->userinfo['userid'] . "
		");

		build_blog_pending_count($vbulletin->userinfo['userid']);
		build_blog_memberblogids($vbulletin->userinfo['userid']);
		build_blog_memberids($inviteinfo['bloguserid']);

		$vbulletin->url = 'blog_usercp.php?' . $vbulletin->session->vars['sessionurl'] . "do=groups";
		if ($inviteinfo['state'] == 'pending')
		{
			eval(print_standard_redirect('redirect_blog_declined_group_blog', true, true));
		}
		else
		{
			$db->query_write("
				UPDATE " . TABLE_PREFIX . "blog
				SET
					postedby_userid = " . $vbulletin->userinfo['userid'] . ",
					postedby_username = '******'username']) . "'
				WHERE
コード例 #3
0
	/**
	*
	* @param	boolean	Do the query?
	*/
	function post_delete($doquery = true)
	{
		// A user's blog entries can only be found from searching after the user is deleted.
		if (!$this->info['skip_blog_entries'])
		{
			$blogids = array();
			$blogs = $this->dbobject->query_read_slave("
				SELECT *
				FROM " . TABLE_PREFIX . "blog
				WHERE userid = " . intval($this->fetch_field('bloguserid')
			));
			while ($blog = $this->dbobject->fetch_array($blogs))
			{
				$blogids[] = intval($blog['blogid']);
			}

			if (sizeof($blogids))
			{
				$blogids = implode(',', $blogids);

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_deletionlog WHERE primaryid IN ($blogids) AND type = 'blogid'
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_moderation WHERE primaryid IN ($blogids) AND type = 'blogid'
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_pinghistory WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_rate WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_read WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_subscribeentry WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_tachyentry WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE " . TABLE_PREFIX . "blog_text, " . TABLE_PREFIX . "blog_textparsed, " . TABLE_PREFIX . "blog_editlog, " . TABLE_PREFIX . "blog_moderation, " . TABLE_PREFIX . "blog_deletionlog
					FROM " . TABLE_PREFIX . "blog_text
					LEFT JOIN " . TABLE_PREFIX . "blog_textparsed ON (" . TABLE_PREFIX . "blog_textparsed.blogtextid = " . TABLE_PREFIX . "blog_text.blogtextid)
					LEFT JOIN " . TABLE_PREFIX . "blog_editlog ON (" . TABLE_PREFIX . "blog_editlog.blogtextid = " . TABLE_PREFIX . "blog_text.blogtextid)
					LEFT JOIN " . TABLE_PREFIX . "blog_moderation ON (" . TABLE_PREFIX . "blog_moderation.primaryid = " . TABLE_PREFIX . "blog_text.blogtextid AND " . TABLE_PREFIX . "blog_moderation.type = 'blogtextid')
					LEFT JOIN " . TABLE_PREFIX . "blog_deletionlog ON (" . TABLE_PREFIX . "blog_deletionlog.primaryid = " . TABLE_PREFIX . "blog_text.blogtextid AND " . TABLE_PREFIX . "blog_deletionlog.type = 'blogtextid')
					WHERE " . TABLE_PREFIX . "blog_text.blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_trackback WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_views WHERE blogid IN ($blogids)
				");

				$this->dbobject->query_write("
					DELETE FROM " . TABLE_PREFIX . "blog_hash
					WHERE blogid IN ($blogids)
				");

				require_once(DIR . '/includes/class_taggablecontent.php');
				vB_Taggable_Content_Item::delete_tag_attachments_list("vBBlog_BlogEntry", explode(',', $blogids));

				$attachdata =& datamanager_init('Attachment', $this->registry, ERRTYPE_SILENT);
				$attachdata->condition = "a.contentid IN ($blogids)";
				$attachdata->delete();

				require_once(DIR . '/includes/class_bootstrap_framework.php');
				require_once(DIR . '/vb/types.php');
				vB_Bootstrap_Framework::init();
				$contenttypeid = vB_Types::instance()->getContentTypeID('vBBlog_BlogEntry');

				$attachdata =& datamanager_init('Attachment', $this->registry, ERRTYPE_SILENT, 'attachment');
				$attachdata->condition = "a.contentid IN ($blogids) AND a.contenttypeid = " . intval($contenttypeid);
				$attachdata->delete(true, false);

				$this->dbobject->query_write("
					DELETE  FROM " . TABLE_PREFIX . "blog WHERE blogid IN ($blogids)
				");
			}
		}
		else
		{
			$this->dbobject->query_write("
				UPDATE " . TABLE_PREFIX . "blog SET
					username = '******'verifyuser']['username']) . "',
					userid = 0
				WHERE userid = " . intval($this->fetch_field('bloguserid'))
			);
		}

		// User's comments
		$this->dbobject->query_write("
			UPDATE " . TABLE_PREFIX . "blog_text SET
				username = '******'verifyuser']['username']) . "',
				userid = 0
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// Deleted items belonging to user
		$this->dbobject->query_write("
			UPDATE " . TABLE_PREFIX . "blog_deletionlog
			SET username = '******'verifyuser']['username']) . "'
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// User's category to post list
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_categoryuser
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// User's categories
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_category
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// User's read status
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_read
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// User's search records
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_search
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// Blog Subscriptions
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_subscribeentry
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// Post Subscriptions
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_subscribeuser
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_subscribeuser
			WHERE bloguserid = " . intval($this->fetch_field('bloguserid'))
		);

		// User's read status for blogs and anyone for they're blog
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_userread
			WHERE userid = " . intval($this->fetch_field('bloguserid')) . " OR bloguserid = " . intval($this->fetch_field('bloguserid'))
		);

		// Groups
		$this->dbobject->query_write("
			UPDATE " . TABLE_PREFIX . "blog
			SET
				postedby_userid = userid,
				postedby_username = username
			WHERE postedby_userid = " . intval($this->fetch_field('bloguserid'))
		);

		$users = $this->dbobject->query_read_slave("
			SELECT userid
			FROM " . TABLE_PREFIX . "blog_groupmembership
			WHERE bloguserid = " . intval($this->fetch_field('bloguserid'))
		);

		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_groupmembership
			WHERE bloguserid = " . intval($this->fetch_field('bloguserid'))
		);

		while ($user = $this->dbobject->fetch_array($users))
		{
			build_blog_memberblogids($user['userid']);
		}

		$groups = $this->dbobject->query_read_slave("
			SELECT bloguserid
			FROM " . TABLE_PREFIX . "blog_groupmembership
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_groupmembership
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		// Blog Customizations
		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_usercss
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		$this->dbobject->query_write("
			DELETE FROM " . TABLE_PREFIX . "blog_usercsscache
			WHERE userid = " . intval($this->fetch_field('bloguserid'))
		);

		while ($group = $this->dbobject->fetch_array($groups))
		{
			build_blog_memberids($group['bloguserid']);
		}

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