<!--<?php
include_once PrintEot('m_header');
print <<<EOT
-->
<div class="infobox pr cc">
	<div class="p10">
		<table border="0" class="vt" cellpadding="0" cellspacing="0">
			<tr>
				<td width="65"><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_friend"><a href="{$thisbase}q=$q&a=friend">好友相冊</a></li>
                            <li id="q_own"><a href="{$thisbase}q=$q&a=own">我的相冊</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{
$friendHeaderGuide = creatFriendsHeader($u);
print <<<EOT
-->
	$friendHeaderGuide
<!--
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">
<!--
EOT;
if (empty($a) || $a == 'own' || $a == 'friend') {print <<<EOT
-->

			<div class="table-list table-list-B">
<!--
EOT;
if (!empty($albumdb)) {
foreach ($albumdb as $key => $value) {
$prviteimg = $value['private']==1?'lock':'key';
if ($value['private']==1) {
	$prviteimg = "<img src=\"$imgpath/pwicon/lock.png\" title=\"僅好友可見\"/>";
} else {
	$prviteimg = "";
}
print <<<EOT
-->
			<div class="w180 bgB boxB">
				<div class="p10">
					<p class="tac">
						<a href="{$thisbase}q=$q&a=album&aid=$value[aid]&u=$value[ownerid]"><img src="$value[lastphoto]" width="145" height="100" /></a>
					</p>
					<p class="mt8">
						<span class="fr">$prviteimg</span>
						<a href="{$thisbase}q=$q&a=album&aid=$value[aid]&u=$value[ownerid]" class="b">{$value[aname]}</a>
					</p>
					<p class="mt8">
<!--
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>| <a href="{$thisbase}q=$q&a=delalbum&aid=$value[aid]" onclick="return ajaxurl(this)" title="刪除相冊" class="o-del gray">刪除</a>
<!--
EOT;
} else {print <<<EOT
-->
						<a href="{$thisbase}q=user&u=$value[ownerid]">$value[owner]</a><br />
<!--
EOT;
}print <<<EOT
-->
					</p>
					<p>共{$value[photonum]}張照片</p>
					<p class="gray f10">更新︰$value[lasttime]</p>
				</div>
			</div>
<!--
EOT;
}} else {print <<<EOT
-->
			<div class="p10 bdbA mt8">暫時沒有相冊信息</div>
<!--
EOT;
}print <<<EOT
-->
		</div>
<!--
EOT;
} elseif ($a == 'album') {
$title = '所屬︰'.$title;
print <<<EOT
-->
		<style style="text/css">.vphoto{max-width:100px}</style>
<div id="share_album" style="display:none">
	<div style="width:450px;">
		<div class="h" style="cursor:move" onmousedown="read.move(event);">
			<div class="pr cc" style="height:30px;">
			<div class="fl threadlist" style="padding-left:10px;">
			<a href="javascript:;" class="current b">分享</a>
			<a href="javascript:;" onclick="shareOtherType('recommend_album');return false;">推薦</a>
			</div>
			</div>
		</div>
		<ul class="nemu-list cc mb8">
			<li>
				<div>摘要︰</div>
				<div class="exp bgB">
					分享了一個相冊︰
					<img src="$album[lastphoto]" width="100"><br /><br />
					所屬︰$username
				</div>
			</li>
		</ul>
		<div class="c"></div>
		<ul class="nemu-list cc">
			<li>
				<div>描述︰</div>
				<textarea style="width:98%;height:60px;"></textarea>
			</li>
		</ul>
		<div class="menu-bt tac">
			<input class="bt3" type="button" value=" 確 定 " style="width:80px;" onclick="postShareOtherType('album','$aid');">&nbsp;<input class="bt" type="button" value="取消" onclick="closep();"/>
		</div>
	</div>
</div>

<div id="recommend_album" style="display:none">
	<form method="post" action="mode.php?m=o&q=share&see=recommend&ajax=1" onsubmit="return false;">
	<input type="hidden" name="step" value="2" />
	<div style="width:450px;">
		<div class="h" style="cursor:move" onmousedown="read.move(event);">
			<div class="pr cc" style="height:30px;">
			<div class="fl threadlist" style="padding-left:10px;">
			<a href="javascript:;" onclick="shareOtherType('share_album');return false;">分享</a>
			<a href="javascript:;" class="current b">推薦</a>
			</div>
			</div>
		</div>
		<div style="padding:5px 20px 0;">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td width="24%" align="center">推薦方式︰</td>
			<td>短消息推薦</td>
		</tr>
		<tr>
			<td align="center">對方姓名︰</td>
			<td><input type="text" class="input" name="sendtoname" size="25" value="" /></td>
		</tr>
		<tr>
			<td align="center">標題︰</td>
			<td><input type="text" class="input" name="subject" size="44" value="{$windid} 給您$atc_name" /></td>
		</tr>
		<tr><td align="center">內容︰</td>
			<td><textarea rows="6" style="width:300px" name="atc_content" onkeydown="ajax.quickpost(event,this.form)">您好！我在$db_bbsname($db_bbsurl/?u=$winduid)\n這個信息，認為很有價值，特推薦給您。\n\n主要信息︰\n$title\n\n描述︰\n$descrip\n\n希望您能喜歡。</textarea></td>
		</tr>
	</table><div style="text-align:center;padding:10px 0;"><input type="button" class="bt3" name="ajaxsubmit" style="width:80px;" onclick="ajax.submit(this.form);" value="提 交" />&nbsp;<input class="bt" type="button" value="取消" onclick="closep();"/></div>
</div></div></form>
</div>


		<div class="list-img list-img-A mt8">
			<span class="fr"><a class="a-reply" href="#" onclick="shareOtherType('share_album');return false;">分享<span>+</span></a></span>
			<p class="text">
<!--
EOT;
if ($album['ownerid'] == $winduid) {print <<<EOT
-->
			$album[aname] $album[photonum] 張照片
			| <a href="{$thisbase}q=$q&a=upload&aid=$aid">上傳更多照片</a>
			| <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)" title="刪除相冊" class="o-del gray">刪除</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>


			<div class="mt8">
<!--
EOT;
if ($cnpho) {
foreach ($cnpho as $key => $value) {print <<<EOT
-->
			<dl	class="o-imgbox fl" onMouseOver="this.className='o-imgbox2 fl';" onMouseOut="this.className='o-imgbox fl';">
				<dt class="tac" style="overflow:hidden;width:165px;height:125px;">
				<table cellpadding="0" cellspacing="0" width="100%" height="100%">
					<tr>
						<td>
							<a href="{$thisbase}q=$q&a=view&pid=$value[pid]">
								<img src="$value[path]" border="0" class="vphoto" />
							</a>
						</td>
					</tr>
				</table>
				</dt>
<!--
EOT;
if ($album['ownerid'] == $winduid || $groupid==3) {print <<<EOT
-->
				<dd>
					<span class="fr"><a href="{$thisbase}q=$q&a=editphoto&pid=$value[pid]">編輯</a> <a style="cursor: pointer;" onclick="pwConfirm('是否確認刪除',this,function(){ajaxdel('$value[pid]')});" title="刪除" class="o-del gray">刪除</a></span>
				</dd>
<!--
EOT;
}print <<<EOT
-->
			</dl>
<!--
EOT;
}}else{print <<<EOT
-->
			<div class="list-img list-img-A">相冊暫時沒有照片</div>
<!--
EOT;
}print <<<EOT
-->
			</div>
			<div class="c"></div>
		<div id="ff" class="cc mt8" style="line-height:2;">$album[aintro]</div>
<script>
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(85)
</script>
	</div>
<!--
EOT;
} elseif ($a == 'view') {
$title = '所屬︰'.$title;
print <<<EOT
-->
<style type="text/css">
.photo-current .current{border:3px solid #555;}
.photo-current .current:hover{border:3px solid #999;}
</style>
		<div class="contentC-side">
            <div class="boxB cc bgB tac" style="margin-top:30px;">
				<table cellpadding="0" cellspacing="0" width="100%" height="100%">
                	<tr>
                    	<td class="tal pdD bdbA boxC" height="25"><div style="overflow:hidden;width:150px;height:20px;line-height:20px;">相冊 <a class="b" href="{$thisbase}q=$q&a=album&aid=$photo[aid]" title="$photo[aname]">$photo[aname]</a></div></td>
                    </tr>
                	<tr>
                    	<td height="15" style="padding-top:5px;"><a style="cursor:pointer;" onclick="photolist.goPre(this);">上一張</a></td>
                    </tr>
                    <tr>
                    	<td height="330" class="photo-current" id="img_list">
<!--
EOT;
foreach($nearphoto as $value){
$ifsel = $pid == $value[pid] ? 'class="current"' : '';
print <<<EOT
-->
							<div class="mt8" id="imglist_{$value[pid]}">
<!--
EOT;
if($value[pid]=='begin'||$value[pid]=='end'){
print <<<EOT
-->
								<img src="$value[path]" style="cursor:pointer;" />
<!--
EOT;
} else {print <<<EOT
-->
								<a href="{$thisbase}q=$q&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;}" $ifsel />
								</a>
<!--
EOT;
}print <<<EOT
-->
							</div>
<!--
EOT;
}print <<<EOT
-->
						</td>
                    </tr>
                    <tr>
                    	<td height="25"><a style="cursor:pointer;" onclick="photolist.goNext(this);">下一張</a></td>
                    </tr>
				</table>
            </div>
        </div>
<script language="JavaScript" src="mode/o/js/photolist.js"></script>
<script language="JavaScript">
var photolist = new photoList('img_list','$pid','$aid');
</script>


<style style="text/css">.vphoto{max-width:530px;}</style>
		<div class="cc mt8 fl" style="width:540px;overflow:hidden;">
			<p>
<!--
EOT;
if($photo['ownerid'] == $winduid){print <<<EOT
-->
			$photo[aname] {$photo[photonum]} 張照片中的第 {$num} 張
<!--
EOT;
}else{print <<<EOT
-->
			$photo[uploader]的相冊 - $photo[aname] {$photo[photonum]} 張照片中的第 {$num} 張
<!--
EOT;
}print <<<EOT
-->

			 | <a href="{$thisbase}q=$q&a=album&aid=$photo[aid]">返回相冊</a></p><br />
			<div class="tac"><img src="$photo[path]" class="vphoto" /></div>
			<p class="text p10">
				<span class="fr"><a class="a-reply" href="javascript:;" onclick="shareOtherType('share_photo');return false;">分享<span>+</span></a></span>
<!--
EOT;
if($photo['pname']){print <<<EOT
-->
				$photo[pname]<br />
<!--
EOT;
}print <<<EOT
-->
				<div id="ff" style="width:470px;">$photo[pintro]</div><br />
<!--
EOT;
if($photo['ownerid'] == $winduid || $groupid==3){print <<<EOT
-->
			<a href="{$thisbase}q=$q&a=editphoto&pid=$photo[pid]">編輯照片</a> | <a style="cursor: pointer;" onclick="pwConfirm('是否將本照片設為封面',this,function(){ajaxSetCover('$photo[pid]')});">設為相冊封面</a> | <a style="cursor: pointer;" onclick="pwConfirm('是否確認刪除',this,function(){ajaxdel('$photo[pid]')});" title="刪除" class="o-del gray">刪除</a><br />
<!--
EOT;
}print <<<EOT
-->
				<span class="gray">上傳于 {$photo[uptime]}</span>
			</p>
		</div>
<script>
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(42)
</script>
<div class="c"></div>
<div id="share_photo" style="display:none">
	<div style="width:450px;">
		<div class="h" style="cursor:move" onmousedown="read.move(event);">
			<div class="pr cc" style="height:30px;">
			<div class="fl threadlist" style="padding-left:10px;">
			<a href="javascript:;" class="current b">分享</a>
			<a href="javascript:;" onclick="shareOtherType('recommend_photo');return false;">推薦</a>
			</div>
			</div>
		</div>
		<ul class="nemu-list cc mb8">
			<li>
				<div>摘要︰</div>
				<div class="exp bgB">
					分享了一張照片︰
					<img src="$photo[path]" width="100"><br /><br />
					所屬︰$username
				</div>
			</li>
		</ul>
		<div class="c"></div>
		<ul class="nemu-list cc">
			<li>
				<div>描述︰</div>
				<textarea style="width:98%;height:60px;"></textarea>
			</li>
		</ul>
		<div class="menu-bt tac">
			<input class="bt3" type="button" value=" 確 定 " style="width:80px;" onclick="postShareOtherType('photo','$photo[pid]');">&nbsp;<input class="bt" type="button" value="取消" onclick="closep();"/>
		</div>
	</div>
</div>
<div id="recommend_photo" style="display:none">
	<form method="post" action="mode.php?m=o&q=share&see=recommend&ajax=1" onsubmit="return false;">
	<input type="hidden" name="step" value="2" />
	<div style="width:450px;">
		<div class="h" style="cursor:move" onmousedown="read.move(event);">
			<div class="pr cc" style="height:30px;">
			<div class="fl threadlist" style="padding-left:10px;">
			<a href="javascript:;" onclick="shareOtherType('share_photo');return false;">分享</a>
			<a href="javascript:;" class="current b">推薦</a>
			</div>
			</div>
		</div>
		<div style="padding:5px 20px 0;">
	<table width="100%" cellspacing="0" cellpadding="5">
		<tr>
			<td width="24%" align="center">推薦方式︰</td>
			<td>短消息推薦</td>
		</tr>
		<tr>
			<td align="center">對方姓名︰</td>
			<td><input type="text" class="input" name="sendtoname" size="25" value="" /></td>
		</tr>
		<tr>
			<td align="center">標題︰</td>
			<td><input type="text" class="input" name="subject" size="44" value="{$windid} 給您$atc_name" /></td>
		</tr>
		<tr><td align="center">內容︰</td>
			<td><textarea rows="6" style="width:300px" name="atc_content" onkeydown="ajax.quickpost(event,this.form)">您好！我在$db_bbsname($db_bbsurl/?u=$winduid)\n這個信息，認為很有價值，特推薦給您。\n\n主要信息︰\n$title\n\n描述︰\n$descrip\n\n希望您能喜歡。</textarea></td>
		</tr>
	</table><div style="text-align:center;padding:10px 0;"><input type="button" class="bt3" name="ajaxsubmit" style="width:80px;" onclick="ajax.submit(this.form);" value="提 交" />&nbsp;<input class="bt" type="button" value="取消" onclick="closep();"/></div>
	</div></div></form></div>
</div>

<script language="JavaScript" src="mode/o/js/comment.js"></script>
		<div class="cc p10">
		<div id="com_photo_{$pid}">
			<P>
				<a style="cursor: pointer;" onclick="javascript:showCommList('photo','$pid','com_photo_{$pid}',this)">回復($photo[c_num])</a>
			</p>
		</div>
	</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="gray">選擇相冊</td>
						<td><select name="aid">{$options}</select></td>
					</tr>
					<tr>
						<td align="right" class="gray">描述</td>
						<td style="width:700px;margin:20px auto;"><textarea id="pintro" name="pintro"  style="width:350px;height:70px">$photo[pintro]</textarea><span id="pintro_warn" class="fr gray" style="margin-right:285px;">限 255 字節</span></td>
					</tr>
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="編輯照片" /></td>
					</tr>
				</table>
			</form>
		</div>
<script language="JavaScript">
var charset = '$db_charset';
initCheckTextNum('pintro','pintro_warn',255);
</script>
<!--
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" />
				<div class="fr">單張照片不得大于{$o_maxfilesize}kb</div>
				<table cellpadding="0" cellspacing="0" width="100%">
					<tr>
						<td width="30%" align="right" class="gray">上傳照片</td>
						<td><input type="file" name="photo_1" /></td>
					</tr>
					<tr>
						<td align="right" class="gray">描述</td>
						<td><textarea id="pintro_1" name="pintro[1]" style="width:350px;height:40px"></textarea><span id="pintro_1_warn" class="fr gray" style="margin-right:290px;">限 255 字節</span></td>
					</tr>

					<tr>
						<td align="right" class="gray">上傳照片</td>
						<td><input type="file" name="photo_2" /></td>
					</tr>
					<tr>
						<td align="right" class="gray">描述</td>
						<td><textarea id="pintro_2" name="pintro[2]" style="width:350px;height:40px"></textarea><span id="pintro_2_warn" class="fr gray" style="margin-right:290px;">限 255 字節</span></td>
					</tr>

					<tr>
						<td align="right" class="gray">上傳照片</td>
						<td><input type="file" name="photo_3" /></td>
					</tr>
					<tr>
						<td align="right" class="gray">描述</td>
						<td><textarea id="pintro_3" name="pintro[3]" style="width:350px;height:40px"></textarea><span id="pintro_3_warn" class="fr gray" style="margin-right:290px;">限 255 字節</span></td>
					</tr>
<!--
EOT;
if ($options) {print <<<EOT
-->
					<tr>
						<td align="right" class="gray">選擇相冊</td>
						<td><select name="aid" style="width:200px;">{$options}</select></td>
					</tr>
<!--
EOT;
}print <<<EOT
-->
					<tr>
						<td></td>
						<td><input class="bt3" type="submit" value="上傳照片" /></td>
					</tr>

				</table>
			</form>
		</div>
<script language="JavaScript">
var charset = '$db_charset';
initCheckTextNum('pintro_1','pintro_1_warn',255);
initCheckTextNum('pintro_2','pintro_2_warn',255);
initCheckTextNum('pintro_3','pintro_3_warn',255);
</script>
<!--
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="gray">相冊名</td>
						<td><input type="text" name="aname" value="$rt[aname]" id="aname" />&nbsp;<span id="aname_warn" class="gray">限 24 字節</span></td>
					</tr>
					<tr>
						<td align="right" class="gray">描述</td>
						<td>
							<textarea id="aintro" name="aintro" style="width:350px;height:70px">{$rt[aintro]}</textarea>
							<span id="aintro_warn" class="gray fr" style="margin-right:290px;"> 限 255 字節</span>
						</td>
					</tr>
					<tr>
						<td align="right" class="gray">可見度</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>
		</div>
<script language="JavaScript">
var charset = '$db_charset';
initCheckTextNum('aname','aname_warn',24);
initCheckTextNum('aintro','aintro_warn',255);
</script>
<!--
EOT;
}print <<<EOT
-->
	</div>
	<div class="sidebarC fr"></div>
</div>
<script language="JavaScript">
function ajaxdel(pid) {
	ajax.send('mode.php?m=o&q=photos&a=delphoto&pid='+pid,'',function() {
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'ok') {
			window.location = 'mode.php?m=o&q=photos&a=album&aid='+rText[1];
		} else {
			ajax.guide();
		}
	});
	return false;
}
function ajaxSetCover(pid){
	ajax.send('mode.php?m=o&q=photos&a=setcover&pid='+pid,'',function() {
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'ok') {
			showDialog('succes','設置封面成功!',1);
		} else {
			ajax.guide();
		}
	});
	return false;
}
</script>
<!--
EOT;
?>-->