<!--<?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();
?>-->