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