function wap_norun($title, $msg = '')
{
    $msg = $msg ? $msg : $title;
    wap_header($title);
    echo '<p>' . $msg . '</p>';
    wap_footer();
}
Example #2
0
function wap_msg($msg, $url = "", $t = "10")
{
    @extract($GLOBALS, EXTR_SKIP);
    global $db_bbsname, $db_obstart;
    ob_end_clean();
    $db_obstart && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
    wap_header('msg', $db_bbsname, $url, $t);
    $msg = getLangInfo('wap', $msg);
    wap_output("<p>{$msg}" . ($url ? " <a href='{$url}'>" . getLangInfo('wap', 'wap_msg_view') . "</a>" : '') . "</p>\n");
    wap_footer();
}
Example #3
0
function message($key, $url = '')
{
    global $link, $cmsgs;
    wap_header(wap_lang('wap_infotip'));
    $str = $cmsgs[$key] ? $cmsgs[$key] : $key;
    if (($num = func_num_args()) > 2) {
        $ars = func_get_args();
        array_splice($ars, 1, 1);
        $ars[0] =& $str;
        $str = call_user_func_array('sprintf', $ars);
    }
    echo str_replace(array("\r\n", "\r", "\n"), '<br/>', wap_encode($str)) . '<br/>';
    if ($url) {
        switch ($url) {
            case 'back':
                echo '<onevent type="ontimer"><prev/><timer value="20"/></onevent>' . '<anchor>' . wap_lang('wap_rightnowgoback') . '<prev/></anchor><br/>';
                break;
            default:
                echo '<onevent type="ontimer"><go href="' . wap_encode($url) . '"/><timer value="20"/></onevent>' . '<a href="' . wap_encode($url) . '">' . wap_lang('wap_rightnowgoback') . '</a><br/>';
        }
    }
    echo $link;
    wap_footer();
}
Example #4
0
function wap_sms_msg($msg, $url = "")
{
    $ysmsg = is_array($msg) ? array_pop($msg) : $msg;
    $msg = getWapLang('wap', $ysmsg);
    if (!empty($msg) && $msg == $ysmsg) {
        $msg = getLangInfo('msg', $ysmsg);
        $msg = strip_tags($msg);
    }
    wap_header($url);
    if ($msg) {
        $str = '<br><div class="warning">' . $msg . '</div>';
        $str .= '<div>
				 <a href="index.php?a=ms_index&action=send">发新消息</a><br />
				 <a href="index.php?a=ms_index&action=all">返回所有消息</a><br />
				 <a href="index.php?a=ms_index&action=self">返回已发消息</a></div>';
        echo $str;
    } else {
        echo $ysmsg;
    }
    wap_footer();
}
Example #5
0
        if ($curuser->info['password'] != $md5_password) {
            $curuser->updatefield('password', $md5_password);
        }
        if ($curuser->info['checked'] == 1) {
            $curuser->updatefield('lastvisit', $timestamp);
            $curuser->updatefield('lastip', $onlineip);
            $curuser->updatedb();
            $memberid = $curuser->info['mid'];
            $z = '_' . rawurlencode(authcode("{$md5_password}\t" . $curuser->info['mid'], 'ENCODE'));
            login_safecheck($username, 0, 1);
            $forward = empty($forward) ? 'index.php' : $forward;
            message('wap_login_ok', $forward . (strpos($forward, '?') !== false ? '&z=' : '?z=') . $z, 'ret_index');
        } elseif ($curuser->info['checked'] == 2) {
            //需要重新激活的会员
            message('wap_out_member_active');
        } else {
            message('wap_nocheck_member', 'back');
        }
    } elseif ($enable_uc) {
        //UC帐号需要激活
        message('wap_out_member_active');
    }
    login_safecheck($username, $errtimes);
    $password = preg_replace("/^(.{" . round(strlen($password) / 4) . "})(.+?)(.{" . round(strlen($password) / 6) . "})\$/s", "\\1***\\3", $password);
    $record = mhtmlspecialchars($timestamp . "\t" . stripslashes($username) . "\t" . $password . "\t" . $onlineip);
    record2file('badlogin', $record);
    message($cantimes ? 'wap_login_failed' : 'wap_login_error_times', 'back', $cantimes);
} elseif ($action == 'logout') {
    wap_header(wap_lang('wap_logout'));
    message('wap_logout_ok', empty($forward) ? 'index.php' : $forward);
}
Example #6
0
<?php

!defined('W_P') && exit('Forbidden');
if ($db_online) {
    $userinbbs = $guestinbbs = 0;
    $query = $db->query("SELECT uid!=0 as ifuser,COUNT(*) AS count FROM pw_online GROUP BY uid='0'");
    while ($rt = $db->fetch_array($query)) {
        if ($rt['ifuser']) {
            $userinbbs = $rt['count'];
        } else {
            $guestinbbs = $rt['count'];
        }
    }
} else {
    @(include_once D_P . 'data/bbscache/olcache.php');
}
$usertotal = $guestinbbs + $userinbbs;
$rt = $db->get_one("SELECT * FROM pw_bbsinfo WHERE id=1");
$rs = $db->get_one("SELECT SUM(fd.topic) as topic,SUM(fd.subtopic) as subtopic,SUM(fd.article) as article,SUM(fd.tpost) as tposts FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.ifsub='0' AND f.cms!='1'");
$topic = $rs['topic'] + $rs['subtopic'];
$article = $rs['article'];
$tposts = $rs['tposts'];
$userService = L::loadClass('UserService', 'user');
$uinfo = $userService->getByUserName($rt['newmember']);
Cookie("wap_scr", serialize(array("page" => "bbsinfo")));
wap_header();
require_once PrintWAP('bbsinfo');
wap_footer();
Example #7
0
        $db->update("UPDATE pw_memberdata SET {$sqladd}postnum=postnum+1,lastpost=" . pwEscape($timestamp) . " WHERE uid=" . pwEscape($winduid));
        wap_msg('post_success', "read.php?tid={$tid}");
    }
} elseif ($action == 'reply') {
    if (!$tid) {
        wap_msg('undefined_action');
    }
    $tp = $db->get_one("SELECT fid,subject,locked,ifcheck,ptable,tpcstatus FROM pw_threads WHERE tid=" . pwEscape($tid));
    !$tp && wap_msg('illegal_tid');
    $fid = $tp['fid'];
    $openIndex = getstatus($tp['tpcstatus'], 2);
    #高楼索引支持
    if (!$_POST['content']) {
        $tp['subject'] = str_replace('&nbsp;', '', wap_cv($tp['subject']));
        $refer = "post.php?action=reply&amp;tid={$tid}&amp;tmp={$timestamp}";
        wap_header('post', $db_bbsname);
        require_once PrintEot('wap_post');
        wap_footer();
    } else {
        if (!$tp['ifcheck']) {
            wap_msg('reply_ifcheck');
        }
        if ($tp['locked'] > 0) {
            wap_msg("reply_lockatc");
        }
        InitGP(array('subject', 'content'), 'P', 0);
        wap_check($fid, 'reply');
        $subject = wap_cv($subject);
        $content = wap_cv($content);
        $ipfrom = Char_cv(cvipfrom($onlineip));
        $pw_posts = GetPtable($tp['ptable']);
Example #8
0
function wap_msg($msg, $url = "")
{
    $ysmsg = is_array($msg) ? array_pop($msg) : $msg;
    $msg = getWapLang('wap', $ysmsg);
    if (!empty($msg) && $msg == $ysmsg) {
        $msg = getLangInfo('msg', $ysmsg);
        $msg = strip_tags($msg);
    }
    wap_header($url);
    if ($msg) {
        echo '<br />', '<div class="warning">' . $msg . '</div>', '<div>' . ($url ? " <a href='{$url}'>" . getWapLang('wap', 'wap_msg_view') . "</a>" : '') . '</div>';
    } else {
        echo $ysmsg;
    }
    wap_footer();
}
            echo "<br />\n";
            echo "</li>\n";
        }
        echo "</ul>\n";
        unset($comment);
        echo "<p>共有" . $total . "条隐藏评论</p>\n";
        echo $multipage;
        $DB->free_result($query);
    } else {
        echo "<p>没有需要审核的评论</p>\n";
    }
    wap_footer();
}
// 审核评论操作
if ($action == 'auditcm_ok' && ($sax_group == '1' || $sax_group == '2') && $sax_hash) {
    wap_header('审核评论');
    $commentid = (int) $commentid;
    // 获取文章信息
    if (!$commentid) {
        wap_message('缺少参数');
    }
    $comment = $DB->fetch_one_array("SELECT c.articleid, a.uid FROM {$db_prefix}comments c LEFT JOIN {$db_prefix}articles a ON (a.articleid=c.articleid) WHERE c.commentid='{$commentid}'");
    if (!$comment) {
        wap_message('记录不存在');
    }
    if ($sax_group == '2') {
        if ($comment['uid'] != $sax_uid) {
            wap_message('此评论不属于您发表的文章');
        }
    }
    $DB->query("UPDATE {$db_prefix}comments SET visible='1' WHERE commentid='{$commentid}'");
Example #10
0
                    $currentPosts[$value]['author'] = wap_cv($currentPosts[$value]['author']);
                    $postdb[] = $currentPosts[$value];
                } else {
                    $postdb[] = array('postdate' => 'N', 'content' => getLangInfo('bbscode', 'post_deleted'));
                }
            }
        }
    } else {
        $query = $db->query("SELECT subject,author,content,postdate,anonymous FROM {$pw_posts} WHERE tid=" . pwEscape($rt[tid]) . " AND ifcheck=1 ORDER BY postdate {$limit}");
        while ($ct = $db->fetch_array($query)) {
            if ($ct['content']) {
                $id++;
                $ct['subject'] = str_replace('&nbsp;', '', wap_cv($ct['subject']));
                $ct['content'] = strip_tags($ct['content']);
                $ct['content'] = substrs($ct['content'], $db_waplimit);
                $ct['content'] = wap_cv($ct['content']);
                $ct['content'] = wap_code($ct['content']);
                $ct['postdate'] = get_date($ct['postdate'], "m-d H:i");
                $ct['id'] = $id;
                $ct['author'] = $ct['anonymous'] ? $db_anonymousname : $ct['author'];
                $ct['author'] = wap_cv($ct['author']);
                $postdb[] = $ct;
            }
        }
    }
} else {
    wap_msg('illegal_tid');
}
wap_header('read', $db_bbsname);
require_once PrintEot('wap_read');
wap_footer();
Example #11
0
<?php

require_once 'wap_global.php';
InitGP(array('prog'));
if (!in_array($prog, array('index', 'cate', 'bbsinfo', 'login', 'quit', 'phone'))) {
    $prog = 'index';
}
include_once D_P . 'data/bbscache/olcache.php';
$total = $userinbbs + $guestinbbs;
wap_header('index', $db_bbsname);
if ($prog == 'cate') {
    $fids = array();
    $query = $db->query("SELECT fid FROM pw_forums WHERE password='' AND allowvisit='' AND f_type!='hidden'");
    while ($rt = $db->fetch_array($query)) {
        $fids[] = $rt['fid'];
    }
} elseif ($prog == 'bbsinfo') {
    $rt = $db->get_one("SELECT * FROM pw_bbsinfo WHERE id=1");
    $rs = $db->get_one("SELECT SUM(fd.topic) as topic,SUM(fd.subtopic) as subtopic,SUM(fd.article) as article,SUM(fd.tpost) as tposts FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.ifsub='0' AND f.cms!='1'");
    $topic = $rs['topic'] + $rs['subtopic'];
    $article = $rs['article'];
    $tposts = $rs['tposts'];
} elseif ($prog == 'login') {
    InitGP(array('lgt', 'pwuser', 'pwpwd', 'question', 'customquest', 'answer'), 'P');
    if ($windid) {
        wap_msg('login_have');
    } elseif ($pwuser && $pwpwd) {
        $safecv = $db_ifsafecv ? wap_quest($question, $customquest, $answer) : '';
        wap_login($pwuser, md5($pwpwd), $safecv, $lgt);
    }
} elseif ($prog == 'quit') {
Example #12
0
<?php

!defined('W_P') && exit('Forbidden');
!$windid && wap_msg('not_login');
wap_header('msg', $db_bbsname);
S::gp(array('action'));
if (!$action) {
    $allnum = $newnum = 0;
    $query = $db->query("SELECT COUNT(*) AS num,ifnew FROM pw_msg WHERE touid=" . S::sqlEscape($winduid) . " AND type='rebox' GROUP BY ifnew=0");
    while ($rt = $db->fetch_array($query)) {
        $allnum += $rt['num'];
        $rt['ifnew'] && ($newnum = $rt['num']);
    }
    require_once PrintEot('wap_msg');
    wap_footer();
} elseif ($action == 'new') {
    $msgdb = array();
    $query = $db->query("SELECT m.*,mc.title FROM pw_msg m LEFT JOIN pw_msgc mc USING(mid) WHERE m.touid=" . S::sqlEscape($winduid) . " AND m.type='rebox' AND m.ifnew=1 ORDER BY m.mdate DESC LIMIT 15");
    while ($rt = $db->fetch_array($query)) {
        $rt['title'] = wap_cv($rt['title']);
        $rt['username'] = wap_cv($rt['username']);
        $rt['mdate'] = get_date($rt['mdate']);
        $msgdb[] = $rt;
    }
    require_once PrintEot('wap_msg');
    wap_footer();
} elseif ($action == 'all') {
    $msgdb = array();
    $query = $db->query("SELECT m.*,mc.title FROM pw_msg m LEFT JOIN pw_msgc mc USING(mid) WHERE m.touid=" . S::sqlEscape($winduid) . " AND m.type='rebox' ORDER BY m.mdate DESC LIMIT 15");
    while ($rt = $db->fetch_array($query)) {
        $rt['title'] = wap_cv($rt['title']);
Example #13
0
$listdb = array();
if ($fid) {
    InitGP(array('page'));
    $per = 10;
    $fm = $db->get_one("SELECT topic FROM pw_forumdata WHERE fid=" . pwEscape($fid));
    $db_maxpage && $page > $db_maxpage && ($page = $db_maxpage);
    (!is_numeric($page) || $page < 1) && ($page = 1);
    $totle = ceil($fm['topic'] / $per);
    $totle == 0 ? $page = 1 : ($page > $totle ? $page = $totle : '');
    $next = $page + 1;
    $pre = $page == 1 ? 1 : $page - 1;
    $pages = wap_numofpage($page, $totle, "list.php?fid={$fid}&amp;", $db_maxpage);
    forumcheck($fid, 'list');
    $list = '';
    $satrt = ($page - 1) * $per;
    $id = $satrt;
    $limit = pwLimit($satrt, $per);
    $query = $db->query("SELECT tid,author,subject,postdate,hits,replies,anonymous FROM pw_threads WHERE fid=" . pwEscape($fid) . " AND topped<3 AND ifcheck=1 ORDER BY topped DESC,lastpost DESC {$limit}");
    while ($rt = $db->fetch_array($query)) {
        $id++;
        $rt['anonymous'] && ($rt['author'] = $db_anonymousname);
        $rt['postdate'] = get_date($rt['postdate'], "m-d H:i");
        $rt['id'] = $id;
        $rt['subject'] = substrs(str_replace('&nbsp;', '', $rt['subject']), 30, 'N');
        $listdb[] = $rt;
    }
    $forumname = wap_cv(strip_tags($forum[$fid]['name']));
}
wap_header('list', $db_bbsname);
require_once PrintEot('wap_list');
wap_footer();