本文整理汇总了PHP中Blog::changeOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::changeOwner方法的具体用法?PHP Blog::changeOwner怎么用?PHP Blog::changeOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::changeOwner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
function remove($userid)
{
$pool = DBModel::getInstance();
if ($userid == 1) {
return false;
}
if (!isset($userid)) {
return false;
}
$blogs = User::getOwnedBlogs($userid);
$pool->reset("Comments");
$pool->setAttribute("replier", NULL);
$pool->setQualifier("replier", "eq", $userid);
$pool->update();
foreach ($blogs as $ownedBlog) {
Blog::changeOwner($ownedBlog, 1);
// 관리자 uid로 변경
}
$blogs = User::getBlogs($userid);
foreach ($blogs as $joinedBlog) {
Blog::deleteUser($joinedBlog, $userid);
}
User::removePermanent($userid);
return true;
}
示例2: remove
function remove($userid)
{
global $database;
if ($userid == 1) {
return false;
}
if (!isset($userid)) {
return false;
}
$blogs = User::getOwnedBlogs($userid);
$sql = "UPDATE {$database['prefix']}Comments SET replier = NULL WHERE replier = " . $userid;
POD::execute($sql);
foreach ($blogs as $ownedBlog) {
Blog::changeOwner($ownedBlog, 1);
// 관리자 uid로 변경
}
$blogs = User::getBlogs($userid);
foreach ($blogs as $joinedBlog) {
Blog::deleteUser($joinedBlog, $userid);
}
User::removePermanent($userid);
return true;
}
示例3: changeBlogOwner
function changeBlogOwner($blogid, $userid)
{
return Blog::changeOwner($blogid, $userid);
}