Esempio n. 1
0
 }
 forumCheck($fid, 'read');
 InitGP(array('page'));
 (int) $page < 1 && ($page = 1);
 if ($rt['ifshield'] || $rt['groupid'] == 6 && $db_shield) {
     if ($rt['ifshield'] == 2) {
         $rt['content'] = shield('shield_del_article');
         $rt['subject'] = '';
         $tpc_shield = 1;
     } else {
         $rt['content'] = shield($rt['ifshield'] ? 'shield_article' : 'ban_article');
         $rt['subject'] = '';
         $tpc_shield = 1;
     }
 }
 $content = viewContent($rt['content']);
 $forumName = wap_cv(strip_tags($forum[$fid]['name']));
 $db_waplimit = $db_waplimit ? $db_waplimit : '';
 $clen = wap_strlen($content, $db_charset);
 //TODO mbstring
 $maxp = ceil($clen / $db_waplimit);
 $nextp = $page + 1;
 $prep = $page - 1;
 if ($nextp > $maxp) {
     $nextp = $maxp;
 }
 if ($prep <= 0) {
     $prep = 1;
 }
 $rt['postdate'] = get_date($rt['postdate']);
 if ($rt['anonymous'] && $rt['authorid'] != $winduid && !$pwAnonyHide) {
Esempio n. 2
0
function viewOneReply($tid, $pid, $ptable)
{
    global $db, $db_waplimit, $c_page, $db_anonymousname, $pwAnonyHide, $winduid;
    $pw_posts = GetPtable($ptable);
    $sql = "SELECT pid,subject,author,authorid,content,postdate,anonymous,aid FROM {$pw_posts} WHERE pid=" . pwEscape($pid);
    $ct = $db->get_one($sql);
    if ($ct) {
        $ct['subject'] = str_replace('&nbsp;', '', wap_cv($ct['subject']));
        $content = viewContent($ct['content']);
        $yxqw = "";
        /*************对内容进行分页**********/
        (int) $c_page < 1 && ($c_page = 1);
        $clen = wap_strlen($content, $db_charset);
        //TODO mbstring
        $maxp = ceil($clen / $db_waplimit);
        $c_nextp = $c_page + 1;
        $c_prep = $c_page - 1;
        if ($c_nextp > $maxp) {
            $c_nextp = $maxp;
        }
        if ($c_prep <= 0) {
            $c_prep = 1;
        }
        $yxqw = "";
        if ($maxp > 1) {
            $content = wap_substr($content, $db_waplimit * ($c_page - 1), $db_waplimit, $db_charset);
            $content = wap_img2($content);
            if (empty($content)) {
                wap_msg("已到最后一页", "index.php?a=read&tid={$tid}");
            }
            if ($c_page == 1) {
                $yxqw = "<a href='index.php?a=reply&pid=" . $pid . "&amp;tid=" . $tid . "&amp;c_page={$c_nextp}'>下一页</a>";
            } elseif ($c_page == $maxp) {
                $yxqw = "<a href='index.php?a=reply&pid=" . $pid . "&amp;tid=" . $tid . "&amp;c_page={$c_prep}'>上一页</a>&nbsp;";
            } else {
                $yxqw = "<a href='index.php?a=reply&pid=" . $pid . "&amp;tid=" . $tid . "&amp;c_page={$c_nextp}'>下一页</a>";
                $yxqw .= "<a href='index.php?a=reply&pid=" . $pid . "&amp;tid=" . $tid . "&amp;c_page={$c_prep}'>上一页</a>&nbsp;";
            }
            $yxqw .= "&nbsp;({$c_page}/{$maxp})<br/>";
        } else {
            $content = wap_img2($content);
        }
        $ct['content'] = $content;
        /*************对内容进行分页**********/
        if ($ct['anonymous'] && $ct['authorid'] != $winduid && !$pwAnonyHide) {
            $ct['author'] = $db_anonymousname;
            $ct['authorid'] = 0;
        }
        list(, $ct['postdate']) = getLastDate($ct['postdate']);
        $ct['id'] = $id;
        //$ct ['author'] = $ct ['anonymous'] ? $db_anonymousname : $ct ['author'];
        $ct['author'] = wap_cv($ct['author']);
        $ct['yxqw'] = $yxqw;
        if ($ct['aid'] && $ct['aid'] != '') {
            $ct['aidimgs'] = viewAidsForHtml($tid, $pid);
            $ct['aidatts'] = viewDownloads($tid, $pid);
        } else {
            $ct['aidimgs'] = '';
            $ct['aidatts'] = '';
        }
    }
    return $ct;
}
Esempio n. 3
0
function replySubject($s)
{
    $max = 90;
    $s = viewContent($s);
    $clen = strlen($s);
    if ($max < $clen) {
        $s = substrs($s, $max);
        $s = wap_img2($s);
    }
    return $s;
}
Esempio n. 4
0
        resetHits();
        break;
    case 'accesspublic':
        accessMenu($cid[0], 0, $option, $client);
        break;
    case 'accessregistered':
        accessMenu($cid[0], 1, $option, $client);
        break;
    case 'accessspecial':
        accessMenu($cid[0], 2, $option, $client);
        break;
    case 'menulink':
        menuLink($option);
        break;
    default:
        viewContent($sectionid, $option);
        break;
}
/**
* Compiles a list of installed or defined modules
* @param database A database connector object
*/
function viewContent($sectionid, $option)
{
    global $database, $mainframe, $mosConfig_list_limit, $adminLanguage;
    $catid = $mainframe->getUserStateFromRequest("catid{$option}{$sectionid}", 'catid', 0);
    $filter_sectionid = $mainframe->getUserStateFromRequest("filter_sectionid{$option}{$sectionid}", 'filter_sectionid', 0);
    $limit = $mainframe->getUserStateFromRequest("viewlistlimit", 'limit', $mosConfig_list_limit);
    $limitstart = $mainframe->getUserStateFromRequest("view{$option}{$sectionid}limitstart", 'limitstart', 0);
    $search = $mainframe->getUserStateFromRequest("search{$option}{$sectionid}", 'search', '');
    $search = $database->getEscaped(trim(strtolower($search)));