<!--<?php
include_once PrintEot('m_header');
include_once PrintEot('user_space');
print <<<EOT
-->
<div id="content" class="fr">
	<div style="padding-top:10px;">
		<div class="cc p-info">
            <h1><strong class="f24 blue"><a href="u.php?uid=$u">$username</a></strong> <span class="f24 gray">/</span> 
					<span class="red b f16">相册</span>
<!--
EOT;
if ($count) {print <<<EOT
-->
					 <span class="gray">( {$count}个 )</span>
<!--
EOT;
}print <<<EOT
-->
					</h1>
        </div>
        <div class="breadCrumb">
				<a href="u.php?uid=$u" class="gray">&laquo;返回首页继续浏览</a>
				</div>
	</div>
    <div>
    <table width="100%">
    	<tr><td height="600" style="padding-bottom:20px;vertical-align:top;">
    	<div style="padding:0 10px;">
<!--
EOT;
if ($a == 'own' || empty($a)) {print <<<EOT
-->
		<ul id="list-box" class="cc list-box-a">
<!--
EOT;
if (!empty($albumdb)) {
foreach ($albumdb as $key => $value) {
$prviteimg = !$value['private']?'key':'lock';
if (!$value['private']) {
	$prviteimg = "";
} elseif ($value['private'] == 1) {
	$prviteimg = "<img src=\"$pwModeImg/icon/lock.png\" title=\"仅好友可见\" align=\"absmiddle\"/>";
} elseif ($value['private'] == 2) {
	$prviteimg = "<img src=\"$pwModeImg/icon/lock.png\" title=\"仅自己可见\" align=\"absmiddle\"/>";
} elseif ($value['private'] == 3) {
	$prviteimg = "<img src=\"$pwModeImg/icon/key.png\" title=\"需要密码访问\" align=\"absmiddle\"/>";
}
if (($u != $winduid || $a == 'friend') && $value['private'] == 3 && $groupid != 3) {
	$viewurl = "{$basename}a=viewalbum&aid=$value[aid]";
	$ajaxclick = "onclick=\"return ajaxurl(this);\"";
} else {
	$viewurl = "{$basename}a=album&aid=$value[aid]";
	$ajaxclick = "";
}
print <<<EOT
-->
	<li>
		<dl>
			<dt><div><table style="height:100%;width:100%;"><tr><td class="tac"><a href="$viewurl" $ajaxclick><img src="$value[lastphoto]" /></a></td></tr></table></div></dt>
                <dd><h2><a href="$viewurl" class="b" $ajaxclick>{$value[aname]}</a></h2>
					<p class="gray">
						更新:$value[lasttime]<br />
						共{$value[photonum]}张照片 $prviteimg<br />
						<span class="none">
<!--
EOT;
if ($value['ownerid'] == $winduid || $groupid == 3) {print <<<EOT
-->
                            <a href="{$temp_basename}a=editalbum&aid=$value[aid]" onclick="return ajaxurl(this);" class="black uline">编辑相册</a>|
<!--
EOT;
}else{print <<<EOT
-->
							<a href="u.php?uid=$u" class="black uline">$value[owner]</a>| 
<!--
EOT;
}if ($value['ownerid'] == $winduid || $groupid == 3) {print <<<EOT
-->
							 <a href="{$temp_basename}a=delalbum&aid=$value[aid]" onclick="return ajaxurl(this)" title="删除相册" class="o-del gray">删除</a>
<!--
EOT;
}print <<<EOT
-->
						</span>
					</p>
                </dd>
            </dl>
</li>
<!--
EOT;
}} else {print <<<EOT
-->
			<div class="list-img list-img-A">相册暂时没有照片</div>
<!--
EOT;
}print <<<EOT
-->
        </ul>
		<div class="mt10">$pages</div>
<script language="JavaScript" src="js/core/changeview.js"></script>
<script language="JavaScript">
var frist = New(changView,['list-box','li',1]); //list 为id dl为id里的样式，样式取消，不停留
var frist2 = New(changView,['list2','dl']); //list 为id dl为id里的样式，鼠标移动上去，停留样式
</script>
<!--
EOT;
} elseif ($a == 'album') {
print <<<EOT
-->
		<div class="cc p10">
<!--
EOT;
if ($isown) {print <<<EOT
-->
		<p><span class="f16 b black">$album[aname]</span>&nbsp;&nbsp;&nbsp;<span class="gray">$album[photonum]张照片</span>&nbsp;&nbsp;&nbsp;<a href="{$basename}q=$q">返回所有相册</a></p>
		<p class="mt10 ong"><a href="{$temp_basename}a=delalbum&aid=$aid" onclick="return ajaxurl(this)" title="删除相册"><img src="$pwModeImg/operation/del.png" align="absmiddle" /> 删除</a>
<!--
EOT;
}else{print <<<EOT
-->
		<p><span class="f16 b black">$album[owner]的相册 -$album[aname]</span>&nbsp;&nbsp;&nbsp;
		<span class="gray">$album[photonum]张照片</span></p>
		<p class="mt10 ong"><a href="{$basename}a=friend">返回好友相册</a>
<!--
EOT;
}if($db_share_open && !$shareGM){print<<<EOT
-->
&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=album&id=$aid','',this.id);"><img src="$pwModeImg/operation/share.png" align="absmiddle" /> 分享</a>
<!--
EOT;
}print <<<EOT
--></p>
    </div>
        <ul class="cc list-img-3">
<!--
EOT;
if ($cnpho) {
foreach ($cnpho as $key => $value) {print <<<EOT
-->                
				<li><table><tr><td class="tac"><a href="{$basename}a=view&pid=$value[pid]" class="photo-img"><img src="$value[path]" onload="if(this.width>100){this.width = 100;}"/></a></td></tr></table>
<p>          
								<!--<div class="lh18-b" id="ff" title="$value[pintro]">$value[sub_pintro]</div>-->
								共$value[c_num]条评论<br />
								<span class="f10 gray">$value[uptime]</span>
<!--
EOT;
if ($isown || $isGM) {print <<<EOT
-->
								<a style="cursor: pointer;" onclick="pwConfirm('是否确认删除',this,function(){ajaxdel('$value[pid]')});" title="删除"><img src="$pwModeImg/operation/del.png" /></a>
<!--
EOT;
}print <<<EOT
-->
						</p>
				</li>
                    
                    
<!--
EOT;
}}else{print <<<EOT
-->
					<li>相册暂时没有照片</li>
<!--
EOT;
}print <<<EOT
-->
         </ul>
<!--
EOT;
} elseif ($a == 'view') {
print <<<EOT
-->
		<div class="cc p10">
       <p><span class="f16 b black">$photo[aname]</span>&nbsp;&nbsp;&nbsp;<span class="gray">$photo[photonum]张照片</span>&nbsp;&nbsp;&nbsp;<a href="{$basename}a=album&aid=$photo[aid]" title="$photo[aname]">返回相册列表</a></p>
				<p class="mt10 ong">
<!--
EOT;
if($isown || $isGM){print <<<EOT
--><a style="cursor: pointer;" onclick="pwConfirm('是否确认删除',this,function(){ajaxdel('$photo[pid]')});" title="删除"><img src="$pwModeImg/operation/del.png" align="absmiddle" /> 删除</a>&nbsp;&nbsp;&nbsp;
<!--
EOT;
}if($db_share_open && !$shareGM){print<<<EOT
--><a href="javascript:;" onclick="sendmsg('operate.php?action=share&ajax=1&type=photo&id=$photo[pid]','',this.id);"><img src="$pwModeImg/operation/share.png" align="absmiddle" /> 分享</a>&nbsp;&nbsp;&nbsp;
<!--
EOT;
}print <<<EOT
--><a style="cursor: pointer;" onclick="sendmsg('pw_ajax.php?action=report&type=photo&tid=$pid&pid=$u','',this.id);" id="report_photo"><img src="$pwModeImg/operation/report.png" align="absmiddle" /> 举报</a>&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="ImgClick();"><img src="$pwModeImg/operation/oline.png" align="absmiddle" /> 原图</a></p>
				<div class="tac list-img-b">
					<table style="width:100%;height:90px;">
													<tr>
														<td width="20" class="pre"><a style="cursor:pointer;" onclick="photolist.refleshPre($prePid);">上一张</a></td>
															<td class="tac" id="img_list">
<!--
EOT;
foreach($nearphoto as $value){
$ifsel = $pid == $value[pid] ? 'class="current img"' : 'class="img"';
print <<<EOT
-->
							<div class="mt8" id="imglist_{$value[pid]}">
<!--
EOT;
if($value[pid]=='begin'||$value[pid]=='end'){
print <<<EOT
-->
							<div class="img"><img src="$value[path]" style="cursor:pointer;" /></div>
<!--
EOT;
} else {print <<<EOT
-->
                                        <div $ifsel><a href="{$basename}a=view&pid=$value[pid]"><img src="$value[path]" onload="if(this.width>100){this.width = 100;} else if(this.height>100){this.height=100;}" /></a></div>
<!--
EOT;
}print <<<EOT
-->
							</div>
<!--
EOT;
}print <<<EOT
-->
							</td>
								<td width="20" class="next"><a style="cursor:pointer;" onclick="photolist.refleshNext($nextPid);">下一张</a></td>
													</tr>
											</table>
				</div>
				        <div class="mt10">
                    	<map name="FPMap0">
						<area shape="rect" id="next" href="{$basename}a=pre&pid=$photo[pid]" onclick="return ajaxpage(this.href,'pre');" title="上一张">
						<area shape="rect" id="pre" href="{$basename}a=next&pid=$photo[pid]" onclick="return ajaxpage(this.href,'next');" title="下一张">
						</map>
				<div style="margin:auto;overflow:hidden;border:1px solid #ccc;background:#f7f7f7;">
				<table cellpadding="0" cellspacing="0" width="100%" height="400">
					<tr>
						<td>
						<div class="tac" id="img-width"><img id="imgview" src="$photo[path]" usemap="#FPMap0" w="$photo[w]" h="$photo[h]" /></div>
						</td>
					</tr>
                    <tr>
                    	<td style="padding-left:10px;">
				<div id="ff">$photo[pintro]</div>
<span class="gray">上传于 {$photo[uptime]} | $photo[hits] 浏览 | $photo[c_num] 评论</span>
                        </td>
                    </tr>
				</table>
				</div>
                    </div>  
<!-- 
EOT;
$rateSets = unserialize($db_ratepower);
if($rateSets[3] && isset($db_hackdb['rate'])){
print <<<EOT
-->	     
                <link rel="stylesheet" type="text/css" href="hack/rate/images/rate.css" />
				<script language="JavaScript" src="js/rate_ajax.js"></script>
				<script language="javascript">
				window.onload = function() {
					rate.getVote("vote_box","{$db_bbsurl}/hack.php?H_name=rate&action=ajax","elementid=vote_box&typeid=3&objectid={$pid}&authorid={$u}");
				};
				</script>						
				<div id="vote_box" class="mt10"></div>
<!-- 
EOT;
}
print <<<EOT
-->	
<script language="JavaScript" src="js/pw_photolist.js"></script>
<script language="JavaScript">
var photolist = new photoList('img_list','$pid','$aid');

function toBreakWord(intLen){
var obj=document.getElementById("ff");
var strContent=obj.innerHTML;
var strTemp="";
while(strContent.length>intLen){
strTemp+=strContent.substr(0,intLen)+"<br>";
strContent=strContent.substr(intLen,strContent.length);
}
strTemp+=""+strContent;
obj.innerHTML=strTemp;
}
if(document.getElementById  &&  !document.all)  toBreakWord(100)
</script>
<div class="c"></div>
<script language="JavaScript">
var imgMaxWidth=540;
var content = document.getElementById("img-width");
ImgLoad(content);

function ImgClick()
{
	var url = getObj('imgview');
	if (url.parentElement){
		if (url.parentElement.tagName!="A"){
			window.open(url.src);
		}
	}else{
		window.open(url.src);
	}
}

function ajaxpage(url,type) {
	var tourl = '{$basename}a=view';
	ajax.send(url,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			if (rText[1]) {
				window.location.href = tourl + '&pid=' + rText[1];
			} else {
				var message = type == 'next' ? '已经是最后一张照片' : '已经是第一张照片';
                                showDialog('error',message,2);
			}
		} else {
			ajax.guide();
		}
	});
	return false;
}

function bbimg()
{
	if (event.ctrlKey){
		var zoom=parseInt(this.style.zoom, 10)||100;
		zoom+=event.wheelDelta/12;
		if (zoom>0) this.style.zoom=zoom+'%';
		return false;
	}else{
		return true;
	}
}
function ImgLoad(obj){
	for(var i=0;i<obj.getElementsByTagName("img").length;i++){
		var o=obj.getElementsByTagName("img")[i];
		if (o.getAttribute('w')>imgMaxWidth){
			if (o.style.width){
				o.style.width="";
			}
			o.width=imgMaxWidth;
			o.removeAttribute("height");
			o.style.cursor="hand";
			o.vspace=5;
			o.resized=1;
		}else{
			o.width=o.getAttribute('w');
		}
		var next = getObj('next');
		var pre = getObj('pre');
		next.coords = '0 0 ' + ',' + o.width/2 + ',' + o.height;
		pre.coords = o.width/2 + ' 0 ' + ',' + o.width + ',' + o.height;
	}
}
</script>
<script language="JavaScript" src="js/app_comment.js"></script>
<div>
<!--
EOT;
require_once PrintEot('m_comment');print <<<EOT
-->
</div>
<!--SCRIPT type="text/javascript" LANGUAGE="JavaScript" src="js/core/space.js"></SCRIPT-->	
<script language="JavaScript">
var imgMaxWidth=750;
var content = document.getElementById("img-width");
M_DIARY_CTRL="ctrl+鼠标滚轮缩放";


function ajaxpage(url,type) {
	var tourl = '{$basename}a=view';
	ajax.send(url,'',function() {
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'ok') {
			if (rText[1]) {
				window.location.href = tourl + '&pid=' + rText[1];
			} else {
				ajax.request.responseText = type == 'next' ? '已经是最后一张照片' : '已经是第一张照片';
				ajax.guide();
			}
		} else {
			ajax.guide();
		}
	});
	return false;
}

</script>
</div>
<!--
EOT;
}print <<<EOT
-->
		</div>
       	</td></tr></table>
	</div>
</div>
<script language="JavaScript">
function ajaxdel(pid) {
	var u = '$u';
	ajax.send('{$temp_basename}a=delphoto&pid='+pid,'',function() {
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'ok') {
			window.location = '{$basename}a=album&aid='+rText[1];
		} else {
			ajax.guide();
		}
	});
	return false;
}
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
</script>
<!--
EOT;
?>-->