<?php
if($lfjid){
	@include(PHP168_PATH."php168/level.php");
	if( ereg("^pwbbs",$webdb[passport_type]) ){
		@extract($db->get_one("SELECT COUNT(*) AS pmNUM FROM {$TB_pre}msg WHERE `touid`='$lfjuid' AND type='rebox' AND ifnew=1"));
	}elseif( ereg("^dzbbs",$webdb[passport_type]) ){
		if($webdb[passport_type]=='dzbbs7'){
			$pmNUM=uc_pm_checknew($lfjuid);
		}else{
			@extract($db->get_one("SELECT COUNT(*) AS pmNUM FROM {$TB_pre}pms WHERE `msgtoid`='$lfjuid' AND folder='inbox' AND new=1"));
		}			
	}else{
		@extract($db->get_one("SELECT COUNT(*) AS pmNUM FROM `{$pre}pm` WHERE `touid`='$lfjuid' AND type='rebox' AND ifnew='1'"));
	}
	if(!$pmNUM){
		$MSG="<A target=\"_blank\" HREF=\"$webdb[www_url]/member/index.php?main=pm.php?job=list\">站內消息</A>";
	}else{
		$MSG="<A target=\"_blank\" HREF=\"$webdb[www_url]/member/index.php?main=pm.php?job=list\" style=\"color:blue;\">你有新消息({$pmNUM})</a>";
	}
	$lfjdb[_lastvist]=date("Y-m-d H:i",$lfjdb[lastvist]);
	$lfjdb[_regdate]=date("Y-m-d H:i",$lfjdb[regdate]);
}
if($styletype&&!eregi("^[-_0-9a-z]+$",$styletype)){
	showerr("風格樣式有誤",1);
}elseif(!$styletype){
	$styletype=0;
}
require_once(html("login_tpl/$styletype"));
$show=ob_get_contents();
ob_end_clean();
$show=str_replace(array("\n","\r","<!---->","'"),array("","","","\'"),$show);

if($iframeID){	//框架方式不會拖慢主頁面打開速度,推薦
	//處理跨域問題
	if($webdb[cookieDomain]){
		echo "<SCRIPT LANGUAGE=\"JavaScript\">document.domain = \"$webdb[cookieDomain]\";</SCRIPT>";
	}
	echo "<SCRIPT LANGUAGE=\"JavaScript\">
	parent.document.getElementById('$iframeID').innerHTML='$show';
	</SCRIPT>";
}else{			//JS式會拖慢主頁面打開速度,不推薦
	echo "document.write('$show');";
}

?>