Example #1
0
 function checkReplyRight($tid)
 {
     global $isGM, $winddb, $isBM, $timestamp;
     $threadService = L::loadClass('threads', 'forum');
     L::loadClass('forum', 'forum', false);
     $read = $threadService->getByThreadId($tid);
     $pwforum = new PwForum($read['fid']);
     $forumset =& $pwforum->forumset;
     $tpc_locked = $read['locked'] % 3 != 0 ? 1 : 0;
     $admincheck = $isGM || $isBM ? 1 : 0;
     if (getstatus($read['tpcstatus'], 7)) {
         $robbuildService = L::loadClass('RobBuild', 'forum');
         /* @var $robbuildService PW_RobBuild */
         $robbuild = $robbuildService->getByTid($tid);
         if ($robbuild['starttime'] > $timestamp) {
             return false;
         }
     }
     $isAuthStatus = $admincheck || (!$forumset['auth_allowrp'] || $pwforum->authStatus($winddb['userstatus'], $forumset['auth_logicalmethod']) === true);
     if ($isAuthStatus && (!$tpc_locked || $SYSTEM['replylock']) && ($admincheck || $pwforum->allowreply($winddb, $groupid))) {
         return true;
     }
     return false;
 }
Example #2
0
                        $at['special'] == 2 && $db_sellset['price'] > 0 && ($at['needrvrc'] = min($at['needrvrc'], $db_sellset['price']));
                    }
                    $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'size' => $at['size'], 'hits' => $at['hits'], 'needrvrc' => $at['needrvrc'], 'special' => $at['special'], 'cname' => $creditnames[$at['ctype']], 'type' => $at['type'], 'dfadmin' => $dfadmin, 'desc' => $at['descrip'], 'ext' => strtolower(substr(strrchr($at['name'], '.'), 1)));
                }
                if ($atype) {
                    $content = attcontent($content, $atype, $rat);
                }
            }
        }
        $alterinfo && ($content .= "<div id=\"alert_{$pid}\" style=\"color:gray;margin-top:30px\">[ {$alterinfo} ]</div>");
        $atcdb['icon'] = $atcdb['icon'] ? "<img src=\"{$imgpath}/post/emotion/{$atcdb['icon']}.gif\" align=\"left\" border=\"0\" />" : '';
        echo "success\t" . stripslashes($atcdb['icon'] . "&nbsp;" . $atc_title) . "\t" . str_replace(array("\r", "\t"), array("", ""), stripslashes($content));
        ajax_footer();
    }
} elseif ($action == 'quote') {
    if (!$pwpost->admincheck && !$pwforum->allowreply($pwpost->user, $pwpost->groupid)) {
        Showmsg('reply_forum_right');
    }
    if (!$pwforum->foruminfo['allowrp'] && !$pwpost->admincheck && $_G['allowrp'] == 0) {
        Showmsg('reply_group_right');
    }
    InitGP(array('pid', 'article', 'page'));
    if ($article == '0') {
        $pw_tmsgs = GetTtable($tid);
        $S_sql = ',tm.ifsign,tm.content,m.uid,m.groupid,m.userstatus';
        $J_sql = "LEFT JOIN {$pw_tmsgs} tm ON tm.tid=t.tid LEFT JOIN pw_members m ON t.authorid=m.uid";
    } else {
        $S_sql = $J_sql = '';
    }
    $tpcarray = $db->get_one("SELECT t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.subject,t.postdate,t.ifshield,t.anonymous,t.ptable {$S_sql} FROM pw_threads t {$J_sql} WHERE t.tid=" . pwEscape($tid));
    $pw_posts = GetPtable($tpcarray['ptable']);
Example #3
0
$quote_content = preg_replace('/(\\[attachment=\\d+\\])+/', '[图片]', $quote_content);
//face
//title
list($guidename, $forumtitle) = $pwforum->getTitle();
if (!$replytitle) {
    $atc_title = "Re:{$read['subject']}";
    //$forumtitle = "$atc_title|$forumtitle";
} else {
    $atc_title = "Re:{$replytitle}";
    //$forumtitle = "$atc_title|$tpcarray[subject]|$forumtitle";
}
//time
list($postTime) = getLastDate($atcarray['postdate']);
$atc_title = substrs(str_replace('&nbsp;', ' ', $atc_title), $db_titlemax - 3);
//quote
if ((!$tpc_locked || $SYSTEM['replylock']) && ($admincheck || $pwforum->allowreply($winddb, $groupid))) {
    if (!$admincheck && !$foruminfo['allowrp'] && !$_G['allowrp']) {
        quickPostMessage('reply_group_right');
    }
    require_once PrintEot('quickpost');
    ajax_footer();
}
if (!$isGM && $tpc_locked && !pwRights($isBM, 'replylock')) {
    //locked
    quickPostMessage('reply_lockatc');
}
quickPostMessage('reply_group_right');
function quickPostMessage($message)
{
    $message = getLangInfo('msg', $message);
    echo $message;