<!--<?php
include_once uTemplate::PrintEot('header');
include_once uTemplate::PrintEot('space_appleft');
$privacy = array('全站可見','僅好友可見','僅自己可見');
print <<<EOT
-->
<div class="sideD">
<!--
EOT;
if($winduid != $space['uid'] &&(!$diaryRight && ($diaryValue == 1 && $indexValue != 2 || $indexValue == 1 && $diaryValue < 2))){print <<<EOT
-->
<div class="boxA">
	<table width="100%">
		<tr><td height="400">
			<div class="space_msg"><img src="u/images/space/report.png" align="absmiddle" />由于對方的隱私設置，容許好友可見！立即 <a href="$db_bbsurl/pw_ajax.php?action=addfriend&touid={$space['uid']}" onclick="return ajaxurl(this);">加為好友</a></div>
		</td></tr>
	</table>
</div>
<!--
EOT;
}elseif(!$diaryRight && $diaryValue =='2'){print <<<EOT
-->
<div class="boxA">
	<table width="100%">
		<tr><td height="400">
			<div class="space_msg"><img src="u/images/space/report.png" align="absmiddle" />對方設置了隱私，您沒有權限查看</div>
		</td></tr>
	</table>
</div>
<!--
EOT;
}else{print <<<EOT
-->
	<div class="boxA">
		<h2>
<!--
EOT;
if ($uid ==$winduid) {print <<<EOT
-->	
		<span class="fr" style="margin-top:-2px;"><span class="btn_add"><span><button type="button" onClick="location.href='apps.php?q=diary&a=write';">寫日志</button></span></span></span>
<!--
EOT;
}print <<<EOT
--><span class="mr10">日志</span>
</h2>		
		<div class="p10 cc">
<!--
EOT;
if ($a == 'list') {print <<<EOT
-->
			<div class="contentC fl">
				<div class="dlB">
<!--
EOT;
if($diaryDb){
foreach($diaryDb as $value){
$typename = !$value[dtid] ?  '默認分類' : $diaryType[$value[dtid]][name];
!$value[dtid] && $value[dtid] = '-1';
$title = '所屬:'.$value[username].'&nbsp;'.$value[title];
$descrip = $value[subject];
print <<<EOT
-->
					<dl class="dl">
						<dt class="dt mb10">
							<div class="mb5"><a href="{$basename}a=detail&did=$value[did]" class="b f14">{$value[subject]}</a></div>
							<div class="gray">
								<span class="mr5">{$value[postdate]}</span>
<!--
EOT;
if ($space['uid'] == $winduid) {print <<<EOT
-->
								<a class="s7" href="apps.php?q=diary&a=edit&did={$value['did']}" >編輯</a>&nbsp;
<!--
EOT;
}if ($space['uid'] == $winduid || $SYSTEM['deldiary']) {print <<<EOT
-->
							<a class="s7" href="javascript:;" onclick="pwConfirm('是否確認刪除？',this,function(){delDiary('$value[did]','$value[uid]')})">刪除</a>
<!--
EOT;
}print <<<EOT
-->
							</div>
						</dt>
						<dd class="dd">
							<p class="mb20">{$value[content]}</p>
							<cite class="gray"><a href="{$basename}a=detail&did=$value[did]" class="s7 fr">閱讀全文&raquo;</a>分類︰<a class="s7" href="{$basename}dtid=$value[dtid]">{$typename}</a><span class="p_lr_10">|</span>回復︰{$value[c_num]}<span class="p_lr_10">|</span>瀏覽︰{$value[r_num]}</cite>
						</dd>
						<dd>
						</dd>
					</dl>
<!--
EOT;
}} else {print <<<EOT
-->					

<!--
EOT;
		if (!$dtid) {print <<<EOT
-->
			<div class="p10 f14 tac">暫無日志！</div>
<!--
EOT;
		} else {print <<<EOT
-->
			<div class="p10 f14 tac">此分類下暫無日志！</div>
<!--
EOT;
		}print <<<EOT
-->

<!--
EOT;
}print <<<EOT
-->
				<div class="p10">$pages</div>
			</div>
			</div>
<!--
EOT;
if ($diaryNums) {print <<<EOT
-->
			<div class="sidebar fr">
				<div class="boxC">
					<h3>日志分類</h3>
					<ul class="ulE">
						<li id="dt_all"><a href="{$basename}">全部日志</a>[{$diaryNums}]</li>
<!--
EOT;
$dtype = $dtid;
foreach($diaryType as $value){
print <<<EOT
-->
						<li id="dt_{$value[dtid]}"><a href="{$basename}dtid={$value[dtid]}">$value[name]</a>[{$value[num]}]</li>
<!--
EOT;
}print <<<EOT
-->
						<li id="dt_-1"}><a href="{$basename}dtid=-1">默認分類</a>[{$defaultTypeNum}]</li>
<!--
EOT;
if($uid == $winduid){
print <<<EOT
-->
						<li id="dt_-2"><img src="u/images/key.png" align="absmiddle" /> <a href="{$basename}dtid=-2">私密日志</a>[{$privacyNum}]</li>
<!--
EOT;
}print <<<EOT
-->
					</ul>
				</div>
<script type="text/javascript">
setCurrent('dt_$dtype','dt_all','current');
</script>	        
			</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
} elseif ($a == 'detail') {print <<<EOT
-->
	<div id="diary_$diary[did]">
				<div class="fr">
					<a href="apps.php?q=collection&a=favor&type=diary&ajax=1&id={$diary['did']}" onclick="return ajaxurl(this)" class="mr20 allCollect">收藏</a>
<!--
EOT;
if ($weiboPriv) {print <<<EOT
-->
<a href="javascript:;" onclick="sendmsg('operate.php?action=toweibo&ajax=1&type=diary&id=$did','',this.id);" class="allForward">新鮮事</a>
<!--
EOT;
}print <<<EOT
-->
				</div>
				<h1 class="mb5">{$diary[subject]}</h1>
				<div class="gray mb10">
					<span class="mr5">{$diary[postdate]}</span>
<!--
EOT;
if($space['uid'] == $winduid){print <<<EOT
-->
					<a class="s7" href="apps.php?q=diary&a=edit&did=$diary[did]">編輯</a>	
<!--
EOT;
}if($space['uid'] == $winduid || $SYSTEM['deldiary']){print <<<EOT
-->
					<a class="s7" href="javascript:;" onclick="pwConfirm('確認刪除？',this,function(){delDiary('$diary[did]','$uid','read')})">刪除</a>
<!--
EOT;
}print <<<EOT
-->
				</div>
				<div class="contentText s5 f14 mb20" id="img-width">
				<table style="table-layout: fixed;"><tr><td height="200" class="vt"><div class="mb10">{$diary[content]}</div>
<!--
EOT;
if($diary['pic']){
foreach($diary['pic'] as $pic){
if($pic){print <<<EOT
-->
				<div class="f12 mb10" id="att_$pic[aid]" style="width:650px;overflow:hidden;">
<!--
EOT;
if($pic['desc']){print <<<EOT
-->
					描述:$pic[desc]<br />
<!--
EOT;
}print <<<EOT
-->
					圖片:$pic[img]
<!--
EOT;
if($pic['dfadmin']){print <<<EOT
-->
					[<a style="cursor:pointer" onclick="deldiaryatt('$diary[did]','$pic[aid]');">刪除</a>]
<!--
EOT;
}print <<<EOT
-->
				</div>
<!--
EOT;
}}}print <<<EOT
-->
			</td></tr></table>
				</div>
				<div class="mb10">
<!--
EOT;
$typename = !$diary[dtid] ?  '默認分類' : $diaryType[$diary[dtid]][name];
!$diary[dtid] && $diary[dtid] = '-1';
print <<<EOT
--->
						<cite class="gray">分類︰<a href="{$basename}dtid=$diary[dtid]" class="s7">{$typename}</a><span class="p_lr_10">|</span>回復︰{$diary[c_num]}<span class="p_lr_10">|</span>瀏覽︰{$diary[r_num]}<span class="p_lr_10">|</span>{$privacy[$diary[privacy]]}<!--
EOT;
if ($_G['allowreport']) {print <<<EOT
--><span class="p_lr_10">|</span><a class="mr10 s7" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=report&type=diary&tid=$did&pid=$uid','',this.id);" id="report_diary">舉報</a><!--
EOT;
}if($diary[ifcopy] && $space['uid'] != $winduid){print <<<EOT
--><span class="p_lr_10">|</span><a class="mr10 s7" href="{$basename}a=copydiary&did=$diary[did]" onclick="return ajaxurl(this);">轉載</a>
<script type="text/javascript">
function ajaxurl(o) {
read.obj = o;
ajax.send(o.href,'',ajax.get);
return false;
}
</script>
<!--
EOT;
}print <<<EOT
-->
					</cite>
				</div>
<!-- 
EOT;
$rateSets = unserialize($db_ratepower);
if($rateSets[2] && isset($db_hackdb['rate'])){
print <<<EOT
-->	 
				<link rel="stylesheet" type="text/css" href="hack/rate/images/rate.css" />
				<script type="text/javascript" src="js/rate_ajax.js"></script>
				<script type="text/javascript">
				window.onload = function() {
					rate.getVote("vote_box","{$db_bbsurl}/hack.php?H_name=rate&action=ajax","elementid=vote_box&typeid=2&objectid={$did}&authorid={$uid}");
				};
				</script>						
				<div id="vote_box"></div>
<!-- 
EOT;
}
print <<<EOT
-->	
<div class="c mb10">&nbsp;</div>
<div class="mb10">
	<p class="mb5">下一篇︰
<!-- 
EOT;
if(empty($diaryNextName)){print <<<EOT
-->
<span>無</span>
<!--
EOT;
}else{print <<<EOT
-->
	<a href="{$basename}a=next&uid={$uid}&did=$diary[did]" onclick="return ajaxpage(this.href,'next','$fuid','$space');">{$diaryNextName}</a>
<!--
EOT;
}print <<<EOT
-->
</p>
<p>上一篇︰
<!-- 
EOT;
if(empty($diaryPreName)){print <<<EOT
-->
<span>無</span>
<!--
EOT;
}else{print <<<EOT
-->
	<a href="{$basename}a=pre&uid={$uid}&did=$diary[did]" onclick="return ajaxpage(this.href,'pre','$fuid','$space');">{$diaryPreName}</a>
<!--
EOT;
}print <<<EOT
-->
</p>
</div>
<!--
EOT;
require_once PrintEot('m_comment');print <<<EOT
-->
<script type="text/javascript" src="js/pw_lwd.js"></script>
	</div>
<!--
EOT;
}}print <<<EOT
-->
		</div>
	</div>
</div>	
<script type="text/javascript" src="apps/$appdir/js/diarytype.js"></script>
<script type="text/javascript" src="js/app_comment.js"></script>
<!--
EOT;
require_once uTemplate::printEot('footer');
pwOutPut();
?>-->