Example #1
0
                $post['message'] = $language['post_banned'];
            } elseif ($post['status'] & 1) {
                $post['message'] = $language['post_single_banned'];
            } else {
                $post['message'] = preg_replace("/\\[hide=?\\d*\\](.*?)\\[\\/hide\\]/is", "[b]{$language['post_hidden']}[/b]", $post['message']);
                $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml'], $_G['forum']['jammer']);
            }
            if ($_G['setting']['bannedmessages']) {
                $post['groupid'] = $users[$post['authorid']]['groupid'];
            }
            $postlist[$k] = $post;
        }
    }
    unset($uids, $users);
    if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) {
        $attachlist = getattach(0);
        $attachs = $attachlist['attachs'];
        $imgattachs = $attachlist['imgattachs'];
        unset($attachlist);
    }
    getgpc('infloat') ? include template('forum/post_infloat') : (include template('forum/post'));
} else {
    $modpost = C::m('forum_post', $_G['tid']);
    $bfmethods = $afmethods = array();
    $params = array('subject' => $subject, 'message' => $message, 'special' => $special, 'extramessage' => $extramessage, 'bbcodeoff' => $_GET['bbcodeoff'], 'smileyoff' => $_GET['smileyoff'], 'htmlon' => $_GET['htmlon'], 'parseurloff' => $_GET['parseurloff'], 'usesig' => $_GET['usesig'], 'isanonymous' => $_GET['isanonymous'], 'noticetrimstr' => $_GET['noticetrimstr'], 'noticeauthor' => $_GET['noticeauthor'], 'from' => $_GET['from'], 'sechash' => $_GET['sechash'], 'geoloc' => diconv($_GET['geoloc'], 'UTF-8'));
    if (!empty($_GET['trade']) && $thread['special'] == 2 && $_G['group']['allowposttrade']) {
        $bfmethods[] = array('class' => 'extend_thread_trade', 'method' => 'before_newreply');
    }
    $attentionon = empty($_GET['attention_add']) ? 0 : 1;
    $attentionoff = empty($attention_remove) ? 0 : 1;
    $bfmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'before_newreply');
Example #2
0
    } else {
        showmessage('username_nonexistence', '', array(), array('msgtype' => 3));
    }
} elseif ($_GET['action'] == 'attachlist') {
    require_once libfile('function/post');
    loadcache('groupreadaccess');
    $attachlist = getattach($_GET['pid'], intval($_GET['posttime']), $_GET['aids']);
    $attachlist = $attachlist['attachs']['unused'];
    $_G['group']['maxprice'] = isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]) ? $_G['group']['maxprice'] : 0;
    include template('common/header_ajax');
    include template('forum/ajax_attachlist');
    include template('common/footer_ajax');
    dexit();
} elseif ($_GET['action'] == 'imagelist') {
    require_once libfile('function/post');
    $attachlist = getattach($_GET['pid'], intval($_GET['posttime']), $_GET['aids']);
    $imagelist = $attachlist['imgattachs']['unused'];
    include template('common/header_ajax');
    include template('forum/ajax_imagelist');
    include template('common/footer_ajax');
    dexit();
} elseif ($_GET['action'] == 'get_rushreply_membernum') {
    $tid = intval($_GET['tid']);
    if ($tid) {
        $membernum = C::t('forum_post')->count_author_by_tid($tid);
        showmessage('thread_reshreply_membernum', '', array('membernum' => intval($membernum - 1)), array('alert' => 'info'));
    }
    dexit();
} elseif ($_GET['action'] == 'deleteattach') {
    $count = 0;
    if ($_GET['aids']) {
Example #3
0
 if ($isfirstpost && $specialextra) {
     @(include_once DISCUZ_ROOT . './source/plugin/' . $_G['setting']['threadplugins'][$specialextra]['module'] . '.class.php');
     $classname = 'threadplugin_' . $specialextra;
     if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'editpost')) {
         $threadplughtml = $threadpluginclass->editpost($_G['fid'], $_G['tid']);
     }
 }
 $postinfo['subject'] = str_replace('"', '"', $postinfo['subject']);
 $postinfo['message'] = dhtmlspecialchars($postinfo['message']);
 $language = lang('forum/misc');
 $postinfo['message'] = preg_replace($postinfo['htmlon'] ? $language['post_edithtml_regexp'] : (!$_G['forum']['allowbbcode'] || $postinfo['bbcodeoff'] ? $language['post_editnobbcode_regexp'] : $language['post_edit_regexp']), '', $postinfo['message']);
 if ($special == 5) {
     $standselected = array($firststand => 'selected="selected"');
 }
 if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) {
     $attachlist = getattach($pid);
     $attachs = $attachlist['attachs'];
     $imgattachs = $attachlist['imgattachs'];
     unset($attachlist);
     $attachfind = $attachreplace = array();
     if (!empty($attachs['used'])) {
         foreach ($attachs['used'] as $attach) {
             if ($attach['isimage']) {
                 $attachfind[] = "/\\[attach\\]{$attach['aid']}\\[\\/attach\\]/i";
                 $attachreplace[] = '[attachimg]' . $attach['aid'] . '[/attachimg]';
             }
         }
     }
     if (!empty($imgattachs['used'])) {
         foreach ($imgattachs['used'] as $attach) {
             $attachfind[] = "/\\[attach\\]{$attach['aid']}\\[\\/attach\\]/i";
Example #4
0
     @(include_once DISCUZ_ROOT . './plugins/' . $threadplugins[$specialextra]['module'] . '.class.php');
     $classname = 'threadplugin_' . $specialextra;
     if (method_exists($classname, 'editpost')) {
         $threadpluginclass = new $classname();
         $threadplughtml = $threadpluginclass->editpost($fid, $tid);
     }
 }
 $postinfo['subject'] = str_replace('"', '"', $postinfo['subject']);
 $postinfo['message'] = dhtmlspecialchars($postinfo['message']);
 include_once language('misc');
 $postinfo['message'] = preg_replace($language['post_edit_regexp'], '', $postinfo['message']);
 if ($special == 5) {
     $standselected = array($firststand => 'selected="selected"');
 }
 if ($allowpostattach) {
     $attachlist = getattach();
     $attachs = $attachlist['attachs'];
     $imgattachs = $attachlist['imgattachs'];
     unset($attachlist);
     $attachfind = $attachreplace = array();
     if ($attachs['used']) {
         foreach ($attachs['used'] as $attach) {
             if ($attach['isimage']) {
                 $attachfind[] = "/\\[attach\\]{$attach['aid']}\\[\\/attach\\]/i";
                 $attachreplace[] = '[attachimg]' . $attach['aid'] . '[/attachimg]';
             }
         }
     }
     if ($imgattachs['used']) {
         foreach ($imgattachs['used'] as $attach) {
             $attachfind[] = "/\\[attach\\]{$attach['aid']}\\[\\/attach\\]/i";
Example #5
0
        $inviteuser = DB::fetch($query);
        $inviteuser = $inviteuser['username'];
        showmessage('invite_send', '', array('inviteuser' => $inviteuser, 'bbname' => $_G['setting']['bbname']));
    }
} elseif ($_G['gp_action'] == 'attachlist') {
    require_once libfile('function/post');
    $attachlist = getattach($_G['gp_pid'], intval($_G['gp_posttime']));
    $attachlist = $attachlist['attachs']['unused'];
    $_G['group']['maxprice'] = isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]) ? $_G['group']['maxprice'] : 0;
    include template('common/header_ajax');
    include template('forum/ajax_attachlist');
    include template('common/footer_ajax');
    dexit();
} elseif ($_G['gp_action'] == 'imagelist') {
    require_once libfile('function/post');
    $attachlist = getattach($_G['gp_pid']);
    $imagelist = $attachlist['imgattachs']['unused'];
    include template('common/header_ajax');
    include template('forum/ajax_imagelist');
    include template('common/footer_ajax');
    dexit();
} elseif ($_G['gp_action'] == 'secondgroup') {
    require_once libfile('function/group');
    $groupselect = get_groupselect($_G['gp_fupid'], $_G['gp_groupid']);
    include template('common/header_ajax');
    include template('forum/ajax_secondgroup');
    include template('common/footer_ajax');
    dexit();
} elseif ($_G['gp_action'] == 'displaysearch_adv') {
    $display = $_G['gp_display'] == 1 ? 1 : '';
    dsetcookie('displaysearch_adv', $display);
Example #6
0
} elseif ($_G['gp_action'] == 'checkuserexists') {
    $check = DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE username='******'gp_username']) . "'");
    $check ? showmessage('<img src="' . $_G['style']['imgdir'] . '/check_right.gif" width="13" height="13">', '', array(), array('msgtype' => 3)) : showmessage('username_nonexistence', '', array(), array('msgtype' => 3));
} elseif ($_G['gp_action'] == 'attachlist') {
    require_once libfile('function/post');
    loadcache('groupreadaccess');
    $attachlist = getattach($_G['gp_pid'], intval($_G['gp_posttime']), $_G['gp_aids']);
    $attachlist = $attachlist['attachs']['unused'];
    $_G['group']['maxprice'] = isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]) ? $_G['group']['maxprice'] : 0;
    include template('common/header_ajax');
    include template('forum/ajax_attachlist');
    include template('common/footer_ajax');
    dexit();
} elseif ($_G['gp_action'] == 'imagelist') {
    require_once libfile('function/post');
    $attachlist = getattach($_G['gp_pid'], intval($_G['gp_posttime']), $_G['gp_aids']);
    $imagelist = $attachlist['imgattachs']['unused'];
    include template('common/header_ajax');
    include template('forum/ajax_imagelist');
    include template('common/footer_ajax');
    dexit();
} elseif ($_G['gp_action'] == 'deleteattach') {
    $count = 0;
    if ($_G['gp_aids']) {
        foreach ($_G['gp_aids'] as $aid) {
            $attach = DB::fetch_first("SELECT * FROM " . DB::table(getattachtablebyaid($aid)) . " WHERE aid='{$aid}'");
            if ($attach && ($attach['pid'] && $attach['pid'] == $_G['gp_pid'] && $_G['uid'] == $attach['uid'] || $_G['forum']['ismoderator'] || !$attach['pid'] && $_G['uid'] == $attach['uid'])) {
                DB::delete(getattachtablebyaid($aid), "aid='{$aid}'");
                DB::delete('forum_attachment', "aid='{$aid}'");
                dunlink($attach);
                $count++;
Example #7
0
 public function getAttachmentByPids($pids)
 {
     global $_G;
     if (!is_array($pids)) {
         $pids = explode(',', $pids);
     }
     include_once libfile('function/post');
     $attachment = array();
     foreach ($pids as $pid) {
         $data = getattach($pid);
         $attachment[] = $data['used'];
     }
     return $attachment;
 }