Exemple #1
0
    }
}
if ($listMode == 'category') {
    $article->getArticleList();
    foreach ($article->articleList as $oneArticle) {
        $cate = $oneArticle['aCateURLName'];
        $groupedArticles[$cate][] = $oneArticle;
        $columnName[$cate] = $oneArticle['aCateDispName'];
        $columnID[$cate] = $oneArticle['aCateURLName'];
        isset($columnCount[$cate]) ? $columnCount[$cate]++ : ($columnCount[$cate] = 1);
    }
    foreach (bw::$cateList as $onecate) {
        if (isset($groupedArticles[$onecate['aCateURLName']])) {
            $returnGroupArticles[$onecate['aCateURLName']] = $groupedArticles[$onecate['aCateURLName']];
        }
    }
    $groupedArticles = $returnGroupArticles;
}
$partOut = '';
foreach ($groupedArticles as $col => $val) {
    $view->setMaster('groupcolumn');
    $view->setPassData(array('groupedArticles' => $val, 'columnName' => $columnName[$col], 'columnID' => $columnID[$col], 'columnCount' => $columnCount[$col]));
    $view->setWorkFlow(array('groupcolumn'));
    $partOut .= $view->getOutput();
    $view->resetPassData();
}
$view->setMaster('page');
$view->setPassData(array('navigation' => bw::$cateList, 'sociallink' => bw::getSocialLinks(), 'externallink' => bw::getExternalLinks(), 'tagClound' => bw::getTagCloud()));
$view->setPassData(array('listContent' => $partOut));
$view->setWorkFlow(array('page'));
$view->finalize();
Exemple #2
0
if (!defined('P')) {
    die('Access Denied.');
}
$article = new bwArticle();
$view = new bwView();
if (isset($canonical->currentArgs['cateID'])) {
    $article->alterCate($canonical->currentArgs['cateID']);
    $view->setPageTitle(bw::$cateData[$canonical->currentArgs['cateID']]);
    $view->setActiveNav($canonical->currentArgs['cateID']);
    if (bw::$cateList[$canonical->currentArgs['cateID']]['aCateTheme']) {
        $view->setTheme(bw::$cateList[$canonical->currentArgs['cateID']]['aCateTheme']);
    }
} else {
    $view->setActiveNav('index');
}
$view->setMetaData(bw::$conf['siteName']);
$article->getArticleList();
// Pagination
$canonical->calTotalPages($article->totalArticles);
$view->doPagination();
// Pass Values
$view->setPassData(array('articlesummary' => $article->articleList));
if (defined('ajax')) {
    $view->setMaster('ajax-article-list');
    $view->setWorkFlow(array('summary', 'ajax-article-list'));
} else {
    $view->setPassData(array('navigation' => bw::$cateList, 'sociallink' => bw::getSocialLinks(), 'externallink' => bw::getExternalLinks(), 'tagClound' => bw::getTagCloud()));
    $view->setMaster('page');
    $view->setWorkFlow(array('summary', 'page'));
}
$view->finalize();
Exemple #3
0
if (!defined('P')) {
    die('Access Denied.');
}
$article = new bwArticle();
$article->fetchArticle($canonical->currentArgs['aID']);
$view = new bwView();
$view->setPageTitle($article->articleList[$canonical->currentArgs['aID']]['aTitle']);
$view->setMetaData($article->articleList[$canonical->currentArgs['aID']]['aTags']);
$aCateURLName = $article->articleList[$canonical->currentArgs['aID']]['aCateURLName'];
$view->setActiveNav($aCateURLName);
if (bw::$cateList[$aCateURLName]['aCateTheme']) {
    $view->setTheme(bw::$cateList[$aCateURLName]['aCateTheme']);
}
$view->setPassData($article->articleList[$canonical->currentArgs['aID']]);
$view->setPassData(array('navigation' => bw::$cateList, 'sociallink' => bw::getSocialLinks(), 'externallink' => bw::getExternalLinks(), 'tagClound' => bw::getTagCloud()));
$view->setMaster('page');
if ($conf['commentOpt'] != 0) {
    loadServices();
    if ($conf['commentOpt'] == 1 || $conf['commentOpt'] == 2) {
        //Build-in comment
        //Discarded on 2016/6/22
        $view->setWorkFlow(array('nocommentarea', 'article', 'page'));
        /*
        @session_start ();
        $comment = new bwComment;
        $comment -> alterAID ($canonical -> currentArgs['aID']);
        $comment -> getComList ();
        $view -> setPassData (array ('comments' => $comment -> comList));
        $comkey = md5 ($comment -> initComAKey () . $comment -> initComSKey ());
        $view -> setPassData (array ('comkey' => $comkey));
        $totalBatches = ceil ($comment -> totalCom / bw :: $conf['comPerLoad']);
Exemple #4
0
        if (file_exists(P . 'conf/mobileauth.php')) {
            include_once P . 'conf/mobileauth.php';
            if (in_array($_REQUEST['mobileToken'], $allMobileKeys)) {
                $admin->storeMobileToken();
                $admin->verified = true;
                $_SESSION['authmobile'] = 1;
            }
        }
    }
}
if ($canonical->currentArgs['mainAction'] != 'login') {
    if (!array_key_exists('login-token', $_SESSION)) {
        if (defined('ajax')) {
            stopError($conf['l']['admin:msg:NeedLogin']);
        }
        $view->setMaster('adminloginpage');
        $view->setWorkFlow(array('adminloginpage'));
        $authX = $view->getOutput();
        $view->setMaster('plainpage');
        $view->setPassData(array('plainContent' => $authX));
        $view->setWorkFlow(array('plainpage'));
        $view->finalize();
    } else {
        $admin->verifySessionToken($_SESSION['login-token']);
    }
    if (!$admin->verified) {
        stopError($conf['l']['admin:msg:NeedLogin']);
    } else {
        $view->setPassData(array('logoutCSRFCode' => $admin->getCSRFCode('logout'), 'navCSRFCode' => $admin->getCSRFCode('navibar')));
    }
}
Exemple #5
0
$view = new bwView();
if ($canonical->currentArgs['mainAction'] == 'na') {
    //Authorize a mobile phone
    $knownDevices = array('iphone' => $conf['l']['page:MPiPhone'], 'ipad' => $conf['l']['page:MPiPad'], 'android' => $conf['l']['page:MPAndroid'], 'windows' => $conf['l']['page:MPWindows'], 'blackberry' => $conf['l']['page:MPBlackberry'], 'symbian' => $conf['l']['page:MPSymbian'], 'palm' => $conf['l']['page:MPPalm'], 'ipod' => $conf['l']['page:MPiPodTouch']);
    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    foreach ($knownDevices as $devID => $devName) {
        if (strpos($ua, $devID) !== false) {
            $uaDev = $devName;
            break;
        }
    }
    if (!isset($uaDev)) {
        $uaDev = $conf['l']['page:MPDefault'];
    }
    $uaDev = $conf['authorName'] . $conf['l']['page:Conj'] . $uaDev;
    $view->setMaster('authmobile');
    $view->setPassData(array('deviceName' => $uaDev));
    $view->setWorkFlow(array('authmobile'));
    $authX = $view->getOutput();
    $view->setMaster('plainpage');
    $view->setPassData(array('plainContent' => $authX));
    $view->setWorkFlow(array('plainpage'));
    $view->finalize();
} elseif ($canonical->currentArgs['mainAction'] == 'nado') {
    if (!isset($_POST['s_token']) || !isset($_POST['s_myname'])) {
        stopError(bw::$conf['l']['page:ComError1']);
    }
    $admin = new bwAdmin();
    $admin->verifyToken($_POST['s_token']);
    if (!$admin->verified) {
        stopError(bw::$conf['l']['page:AuthMobileError']);