<?php
/*************************************************************\
+-------------------------------------------------------------+
| 通灵佛教网在线烧香程序 System                                 |
| Copyright (c) 2003-2010 Alfred China                        |
| All rights reserved.                                        |
+-------------------------------------------------------------+
\*************************************************************/
require_once('config.php');
if (!defined('NetGou_START')) die("ERROR: Can not initiate application! Please check configuration.");

$t_array = explode(' ',microtime());
$P_S_T	 = $t_array[0] + $t_array[1];
$query_num = 0;

include_once $cache_dir."/nglinks.php";

if($netgou["web_closed"] == "Y"){
	echo "<div align=center><br><br><br><br><br>".$netgou["web_closed_txt"]."</div>"; 
	exit; 
}

$tplpath = "netgou";
$temp_dir = "template/".$tplpath;
$temp_img = "template/".$tplpath."/images";
$form_dir = ".";

$urlpre = $NetGou_http_host.$NetGou_web_dir;

$newslists = ng_query("SELECT * FROM $sql_tbl[newslists] where $sql_tbl[newslists].parentid = 0 and $sql_tbl[newslists].listid != 1 order by listid desc");

if($uid && $userinfo){

	$logintxt = "欢迎(<span class=usernamefont>$username</span>) <A href='$urlpre/login.php?mode=logout'>退出</A> | <A href='$urlpre/users.php'>会员中心</A> | <A href=$urlpre/users.php?mode=gongde&uid=$uid>我的功德</A> |";

}else{

	$logintxt = "<A href='$urlpre/reg.php'>注册</A> | <A href='$urlpre/login.php'>登录</A> | <A href=$urlpre/users.php?mode=gongde>我的功德</A> |";
}

function PrintTemp($template,$EXT="htm"){
	global $tplpath;
	if(!$template) $template=N;
	file_exists("./template/$tplpath/$template.$EXT") ? $path="./template/$tplpath/$template.$EXT" : $path="./template/netgou/$template.$EXT";
	return $path;
}

function PrintFuTemp($template,$EXT="htm"){
	global $tplpath;
	if(!$template) $template=N;
	file_exists("../template/$tplpath/$template.$EXT") ? $path="../template/$tplpath/$template.$EXT" : $path="../template/netgou/$template.$EXT";
	return $path;
}

function EchoTemp($template,$EXT="htm"){
	global $tplpath;
	if(!$template) $template=N;
	file_exists("$template.$EXT") ? $path="$template.$EXT" : $path="$template.$EXT";
	return $path;
}

?>