Example #1
0
    }
    // Handle the subscriptions
    add_blog_subscriptions($blog_id, 'subscription_');
    // Insert into the categories list
    if (sizeof($category_ary) > 1 || isset($category_ary[0]) && $category_ary[0] != 0) {
        $category_list = get_blog_categories('category_id');
        foreach ($category_ary as $i => $cat_id) {
            if (!isset($category_list[$cat_id])) {
                unset($category_ary[$i]);
            }
        }
    }
    put_blogs_in_cats($blog_id, $category_ary, blog_data::$blog[$blog_id]['blog_approved'] == 1 || $auth->acl_get('u_blognoapprove') ? true : false);
    // If it needs reapproval...
    if (blog_data::$blog[$blog_id]['blog_approved'] == 0 && !$auth->acl_get('u_blognoapprove')) {
        $sql = 'UPDATE ' . USERS_TABLE . ' SET blog_count = blog_count - 1 WHERE user_id = ' . $user->data['user_id'];
        $db->sql_query($sql);
        set_config('num_blogs', --$config['num_blogs'], true);
        inform_approve_report('blog_approve', $blog_id);
    }
    handle_blog_cache('edit_blog', $user_id);
    $message = (!$sql_data['blog_approved'] ? $user->lang['BLOG_NEED_APPROVE'] . '<br /><br />' : $user->lang['BLOG_EDIT_SUCCESS']) . '<br /><br />';
    $message .= '<a href="' . $blog_urls['view_blog'] . '">' . $user->lang['VIEW_BLOG'] . '</a><br /><br />';
    if ($user->data['user_id'] == $user_id) {
        $message .= sprintf($user->lang['RETURN_BLOG_OWN'], '<a href="' . $blog_urls['view_user'] . '">', '</a>');
    } else {
        $message .= sprintf($user->lang['RETURN_BLOG_MAIN'], '<a href="' . $blog_urls['view_user'] . '">', blog_data::$user[$user_id]['username'], '</a>');
    }
    blog_meta_refresh(3, $blog_urls['view_blog']);
    trigger_error($message);
}
Example #2
0
 generate_blog_urls();
 $blog_attachment->update_attachment_data(false, $reply_id);
 blog_plugins::plugin_do_arg('reply_add_after_sql', $reply_id);
 // Handle the subscriptions
 add_blog_subscriptions($blog_id, 'subscription_');
 handle_blog_cache('add_reply', $user_id);
 // update the reply count for the blog
 if ($sql_data['reply_approved']) {
     $sql = 'UPDATE ' . BLOGS_TABLE . ' SET blog_reply_count = blog_reply_count + 1, blog_real_reply_count = blog_real_reply_count + 1 WHERE blog_id = ' . intval($blog_id);
     $db->sql_query($sql);
     set_config('num_blog_replies', ++$config['num_blog_replies'], true);
     handle_subscription('new_reply', censor_text($reply_subject), 0, $blog_id, $reply_id);
 } else {
     $sql = 'UPDATE ' . BLOGS_TABLE . ' SET blog_real_reply_count = blog_real_reply_count + 1 WHERE blog_id = ' . intval($blog_id);
     $db->sql_query($sql);
     inform_approve_report('reply_approve', $reply_id);
 }
 $message = (!$sql_data['reply_approved'] ? $user->lang['REPLY_NEED_APPROVE'] : $user->lang['REPLY_SUBMIT_SUCCESS']) . '<br /><br />';
 $message .= '<a href="' . $blog_urls['view_reply'] . '">' . $user->lang['VIEW_REPLY'] . '</a><br />';
 $message .= '<a href="' . $blog_urls['view_blog'] . '">' . $user->lang['VIEW_BLOG'] . '</a><br />';
 if ($user_id == $user->data['user_id']) {
     $message .= sprintf($user->lang['RETURN_BLOG_OWN'], '<a href="' . $blog_urls['view_user'] . '">', '</a>');
 } else {
     $message .= sprintf($user->lang['RETURN_BLOG_MAIN'], '<a href="' . $blog_urls['view_user'] . '">', blog_data::$user[$user_id]['username'], '</a>') . '<br />';
     $message .= sprintf($user->lang['RETURN_BLOG_OWN'], '<a href="' . $blog_urls['view_user_self'] . '">', '</a>');
 }
 if (!$sql_data['reply_approved']) {
     blog_meta_refresh(3, $blog_urls['view_blog']);
 } else {
     blog_meta_refresh(3, $blog_urls['view_reply']);
 }