Esempio n. 1
0
    case 'edit_blog':
        $user->add_lang('posting');
        if (!$auth->acl_get('u_blog_post')) {
            trigger_error($user->lang['UNAUTHED']);
        }
        if (isset($_POST['submit'])) {
            $tag = request_var('tags', '', true);
            $tag = $tag != '' && substr($tag, -1) != ',' ? $tag . ',' : $tag;
            $tag = utf8_normalize_nfc($tag);
            $poll = $uid = $bitfield = $options = '';
            $allow_bbcode = $config['blog_bbcode_on'] == 1 ? true : false;
            $allow_smilies = $config['blog_emote_on'] == 1 ? true : false;
            $message = request_var('message', '', true);
            generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, true, $allow_smilies);
            $data = array('blog_text' => $message, 'blog_title' => request_var('title', '', true), 'blog_desc' => request_var('desc', '', true), 'blog_allow_cmnt' => request_var('allow_cmnt', 0), 'blog_cat_id' => request_var('cat_id', 1), 'blog_poster_id' => $user->data['user_id'], 'blog_tags' => $tag, 'blog_last_edited' => time(), 'bbcode_bitfield' => $bitfield, 'bbcode_uid' => $uid, 'enable_bbcode' => $allow_bbcode, 'enable_smilies' => $allow_smilies);
            $blog_id = blog::submit_blog('update', $data, $blog_id);
            if (!$blog_id) {
                trigger_error($user->lang['GEN_ERROR']);
            }
            $u_action = append_sid("{$phpbb_root_path}blog.{$phpEx}", array($act_name => 'view', 'id' => $blog_id));
            meta_refresh('3', $u_action);
            trigger_error($user->lang['BLOG_POST_SUCCESS'] . '<BR /><BR /><a href="' . $u_action . '">' . $user->lang['RETURN_POST'] . '</a>');
        }
        if (!($blog_data = blog::get_blog_data($blog_id))) {
            trigger_error($user->lang['GEN_ERROR']);
        }
        $bbcode = $auth->acl_get('u_blog_bbcode') && $config['blog_bbcode_on'];
        $emote = $auth->acl_get('u_blog_emote') && $config['blog_emote_on'];
        generate_smilies('inline', 3);
        $sql = 'SELECT *
				FROM ' . BLOG_CATS_TABLE . '