public function after_newreply()
 {
     $feedid = 0;
     if (helper_access::check_module('follow') && !$this->param['isanonymous']) {
         require_once libfile('function/discuzcode');
         require_once libfile('function/followcode');
         $feedcontent = C::t('forum_threadpreview')->count_by_tid($this->thread['tid']);
         $firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid']);
         if (empty($feedcontent)) {
             $feedcontent = array('tid' => $this->thread['tid'], 'content' => followcode($firstpost['message'], $this->thread['tid'], $this->pid, 1000));
             C::t('forum_threadpreview')->insert($feedcontent);
             C::t('forum_thread')->update_status_by_tid($this->thread['tid'], '512');
         } else {
             C::t('forum_threadpreview')->update_relay_by_tid($this->thread['tid'], 1);
         }
         $notemsg = cutstr(followcode($this->param['message'], $this->thread['tid'], $this->pid, 0, false), 140);
         $followfeed = array('uid' => $this->member['uid'], 'username' => $this->member['username'], 'tid' => $this->thread['tid'], 'note' => $notemsg, 'dateline' => TIMESTAMP);
         $feedid = C::t('home_follow_feed')->insert($followfeed, true);
         C::t('common_member_count')->increase($this->member['uid'], array('feeds' => 1));
     }
     if ($feedid) {
         $this->param['showmsgparam'] = array_merge((array) $this->param['showmsgparam'], array('feedid' => $feedid));
     }
 }
Пример #2
0
function add_comment($message, $id, $idtype, $cid = 0)
{
    global $_G, $bbcode;
    $allowcomment = false;
    switch ($idtype) {
        case 'uid':
            $allowcomment = helper_access::check_module('wall');
            break;
        case 'picid':
            $allowcomment = helper_access::check_module('album');
            break;
        case 'blogid':
            $allowcomment = helper_access::check_module('blog');
            break;
        case 'sid':
            $allowcomment = helper_access::check_module('share');
            break;
    }
    if (!$allowcomment) {
        showmessage('quickclear_noperm');
    }
    $summay = getstr($message, 150, 0, 0, 0, -1);
    $comment = array();
    if ($cid) {
        $comment = C::t('home_comment')->fetch_by_id_idtype($id, $idtype, $cid);
        if ($comment && $comment['authorid'] != $_G['uid']) {
            $comment['message'] = preg_replace("/\\<div class=\"quote\"\\>\\<blockquote\\>.*?\\<\\/blockquote\\>\\<\\/div\\>/is", '', $comment['message']);
            $comment['message'] = $bbcode->html2bbcode($comment['message']);
            $message = "<div class=\"quote\"><blockquote><b>" . $comment['author'] . "</b>: " . getstr($comment['message'], 150, 0, 0, 2, 1) . '</blockquote></div>' . $message;
            if ($comment['idtype'] == 'uid') {
                $id = $comment['authorid'];
            }
        } else {
            $comment = array();
        }
    }
    $hotarr = array();
    $stattype = '';
    $tospace = $pic = $blog = $album = $share = $poll = array();
    switch ($idtype) {
        case 'uid':
            $tospace = getuserbyuid($id);
            $stattype = 'wall';
            break;
        case 'picid':
            $pic = C::t('home_pic')->fetch($id);
            if (empty($pic)) {
                showmessage('view_images_do_not_exist');
            }
            $picfield = C::t('home_picfield')->fetch($id);
            $pic['hotuser'] = $picfield['hotuser'];
            $tospace = getuserbyuid($pic['uid']);
            $album = array();
            if ($pic['albumid']) {
                $query = C::t('home_album')->fetch($pic['albumid']);
                if (!$query['albumid']) {
                    C::t('home_pic')->update_for_albumid($albumid, array('albumid' => 0));
                }
            }
            if (!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
                showmessage('no_privilege_ckfriend_pic');
            } elseif (!$tospace['self'] && $album['friend'] == 4) {
                $cookiename = "view_pwd_album_{$album['albumid']}";
                $cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
                if ($cookievalue != md5(md5($album['password']))) {
                    showmessage('no_privilege_ckpassword_pic');
                }
            }
            $hotarr = array('picid', $pic['picid'], $pic['hotuser']);
            $stattype = 'piccomment';
            break;
        case 'blogid':
            $blog = array_merge(C::t('home_blog')->fetch($id), C::t('home_blogfield')->fetch_targetids_by_blogid($id));
            if (empty($blog)) {
                showmessage('view_to_info_did_not_exist');
            }
            $tospace = getuserbyuid($blog['uid']);
            if (!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) {
                showmessage('no_privilege_ckfriend_blog');
            } elseif (!$tospace['self'] && $blog['friend'] == 4) {
                $cookiename = "view_pwd_blog_{$blog['blogid']}";
                $cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
                if ($cookievalue != md5(md5($blog['password']))) {
                    showmessage('no_privilege_ckpassword_blog');
                }
            }
            if (!empty($blog['noreply'])) {
                showmessage('do_not_accept_comments');
            }
            if ($blog['target_ids']) {
                $blog['target_ids'] .= ",{$blog['uid']}";
            }
            $hotarr = array('blogid', $blog['blogid'], $blog['hotuser']);
            $stattype = 'blogcomment';
            break;
        case 'sid':
            $share = C::t('home_share')->fetch($id);
            if (empty($share)) {
                showmessage('sharing_does_not_exist');
            }
            $tospace = getuserbyuid($share['uid']);
            $hotarr = array('sid', $share['sid'], $share['hotuser']);
            $stattype = 'sharecomment';
            break;
        default:
            showmessage('non_normal_operation');
            break;
    }
    if (empty($tospace)) {
        showmessage('space_does_not_exist', '', array(), array('return' => true));
    }
    if (isblacklist($tospace['uid'])) {
        showmessage('is_blacklist');
    }
    if ($hotarr && $tospace['uid'] != $_G['uid']) {
        hot_update($hotarr[0], $hotarr[1], $hotarr[2]);
    }
    $fs = array();
    $fs['icon'] = 'comment';
    $fs['target_ids'] = '';
    $fs['friend'] = '';
    $fs['body_template'] = '';
    $fs['body_data'] = array();
    $fs['body_general'] = '';
    $fs['images'] = array();
    $fs['image_links'] = array();
    switch ($idtype) {
        case 'uid':
            $fs['icon'] = 'wall';
            $fs['title_template'] = 'feed_comment_space';
            $fs['title_data'] = array('touser' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}\">{$tospace['username']}</a>");
            break;
        case 'picid':
            $fs['title_template'] = 'feed_comment_image';
            $fs['title_data'] = array('touser' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}\">" . $tospace['username'] . "</a>");
            $fs['body_template'] = '{pic_title}';
            $fs['body_data'] = array('pic_title' => $pic['title']);
            $fs['body_general'] = $summay;
            $fs['images'] = array(pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote']));
            $fs['image_links'] = array("home.php?mod=space&uid={$tospace['uid']}&do=album&picid={$pic['picid']}");
            $fs['target_ids'] = $album['target_ids'];
            $fs['friend'] = $album['friend'];
            break;
        case 'blogid':
            C::t('home_blog')->increase($id, 0, array('replynum' => 1));
            $fs['title_template'] = 'feed_comment_blog';
            $fs['title_data'] = array('touser' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}\">" . $tospace['username'] . "</a>", 'blog' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}&do=blog&id={$id}\">{$blog['subject']}</a>");
            $fs['target_ids'] = $blog['target_ids'];
            $fs['friend'] = $blog['friend'];
            break;
        case 'sid':
            $fs['title_template'] = 'feed_comment_share';
            $fs['title_data'] = array('touser' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}\">" . $tospace['username'] . "</a>", 'share' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}&do=share&id={$id}\">" . str_replace(lang('spacecp', 'share_action'), '', $share['title_template']) . "</a>");
            break;
    }
    $message = censor($message);
    if (censormod($message)) {
        $comment_status = 1;
    } else {
        $comment_status = 0;
    }
    $setarr = array('uid' => $tospace['uid'], 'id' => $id, 'idtype' => $idtype, 'authorid' => $_G['uid'], 'author' => $_G['username'], 'dateline' => $_G['timestamp'], 'message' => $message, 'ip' => $_G['clientip'], 'port' => $_G['remoteport'], 'status' => $comment_status);
    $cid = C::t('home_comment')->insert($setarr, true);
    $action = 'comment';
    $becomment = 'getcomment';
    $note = $q_note = '';
    $note_values = $q_values = array();
    switch ($idtype) {
        case 'uid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=wall&cid={$cid}";
            $note_type = 'wall';
            $note = 'wall';
            $note_values = array('url' => $n_url);
            $q_note = 'wall_reply';
            $q_values = array('url' => $n_url);
            if ($comment) {
                $msg = 'note_wall_reply_success';
                $magvalues = array('username' => $tospace['username']);
                $becomment = '';
            } else {
                $msg = 'do_success';
                $magvalues = array();
                $becomment = 'getguestbook';
            }
            $action = 'guestbook';
            break;
        case 'picid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=album&picid={$id}&cid={$cid}";
            $note_type = 'comment';
            $note = 'pic_comment';
            $note_values = array('url' => $n_url);
            $q_note = 'pic_comment_reply';
            $q_values = array('url' => $n_url);
            $msg = 'do_success';
            $magvalues = array();
            break;
        case 'blogid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=blog&id={$id}&cid={$cid}";
            $note_type = 'comment';
            $note = 'blog_comment';
            $note_values = array('url' => $n_url, 'subject' => $blog['subject']);
            $q_note = 'blog_comment_reply';
            $q_values = array('url' => $n_url);
            $msg = 'do_success';
            $magvalues = array();
            break;
        case 'sid':
            $n_url = "home.php?mod=space&uid={$tospace['uid']}&do=share&id={$id}&cid={$cid}";
            $note_type = 'comment';
            $note = 'share_comment';
            $note_values = array('url' => $n_url);
            $q_note = 'share_comment_reply';
            $q_values = array('url' => $n_url);
            $msg = 'do_success';
            $magvalues = array();
            break;
    }
    if (empty($comment)) {
        if ($tospace['uid'] != $_G['uid']) {
            if (ckprivacy('comment', 'feed')) {
                require_once libfile('function/feed');
                $fs['title_data']['hash_data'] = "{$idtype}{$id}";
                feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
            }
            $note_values['from_id'] = $id;
            $note_values['from_idtype'] = $idtype;
            $note_values['url'] .= "&goto=new#comment_{$cid}_li";
            notification_add($tospace['uid'], $note_type, $note, $note_values);
        }
    } elseif ($comment['authorid'] != $_G['uid']) {
        notification_add($comment['authorid'], $note_type, $q_note, $q_values);
    }
    if ($comment_status == 1) {
        updatemoderate($idtype . '_cid', $cid);
        manage_addnotify('verifycommontes');
    }
    if ($stattype) {
        include_once libfile('function/stat');
        updatestat($stattype);
    }
    if ($tospace['uid'] != $_G['uid']) {
        $needle = $id;
        if ($idtype != 'uid') {
            $needle = $idtype . $id;
        } else {
            $needle = $tospace['uid'];
        }
        updatecreditbyaction($action, 0, array(), $needle);
        if ($becomment) {
            if ($idtype == 'uid') {
                $needle = $_G['uid'];
            }
            updatecreditbyaction($becomment, $tospace['uid'], array(), $needle);
        }
    }
    C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']), 'UNBUFFERED');
    $magvalues['cid'] = $cid;
    return array('cid' => $cid, 'msg' => $msg, 'magvalues' => $magvalues);
}
Пример #3
0
    foreach ($query as $value) {
        if ($value['picnum']) {
            $albumlist[] = $value;
        }
    }
}
$posturl = "action={$_GET['action']}&fid={$_G['fid']}" . (!empty($_G['tid']) ? "&tid={$_G['tid']}" : '') . (!empty($pid) ? "&pid={$pid}" : '') . (!empty($special) ? "&special={$special}" : '') . (!empty($sortid) ? "&sortid={$sortid}" : '') . (!empty($typeid) ? "&typeid={$typeid}" : '') . (!empty($_GET['firstpid']) ? "&firstpid={$firstpid}" : '') . (!empty($_GET['addtrade']) ? "&addtrade={$addtrade}" : '');
if ($_GET['action'] == 'reply') {
    check_allow_action('allowreply');
} else {
    check_allow_action('allowpost');
}
if ($special == 4) {
    $_G['setting']['activityfield'] = $_G['setting']['activityfield'] ? dunserialize($_G['setting']['activityfield']) : array();
}
if (helper_access::check_module('album') && $_G['group']['allowupload'] && $_G['setting']['albumcategorystat'] && !empty($_G['cache']['albumcategory'])) {
    require_once libfile('function/portalcp');
}
$navtitle = lang('core', 'title_' . $_GET['action'] . '_post');
if ($_GET['action'] == 'newthread' || $_GET['action'] == 'newtrade') {
    loadcache('groupreadaccess');
    $navtitle .= ' - ' . $_G['forum']['name'];
    require_once libfile('post/newthread', 'include');
} elseif ($_GET['action'] == 'reply') {
    $navtitle .= ' - ' . $thread['subject'] . ' - ' . $_G['forum']['name'];
    require_once libfile('post/newreply', 'include');
} elseif ($_GET['action'] == 'edit') {
    loadcache('groupreadaccess');
    $navtitle .= ' - ' . $thread['subject'] . ' - ' . $_G['forum']['name'];
    require_once libfile('post/editpost', 'include');
}
<div class="umus">
<a  style="display:none;" href="javascript:;" onClick="tbox('wrap');"><img src="<?php echo $mstyle;?>/m_xinglan/img/unfold.png" height="20" /></a>
<a  style="display:none;" href="search.php<?php if($searchstyle == 1) { ?>?mod=forum<?php } else { ?>?mod=portal<?php } ?>" class="a"><img src="<?php echo $mstyle;?>/m_xinglan/img/sreach.png" height="20" /></a>
<?php if($_G['uid'] || $_G['connectguest']) { ?>
<a href="javascript:;" id="h_umu" class="a" onClick="dbox('h_umu','a');"><img src="<?php echo $mstyle;?>/m_xinglan/img/image/5.png" height="29" /></a>
<?php } else { ?>    
<a href="member.php?mod=logging&amp;action=login" class="a"><img src="<?php echo $mstyle;?>/m_xinglan/img/image/5.png" height="20" /></a>
<?php } if($_G['member']['newpm'] || $_G['member']['newprompt'] ) { } ?>
</div>
<div class="a_no"><a href="javascript:;" onClick="tbox('wrap');"></a></div>
<?php if($_G['uid']) { ?>
<ul class="p_umu" id="h_umu_menu" style="display:none;"><em></em>
    <li class="notb"><a href="home.php?mod=space&amp;do=pm"<?php if($_G['member']['newpm']) { ?> class="xi1"<?php } ?>><?php if($_G['member']['newpm']) { ?>新短消息<?php } else { ?>消息<?php } ?></a></li>
    <li><a href="home.php?mod=space&amp;do=notice"<?php if($_G['member']['newprompt']) { ?> class="xi1"<?php } ?>><?php if($_G['member']['newprompt']) { ?>提醒(<?php echo $_G['member']['newprompt'];?>)<?php } else { ?>提醒<?php } ?></a></li>
<?php if($_G['setting']['version'] != 'X2') { if(helper_access::check_module('feed')) { ?><li><a href="home.php"><?php echo m_lang('mfeed'); ?></a></li><?php } if(helper_access::check_module('doing')) { ?><li><a href="home.php?mod=space&amp;do=doing"><?php echo m_lang('mdoing'); ?></a></li><?php } if(helper_access::check_module('album')) { ?><li><a href="home.php?mod=space&amp;do=album"><?php echo m_lang('photo'); ?></a></li><?php } } ?>
    <li><a href="home.php?mod=space&amp;uid=<?php echo $_G['uid'];?>&amp;do=thread&amp;view=me">我的帖子</a></li>
    <li><a href="home.php?mod=space&amp;uid=<?php echo $_G['uid'];?>&amp;do=favorite&amp;view=me&amp;type=forum"><?php echo m_lang('favorite'); ?></a></li>    
    <li><a href="home.php?mod=space&amp;uid=<?php echo $_G['uid'];?>&amp;do=profile"><?php echo m_lang('profile'); ?></a></li>
    <li style=" border-bottom:none;"><a href="member.php?mod=logging&amp;action=logout&amp;formhash=<?php echo FORMHASH;?>">退出</a></li>
</ul>
<?php } elseif($_G['connectguest']) { ?>
<ul class="p_umu" id="h_umu_menu" style="display:none;"><em></em>
    <li style=" border-bottom:none;"><a href="member.php?mod=logging&amp;action=logout&amp;formhash=<?php echo FORMHASH;?>">退出</a></li>
</ul>
<?php } ?>
</header>

<div class="wp">
<?php echo $imenus;?><div class="ct">
<div class="pt bb">
Пример #5
0
        }
        C::t('common_setting')->update('domain', $_G['setting']['domain']);
        updatecache('setting');
        cpmsg('setting_update_succeed', 'action=domain&operation=root', 'succeed');
    }
} else {
    if (!submitcheck('domainsubmit')) {
        showtips('setting_domain_base_tips');
        showformheader("domain");
        showtableheader();
        if ($_G['setting']['homepagestyle']) {
            showsetting('setting_domain_allow_space', 'settingnew[allowspacedomain]', $_G['setting']['allowspacedomain'], 'radio');
        } else {
            showhiddenfields(array('settingnew[allowspacedomain]' => 0));
        }
        if (helper_access::check_module('group')) {
            showsetting('setting_domain_allow_group', 'settingnew[allowgroupdomain]', $_G['setting']['allowgroupdomain'], 'radio');
        } else {
            showhiddenfields(array('settingnew[allowgroupdomain]' => 0));
        }
        showsetting('setting_domain_hold_domain', 'settingnew[holddomain]', $_G['setting']['holddomain'], 'text');
        showsubmit('domainsubmit');
        showtablefooter();
        showformfooter();
    } else {
        $settings = $_GET['settingnew'];
        $settings['allowspacedomain'] = (double) $settings['allowspacedomain'];
        $settings['allowgroupdomain'] = (double) $settings['allowgroupdomain'];
        if ($settings) {
            C::t('common_setting')->update_batch($settings);
            updatecache('setting');
<span id="imgSpanButtonPlaceholder"></span>
</div>
<div class="upfilelist upfl bbda">
<div id="imgattachlist">
<?php 
    if ($_G['basescript'] == 'portal') {
        echo $article['attachs'];
    }
    ?>
</div>
<div class="fieldset flash" id="imgUploadProgress"></div>
</div>
<p class="notice">点击图片添加到编辑器内容中</p>
</div>
<?php 
    if (helper_access::check_module('album')) {
        ?>
<div class="p_opt" unselectable="on" id="icoImg_albumlist" <?php 
        if ($_G['basescript'] == 'home' && $_G['group']['allowupload'] || $_G['basescript'] == 'portal') {
            ?>
 style="display: none;"<?php 
        }
        ?>
>
<div class="upfilelist pbm bbda">
选择相册:
<select name="view_albumid" onchange="picView(this.value, 'albumphoto')" class="ps">
<option value="none">选择相册</option>
<option value="0">默认相册</option><?php 
        if (is_array($albums)) {
            foreach ($albums as $value) {
Пример #7
0
     $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');
 if ($_G['group']['allowat']) {
     $bfmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'before_newreply');
 }
 $bfmethods[] = array('class' => 'extend_thread_comment', 'method' => 'before_newreply');
 $modpost->attach_before_method('newreply', array('class' => 'extend_thread_filter', 'method' => 'before_newreply'));
 if ($_G['group']['allowat']) {
     $afmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'after_newreply');
 }
 $afmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'after_newreply');
 $afmethods[] = array('class' => 'extend_thread_comment', 'method' => 'after_newreply');
 if (helper_access::check_module('follow') && !empty($_GET['adddynamic'])) {
     $afmethods[] = array('class' => 'extend_thread_follow', 'method' => 'after_newreply');
 }
 if ($thread['replycredit'] > 0 && $thread['authorid'] != $_G['uid'] && $_G['uid']) {
     $afmethods[] = array('class' => 'extend_thread_replycredit', 'method' => 'after_newreply');
 }
 if ($special == 5) {
     $afmethods[] = array('class' => 'extend_thread_debate', 'method' => 'after_newreply');
 }
 $afmethods[] = array('class' => 'extend_thread_image', 'method' => 'after_newreply');
 if ($special == 2 && $_G['group']['allowposttrade'] && $thread['authorid'] == $_G['uid']) {
     $afmethods[] = array('class' => 'extend_thread_trade', 'method' => 'after_newreply');
 }
 $afmethods[] = array('class' => 'extend_thread_filter', 'method' => 'after_newreply');
 if ($_G['forum']['allowfeed']) {
     if ($special == 2 && !empty($_GET['trade'])) {
Пример #8
0
 $newdoid = C::t('home_doing')->insert($setarr, 1);
 $setarr = array('recentnote' => $message, 'spacenote' => $message);
 $credit = $experience = 0;
 $extrasql = array('doings' => 1);
 updatecreditbyaction('doing', 0, $extrasql);
 C::t('common_member_field_home')->update($_G['uid'], $setarr);
 if ($_POST['to_signhtml'] && $_G['group']['maxsigsize']) {
     if ($_G['group']['maxsigsize'] < 200) {
         $signhtml = getstr($_POST['message'], $_G['group']['maxsigsize'], 0, 0, 1);
         $signhtml = preg_replace("/\\<br.*?\\>/i", ' ', $signhtml);
     } else {
         $signhtml = $message;
     }
     C::t('common_member_field_forum')->update($_G['uid'], array('sightml' => $signhtml));
 }
 if (helper_access::check_module('feed') && ckprivacy('doing', 'feed') && $doing_status == '0') {
     $feedarr = array('appid' => '', 'icon' => 'doing', 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $_G['timestamp'], 'title_template' => lang('feed', 'feed_doing_title'), 'title_data' => serialize(array('message' => $message)), 'body_template' => '', 'body_data' => '', 'id' => $newdoid, 'idtype' => 'doid');
     C::t('home_feed')->insert($feedarr);
 }
 if ($doing_status == '1') {
     updatemoderate('doid', $newdoid);
     manage_addnotify('verifydoing');
 }
 require_once libfile('function/stat');
 updatestat('doing');
 C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED');
 if (!empty($_GET['fromcard'])) {
     showmessage($message . lang('spacecp', 'card_update_doing'));
 } else {
     showmessage('do_success', dreferer(), array('doid' => $newdoid), $_GET['spacenote'] ? array('showmsg' => false) : array('header' => true));
 }
Пример #9
0
    if (!helper_access::check_module('blog') || !checkperm('allowblog')) {
        showmessage('no_authority_to_add_log', '', array(), array('return' => true));
    }
    cknewuser();
    $waittime = interval_check('post');
    if ($waittime > 0) {
        showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true));
    }
    $blog['subject'] = empty($_GET['subject']) ? '' : getstr($_GET['subject'], 80);
    $blog['message'] = empty($_GET['message']) ? '' : getstr($_GET['message'], 5000);
} else {
    if ($_G['uid'] != $blog['uid'] && !checkperm('manageblog') && $_GET['modblogkey'] != modauthkey($blog['blogid'])) {
        showmessage('no_authority_operation_of_the_log');
    }
}
if (submitcheck('blogsubmit', 0, $seccodecheck, $secqaacheck) && helper_access::check_module('blog')) {
    if (empty($blog['blogid'])) {
        $blog = array();
    } else {
        if (!checkperm('allowblog')) {
            showmessage('no_privilege_blog');
        }
    }
    if ($_G['setting']['blogcategorystat'] && $_G['setting']['blogcategoryrequired'] && !$_POST['catid']) {
        showmessage('blog_choose_system_category');
    }
    require_once libfile('function/blog');
    if ($newblog = blog_post($_POST, $blog)) {
        if (empty($blog) && $newblog['topicid']) {
            $url = 'home.php?mod=space&uid=' . $_G['uid'] . '&do=topic&topicid=' . $newblog['topicid'] . '&view=blog&quickforward=1';
        } else {
Пример #10
0
<?php if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('guide');
0
|| checktplrefresh('./template/default/forum/guide.htm', './template/default/forum/guide_list_row.htm', 1436237307, '1', './data/template/1_1_forum_guide.tpl.php', './template/default', 'forum/guide')
;?><?php include template('common/header'); ?><style type="text/css">
.xl2 { background: url(<?php echo IMGDIR;?>/vline.png) repeat-y 50% 0; }
.xl2 li { width: 49.9%; }
.xl2 li em { padding-right: 10px; }
.xl2 .xl2_r em { padding-right: 0; }
.xl2 .xl2_r i { padding-left: 10px; }
</style>
<div id="pt" class="bm cl">
<div class="z">
<a href="./" class="nvhm" title="首页"><?php echo $_G['setting']['bbname'];?></a><?php if(helper_access::check_module('guide')) { ?><em>&raquo;</em><a href="forum.php?mod=guide&amp;view=index">导读</a><?php } ?><?php echo $navigation;?>
</div>
</div>
<div class="boardnav">
<div id="ct" class="wp cl<?php if($_G['forum']['allowside']) { ?> ct2<?php } ?>"<?php if($leftside) { ?> style="margin-left:<?php echo $_G['leftsidewidth_mwidth'];?>px"<?php } ?>>
<div class="mn">
<div class="bm bml pbn">
<div class="bm_h cl">
<?php if($view != 'index' && $view != 'my') { ?>
<span class="y">
<a href="forum.php?mod=guide&amp;view=<?php echo $view;?>&amp;rss=1" class="fa_rss" target="_blank" title="RSS">订阅</a>
</span>
<?php } ?>
<h1 class="xs2">
<?php echo $lang['guide_'.$view];?>
</h1>
</div>
<?php if($view != 'my') { ?>
<div class="bm_c cl pbn">
Пример #11
0
        if (empty($_GET['syncbbs'])) {
            $_GET['subject'] = cutstr($_GET['message'], 75, '');
        }
        $_POST['replysubmit'] = true;
        $_GET['fid'] = $fid;
        $_GET['action'] = 'newthread';
        $_GET['allownoticeauthor'] = '1';
        include_once libfile('function/forum');
        require_once libfile('function/post');
        loadforum();
        $_G['forum']['picstyle'] = 0;
        $skipmsg = 1;
        include_once libfile('forum/post', 'module');
    }
} elseif ($op == 'relay') {
    if (!helper_access::check_module('follow')) {
        showmessage('quickclear_noperm');
    }
    $tid = intval($_GET['tid']);
    $preview = $post = array();
    $preview = C::t('forum_threadpreview')->fetch($tid);
    if (empty($preview)) {
        $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($tid);
        if ($post['anonymous']) {
            showmessage('follow_anonymous_unfollow');
        }
    }
    if (empty($post) && empty($preview)) {
        showmessage('follow_content_not_exist');
    }
    if (submitcheck('relaysubmit')) {
Пример #12
0
} elseif ($_GET['op'] == 'edithot') {
    if (!checkperm('manageshare')) {
        showmessage('no_privilege_edithot_share');
    }
    if ($sid) {
        if (!($share = C::t('home_share')->fetch($sid))) {
            showmessage('share_does_not_exist');
        }
    }
    if (submitcheck('hotsubmit')) {
        C::t('home_share')->update($sid, array('hot' => $_POST['hot']));
        C::t('home_feed')->update($sid, array('hot' => $_POST['hot']), 'sid');
        showmessage('do_success', dreferer());
    }
} else {
    if (!checkperm('allowshare') || !helper_access::check_module('share')) {
        showmessage('no_privilege_share');
    }
    cknewuser();
    $type = empty($_GET['type']) ? '' : $_GET['type'];
    $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
    $note_uid = 0;
    $note_message = '';
    $note_values = array();
    $hotarr = array();
    $arr = array();
    $feed_hash_data = '';
    switch ($type) {
        case 'space':
            $feed_hash_data = "uid{$id}";
            $tospace = getuserbyuid($id);
Пример #13
0
 private function sendPost($extract)
 {
     global $_G;
     extract($extract);
     // 获取主题和帖子要插入的状态信息
     $topicStatus = ForumUtils::getPostSendStatus('topic', $_GET['platType']);
     $postStatus = ForumUtils::getPostSendStatus('post', $_GET['platType']);
     //copy from dz source/include/post/post_newthread.php
     if (empty($_G['forum']['fid']) || $_G['forum']['type'] == 'group') {
         return WebUtils::makeErrorInfo_oldVersion($res, 'forum_nonexistence');
     }
     if ($special == 1 && !$_G['group']['allowpostpoll'] || $special == 2 && !$_G['group']['allowposttrade'] || $special == 3 && !$_G['group']['allowpostreward'] || $special == 4 && !$_G['group']['allowpostactivity'] || $special == 5 && !$_G['group']['allowpostdebate']) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']));
     }
     if (!$_G['uid'] && !(!$_G['forum']['postperm'] && $_G['group']['allowpost'] || $_G['forum']['postperm'] && forumperm($_G['forum']['postperm']))) {
         if (!defined('IN_MOBILE')) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_login_nopermission', array('{login}' => 1));
         } else {
             return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_login_nopermission_mobile', array('{login}' => 1));
         }
     } elseif (empty($_G['forum']['allowpost'])) {
         if (!$_G['forum']['postperm'] && !$_G['group']['allowpost']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_none_nopermission');
         } elseif ($_G['forum']['postperm'] && !forumperm($_G['forum']['postperm'])) {
             $msg = mobcent_showmessagenoperm('postperm', $_G['fid'], $_G['forum']['formulaperm']);
             return WebUtils::makeErrorInfo_oldVersion($res, $msg['message'], $msg['params']);
         }
     } elseif ($_G['forum']['allowpost'] == -1) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_forum_newthread_nopermission');
     }
     if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_login_nopermission');
     }
     if (trim($subject) == '') {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_sm_isnull');
     }
     if (!$sortid && !$special && trim($message) == '') {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_sm_isnull');
     }
     if ($post_invalid = checkpost($subject, $message, $special || $sortid)) {
         return WebUtils::makeErrorInfo_oldVersion($res, $post_invalid, array('{minpostsize}' => $_G['setting']['minpostsize'], '{maxpostsize}' => $_G['setting']['maxpostsize']));
         //showmessage($post_invalid, '', array('minpostsize' => $_G['setting']['minpostsize'], 'maxpostsize' => $_G['setting']['maxpostsize']));
     }
     if (checkflood()) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_flood_ctrl', array('{floodctrl}' => $_G['setting']['floodctrl']));
     } elseif (checkmaxperhour('tid')) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'thread_flood_ctrl_threads_per_hour', array('{threads_per_hour}' => $_G['group']['maxthreadsperhour']));
     }
     $_GET['save'] = $_G['uid'] ? $_GET['save'] : 0;
     if ($_G['group']['allowsetpublishdate'] && $_GET['cronpublish'] && $_GET['cronpublishdate']) {
         $publishdate = strtotime($_GET['cronpublishdate']);
         if ($publishdate > $_G['timestamp']) {
             $_GET['save'] = 1;
         } else {
             $publishdate = $_G['timestamp'];
         }
     } else {
         $publishdate = $_G['timestamp'];
     }
     $typeid = isset($typeid) && isset($_G['forum']['threadtypes']['types'][$typeid]) && (empty($_G['forum']['threadtypes']['moderators'][$typeid]) || $_G['forum']['ismoderator']) ? $typeid : 0;
     $displayorder = $modnewthreads ? -2 : ($_G['forum']['ismoderator'] && $_G['group']['allowstickthread'] && !empty($_GET['sticktopic']) ? 1 : (empty($_GET['save']) ? 0 : -4));
     if ($displayorder == -2) {
         C::t('forum_forum')->update($_G['fid'], array('modworks' => '1'));
     } elseif ($displayorder == -4) {
         $_GET['addfeed'] = 0;
     }
     $digest = $_G['forum']['ismoderator'] && $_G['group']['allowdigestthread'] && !empty($_GET['addtodigest']) ? 1 : 0;
     $readperm = $_G['group']['allowsetreadperm'] ? $readperm : 0;
     $isanonymous = $_G['group']['allowanonymous'] && $_GET['isanonymous'] ? 1 : 0;
     $price = intval($price);
     $price = $_G['group']['maxprice'] && !$special ? $price <= $_G['group']['maxprice'] ? $price : $_G['group']['maxprice'] : 0;
     //强制主题类别判断
     if (!$typeid && $_G['forum']['threadtypes']['required'] && !$special) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_type_isnull');
     }
     //强制主题分类判断
     if (!$sortid && $_G['forum']['threadsorts']['required'] && !$special) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_sort_isnull');
     }
     //主题售价 客户端暂不支持
     if ($price > 0 && floor($price * (1 - $_G['setting']['creditstax'])) == 0) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
         showmessage('post_net_price_iszero');
     }
     //投票贴相关
     if ($special == 1) {
         $polloption = $_GET['tpolloption'] == 2 ? explode("\n", $_GET['polloptions']) : $_GET['polloption'];
         $pollarray = array();
         foreach ($polloption as $key => $value) {
             $polloption[$key] = censor($polloption[$key]);
             if (trim($value) === '') {
                 unset($polloption[$key]);
             }
         }
         if (count($polloption) > $_G['setting']['maxpolloptions']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('post_poll_option_toomany', '', array('maxpolloptions' => $_G['setting']['maxpolloptions']));
         } elseif (count($polloption) < 2) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('post_poll_inputmore');
         }
         $curpolloption = count($polloption);
         $pollarray['maxchoices'] = empty($_GET['maxchoices']) ? 0 : ($_GET['maxchoices'] > $curpolloption ? $curpolloption : $_GET['maxchoices']);
         $pollarray['multiple'] = empty($_GET['maxchoices']) || $_GET['maxchoices'] == 1 ? 0 : 1;
         $pollarray['options'] = $polloption;
         $pollarray['visible'] = empty($_GET['visibilitypoll']);
         $pollarray['overt'] = !empty($_GET['overt']);
         if (preg_match("/^\\d*\$/", trim($_GET['expiration']))) {
             if (empty($_GET['expiration'])) {
                 $pollarray['expiration'] = 0;
             } else {
                 $pollarray['expiration'] = TIMESTAMP + 86400 * $_GET['expiration'];
             }
         } else {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('poll_maxchoices_expiration_invalid');
         }
     }
     // 分类信息有效期
     $_GET['typeexpiration'] = $_GET['typeoption']['typeexpiration'];
     $sortid = $special && $_G['forum']['threadsorts']['types'][$sortid] ? 0 : $sortid;
     $typeexpiration = intval($_GET['typeexpiration']);
     if ($_G['forum']['threadsorts']['expiration'][$typeid] && !$typeexpiration) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'threadtype_expiration_invalid');
     }
     $_G['forum_optiondata'] = array();
     if ($_G['forum']['threadsorts']['types'][$sortid] && !$_G['forum']['allowspecialonly']) {
         Mobcent::import(MOBCENT_APP_ROOT . '/components/discuz/source/function/function_threadsort.php');
         $_G['forum_optiondata'] = mobcent_threadsort_validator($_GET['typeoption'], $pid);
         if ($_G['forum_optiondata']['message'] != '') {
             return WebUtils::makeErrorInfo_oldVersion($res, $_G['forum_optiondata']['message'], $_G['forum_optiondata']['params']);
         }
     }
     $author = !$isanonymous ? $_G['username'] : '';
     $moderated = $digest || $displayorder > 0 ? 1 : 0;
     $thread['status'] = 0;
     $_GET['ordertype'] && ($thread['status'] = setstatus(4, 1, $thread['status']));
     $_GET['hiddenreplies'] && ($thread['status'] = setstatus(2, 1, $thread['status']));
     /*             if($_G['group']['allowpostrushreply'] && $_GET['rushreply']) {
              $_GET['rushreplyfrom'] = strtotime($_GET['rushreplyfrom']);
             $_GET['rushreplyto'] = strtotime($_GET['rushreplyto']);
             $_GET['rewardfloor'] = trim($_GET['rewardfloor']);
             $_GET['stopfloor'] = intval($_GET['stopfloor']);
             $_GET['creditlimit'] = $_GET['creditlimit'] == '' ? '-996' : intval($_GET['creditlimit']);
             if($_GET['rushreplyfrom'] > $_GET['rushreplyto'] && !empty($_GET['rushreplyto'])) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('post_rushreply_timewrong');
             }
             if(($_GET['rushreplyfrom'] > $_G['timestamp']) || (!empty($_GET['rushreplyto']) && $_GET['rushreplyto'] < $_G['timestamp']) || ($_GET['stopfloor'] == 1) ) {
             $closed = true;
             }
             if(!empty($_GET['rewardfloor']) && !empty($_GET['stopfloor'])) {
             $floors = explode(',', $_GET['rewardfloor']);
             if(!empty($floors) && is_array($floors)) {
             foreach($floors AS $key => $floor) {
             if(strpos($floor, '*') === false) {
             if(intval($floor) == 0) {
             unset($floors[$key]);
             } elseif($floor > $_GET['stopfloor']) {
             unset($floors[$key]);
             }
             }
             }
             $_GET['rewardfloor'] = implode(',', $floors);
             }
             }
             $thread['status'] = setstatus(3, 1, $thread['status']);
             $thread['status'] = setstatus(1, 1, $thread['status']);
             } */
     $_GET['allownoticeauthor'] && ($thread['status'] = setstatus(6, 1, $thread['status']));
     $isgroup = $_G['forum']['status'] == 3 ? 1 : 0;
     /*  if($_G['group']['allowreplycredit']) {
              $_GET['replycredit_extcredits'] = intval($_GET['replycredit_extcredits']);
             $_GET['replycredit_times'] = intval($_GET['replycredit_times']);
             $_GET['replycredit_membertimes'] = intval($_GET['replycredit_membertimes']);
             $_GET['replycredit_random'] = intval($_GET['replycredit_random']);
     
             $_GET['replycredit_random'] = $_GET['replycredit_random'] < 0 || $_GET['replycredit_random'] > 99 ? 0 : $_GET['replycredit_random'] ;
             $replycredit = $replycredit_real = 0;
             if($_GET['replycredit_extcredits'] > 0 && $_GET['replycredit_times'] > 0) {
             $replycredit_real = ceil(($_GET['replycredit_extcredits'] * $_GET['replycredit_times']) + ($_GET['replycredit_extcredits'] * $_GET['replycredit_times'] *  $_G['setting']['creditstax']));
             if($replycredit_real > getuserprofile('extcredits'.$_G['setting']['creditstransextra'][10])) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('replycredit_morethan_self');
             } else {
             $replycredit = ceil($_GET['replycredit_extcredits'] * $_GET['replycredit_times']);
             }
             }
             } */
     $newthread = array('fid' => $_G['fid'], 'posttableid' => 0, 'readperm' => $readperm, 'price' => $price, 'typeid' => $typeid, 'sortid' => $sortid, 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => 0, 'moderated' => $moderated, 'status' => $thread['status'] | $topicStatus, 'isgroup' => $isgroup, 'replycredit' => $replycredit, 'closed' => $closed ? 1 : 0);
     $tid = C::t('forum_thread')->insert($newthread, true);
     useractionlog($_G['uid'], 'tid');
     if (!getuserprofile('threads') && $_G['setting']['newbie']) {
         C::t('forum_thread')->update($tid, array('icon' => $_G['setting']['newbie']));
     }
     if ($publishdate != $_G['timestamp']) {
         loadcache('cronpublish');
         $cron_publish_ids = dunserialize($_G['cache']['cronpublish']);
         $cron_publish_ids[$tid] = $tid;
         $cron_publish_ids = serialize($cron_publish_ids);
         savecache('cronpublish', $cron_publish_ids);
     }
     if (!$isanonymous) {
         C::t('common_member_field_home')->update($_G['uid'], array('recentnote' => $subject));
     }
     if ($special == 3 && $_G['group']['allowpostreward']) {
         updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][2] => -$realprice), 1, 'RTC', $tid);
     }
     if ($moderated) {
         updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
         updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
     }
     /* if($special == 1) {
     
             foreach($pollarray['options'] as $polloptvalue) {
             $polloptvalue = dhtmlspecialchars(trim($polloptvalue));
             C::t('forum_polloption')->insert(array('tid' => $tid, 'polloption' => $polloptvalue));
             }
             $polloptionpreview = '';
             $query = C::t('forum_polloption')->fetch_all_by_tid($tid, 1, 2);
             foreach($query as $option) {
             $polloptvalue = preg_replace("/\[url=(https?){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $option['polloption']);
             $polloptionpreview .= $polloptvalue."\t";
             }
     
             $polloptionpreview = daddslashes($polloptionpreview);
     
             $data = array('tid' => $tid, 'multiple' => $pollarray['multiple'], 'visible' => $pollarray['visible'], 'maxchoices' => $pollarray['maxchoices'], 'expiration' => $pollarray['expiration'], 'overt' => $pollarray['overt'], 'pollpreview' => $polloptionpreview);
             C::t('forum_poll')->insert($data);
             } */
     if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata'])) {
         $filedname = $valuelist = $separator = '';
         foreach ($_G['forum_optiondata'] as $optionid => $value) {
             if ($value) {
                 $filedname .= $separator . $_G['forum_optionlist'][$optionid]['identifier'];
                 $valuelist .= $separator . "'" . daddslashes($value) . "'";
                 $separator = ' ,';
             }
             if ($_G['forum_optionlist'][$optionid]['type'] == 'image') {
                 $identifier = $_G['forum_optionlist'][$optionid]['identifier'];
                 $sortaids[] = intval($_GET['typeoption'][$identifier]['aid']);
             }
             C::t('forum_typeoptionvar')->insert(array('sortid' => $sortid, 'tid' => $tid, 'fid' => $_G['fid'], 'optionid' => $optionid, 'value' => censor($value), 'expiration' => $typeexpiration ? $publishdate + $typeexpiration : 0));
         }
         if ($filedname && $valuelist) {
             C::t('forum_optionvalue')->insert($sortid, "({$filedname}, tid, fid) VALUES ({$valuelist}, '{$tid}', '{$_G['fid']}')");
         }
     }
     if ($_G['group']['allowat']) {
         $atlist = $atlist_tmp = array();
         preg_match_all("/@([^\r\n]*?)\\s/i", $message . ' ', $atlist_tmp);
         $atlist_tmp = array_slice(array_unique($atlist_tmp[1]), 0, $_G['group']['allowat']);
         if (!empty($atlist_tmp)) {
             if (empty($_G['setting']['at_anyone'])) {
                 foreach (C::t('home_follow')->fetch_all_by_uid_fusername($_G['uid'], $atlist_tmp) as $row) {
                     $atlist[$row['followuid']] = $row['fusername'];
                 }
                 if (count($atlist) < $_G['group']['allowat']) {
                     $query = C::t('home_friend')->fetch_all_by_uid_username($_G['uid'], $atlist_tmp);
                     foreach ($query as $row) {
                         $atlist[$row['fuid']] = $row['fusername'];
                     }
                 }
             } else {
                 foreach (C::t('common_member')->fetch_all_by_username($atlist_tmp) as $row) {
                     $atlist[$row['uid']] = $row['username'];
                 }
             }
         }
         if ($atlist) {
             foreach ($atlist as $atuid => $atusername) {
                 $atsearch[] = "/@" . str_replace('/', '\\/', preg_quote($atusername)) . " /i";
                 $atreplace[] = "[url=home.php?mod=space&uid={$atuid}]@{$atusername}[/url] ";
             }
             $message = preg_replace($atsearch, $atreplace, $message . ' ', 1);
         }
     }
     $bbcodeoff = checkbbcodes($message, !empty($_GET['bbcodeoff']));
     $smileyoff = checksmilies($message, !empty($_GET['smileyoff']));
     $parseurloff = !empty($_GET['parseurloff']);
     $htmlon = $_G['group']['allowhtml'] && !empty($_GET['htmlon']) ? 1 : 0;
     $usesig = !empty($_GET['usesig']) && $_G['group']['maxsigsize'] ? 1 : 0;
     $class_tag = new tag();
     $tagstr = $class_tag->add_tag($_GET['tags'], $tid, 'tid');
     /* if($_G['group']['allowreplycredit']) {
         if($replycredit > 0 && $replycredit_real > 0) {
        updatemembercount($_G['uid'], array('extcredits'.$_G['setting']['creditstransextra'][10] => -$replycredit_real), 1, 'RCT', $tid);
        $insertdata = array(
                'tid' => $tid,
                'extcredits' => $_GET['replycredit_extcredits'],
                'extcreditstype' => $_G['setting']['creditstransextra'][10],
                'times' => $_GET['replycredit_times'],
                'membertimes' => $_GET['replycredit_membertimes'],
                'random' => $_GET['replycredit_random']
        );
        C::t('forum_replycredit')->insert($insertdata);
        }
        } */
     if ($_G['group']['allowpostrushreply'] && $_GET['rushreply']) {
         $rushdata = array('tid' => $tid, 'stopfloor' => $_GET['stopfloor'], 'starttimefrom' => $_GET['rushreplyfrom'], 'starttimeto' => $_GET['rushreplyto'], 'rewardfloor' => $_GET['rewardfloor'], 'creditlimit' => $_GET['creditlimit']);
         C::t('forum_threadrush')->insert($rushdata);
     }
     $pinvisible = $modnewthreads ? -2 : (empty($_GET['save']) ? 0 : -3);
     $message = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $message);
     $pid = insertpost(array('fid' => $_G['fid'], 'tid' => $tid, 'first' => '1', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'tags' => $tagstr, 'replycredit' => 0, 'status' => (defined('IN_MOBILE') ? 8 : 0) | $postStatus));
     if ($_G['group']['allowat'] && $atlist) {
         foreach ($atlist as $atuid => $atusername) {
             notification_add($atuid, 'at', 'at_message', array('from_id' => $tid, 'from_idtype' => 'at', 'buyerid' => $_G['uid'], 'buyer' => $_G['username'], 'tid' => $tid, 'subject' => $subject, 'pid' => $pid, 'message' => messagecutstr($message, 150)));
         }
         set_atlist_cookie(array_keys($atlist));
     }
     $threadimageaid = 0;
     $threadimage = array();
     if ($special == 4 && $_GET['activityaid']) {
         $threadimageaid = $_GET['activityaid'];
         convertunusedattach($_GET['activityaid'], $tid, $pid);
     }
     if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata']) && $sortaids) {
         foreach ($sortaids as $sortaid) {
             convertunusedattach($sortaid, $tid, $pid);
         }
     }
     if (($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_GET['attachnew'] || $sortid || !empty($_GET['activityaid']))) {
         updateattach($displayorder == -4 || $modnewthreads, $tid, $pid, $_GET['attachnew']);
         if (!$threadimageaid) {
             $threadimage = C::t('forum_attachment_n')->fetch_max_image('tid:' . $tid, 'tid', $tid);
             $threadimageaid = $threadimage['aid'];
         }
     }
     $values = array('fid' => $_G['fid'], 'tid' => $tid, 'pid' => $pid, 'coverimg' => '', 'sechash' => !empty($_GET['sechash']) ? $_GET['sechash'] : '');
     $param = array();
     Mobcent::import(MOBCENT_APP_ROOT . '/components/discuz/source/function/function_post.php');
     if ($_G['forum']['picstyle']) {
         if (!mobcent_setthreadcover($pid, 0, $threadimageaid)) {
             preg_match_all("/(\\[img\\]|\\[img=\\d{1,4}[x|\\,]\\d{1,4}\\])\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/is", $message, $imglist, PREG_SET_ORDER);
             $values['coverimg'] = "<p id=\"showsetcover\">" . lang('message', 'post_newthread_set_cover') . "<span id=\"setcoverwait\"></span></p><script>if(\$('forward_a')){\$('forward_a').style.display='none';setTimeout(\"\$('forward_a').style.display=''\", 5000);};ajaxget('forum.php?mod=ajax&action=setthreadcover&tid={$tid}&pid={$pid}&fid={$_G['fid']}&imgurl={$imglist[0][2]}&newthread=1', 'showsetcover', 'setcoverwait')</script>";
             $param['clean_msgforward'] = 1;
             $param['timeout'] = $param['refreshtime'] = 15;
         }
     }
     if ($threadimageaid) {
         if (!$threadimage) {
             $threadimage = C::t('forum_attachment_n')->fetch('tid:' . $tid, $threadimageaid);
         }
         $threadimage = daddslashes($threadimage);
         C::t('forum_threadimage')->insert(array('tid' => $tid, 'attachment' => $threadimage['attachment'], 'remote' => $threadimage['remote']));
     }
     $statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
     include_once libfile('function/stat');
     updatestat($isgroup ? 'groupthread' : $statarr[$special]);
     if ($modnewthreads) {
         updatemoderate('tid', $tid);
         C::t('forum_forum')->update_forum_counter($_G['fid'], 0, 0, 1);
         manage_addnotify('verifythread');
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_newthread_mod_succeed', array('noError' => 1));
         //showmessage('post_newthread_mod_succeed', $returnurl, $values, $param);
     } else {
         if ($displayorder >= 0 && helper_access::check_module('follow') && !empty($_GET['adddynamic']) && !$isanonymous) {
             require_once libfile('function/discuzcode');
             require_once libfile('function/followcode');
             $feedcontent = array('tid' => $tid, 'content' => followcode($message, $tid, $pid, 1000));
             C::t('forum_threadpreview')->insert($feedcontent);
             C::t('forum_thread')->update_status_by_tid($tid, '512');
             $followfeed = array('uid' => $_G['uid'], 'username' => $_G['username'], 'tid' => $tid, 'note' => '', 'dateline' => TIMESTAMP);
             $values['feedid'] = C::t('home_follow_feed')->insert($followfeed, true);
             C::t('common_member_count')->increase($_G['uid'], array('feeds' => 1));
         }
         $feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
         if ($displayorder != -4) {
             if ($digest) {
                 updatepostcredits('+', $_G['uid'], 'digest', $_G['fid']);
             }
             //updatepostcredits('+',  $_G['uid'], 'post', $_G['fid']);
             Mobcent::import(MOBCENT_APP_ROOT . '/components/discuz/source/function/function_post.php');
             //Yii::import('application.components.discuz.source.function.function_post', true);
             mobcent_updatepostcredits('+', $_G['uid'], 'post', $_G['fid']);
             if ($isgroup) {
                 C::t('forum_groupuser')->update_counter_for_user($_G['uid'], $_G['fid'], 1);
             }
             $subject = str_replace("\t", ' ', $subject);
             $lastpost = "{$tid}\t" . $subject . "\t{$_G['timestamp']}\t{$author}";
             C::t('forum_forum')->update($_G['fid'], array('lastpost' => $lastpost));
             C::t('forum_forum')->update_forum_counter($_G['fid'], 1, 1, 1);
             if ($_G['forum']['type'] == 'sub') {
                 C::t('forum_forum')->update($_G['forum']['fup'], array('lastpost' => $lastpost));
             }
         }
         if ($_G['forum']['status'] == 3) {
             C::t('forum_forumfield')->update($_G['fid'], array('lastupdate' => TIMESTAMP));
             require_once libfile('function/grouplog');
             updategroupcreditlog($_G['fid'], $_G['uid']);
         }
         /*如果显示地理位置,入库到表里*/
         if ($jsonInfo['isShowPostion']) {
             $data = DB::query('INSERT INTO  %t VALUES(null,%f,%f,%d,%d,%s)', array('home_surrounding_user', $jsonInfo['longitude'], $jsonInfo['latitude'], $tid, 3, (string) $jsonInfo['location']));
         }
         /*  //客户端发表主题积分入库
                $temp = DB::fetch_first('SELECT extcredits3  FROM '.DB::table('common_credit_rule').' WHERE rid =%d ',array(1));
                $extcredits3 = DB::fetch_first('SELECT extcredits3 FROM '.DB::table('common_member_count').' WHERE uid = %d',array($_G['uid']));
                $temp = $extcredits3['extcredits3'] + $temp['extcredits3'];
                DB::query('UPDATE '.DB::table('common_member_count').' set extcredits3 = %d WHERE uid = %d',array($temp,$_G['uid']));
             */
         //showmessage('post_newthread_succeed', $returnurl, $values, $param);
         // return array('rs'=>1,'errcode'=>WebUtils::t('发贴成功'));
         return $this->makeErrorInfo($res, 'mobcent_post_newthread_success', array('noError' => 1));
     }
 }
Пример #14
0
 if (helper_access::check_module('portal')) {
     $search_portal = array($setting['search']['portal']['status'] ? '<input type="checkbox" class="checkbox" name="settingnew[search][portal][status]" value="1" checked="checked" />' : '<input type="checkbox" class="checkbox" name="settingnew[search][portal][status]" value="1" />', cplang('setting_search_status_portal'), '<input type="text" class="txt" name="settingnew[search][portal][searchctrl]" value="' . $setting['search']['portal']['searchctrl'] . '" />', '<input type="text" class="txt" name="settingnew[search][portal][maxspm]" value="' . $setting['search']['portal']['maxspm'] . '" />', '<input type="text" class="txt" name="settingnew[search][portal][maxsearchresults]" value="' . $setting['search']['portal']['maxsearchresults'] . '" />');
 }
 if (!$appService->getCloudAppStatus('search')) {
     $search_forum = array($setting['search']['forum']['status'] ? '<input type="checkbox" class="checkbox" name="settingnew[search][forum][status]" value="1" checked="checked" />' : '<input type="checkbox" class="checkbox" name="settingnew[search][forum][status]" value="1" />', cplang('setting_search_status_forum'), '<input type="text" class="txt" name="settingnew[search][forum][searchctrl]" value="' . $setting['search']['forum']['searchctrl'] . '" />', '<input type="text" class="txt" name="settingnew[search][forum][maxspm]" value="' . $setting['search']['forum']['maxspm'] . '" />', '<input type="text" class="txt" name="settingnew[search][forum][maxsearchresults]" value="' . $setting['search']['forum']['maxsearchresults'] . '" />');
 }
 if (helper_access::check_module('blog')) {
     $search_blog = array($setting['search']['blog']['status'] ? '<input type="checkbox" class="checkbox" name="settingnew[search][blog][status]" value="1" checked="checked" />' : '<input type="checkbox" class="checkbox" name="settingnew[search][blog][status]" value="1" />', cplang('setting_search_status_blog'), '<input type="text" class="txt" name="settingnew[search][blog][searchctrl]" value="' . $setting['search']['blog']['searchctrl'] . '" />', '<input type="text" class="txt" name="settingnew[search][blog][maxspm]" value="' . $setting['search']['blog']['maxspm'] . '" />', '<input type="text" class="txt" name="settingnew[search][blog][maxsearchresults]" value="' . $setting['search']['blog']['maxsearchresults'] . '" />');
 }
 if (helper_access::check_module('album')) {
     $search_album = array($setting['search']['album']['status'] ? '<input type="checkbox" class="checkbox" name="settingnew[search][album][status]" value="1" checked="checked" />' : '<input type="checkbox" class="checkbox" name="settingnew[search][album][status]" value="1" />', cplang('setting_search_status_album'), '<input type="text" class="txt" name="settingnew[search][album][searchctrl]" value="' . $setting['search']['album']['searchctrl'] . '" />', '<input type="text" class="txt" name="settingnew[search][album][maxspm]" value="' . $setting['search']['album']['maxspm'] . '" />', '<input type="text" class="txt" name="settingnew[search][album][maxsearchresults]" value="' . $setting['search']['album']['maxsearchresults'] . '" />');
 }
 if (helper_access::check_module('group')) {
     $search_group = array($setting['search']['group']['status'] ? '<input type="checkbox" class="checkbox" name="settingnew[search][group][status]" value="1" checked="checked" />' : '<input type="checkbox" class="checkbox" name="settingnew[search][group][status]" value="1" />', cplang('setting_search_status_group'), '<input type="text" class="txt" name="settingnew[search][group][searchctrl]" value="' . $setting['search']['group']['searchctrl'] . '" />', '<input type="text" class="txt" name="settingnew[search][group][maxspm]" value="' . $setting['search']['group']['maxspm'] . '" />', '<input type="text" class="txt" name="settingnew[search][group][maxsearchresults]" value="' . $setting['search']['group']['maxsearchresults'] . '" />');
 }
 if (helper_access::check_module('collection')) {
     $search_collection = array($setting['search']['collection']['status'] ? '<input type="checkbox" class="checkbox" name="settingnew[search][collection][status]" value="1" checked="checked" />' : '<input type="checkbox" class="checkbox" name="settingnew[search][collection][status]" value="1" />', cplang('setting_search_status_collection'), '<input type="text" class="txt" name="settingnew[search][collection][searchctrl]" value="' . $setting['search']['collection']['searchctrl'] . '" />', '<input type="text" class="txt" name="settingnew[search][collection][maxspm]" value="' . $setting['search']['collection']['maxspm'] . '" />', '<input type="text" class="txt" name="settingnew[search][collection][maxsearchresults]" value="' . $setting['search']['collection']['maxsearchresults'] . '" />');
 }
 showtablerow('', array('width="100"', 'width="120"', 'width="120"', 'width="120"'), $search_portal);
 showtablerow('', '', $search_forum);
 showtablerow('', '', $search_blog);
 showtablerow('', '', $search_album);
 showtablerow('', '', $search_group);
 showtablerow('', '', $search_collection);
 showtablefooter();
 if (!$appService->getCloudAppStatus('search')) {
     showtableheader('setting_search_srchhotkeywords');
     showsetting('setting_search_srchhotkeywords', 'settingnew[srchhotkeywords]', $setting['srchhotkeywords'], 'textarea');
     showtablefooter();
     showtableheader('settings_sphinx', 'fixpadding');
     showsetting('settings_sphinx_sphinxon', 'settingnew[sphinxon]', $setting['sphinxon'], 'radio');
Пример #15
0
<li><a href="admin.php?action=threads&amp;operation=group&amp;searchsubmit=1&amp;detail=1&amp;search=true&amp;fromumanage=1&amp;users=<?php echo $encodeusername;?>" target="_blank">群组主题</a></li>
<li><a href="admin.php?action=prune&amp;searchsubmit=1&amp;detail=1&amp;operation=group&amp;fromumanage=1&amp;users=<?php echo $encodeusername;?>" target="_blank">群组帖子</a></li>
<?php } ?>
</ul>
<?php } } ?>
</p>
</div>

<?php if(!empty($_G['setting']['pluginhooks']['space_menu_extra'])) echo $_G['setting']['pluginhooks']['space_menu_extra'];?>
<ul class="tb cl" style="padding-left: 75px;">
<?php if(helper_access::check_module('follow')) { ?>
<li<?php if(CURMODULE == 'follow') { ?> class="a"<?php } ?>><a href="home.php?mod=follow&amp;uid=<?php echo $space['uid'];?>&amp;do=view&amp;from=space">广播</a></li>
<?php } ?>
<li<?php if($do=='thread') { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=thread&amp;view=me&amp;from=space">主题</a></li>
<?php if(helper_access::check_module('blog')) { ?>
<li<?php if($do=='blog') { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=blog&amp;view=me&amp;from=space">日志</a></li>
<?php } if(helper_access::check_module('album')) { ?>
<li<?php if($do=='album') { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=album&amp;view=me&amp;from=space">相册</a></li>
<?php } if(helper_access::check_module('doing')) { ?>
<li<?php if($do=='doing') { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=doing&amp;view=me&amp;from=space">记录</a></li>
<?php } if(helper_access::check_module('home')) { ?>
<li<?php if($do=='home') { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=home&amp;view=me&amp;from=space">动态</a></li>
<?php } if(helper_access::check_module('share')) { ?>
<li<?php if($do=='share') { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=share&amp;view=me&amp;from=space">分享</a></li>
<?php } if(helper_access::check_module('wall')) { ?>
<li<?php if($do==wall) { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=wall&amp;from=space">留言板</a></li>
<?php } ?>
<li<?php if($do==profile) { ?> class="a"<?php } ?>><a href="home.php?mod=space&amp;uid=<?php echo $space['uid'];?>&amp;do=profile&amp;from=space">个人资料</a></li>
</ul>
</div>
<?php } ?>
Пример #16
0
    <p class="copyright">Copyright &copy; 2014 <?php if($_G['setting']['icp']) { ?>( <?php echo $_G['setting']['icp'];?> )<?php } ?></p>
    <p class="powered">Powered by <a href="http://www.discuz.net" target="_blank">Discuz!</a> <em><?php echo $_G['setting']['version'];?></em><?php if(!empty($_G['setting']['boardlicensed'])) { ?> <a href="http://license.comsenz.com/?pid=1&amp;host=<?php echo $_SERVER['HTTP_HOST'];?>" target="_blank">Licensed</a><?php } ?></p>
     
    <span class="slogan"><?php echo $_G['setting']['sitename'];?></span>

    </div><?php updatesession();?><?php if($_G['uid'] && $_G['group']['allowinvisible']) { ?>
<script type="text/javascript">
var invisiblestatus = '<?php if($_G['session']['invisible']) { ?>隐身<?php } else { ?>在线<?php } ?>';
var loginstatusobj = $('loginstatusid');
if(loginstatusobj != undefined && loginstatusobj != null) loginstatusobj.innerHTML = invisiblestatus;
</script>
<?php } ?>
</div>
<?php } if(!$_G['setting']['bbclosed'] && !$_G['member']['freeze'] && !$_G['member']['groupexpiry']) { if($_G['uid'] && !isset($_G['cookie']['checkpm'])) { ?>
<script src="home.php?mod=spacecp&ac=pm&op=checknewpm&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } if($_G['uid'] && helper_access::check_module('follow') && !isset($_G['cookie']['checkfollow'])) { ?>
<script src="home.php?mod=spacecp&ac=follow&op=checkfeed&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } if(!isset($_G['cookie']['sendmail'])) { ?>
<script src="home.php?mod=misc&ac=sendmail&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !isset($_G['cookie']['checkpatch'])) { ?>
<script src="misc.php?mod=patch&action=checkpatch&rand=<?php echo $_G['timestamp'];?>" type="text/javascript"></script>
<?php } } if($_GET['diy'] == 'yes') { if(check_diy_perm($topic) && (empty($do) || $do != 'index')) { ?>
<script src="<?php echo $_G['setting']['jspath'];?>common_diy.js?<?php echo VERHASH;?>" type="text/javascript"></script>
<script src="<?php echo $_G['setting']['jspath'];?>portal_diy<?php if(!check_diy_perm($topic, 'layout')) { ?>_data<?php } ?>.js?<?php echo VERHASH;?>" type="text/javascript"></script>
<?php } if($space['self'] && CURMODULE == 'space' && $do == 'index') { ?>
<script src="<?php echo $_G['setting']['jspath'];?>common_diy.js?<?php echo VERHASH;?>" type="text/javascript"></script>
<script src="<?php echo $_G['setting']['jspath'];?>space_diy.js?<?php echo VERHASH;?>" type="text/javascript"></script>
<?php } } if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && $_G['setting']['showpatchnotice'] == 1) { ?>
<script type="text/javascript">patchNotice();</script>
<?php } if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && empty($_G['cookie']['pluginnotice'])) { ?>
<div class="focus plugin" id="plugin_notice"></div>
Пример #17
0
 /**
  * 上传相册图片
  * 
  * @param mixed $allowValue 允许上传图片编号(file=name[]).
  * @param int   $albumId 相册ID
  *
  * @return array 
  */
 private function _uploadAlbum($allowValue, $albumId)
 {
     global $_G;
     $_FILES["Filedata"] = array('name' => $_FILES['uploadFile']['name'][$allowValue], 'type' => $_FILES['uploadFile']['type'][$allowValue], 'tmp_name' => $_FILES['uploadFile']['tmp_name'][$allowValue], 'error' => $_FILES['uploadFile']['error'][$allowValue], 'size' => $_FILES['uploadFile']['size'][$allowValue]);
     // /source/module/misc/misc_swfupload.php
     $res = array();
     if (helper_access::check_module('album')) {
         require_once libfile('function/spacecp');
         if ($_FILES["Filedata"]['error']) {
             $file = lang('spacecp', 'file_is_too_big');
         } else {
             require_once libfile('function/home');
             $_FILES["Filedata"]['name'] = addslashes(diconv(urldecode($_FILES["Filedata"]['name']), 'UTF-8'));
             // 为了水印的问题来修改discuz的方法
             Yii::import('application.components.discuz.source.function.function_spacecp', true);
             $file = mobcent_pic_save($_FILES["Filedata"], $albumId, '', true, 0);
             if (!empty($file) && is_array($file)) {
                 $url = pic_get($file['filepath'], 'album', $file['thumb'], $file['remote']);
                 $bigimg = pic_get($file['filepath'], 'album', 0, $file['remote']);
                 // echo "{\"picid\":\"$file[picid]\", \"url\":\"$url\", \"bigimg\":\"$bigimg\"}";
                 // die;
                 $res['id'] = $file['picid'];
                 $res['urlName'] = $_G['setting']['ftp']['on'] == 1 ? $this->_processPath($bigimg) : $this->getController()->dzRootUrl . '/' . $bigimg;
                 // ??图片的描述:暂时albumPicDesc[]的方式传进来
                 // C::t('home_pic')->update_for_uid($_G['uid'], $file['picid'], array('title'=>'123321', 'albumid' => $albumId));
                 // if($albumId) {
                 //     album_update_pic($albumId);
                 // }
             }
             // echo WebUtils::u($file);
         }
     }
     return $res;
 }
    $_GET['orderby'] = '';
    if (!defined('IN_ARCHIVER')) {
        include template('diy:forum/forumdisplay:' . $_G['fid']);
    } else {
        include loadarchiver('forum/forumdisplay');
    }
    exit;
}
if ($_GET['filter'] != 'hot') {
    $page = $_G['setting']['threadmaxpages'] && $page > $_G['setting']['threadmaxpages'] ? 1 : $page;
}
if ($_G['forum']['modrecommend'] && $_G['forum']['modrecommend']['open']) {
    $_G['forum']['recommendlist'] = recommendupdate($_G['fid'], $_G['forum']['modrecommend'], '', 1);
}
$recommendgroups = array();
if ($_G['forum']['status'] != 3 && helper_access::check_module('group')) {
    loadcache('forumrecommend');
    $recommendgroups = $_G['cache']['forumrecommend'][$_G['fid']];
}
if ($recommendgroups) {
    if (empty($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'recommendgroups_' . $_G['fid']) === FALSE) {
        $collapse['recommendgroups'] = '';
        $collapseimg['recommendgroups'] = 'collapsed_no.gif';
    } else {
        $collapse['recommendgroups'] = 'display: none';
        $collapseimg['recommendgroups'] = 'collapsed_yes.gif';
    }
}
if (!$simplestyle || !$_G['forum']['allowside'] && $page == 1) {
    if ($_G['cache']['announcements_forum'] && (!$_G['cache']['announcements_forum']['endtime'] || $_G['cache']['announcements_forum']['endtime'] > TIMESTAMP)) {
        $announcement = $_G['cache']['announcements_forum'];
Пример #19
0
} else {
    $wheresql = '';
    $list = array();
    $rid = intval($_GET['rid']);
    if ($_GET['rid']) {
        $wheresql = " AND rid='{$rid}'";
    }
    require_once libfile('function/forumlist');
    $select = forumselect(false, 0, $_GET['fid']);
    $keys = array_keys($_G['setting']['extcredits']);
    foreach (C::t('common_credit_rule')->fetch_all_by_rid($rid) as $value) {
        if (!helper_access::check_module('doing') && $value['action'] == 'doing') {
            continue;
        } elseif (!helper_access::check_module('blog') && $value['action'] == 'publishblog') {
            continue;
        } elseif (!helper_access::check_module('wall') && in_array($value['action'], array('guestbook', 'getguestbook'))) {
            continue;
        }
        if (empty($_GET['fid']) || in_array($value['action'], array('digest', 'post', 'reply', 'getattach', 'postattach'))) {
            if (checkvalue($value, $keys)) {
                $list[$value['action']] = $value;
            }
        }
    }
    if (!empty($_GET['fid'])) {
        $_GET['fid'] = intval($_GET['fid']);
        $foruminfo = C::t('forum_forumfield')->fetch($_GET['fid']);
        $flist = dunserialize($foruminfo['creditspolicy']);
        foreach ($flist as $action => $value) {
            $list[$value['action']] = $value;
        }
Пример #20
0
function get_cachedata_mainnav() {
	global $_G;

	$data['navs'] = $data['subnavs'] = $data['menunavs'] = $data['navmns'] = $data['navmn'] = $data['navdms'] = $navids = array();
	foreach(C::t('common_nav')->fetch_all_mainnav() as $nav) {
		if($nav['available'] < 0) {
			continue;
		}
		$id = $nav['type'] == 0 ? $nav['identifier'] : 100 + $nav['id'];
		if($nav['identifier'] == 1 && $nav['type'] == 0 && !helper_access::check_module('portal')) {
			$nav['available'] = 0;
		}
		if($nav['identifier'] == 3 && $nav['type'] == 0 && !helper_access::check_module('group')) {
			$nav['available'] = 0;
		}
		if($nav['identifier'] == 4 && $nav['type'] == 0 && !helper_access::check_module('feed')) {
			$nav['available'] = 0;
		}
		if($nav['type'] == 3) {
			if(!in_array($nav['identifier'], $_G['setting']['plugins']['available'])) {
				continue;
			}
		}
		if($nav['identifier'] == 5 && $nav['type'] == 0 && !$_G['setting']['my_app_status']) {
			$nav['available'] = 0;
		}
		if($nav['identifier'] == 8 && $nav['type'] == 0 && !$_G['setting']['ranklist']['status']) {
			$nav['available'] = 0;
		}
		$nav['style'] = parsehighlight($nav['highlight']);
/*vot*/		$data['navs'][$id]['id'] = $nav['identifier'];
		$data['navs'][$id]['navname'] = $nav['name'];
/*vot*/		$nav['name'] .= ($nav['identifier'] == 5 && $nav['type'] == 0 ? '<b class="icon_down"></b>' : '');
		$data['navs'][$id]['filename'] = $nav['url'];
		$data['navs'][$id]['available'] = $nav['available'];
		$nav['name'] = $nav['name'].($nav['title'] ? '<span>'.$nav['title'].'</span>' : '');
/*vot*/		$subnavs = array();

//--------------------------------
//vot Get All Sub-navigation links

/*vot*/		$subindex = 0;

		foreach(C::t('common_nav')->fetch_all_subnav($nav['id']) as $subnav) {

/*vot*/			$subnavs[$subindex] = $subnav;

//vot			$item = "<a href=\"$subnav[url]\" hidefocus=\"true\" ".($subnav['title'] ? "title=\"$subnav[title]\" " : '').($subnav['target'] == 1 ? "target=\"_blank\" " : '').parsehighlight($subnav['highlight']).">$subnav[name]</a>";
			$liparam = !$nav['subtype'] || !$nav['subcols'] ? '' : ' style="width:'.sprintf('%1.1f', (1 / $nav['subcols']) * 100).'%"';

//vot			$subnavs .= '<li'.$liparam.'>'.$item.'</li>';

/*vot*/			$extra = " hidefocus=\"true\" ".($subnav['target'] == 1 ? "target=\"_blank\" " : '').parsehighlight($subnav['highlight']);

//			$subnavs[$subindex]['title'] = $title; // Translate this!,
			$subnavs[$subindex]['extra'] = $extra;
			$subnavs[$subindex]['liparam'] = $liparam;

/*vot*/			$subindex++;
		}
		list($navid) = explode('.', basename($nav['url']));
		if($nav['type'] || $navid == 'misc' || $nav['identifier'] == 6) {
			if($nav['type'] == 4) {
				$navid = 'P'.$nav['identifier'];
			} elseif($nav['type'] == 5) {
				$navid = 'F'.$nav['identifier'];
			} else {
				$navid = 'N'.substr(md5(($nav['url'] != '#' ? $nav['url'] : $nav['name'])), 0, 4);
			}
		}
		$navid = 'mn_'.$navid;
		if(in_array($navid, $navids)) {
			$navid .= '_'.$nav['identifier'];
		}
		$navids[] = $navid;
		$onmouseover = '';
		if($subnavs) {
			if($nav['subtype']) {
				$onmouseover = 'navShow(\''.substr($navid, 3).'\')';
				$data['subnavs'][$navid] = $subnavs;
			} else {
				$onmouseover = 'showMenu({\'ctrlid\':this.id,\'ctrlclass\':\'hover\',\'duration\':2})';
//vot				$data['menunavs'][] = '<ul class="p_pop h_pop" id="'.$navid.'_menu" style="display: none">'.$subnavs.'</ul>';
/*vot*/				$data['menunavs'][$navid] = $subnavs;
			}
		}
		if($nav['identifier'] == 6 && $nav['type'] == 0) {
			if(!empty($_G['setting']['plugins']['jsmenu'])) {
				$onmouseover .= "showMenu({'ctrlid':this.id,'ctrlclass':'hover','menuid':'plugin_menu'})";
			} else {
				$data['navs'][$id]['available'] = 0;
				continue;
			}
		}
		if($nav['identifier'] == 5 && $nav['type'] == 0) {
			$onmouseover = 'delayShow(this, function () {showMenu({\'ctrlid\':\'mn_userapp\',\'pos\':\'43!\',\'ctrlclass\':\'a\',\'duration\':2});showUserApp();})';
			$data['menunavs'][] = '<div class="p_pop h_pop" id="'.$navid.'_menu" style="display: none"></div>';
			$data['subnavs'][$navid] = '';
		}

		if($nav['logo']) {
			$navlogo = str_replace('{STATICURL}', STATICURL, $nav['logo']);
			if(!preg_match("/^".preg_quote(STATICURL, '/')."/i", $navlogo) && !(($valueparse = parse_url($navlogo)) && isset($valueparse['host']))) {
				$navlogo = $_G['setting']['attachurl'].'common/'.$nav['logo'];
			}
			$data['navlogos'][$navid] = '<a href="'.$nav['url'].'" title="'.$_G['setting']['bbname'].'"><img src="'.$navlogo.'" alt="'.$_G['setting']['bbname'].'" border="0" /></a>';
		}

		$purl = parse_url($nav['url']);
		$getvars = array();
		if($purl['query']) {
			parse_str($purl['query'], $getvars);
			$data['navmns'][$purl['path']][] = array($getvars, $navid);
		} elseif($purl['host']) {
			$data['navdms'][strtolower($purl['host'].$purl['path'])] = $navid;
		} elseif($purl['path']) {
			$data['navmn'][$purl['path']] = $navid;
		}
		if($nav['type'] == 0) {
			$domainkey = substr($purl['path'], 0, -strlen(strrchr($purl['path'], '.')));
			if(!empty($_G['setting']['domain']['app'][$domainkey]) && !in_array(strtolower($nav['title']), array('follow', 'guide', 'collection', 'blog', 'album', 'favorite', 'friend', 'share', 'doing'))) {
				$nav['url'] = 'http://'.$_G['setting']['domain']['app'][$domainkey];
			}
		}

		$data['navs'][$id]['navid'] = $navid;
		$data['navs'][$id]['level'] = $nav['level'];
/*vot*/		$data['navs'][$id]['nav'] = "id=\"$navid\" ".($onmouseover ? 'onmouseover="'.$onmouseover.'"' : '')."><a href=\"$nav[url]\" hidefocus=\"true\" ".($nav['title'] ? "title=\"$nav[title]\" " : '').($nav['target'] == 1 ? "target=\"_blank\" " : '')." $nav[style]";
	}
//vot	$data['menunavs'] = implode('', $data['menunavs']);

	return array($data['navs'], $data['subnavs'], $data['menunavs'], $data['navmns'], $data['navmn'], $data['navdms'], $data['navlogos']);

}
Пример #21
0
&amp;srchtxt={$keywordenc}&amp;searchsubmit=yes
EOF;
            }
            $slist[group] .= <<<EOF
"
EOF;
            if (CURMODULE == 'group') {
                $slist[group] .= <<<EOF
 class="a"
EOF;
            }
            $slist[group] .= <<<EOF
>{$_G['setting']['navs']['3']['navname']}</a>
EOF;
        }
        if (helper_access::check_module('collection') && $_G['setting']['search']['collection']['status'] && ($_G['group']['allowsearch'] & 64 || $_G['adminid'] == 1)) {
            $slist[collection] = <<<EOF
<a href="search.php?mod=collection
EOF;
            if ($keyword) {
                $slist[collection] .= <<<EOF
&amp;srchtxt={$keywordenc}&amp;searchsubmit=yes
EOF;
            }
            $slist[collection] .= <<<EOF
"
EOF;
            if (CURMODULE == 'collection') {
                $slist[collection] .= <<<EOF
 class="a"
EOF;
Пример #22
0
function discuzcode($message, $smileyoff, $bbcodeoff, $htmlon = 0, $allowsmilies = 1, $allowbbcode = 1, $allowimgcode = 1, $allowhtml = 0, $jammer = 0, $parsetype = '0', $authorid = '0', $allowmediacode = '0', $pid = 0, $lazyload = 0, $pdateline = 0, $first = 0)
{
    global $_G;
    static $authorreplyexist;
    if ($pid && strpos($message, '[/password]') !== FALSE) {
        if ($authorid != $_G['uid'] && !$_G['forum']['ismoderator']) {
            $message = preg_replace("/\\s?\\[password\\](.+?)\\[\\/password\\]\\s?/ie", "parsepassword('\\1', \$pid)", $message);
            if ($_G['forum_discuzcode']['passwordlock'][$pid]) {
                return '';
            }
        } else {
            $message = preg_replace("/\\s?\\[password\\](.+?)\\[\\/password\\]\\s?/ie", "", $message);
            $_G['forum_discuzcode']['passwordauthor'][$pid] = 1;
        }
    }
    if ($parsetype != 1 && !$bbcodeoff && $allowbbcode && (strpos($message, '[/code]') || strpos($message, '[/CODE]')) !== FALSE) {
        $message = preg_replace("/\\s?\\[code\\](.+?)\\[\\/code\\]\\s?/ies", "codedisp('\\1')", $message);
    }
    $msglower = strtolower($message);
    $htmlon = $htmlon && $allowhtml ? 1 : 0;
    if (!$htmlon) {
        $message = dhtmlspecialchars($message);
    } else {
        $message = preg_replace("/<script[^\\>]*?>(.*?)<\\/script>/i", '', $message);
    }
    if ($_G['setting']['plugins']['func'][HOOKTYPE]['discuzcode']) {
        $_G['discuzcodemessage'] =& $message;
        $param = func_get_args();
        hookscript('discuzcode', 'global', 'funcs', array('param' => $param, 'caller' => 'discuzcode'), 'discuzcode');
    }
    if (!$smileyoff && $allowsmilies) {
        $message = parsesmiles($message);
    }
    if ($_G['setting']['allowattachurl'] && strpos($msglower, 'attach://') !== FALSE) {
        $message = preg_replace("/attach:\\/\\/(\\d+)\\.?(\\w*)/ie", "parseattachurl('\\1', '\\2', 1)", $message);
    }
    if ($allowbbcode) {
        if (strpos($msglower, 'ed2k://') !== FALSE) {
            $message = preg_replace("/ed2k:\\/\\/(.+?)\\//e", "parseed2k('\\1')", $message);
        }
    }
    if (!$bbcodeoff && $allowbbcode) {
        if (strpos($msglower, '[/url]') !== FALSE) {
            $message = preg_replace("/\\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\\/\\/|www\\.|mailto:)?([^\r\n\\[\"']+?))?\\](.+?)\\[\\/url\\]/ies", "parseurl('\\1', '\\5', '\\2')", $message);
        }
        if (strpos($msglower, '[/email]') !== FALSE) {
            $message = preg_replace("/\\[email(=([a-z0-9\\-_.+]+)@([a-z0-9\\-_]+[.][a-z0-9\\-_.]+))?\\](.+?)\\[\\/email\\]/ies", "parseemail('\\1', '\\4')", $message);
        }
        $nest = 0;
        while (strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE) {
            $message = preg_replace("/\\[table(?:=(\\d{1,4}%?)(?:,([\\(\\)%,#\\w ]+))?)?\\]\\s*(.+?)\\s*\\[\\/table\\]/ies", "parsetable('\\1', '\\2', '\\3')", $message);
            if (++$nest > 4) {
                break;
            }
        }
        $message = str_replace(array('[/color]', '[/backcolor]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[s]', '[/s]', '[hr]', '[/p]', '[i=s]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]'), array('</font>', '</font>', '</font>', '</font>', '</div>', '<strong>', '</strong>', '<strike>', '</strike>', '<hr class="l" />', '</p>', '<i class="pstatus">', '<i>', '</i>', '<u>', '</u>', '<ul>', '<ul type="1" class="litype_1">', '<ul type="a" class="litype_2">', '<ul type="A" class="litype_3">', '<li>', '<li>', '</ul>', '<blockquote>', '</blockquote>', '</span>'), preg_replace(array("/\\[color=([#\\w]+?)\\]/i", "/\\[color=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[backcolor=([#\\w]+?)\\]/i", "/\\[backcolor=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[size=(\\d{1,2}?)\\]/i", "/\\[size=(\\d{1,2}(\\.\\d{1,2}+)?(px|pt)+?)\\]/i", "/\\[font=([^\\[\\<]+?)\\]/i", "/\\[align=(left|center|right)\\]/i", "/\\[p=(\\d{1,2}|null), (\\d{1,2}|null), (left|center|right)\\]/i", "/\\[float=left\\]/i", "/\\[float=right\\]/i"), array("<font color=\"\\1\">", "<font style=\"color:\\1\">", "<font style=\"background-color:\\1\">", "<font style=\"background-color:\\1\">", "<font size=\"\\1\">", "<font style=\"font-size:\\1\">", "<font face=\"\\1\">", "<div align=\"\\1\">", "<p style=\"line-height:\\1px;text-indent:\\2em;text-align:\\3\">", "<span style=\"float:left;margin-right:5px\">", "<span style=\"float:right;margin-left:5px\">"), $message));
        if ($pid && !defined('IN_MOBILE')) {
            $message = preg_replace("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/ies", "parsepostbg('\\1', '{$pid}')", $message);
        } else {
            $message = preg_replace("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/is", "", $message);
        }
        if ($parsetype != 1) {
            if (strpos($msglower, '[/quote]') !== FALSE) {
                $message = preg_replace("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", tpl_quote(), $message);
            }
            if (strpos($msglower, '[/free]') !== FALSE) {
                $message = preg_replace("/\\s*\\[free\\][\n\r]*(.+?)[\n\r]*\\[\\/free\\]\\s*/is", tpl_free(), $message);
            }
        }
        if (!defined('IN_MOBILE')) {
            if (strpos($msglower, '[/media]') !== FALSE) {
                $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", $allowmediacode ? "parsemedia('\\1', '\\2')" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
            }
            if (strpos($msglower, '[/audio]') !== FALSE) {
                $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", $allowmediacode ? "parseaudio('\\2', 400)" : "bbcodeurl('\\2', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
            }
            if (strpos($msglower, '[/flash]') !== FALSE) {
                $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", $allowmediacode ? "parseflash('\\2', '\\3', '\\4');" : "bbcodeurl('\\4', '<a href=\"{url}\" target=\"_blank\">{url}</a>')", $message);
            }
        } else {
            if (strpos($msglower, '[/media]') !== FALSE) {
                $message = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/is", "[media]\\2[/media]", $message);
            }
            if (strpos($msglower, '[/audio]') !== FALSE) {
                $message = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/is", "[media]\\2[/media]", $message);
            }
            if (strpos($msglower, '[/flash]') !== FALSE) {
                $message = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/is", "[media]\\4[/media]", $message);
            }
        }
        if ($parsetype != 1 && $allowbbcode < 0 && isset($_G['cache']['bbcodes'][-$allowbbcode])) {
            $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], $_G['cache']['bbcodes'][-$allowbbcode]['replacearray'], $message);
        }
        if ($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) {
            if ($_G['setting']['hideexpiration'] && $pdateline && (TIMESTAMP - $pdateline) / 86400 > $_G['setting']['hideexpiration']) {
                $message = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", "\\3", $message);
                $msglower = strtolower($message);
            }
            if (strpos($msglower, '[hide=d') !== FALSE) {
                $message = preg_replace("/\\[hide=(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/ies", "expirehide('\\1','\\2','\\3', {$pdateline})", $message);
                $msglower = strtolower($message);
            }
            if (strpos($msglower, '[hide]') !== FALSE) {
                if ($authorreplyexist === null) {
                    if (!$_G['forum']['ismoderator']) {
                        if ($_G['uid']) {
                            $authorreplyexist = C::t('forum_post')->fetch_pid_by_tid_authorid($_G['tid'], $_G['uid']);
                        }
                    } else {
                        $authorreplyexist = TRUE;
                    }
                }
                if ($authorreplyexist) {
                    $message = preg_replace("/\\[hide\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", tpl_hide_reply(), $message);
                } else {
                    $message = preg_replace("/\\[hide\\](.*?)\\[\\/hide\\]/is", tpl_hide_reply_hidden(), $message);
                    $message = '<script type="text/javascript">replyreload += \',\' + ' . $pid . ';</script>' . $message;
                }
            }
            if (strpos($msglower, '[hide=') !== FALSE) {
                $message = preg_replace("/\\[hide=(\\d+)\\]\\s*(.*?)\\s*\\[\\/hide\\]/ies", "creditshide(\\1,'\\2', {$pid}, {$authorid})", $message);
            }
        }
    }
    if (!$bbcodeoff) {
        if ($parsetype != 1 && strpos($msglower, '[swf]') !== FALSE) {
            $message = preg_replace("/\\[swf\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/swf\\]/ies", "bbcodeurl('\\1', ' <img src=\"'.STATICURL.'image/filetype/flash.gif\" align=\"absmiddle\" alt=\"\" /> <a href=\"{url}\" target=\"_blank\">Flash: {url}</a> ')", $message);
        }
        if (defined('IN_MOBILE') && !defined('TPL_DEFAULT') && !defined('IN_MOBILE_API')) {
            $allowimgcode = false;
        }
        $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src';
        if (strpos($msglower, '[/img]') !== FALSE) {
            $message = preg_replace(array("/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies", "/\\[img=(\\d{1,4})[x|\\,](\\d{1,4})\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies"), $allowimgcode ? array("parseimg(0, 0, '\\1', " . intval($lazyload) . ", " . intval($pid) . ", 'onmouseover=\"img_onmouseoverfunc(this)\" " . ($lazyload ? "lazyloadthumb=\"1\"" : "onload=\"thumbImg(this)\"") . "')", "parseimg('\\1', '\\2', '\\3', " . intval($lazyload) . ", " . intval($pid) . ")") : ($allowbbcode ? array(!defined('IN_MOBILE') ? "bbcodeurl('\\1', '<a href=\"{url}\" target=\"_blank\">{url}</a>')" : "bbcodeurl('\\1', '')", !defined('IN_MOBILE') ? "bbcodeurl('\\3', '<a href=\"{url}\" target=\"_blank\">{url}</a>')" : "bbcodeurl('\\3', '')") : array("bbcodeurl('\\1', '{url}')", "bbcodeurl('\\3', '{url}')")), $message);
        }
    }
    for ($i = 0; $i <= $_G['forum_discuzcode']['pcodecount']; $i++) {
        $message = str_replace("[\tDISCUZ_CODE_{$i}\t]", $_G['forum_discuzcode']['codehtml'][$i], $message);
    }
    unset($msglower);
    if ($jammer) {
        $message = preg_replace("/\r\n|\n|\r/e", "jammer()", $message);
    }
    if ($first) {
        if (helper_access::check_module('group')) {
            $message = preg_replace("/\\[groupid=(\\d+)\\](.*)\\[\\/groupid\\]/i", lang('forum/template', 'fromgroup') . ': <a href="forum.php?mod=forumdisplay&fid=\\1" target="_blank">\\2</a>', $message);
        } else {
            $message = preg_replace("/(\\[groupid=\\d+\\].*\\[\\/groupid\\])/i", '', $message);
        }
    }
    return $htmlon ? $message : nl2br(str_replace(array("\t", '   ', '  '), array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;'), $message));
}
Пример #23
0
            $query = C::t('common_tagitem')->select($id, 0, 'blogid', '', '', $start_limit, $tpp);
            foreach ($query as $result) {
                $blogidarray[$result['itemid']] = $result['itemid'];
            }
            $bloglist = getblogbyid($blogidarray);
            $multipage = multi($count, $tpp, $page, "misc.php?mod=tag&id={$tag['tagid']}&type=blog");
        }
    } else {
        $shownum = 20;
        $tidarray = $threadlist = array();
        $query = C::t('common_tagitem')->select($id, 0, 'tid', '', '', $shownum);
        foreach ($query as $result) {
            $tidarray[$result['itemid']] = $result['itemid'];
        }
        $threadlist = getthreadsbytids($tidarray);
        if (helper_access::check_module('blog')) {
            $blogidarray = $bloglist = array();
            $query = C::t('common_tagitem')->select($id, 0, 'blogid', '', '', $shownum);
            foreach ($query as $result) {
                $blogidarray[$result['itemid']] = $result['itemid'];
            }
            $bloglist = getblogbyid($blogidarray);
        }
    }
    include_once template('tag/tagitem');
} else {
    $navtitle = $metakeywords = $metadescription = $taglang;
    $viewthreadtags = 100;
    $tagarray = array();
    $query = C::t('common_tag')->fetch_all_by_status(0, '', $viewthreadtags);
    foreach ($query as $result) {
" onclick="showWindow('sharethread', this.href, 'get', 0);" title="分享推精华"><i><img src="<?php 
                echo IMGDIR;
                ?>
/oshr.png" alt="分享" />分享<?php 
                if ($_G['forum_thread']['sharetimes']) {
                    ?>
<span id="sharenumber"><?php 
                    echo $_G['forum_thread']['sharetimes'];
                    ?>
</span><?php 
                }
                ?>
</i></a>
<?php 
            }
            if (!$_G['forum']['disablecollect'] && helper_access::check_module('collection')) {
                ?>
<a href="forum.php?mod=collection&amp;action=edit&amp;op=addthread&amp;tid=<?php 
                echo $_G['tid'];
                ?>
" id="k_collect" onclick="showWindow(this.id, this.href);return false;" onmouseover="this.title = $('collectionnumber').innerHTML + ' 人淘帖'" title="淘好帖进专辑"><i><img src="<?php 
                echo IMGDIR;
                ?>
/collection.png" alt="分享" />淘帖<span id="collectionnumber"<?php 
                if (!$post['releatcollectionnum']) {
                    ?>
 style="display:none"<?php 
                }
                ?>
><?php 
                echo $post['releatcollectionnum'];
Пример #25
0
 public function fetch_all_heats()
 {
     $heatdateline = getglobal('timestamp') - 86400 * getglobal('setting/indexhot/days');
     $addtablesql = $addsql = '';
     if (!helper_access::check_module('group')) {
         $addtablesql = " LEFT JOIN " . DB::table('forum_forum') . " f ON f.fid = t.fid ";
         $addsql = " AND f.status IN ('0', '1') ";
     }
     return DB::fetch_all("SELECT t.tid,t.posttableid,t.views,t.dateline,t.replies,t.author,t.authorid,t.subject,t.price\r\n\t\t\t\tFROM " . DB::table('forum_thread') . " t {$addtablesql}\r\n\t\t\t\tWHERE t.dateline>'{$heatdateline}' AND t.heats>'0' AND t.displayorder>='0' {$addsql} ORDER BY t.heats DESC LIMIT " . getglobal('setting/indexhot/limit') * 2);
 }
<p class="mtn mbn xi2">
<?php if($attach['pid']) { ?>
<input type="hidden" name="attachupdate[<?php echo $image['aid'];?>]" id="attachupdate<?php echo $image['aid'];?>" size="2" />&nbsp;
<a href="javascript:;" onclick="uploadWindow(function (aid, url, name){$('attachupdate<?php echo $image['aid'];?>').value = aid;ajaxget('forum.php?mod=ajax&action=getimage&aid=' + aid, 'imageattach<?php echo $image['aid'];?>');}, 'image');return false;">更新</a>
<span class="pipe">|</span>
<?php } ?>
<a href="javascript:;" onclick="delImgAttach(<?php echo $image['aid'];?>,<?php if(!$attach['pid']) { ?>1<?php } else { ?>0<?php } ?>);return false;">删除</a>
</p>
<p class="imgf">
<?php if($image['description']) { ?>
<input type="text" name="attachnew[<?php echo $image['aid'];?>][description]" class="px xg2" value="<?php echo $image['description'];?>" id="image_desc_<?php echo $image['aid'];?>" />
<?php } else { ?>
<input type="text" class="px xg2" value="描述" onclick="this.style.display='none';$('image_desc_<?php echo $image['aid'];?>').style.display='';$('image_desc_<?php echo $image['aid'];?>').focus();" />
<input type="text" name="attachnew[<?php echo $image['aid'];?>][description]" class="px" style="display: none" id="image_desc_<?php echo $image['aid'];?>" />
<?php } ?>
</p>
<?php if(helper_access::check_module('album') && $_G['group']['allowupload']) { ?>
<p class="mtn"><?php if(!$attach['pid']) { ?><input type="hidden" class="pc" id="albumaid_<?php echo $image['aid'];?>" name="albumaid[]" value="" /><label for="albumaidchk_<?php echo $image['aid'];?>"><input id="albumaidchk_<?php echo $image['aid'];?>" type="checkbox" class="pc" onclick="$('albumaid_<?php echo $image['aid'];?>').value=this.checked?this.value:''" value="<?php echo $image['aid'];?>" />保存到相册</label><?php } ?></p>
<?php } ?>
</td>
<?php if($_GET['type'] != 'single' && $i % 4 == 0 && isset($imagelist[$i])) { ?></tr><tr><?php } } if($_GET['type'] != 'single') { if(($imgpad = $i % 4) > 0) { echo str_repeat('<td width="25%"></td>', 4 - $imgpad);; } ?>
</tr></table>
<?php } if($_G['inajax']) { ?>
<script type="text/javascript" reload="1">
ATTACHNUM['imageunused'] += <?php echo count($imagelist); ?>;
updateattachnum('image');
if($('attachlimitnotice')) {
ajaxget('forum.php?mod=ajax&action=updateattachlimit&fid=' + fid, 'attachlimitnotice');
}
</script>
<?php } } ?>
maxSizePerDay: <?php echo $swfconfig['maxsizeperday'];?>,
<?php } if($swfconfig['maxattachnum']) { ?>
maxAttachNum: <?php echo $swfconfig['maxattachnum'];?>,
<?php } ?>
uploadFrom: 'fastpost'
},
debug: false
});
</script>
<?php } else { ?>
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_fastpost_upload_extend'])) echo $_G['setting']['pluginhooks']['forumdisplay_fastpost_upload_extend'];?>
<?php } ?>
</div>
<?php } ?>

<p class="ptm pnpost">
<a href="home.php?mod=spacecp&amp;ac=credit&amp;op=rule&amp;fid=<?php echo $_G['fid'];?>" class="y" target="_blank">本版积分规则</a>
<button <?php if($fastpost) { ?>type="submit" <?php } elseif(!$_G['uid']) { ?>type="button" onclick="showWindow('login', 'member.php?mod=logging&action=login&guestmessage=yes')" <?php } if(!$seccodecheck && !$secqaacheck) { ?>onmouseover="checkpostrule('seccheck_fastpost', 'ac=newthread');this.onmouseover=null" <?php } ?>name="topicsubmit" id="fastpostsubmit" value="topicsubmit" tabindex="13" class="pn pnc"><strong>发表帖子</strong></button>
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_fastpost_btn_extra'])) echo $_G['setting']['pluginhooks']['forumdisplay_fastpost_btn_extra'];?>
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_fastpost_sync_method'])) { ?>
<span>
将此主题同步到:
<?php if(!empty($_G['setting']['pluginhooks']['forumdisplay_fastpost_sync_method'])) echo $_G['setting']['pluginhooks']['forumdisplay_fastpost_sync_method'];?>
</span>
<?php } if(helper_access::check_module('follow')) { ?>
<label><input type="checkbox" name="adddynamic" class="pc" value="1" <?php if($_G['forum']['allowfeed'] && !$_G['tid'] && empty($_G['forum']['viewperm'])) { ?>checked="checked"<?php } ?> />转播给听众</label>
<?php } ?>
</p>
</form>
</div>
</div>
Пример #28
0
function feed_publish($id, $idtype, $add=0) {
	global $_G;
	$id = intval($id);
	if(empty($id)) {
		return;
	}
	if(!helper_access::check_module('feed')) {
		return false;
	}
	$setarr = array();
	switch ($idtype) {
		case 'blogid':
			$value = array_merge(
				C::t('home_blog')->fetch($id),
				C::t('home_blogfield')->fetch($id)
			);
			if($value) {
				if($value['friend'] != 3) {
					$setarr['icon'] = 'blog';
					$setarr['id'] = $value['blogid'];
					$setarr['idtype'] = $idtype;
					$setarr['uid'] = $value['uid'];
					$setarr['username'] = $value['username'];
					$setarr['dateline'] = $value['dateline'];
					$setarr['target_ids'] = $value['target_ids'];
					$setarr['friend'] = $value['friend'];
					$setarr['hot'] = $value['hot'];
					$status = $value['status'];

					$url = "home.php?mod=space&uid=$value[uid]&do=blog&id=$value[blogid]";
					if($value['friend'] == 4) {
						$setarr['title_template'] = 'feed_blog_password';
						$setarr['title_data'] = array('subject' => "<a href=\"$url\">$value[subject]</a>");
					} else {
						if($value['pic']) {
							$setarr['image_1'] = pic_cover_get($value['pic'], $value['picflag']);
							$setarr['image_1_link'] = $url;
						}
						$setarr['title_template'] = 'feed_blog_title';
						$setarr['body_template'] = 'feed_blog_body';
						$value['message'] = preg_replace("/&[a-z]+\;/i", '', $value['message']);
						$setarr['body_data'] = array(
							'subject' => "<a href=\"$url\">$value[subject]</a>",
							'summary' => getstr($value['message'], 150, 0, 0, 0, -1)
						);
					}
				}
			}
			break;
		case 'albumid':
			$key = 1;
			if($id > 0) {
				$query = C::t('home_pic')->fetch_all_by_sql('p.'.DB::field('albumid', $id), 'a.dateline DESC', 0, 4);
				foreach($query as $value) {
					if($value['friend'] <= 2) {
						if(empty($setarr['icon'])) {
							$setarr['icon'] = 'album';
							$setarr['id'] = $value['albumid'];
							$setarr['idtype'] = $idtype;
							$setarr['uid'] = $value['uid'];
							$setarr['username'] = $value['username'];
							$setarr['dateline'] = $value['dateline'];
							$setarr['target_ids'] = $value['target_ids'];
							$setarr['friend'] = $value['friend'];
							$status = $value['status'];
							$setarr['title_template'] = 'feed_album_title';
							$setarr['body_template'] = 'feed_album_body';
							$setarr['body_data'] = array(
								'album' => "<a href=\"home.php?mod=space&uid=$value[uid]&do=album&id=$value[albumid]\">$value[albumname]</a>",
								'picnum' => $value['picnum']
							);
						}
						$setarr['image_'.$key] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
						$setarr['image_'.$key.'_link'] = "home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]";
						$key++;
					} else {
						break;
					}
				}
			}
			break;
		case 'picid':
			$plussql = $id>0 ? 'p.'.DB::field('picid', $id) : 'p.'.DB::field('uid', $_G[uid]).' ORDER BY dateline DESC LIMIT 1';
			$query = C::t('home_pic')->fetch_all_by_sql($plussql);
			if($value = $query[0]) {
				if(empty($value['friend'])) {
					$setarr['icon'] = 'album';
					$setarr['id'] = $value['picid'];
					$setarr['idtype'] = $idtype;
					$setarr['uid'] = $value['uid'];
					$setarr['username'] = $value['username'];
					$setarr['dateline'] = $value['dateline'];
					$setarr['target_ids'] = $value['target_ids'];
					$setarr['friend'] = $value['friend'];
					$setarr['hot'] = $value['hot'];
					$status = $value['status'];
					$url = "home.php?mod=space&uid=$value[uid]&do=album&picid=$value[picid]";
					$setarr['image_1'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
					$setarr['image_1_link'] = $url;
					$setarr['title_template'] = 'feed_pic_title';
					$setarr['body_template'] = 'feed_pic_body';
					$setarr['body_data'] = array('title' => $value['title']);
				}
			}
			break;
	}

	if($setarr['icon']) {
//vot		$setarr['title_template'] = $setarr['title_template']?lang('feed', $setarr['title_template']):'';
//vot		$setarr['body_template'] = $setarr['body_template']?lang('feed', $setarr['body_template']):'';
		$setarr['body_general'] = $setarr['body_general']?lang('feed', $setarr['body_general']):'';

		$setarr['title_data']['hash_data'] = "{$idtype}{$id}";
		$setarr['title_data'] = serialize($setarr['title_data']);
		$setarr['body_data'] = serialize($setarr['body_data']);

		$feedid = 0;
		if(!$add && $setarr['id']) {
			$feedid = C::t('home_feed')->fetch($id, $idtype);
			$feedid = $feedid['feedid'];
		}
		if($status == 0) {
			if($feedid) {
				C::t('home_feed')->update('', $setarr, '', '', $feedid);
			} else {
				C::t('home_feed')->insert($setarr);
			}
		}
	}

}
$slist[forumfid] = <<<EOF
<li><a href="javascript:;" rel="curforum" fid="{$_G['fid']}" >本版</a></li>
EOF;
?><?php } if($_G['setting']['portalstatus'] && $_G['setting']['search']['portal']['status'] && ($_G['group']['allowsearch'] & 1 || $_G['adminid'] == 1)) { ?><?php
$slist[portal] = <<<EOF
<li><a href="javascript:;" rel="article">文章</a></li>
EOF;
?><?php } if($_G['setting']['search']['forum']['status'] && ($_G['group']['allowsearch'] & 2 || $_G['adminid'] == 1)) { ?><?php
$slist[forum] = <<<EOF
<li><a href="javascript:;" rel="forum" class="curtype">帖子</a></li>
EOF;
?><?php } if(helper_access::check_module('blog') && $_G['setting']['search']['blog']['status'] && ($_G['group']['allowsearch'] & 4 || $_G['adminid'] == 1)) { ?><?php
$slist[blog] = <<<EOF
<li><a href="javascript:;" rel="blog">日志</a></li>
EOF;
?><?php } if(helper_access::check_module('album') && $_G['setting']['search']['album']['status'] && ($_G['group']['allowsearch'] & 8 || $_G['adminid'] == 1)) { ?><?php
$slist[album] = <<<EOF
<li><a href="javascript:;" rel="album">相册</a></li>
EOF;
?><?php } if($_G['setting']['groupstatus'] && $_G['setting']['search']['group']['status'] && ($_G['group']['allowsearch'] & 16 || $_G['adminid'] == 1)) { ?><?php
$slist[group] = <<<EOF
<li><a href="javascript:;" rel="group">{$_G['setting']['navs']['3']['navname']}</a></li>
EOF;
?><?php } ?><?php
$slist[user] = <<<EOF
<li><a href="javascript:;" rel="user">用户</a></li>
EOF;
?>
<?php } if($_G['setting']['search'] && $slist) { ?>
<div class="xm_search">
<div class="" id="scbar">
Пример #30
0
function check_ban_block($blockname, $space)
{
    global $_G;
    $return = true;
    if ($blockname == 'group' && !helper_access::check_module('group')) {
        $return = false;
    } elseif ($blockname == 'thread' && $_G['setting']['allowviewuserthread'] === -1) {
        $return = false;
    } elseif ($blockname == 'myapp') {
        loadcache('usergroup_' . $space['groupid']);
        if (empty($_G['setting']['my_app_status']) || empty($_G['cache']['usergroup_' . $space['groupid']]['allowmyop'])) {
            $return = false;
        }
    }
    return $return;
}