Example #1
0
function nparse_news($start = 0, $range = 0)
{
    //$type = '') {
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys'));
    //$file = $file ? $file : $newsfile;
    //$ninfo = openfile($file);
    $range = $range == 0 ? $newslimit : $range;
    $result = $db->query("SELECT * FROM {$tablepre}newsinfo ORDER BY nid DESC LIMIT {$start},{$range}");
    //$r = sizeof($ninfo) - 1;
    //	$rnum=$db->num_rows($result);
    //	if($range && ($range <= $rnum)) {
    //		$nnum = $range;
    //	} else{
    //		$nnum = $rnum;
    //	}
    $newsinfo = '<ul>';
    $nday = 0;
    //for($i = $start;$i <= $r;$i++) {
    //for($i = 0;$i < $nnum;$i++) {
    while ($news0 = $db->fetch_array($result)) {
        //$news0=$db->fetch_array($result);
        $time = $news0['time'];
        $news = $news0['news'];
        $a = $news0['a'];
        $b = $news0['b'];
        $c = $news0['c'];
        $d = $news0['d'];
        $e = $news0['e'];
        list($sec, $min, $hour, $day, $month, $year, $wday) = explode(',', date("s,i,H,j,n,Y,w", $time));
        if ($day != $nday) {
            $newsinfo .= "<span class=\"evergreen\"><B>{$month}月{$day}日(星期{$week[$wday]})</B></span><br>";
            $nday = $day;
        }
        $newsinfo .= parse_news($news, $hour, $min, $sec, $a, $b, $c, $d, $e);
    }
    $newsinfo .= '</ul>';
    return $newsinfo;
}
Example #2
0
    $tpl->assign('update_available', 0);
}
//Security check
$security_warnings = install_security_check();
if (!empty($security_warnings)) {
    $tpl->assign('security_warnings', $security_warnings);
}
unset($security_warnings);
//Directory statistics
$stats[0] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` > '1'");
$stats[1] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = '1'");
$stats[2] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = '0'");
$stats[3] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}`");
$stats[4] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['email']['name']}`");
$stats[5] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['email_tpl']['name']}`");
//phpLinkDirectory News
if (ENABLE_NEWS) {
    $url = get_url("http://code.google.com/p/scriptmind-links/wiki/UsersNews?show=content", URL_CONTENT);
    if ($url['status']) {
        $news = parse_news($url['content']);
        $tpl->assign('news', $news);
    }
}
$tpl->assign('stats', $stats);
$tpl->assign('version', $version);
$content = $tpl->fetch('index.tpl');
$tpl->assign('content', $content);
//Clean whitespace
$tpl->loadFilter('output', 'trimwhitespace');
//Make output
echo $tpl->fetch('main.tpl');