<!--<?php
include_once PrintEot('m_header');
print <<<EOT
-->

<div class="infobox pr cc">
	<div class="p10">
		<table border="0" class="vt" style="table-layout:fixed; width:100%;">
			<tr>
				<td width="60"><a href="{$thisbase}q=user"><img src="$faceimg" class="portrait-m"/></a></td>
				<td>
					<p class="pd8">
						<span class="b f14 pdr">{$username}</span>
						<a href="{$thisbase}q=user">返回首页</a>
					</p>
                    <div class="tabA" style="position:absolute;bottom:-1px;padding-left:0;width:600px;">
                        <ul>
<!--
EOT;
if ($u == $winduid) {print <<<EOT
-->
                            <li id="q_index"><a href="{$thisbase}q=$q">我的相册</a></li>
                            <li id="q_friend"><a href="{$thisbase}q=$q&a=friend">好友相册</a></li>
                            <li id="q_upload"><a href="{$thisbase}q=$q&a=upload">上传照片</a></li>
                            <li id="q_create"><a href="{$thisbase}q=$q&a=create">创建相册</a></li>
<!--
EOT;
} else {print <<<EOT
-->
								<li><a href="{$basename}q=write&u=$u">记录</a></li>
								<li class="current"><a href="{$basename}q=photos&u=$u">相册</a></li>
								<li><a href="{$basename}q=share&u=$u">分享</a></li>
								<li><a href="{$basename}q=article&u=$u">帖子</a></li>
								<li><a href="{$basename}q=friend&u=$u">好友</a></li>
<!--
EOT;
}print <<<EOT
-->
                        </ul>
                	</div>
<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
setCurrent('q_{$a_key}','q_index','current');
</script>
                </td>
			</tr>
		</table>
	</div>

  </div>
<div class="wrapB cc">
	<div class="contentC fl cc">




		<div class="c"></div>
<!--
EOT;
if (empty($a) || $a == 'friend') {print <<<EOT
-->
		<div class="boxB bgB pdD mt8">
			<div class="table-list table-list-B">
<!--
EOT;
if (!empty($albumdb)) {
foreach ($albumdb as $key => $value) {print <<<EOT
-->
			<table cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td class="tac table-list-img"><a href="{$thisbase}q=$q&a=album&aid=$value[aid]"><img src="$value[lastphoto]" width="80" /></a></td>
					<td valign="top"><a href="{$thisbase}q=$q&a=album&aid=$value[aid]" class="f14 b s1 pdr">{$value[aname]}</a>
						<p class="text">
<!--
EOT;
if ($value['ownerid'] == $winduid) {print <<<EOT
-->
						<a href="{$thisbase}q=$q&a=upload&aid=$value[aid]">上传照片</a> | <a href="{$thisbase}q=$q&a=editalbum&aid=$value[aid]" onclick="return ajaxurl(this);">编辑相册</a><br />
<!--
EOT;
} else {print <<<EOT
-->
						<a href="{$thisbase}q=user">$value[owner]</a><br />
<!--
EOT;
}print <<<EOT
-->
						<span class="gray1">$value[photonum]张照片|更新于 $value[lasttime]</span><br />
<!--
EOT;
if (isset($smphoto[$value['aid']])) {print <<<EOT
-->
						<span class="list-img2">
<!--
EOT;
foreach ($smphoto[$value['aid']] as $k => $v) {print <<<EOT
-->
						<a href="{$thisbase}q=$q&a=view&pid=$v[pid]"><img src="$v[path]" /></a>
<!--
EOT;
}print <<<EOT
-->
						</span>
						<a href="{$thisbase}q=$q&a=album&aid=$value[aid]">浏览更多&laquo;</a>
<!--
EOT;
}else{print <<<EOT
-->
						相册暂时没有照片！
<!--
EOT;
if($value['ownerid'] == $winduid){print <<<EOT
-->
						<a href="{$thisbase}q=$q&a=upload&aid=$value[aid]">上传照片&laquo;</a>
<!--
EOT;
}
}print <<<EOT
-->
						</p>
					</td>
				</tr>
			</table>
<!--
EOT;
}} else {print <<<EOT
-->
			<table cellpadding="0" cellspacing="0" width="100%"><tr><td class="tac">暂时没有相册信息</td></tr></table>
<!--
EOT;
}print <<<EOT
-->
		</div>
<!--
EOT;
} elseif ($a == 'album') {print <<<EOT
-->
		<style style="text/css">.vphoto{max-width:100px}</style>
		<div class="list-img boxB bgB cc list-img-A mt8">
			<p class="text">
<!--
EOT;
if ($album['ownerid'] == $winduid) {print <<<EOT
-->
			$album[aname] $album[photonum] 张照片
			| <a href="{$thisbase}q=$q&a=editalbum&aid=$aid" onclick="return ajaxurl(this)">编辑相册</a>
			| <a href="{$thisbase}q=$q&a=delalbum&aid=$aid" onclick="return ajaxurl(this)">删除相册</a>
			| <a href="{$thisbase}q=$q&a=upload&aid=$aid">上传更多照片</a>
			| <a href="{$thisbase}q=$q">返回所有相册</a>
<!--
EOT;
} else {print <<<EOT
-->
			$album[owner]的相册 - $album[aname] $album[photonum] 张照片
			| <a href="{$thisbase}q=$q&a=friend">返回好友相册</a>
<!--
EOT;
}print <<<EOT
-->
			</p><br />
			<ul>
<!--
EOT;
if ($cnpho) {
foreach ($cnpho as $key => $value) {print <<<EOT
-->
			<li><a href="{$thisbase}q=$q&a=view&pid=$value[pid]"><img src="$value[path]" class="vphoto" /></a><br />
				<a href="{$thisbase}q=$q&a=view&pid=$value[pid]">$value[aname]</a></li>
<!--
EOT;
}}else{print <<<EOT
-->

			<li>相册暂时没有照片</li>
<!--
EOT;
}print <<<EOT
-->
			</ul>
			<div class="c"></div>
		<div class="list-img cc list-img-A mt8"><p class="text">$album[aintro]</p></div>
<!--
EOT;
} elseif ($a == 'view') {print <<<EOT
-->
<script language="JavaScript">
function ajaxpage(url,type) {
	ajax.send(url,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			if (rText[1]) {
				window.location.href = '{$thisbase}q=$q&a=view&pid=' + rText[1];
			} else {
				ajax.request.responseText = type == 'next' ? '已经是最后一张照片了' : '已经是第一张照片了';
				ajax.guide();
			}
		} else {
			ajax.guide();
		}
	});
	return false;
}
function ajaxdel(url) {
	if (!confirm('您确定要删除该相片吗？')) {
		return false;
	}
	ajax.send(url,'',function() {
		if (ajax.request.responseText == 'ok') {
			window.location.href = '{$thisbase}q=$q&a=album&cyid=$cyid&aid={$photo[aid]}';
		} else {
			ajax.guide();
		}
	})
	return false;
}
</script>
<style style="text/css">.vphoto{max-width:700px}</style>
		<div class="list-img boxB bgB cc mt8">
			<p class="text">
			<a href="{$thisbase}q=$q&a=next&pid=$photo[pid]" style="float:right" onclick="return ajaxpage(this.href,'next');">下一张</a>
			<a href="{$thisbase}q=$q&a=pre&pid=$photo[pid]" style="float:right;margin-right:5px" onclick="return ajaxpage(this.href,'pre');">上一张</a>
<!--
EOT;
if($photo['ownerid'] == $winduid){print <<<EOT
-->
			$photo[aname] {$photo[photonum]} 张照片中的第 {$num} 张 | <a href="{$thisbase}q=$q&a=album&aid=$photo[aid]">返回相册</a> | <a href="{$thisbase}q=$q&a=editphoto&pid=$photo[pid]">编辑照片</a> | <a href="{$thisbase}q=$q&a=delphoto&pid=$photo[pid]" onclick="return ajaxdel(this.href);">删除照片</a>
<!--
EOT;
}else{print <<<EOT
-->
			$photo[uploader]的相册 - $photo[aname] {$photo[photonum]} 张照片中的第 {$num} 张 | <a href="{$thisbase}q=$q&a=album&aid=$photo[aid]">返回相册</a>
<!--
EOT;
}print <<<EOT
-->
			</p><br />
			<div class="tac"><img src="$photo[path]" class="vphoto" /></div>
		</div>
<script language="JavaScript" src="js/json.js"></script>
<script language="JavaScript" src="mode/o/js/comment.js"></script>
		<div class="list-img cc">
			<p class="text">
				<b>$photo[pname]</b><br />
				$photo[pintro]<br />
				<span class="gray1">上传于 {$photo[uptime]} | $photo[hits] 浏览</span>
			</p>
		<div id="com_photo_{$pid}">
			<P>
				<a style="cursor: pointer;" class="flatcmt-get" onclick="javascript:showCommList('photo','$pid','com_photo_{$pid}',this)">回复($photo[c_num])</a>
			</p>
		</div>
<!--
EOT;
} elseif ($a == 'editphoto') {print <<<EOT
-->
		<div class="list-img boxB bgB cc mt8 table-list">
			<p class="text">编辑照片 | <a href="{$thisbase}q=$q&a=view&pid=$pid">返回照片</a></p>
			<form action="{$thisbase}q=$q&a=$a" method="post">
				<input type="hidden" name="step" value="3" />
				<input type="hidden" name="pid" value="$pid" />
				<table cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td width="30%" align="right" class="gray1">选择相册</td>
						<td><select name="aid">{$options}</select></td>
					</tr>
					<tr>
						<td align="right" class="gray1">描述</td>
						<td style="width:700px;margin:20px auto;"><textarea name="pintro"  style="width:350px;height:70px" class="txa">$photo[pintro]</textarea></td>
					</tr>
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="编辑照片" /></td>
					</tr>
				</table>
			</form>
<!--
EOT;
} elseif ($a == 'upload') {print <<<EOT
-->
		<div class="list-img boxB bgB cc mt8 table-list">
			<!-- <p class="text">上传新照片 | <a href="{$thisbase}q=$q">返回我的相册</a></p> -->
			<form action="{$thisbase}q=$q&a=$a" enctype="multipart/form-data" method="post">
				<input type="hidden" name="step" value="3" />
				<table cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td align="right" class="gray1">上传照片</td>
						<td><input type="file" name="photo_1" /></td>
					</tr>
					<tr>
						<td align="right" class="gray1">描述</td>
						<td><textarea name="pintro[1]" style="width:350px;height:40px"></textarea></td>
					</tr>

					<tr>
						<td align="right" class="gray1">上传照片</td>
						<td><input type="file" name="photo_2" /></td>
					</tr>
					<tr>
						<td align="right" class="gray1">描述</td>
						<td><textarea name="pintro[2]" style="width:350px;height:40px"></textarea></td>
					</tr>

					<tr>
						<td align="right" class="gray1">上传照片</td>
						<td><input type="file" name="photo_3" /></td>
					</tr>
					<tr>
						<td align="right" class="gray1">描述</td>
						<td><textarea name="pintro[3]" style="width:350px;height:40px"></textarea></td>
					</tr>


					<tr>
						<td width="30%" align="right" class="gray1">选择相册</td>
						<td><select name="aid" style="width:200px;">{$options}</select></td>
					</tr>
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="上传照片" /></td>
					</tr>

				</table>
			</form>
<!--
EOT;
} elseif ($a == 'create' || $a == 'edit') {print <<<EOT
-->
		<div class="list-img boxB bgB cc mt8 table-list">
			<p class="text">
<!--
EOT;
if ($a == 'create') {print <<<EOT
-->
				创建新相册
<!--
EOT;
} else {print <<<EOT
-->
				编辑相册
<!--
EOT;
}print <<<EOT
-->
				| <a href="{$thisbase}q=$q">返回我的相册</a>
			</p>
			<form action="{$thisbase}q=$q&a=$a" method="post">
			<input type="hidden" name="step" value="3" />
			<input type="hidden" name="aid" value="$aid" />
				<table cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td width="30%" align="right" class="gray1">相册名</td>
						<td><input type="text" name="aname" value="$rt[aname]" /></td>
					</tr>
					<tr>
						<td align="right" class="gray1">描述</td>
						<td><textarea class="txa" name="aintro" style="width:350px;height:70px">{$rt[aintro]}</textarea></td>
					</tr>
					<tr>
						<td align="right" class="gray1">可见度</td>
						<td><select name="private"><option value="0" $select_0>全站用户可见</option><option value="1" $select_1>仅好友可见</option></select></td>
					</tr>
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="创建相册" /></td>
					</tr>
				</table>
			</form>
<!--
EOT;
}print <<<EOT
-->
	</div>
	<div class="sidebarC fr"></div>
    </div>
    </div></div>
<!--
EOT;
?>-->