<!--<?php
require_once PrintEot('m_header');
if (empty($a)) {print <<<EOT
-->
<div class="g_navB mb10">
	<span class="fr">
<!--
EOT;
if ($ifadmin || $uploadAvaliable) {print <<<EOT
-->
		<a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash" >上傳照片</a>&nbsp;　&nbsp;<!--
EOT;
}print <<<EOT
-->
<a href="apps.php?q=galbum&cyid=$cyid&a=photolist">全部照片</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&cyid=$cyid" class="current">相冊專輯</a><!--
EOT;
if($ifadmin){print<<<EOT
-->
&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=create&cyid=$cyid" >創建相冊</a>
<!--
EOT;
}print<<<EOT
-->
	</span>
	<span class="mr10">共{$colony['albumnum']}本相冊</span>&nbsp;{$photonum}&nbsp;張照片
</div>
<div>
<!--
EOT;
if (!empty($album)) {
	foreach ($album as $key => $value){
    	if($value['private'] == 0|| ($value['private']==1 && ($ifadmin ||$colony['ifcyer']))){print <<<EOT
-->
  <div class="Albumbox cc">
  <dl class="r_admininfo">
  <dt class="Album"><a href="{$basename}a=album&cyid=$cyid&aid=$value[aid]"><img src="$value[lastphoto]" /></a></dt>
  <dd>
  <p class="f16 b"><a href="{$basename}a=album&cyid=$cyid&aid=$value[aid]" title="{$value[aname]}">{$value[sub_aname]}</a></p>
  <p class="cl666">共 {$value[photonum]} 張照片</p>
  <p class="cl666">$value[lasttime]更新</p>
  <p class="cl666">$value[crtime]創建</p>
<!--
EOT;
if (!$value['forbidden']) {print <<<EOT
-->
<span>
<!--
EOT;
if ($ifadmin || ($colony['ifFullMember'] && $value['memopen'] == 1)) {print <<<EOT
-->
          <a href="{$basename}a=upload&cyid=$cyid&job=flash&aid=$value[aid]">上傳照片</a>
<!--
EOT;
}}if ($ifadmin && !$value[ifdefault]) {print <<<EOT
-->
		 | <a href="{$basename}a=edit&cyid=$cyid&aid=$value[aid]">編輯相冊</a> | <a href="{$basename}a=delalbum&cyid=$cyid&aid=$value[aid]" onclick="return ajaxurl(this)" title="刪除">刪除相冊</a>
<!--
EOT;
}print <<<EOT
-->  
</span>
  </dd>
  </dl>   
<!--
EOT;
}else {
print <<<EOT
--> 
  <div class="Albumbox cc">
  <dl class="r_admininfo">
  <dt class="Album"><a href="{$basename}a=album&cyid=$cyid&aid=$value[aid]"><img src="{$db_bbsurl}/images/lock.gif" /></a></dt>
  <dd>
  <p class="f16 b"><a href="{$basename}a=album&cyid=$cyid&aid=$value[aid]" title="{$value[aname]}">{$value[sub_aname]}</a></p>
  <p class="cl666">共 {$value[photonum]} 張照片 <img src="{$db_bbsurl}/u/images/lock.png" /></p>
  <p class="cl666">$value[lasttime]更新</p>
  <p class="cl666">$value[crtime]創建</p>
  </span>
  </dd>
  </dl> 
<!--
EOT;
}
print <<<EOT
--> 
      </div>
<!--
EOT;
}print <<<EOT
-->  
<script type="text/javascript" src="js/core/changeview.js"></script>
<script type="text/javascript">
var frist = New(changView,['list-box','li',1]);

</script>
<!--
EOT;
} else {
if($ifadmin){print <<<EOT
-->
		<div class="p15 tac f14">暫無相冊，我來第一個<a href="apps.php?q=galbum&a=create&cyid=$cyid" class="line s2">創建相冊</a>吧！</div>
<!--
EOT;
}else{print <<<EOT
-->
		<div class="p15">暫無相冊</div>
<!--
EOT;
}}print <<<EOT
-->
</div>      
      <div class="c"></div>
      <div class="p15">$pages</div>
<!--
EOT;
} elseif($a  == 'photolist'){print <<<EOT
-->
	<div class="g_navB mb10">
		<span class="fr">
<!--
EOT;
if ($ifadmin || $uploadAvaliable) {print <<<EOT
-->
			<a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash" >上傳照片</a>&nbsp;　&nbsp;<!--
EOT;
}print <<<EOT
-->
<a href="apps.php?q=galbum&cyid=$cyid&a=photolist"  class="current">全部照片</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&cyid=$cyid">相冊專輯</a><!--
EOT;
if($ifadmin){
print<<<EOT
-->&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=create&cyid=$cyid" >創建相冊</a>
<!--
EOT;
}print<<<EOT
--> 
		</span>
        <span>共{$photonum}張照片</span>
	</div>
<!-- 
if($photonum > 0){
	print <<<EOT
 -->
    <div class="g_listA g_listAB">
      <ul class="cc">
<!--
EOT;
if (!empty($cnpho)) {
foreach ($cnpho as $key => $value) {
empty($value[pintro]) && $value[pintro] = '沒有照片描述';
print <<<EOT
-->     
      <li>
      	<div class="aimg"><a href="{$basename}a=view&cyid=$cyid&pid=$value[pid]"><img src="$value[path]" onload="resizeImg(this)" /></a></div>
      	<p>$value[pintro]</p>
<!--
EOT;
if ($ifadmin || $cnpho['uploader'] == $windid) {print <<<EOT
-->
		<p><span><a href="{$basename}a=delphoto&cyid=$cyid&pid=$value[pid]" onclick="return ajaxdel(this.href,'{$value[aid]}');" title="刪除"  class="adel">刪除</a><a href="javascript:;" onclick="sendmsg('apps.php?q=galbum&a=editphoto&cyid=$cyid&pid=$value[pid]','',this.id)" id="editphoto_{$value[pid]}"  title="編輯" class="aedit mr10">編輯</a></span></p>
<!--
EOT;
}print <<<EOT
-->
	  </li>

<!--
EOT;
}print <<<EOT
-->
      </ul>
      </div>
      <div class="p15">$pages</div>
<!-- 
EOT;
	}else{
	print <<<EOT
 -->
 	<div><div class="p15">暫無照片</div></div>
<!-- 
EOT;
	}
	print <<<EOT
-->
      <div class="c"></div>
      </div>
<script type="text/javascript">
function ajaxdel(url, aid) {
	if (!confirm('你確定要刪除該照片嗎？')) {
		return false;
	}
	ajax.send(url,'',function() {
		if (ajax.request.responseText == 'ok') {
			window.location.href = '{$basename}a=photolist&cyid=$cyid';
		} else {
			ajax.guide();
		}
	})
	return false;
}
</script>

<!--
EOT;
} elseif ($a == 'album') {print <<<EOT
-->
<div class="g_navB mb10">
	<p class=" fr">
<!--
EOT;
if ($ifadmin) {print <<<EOT
--><a href="apps.php?q=galbum&a=edit&cyid=$cyid&aid=$aid">編輯相冊信息</a>&nbsp;　&nbsp;<!--
EOT;
}if ($ifadmin || ($colony['ifFullMember'] && $album['memopen'])) {print <<<EOT
-->
<a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash&aid=$aid">上傳照片</a>&nbsp;　&nbsp;<!--
EOT;
}print<<<EOT
--><a href="{$basename}cyid=$cyid">返回{$groupRight[modeset][galbum][title]}列表</a>&nbsp;&nbsp;<a href="javascript:;" onclick="sendmsg('operate.php?action=toweibo&ajax=1&cyid=$cyid&type=album&id=$aid','',this.id);" class="allForward">新鮮事</a>

	</p>
	<span class="b f14 mr10">{$album[aname]}</span>共{$album[photonum]}張照片
</div>
    <div class="g_listA g_listAB">
      <ul class="cc">
<!--
EOT;
if (!empty($cnpho)) {
foreach ($cnpho as $key => $value) {
empty($value[pintro]) && $value[pintro] = '沒有照片描述';
print <<<EOT
-->     
      <li><div class="aimg"><a href="{$basename}a=view&cyid=$cyid&pid=$value[pid]"><img src="$value[path]" onload="resizeImg(this)" /></a></div>
      <p>$value[pintro]</p>
	  
<!--
EOT;
if ($ifadmin || $value['uploader'] == $windid) {print <<<EOT
-->
<p><span><a href="{$basename}a=delphoto&cyid=$cyid&pid=$value[pid]" onclick="return ajaxdel(this.href,'$aid');" title="刪除"  class="adel">刪除</a>
<a href="javascript:;" onclick="sendmsg('apps.php?q=galbum&a=editphoto&cyid=$cyid&pid=$value[pid]','',this.id)" id="editphoto_{$value[pid]}"  title="編輯" class="aedit mr10">編輯</a></span></p>
<!--
EOT;
}print <<<EOT
-->

	  </li>

<!--
EOT;
}
}else{
	if(($album['memopen'] == 1 && $colony['ifFullMember']) || $ifadmin){
		print <<<EOT
-->
		<div class="p15 f14 tac">暫無照片，我來第一個<a href="{$basename}a=upload&cyid=$cyid&job=flash&aid=$aid" class="line s2">上傳照片</a>吧！</div>
<!--
EOT;
	}else{
		print <<<EOT
-->
		<div class="p15 f14 tac">暫無照片</div>
<!--
EOT;
	}
}print <<<EOT
-->
      </ul>
    </div>
    <div class="p15">$pages</div>
    <div class="c"></div>
<script type="text/javascript">
function ajaxdel(url, aid) {
	if (!confirm('你確定要刪除該照片嗎？')) {
		return false;
	}
	ajax.send(url,'',function() {
		if (ajax.request.responseText == 'ok') {
			window.location.href = '{$basename}a=album&cyid=$cyid&aid=' + aid;
		} else {
			ajax.guide();
		}
	})
	return false;
}
</script>
<!--
EOT;
} elseif ($a == 'view') {print <<<EOT
-->
<script type="text/javascript">
function ajaxdel(url, aid) {
	if (!confirm('你確定要刪除該照片嗎？')) {
		return false;
	}
	ajax.send(url,'',function() {
		if (ajax.request.responseText == 'ok') {
			window.location.href = '{$basename}a=album&cyid=$cyid&aid=' + aid;
		} else {
			ajax.guide();
		}
	})
	return false;
}
var db_urlcheck = "$db_urlcheck";
var db_bbsurl = '$db_bbsurl';
</script>
<div class="g_navB mb10">
	<span class="fr">
<!--
EOT;
if ($ifadmin || $photo['uploader'] == $windid) {print <<<EOT
-->
		<a href="javascript:;" onclick="sendmsg('apps.php?q=galbum&a=editphoto&cyid=$cyid&pid=$photo[pid]','',this.id)" id="editphoto">編輯照片</a>&nbsp;　&nbsp;<a href="{$basename}a=delphoto&cyid=$cyid&pid=$photo[pid]" onclick="return ajaxdel(this.href,'$photo[aid]');">刪除</a>&nbsp;　&nbsp;
<!--
EOT;
}if ($ifadmin || ($colony['ifFullMember'] && $photo['memopen'])) {print <<<EOT
-->
		<a href="{$basename}a=upload&job=flash&cyid=$cyid&aid=$photo[aid]">上傳</a>&nbsp;　&nbsp;<!--
EOT;
}if ($_G['allowreport']) {print <<<EOT
--><a onclick="sendmsg('pw_ajax.php?action=report&type=groupphoto&tid=$pid&pid=$cyid','',this.id);" id="report_groupphoto" style="cursor:pointer;">舉報</a>&nbsp;　&nbsp;<!--
EOT;
}print <<<EOT
--><a href="javascript:;" onclick="ImgClick();">原圖</a>&nbsp;　&nbsp;<a href="{$basename}a=album&cyid=$cyid&aid=$photo[aid]">返回照片列表</a>&nbsp;&nbsp;
<a href="javascript:;" onclick="sendmsg('operate.php?action=toweibo&ajax=1&cyid=$cyid&type=photo&id=$photo[pid]','',this.id);" class="allForward">新鮮事</a>
	</span>
	<span class="f14 b mr10">$photo[aname]</span>
	<span>{$photo[photonum]} 張照片中的第<b class="s2">{$num}</b>張</span>
</div>
<div class="galbum_photo mb10" id="123">
	<table style="width:100%;height:90px;">
		<tr>
<!--
EOT;
if($photo[photonum]>5){print<<<EOT
-->
			<td width="20" class="pre"><a onclick="return ajaxpage('apps.php?q=galbum&a=next&cyid=$cyid&pid=$photo[pid]','pre');">上一張</a></td>
<!--
EOT;
}print<<<EOT
-->
			<td class="tac" id="img_list">

<!--
EOT;
foreach($nearphoto as $value){
$ifsel = ($pid == $value[pid]) ? 'class="current"' : '';
print <<<EOT
-->
				<ul class="g_listA" id="imglist_{$value[pid]}">
<!--
EOT;
if($value[pid]=='begin'||$value[pid]=='end'){
print <<<EOT
-->
					<li><div class="aimg"><a href="javascript:;"><img src="$value[path]" onload="resizeImg(this)" /></a></div></li>
<!--
EOT;
} else {print <<<EOT
-->
					<li $ifsel><div class="aimg"><a href="{$basename}cyid=$cyid&a=view&pid=$value[pid]#g_navA"><img src="$value[path]"  onload="resizeImg(this)" /></a></div></li>
<!--
EOT;
}print <<<EOT
-->
				</ul>
<!--
EOT;
}print <<<EOT
-->
			</td>
<!--
EOT;
if($photo[photonum]>5){print<<<EOT
-->
			<td width="20" class="next"><a onclick="return ajaxpage('apps.php?q=galbum&a=pre&cyid=$cyid&pid=$photo[pid]','next');">下一張</a></td>
<!--
EOT;
}print <<<EOT
-->
		</tr>
	</table>
</div>
<div class="galbum_photo_con pr">
	<a onclick="return ajaxpage('apps.php?q=galbum&a=next&cyid=$cyid&pid=$photo[pid]','pre');" class="aPre" style="cursor:url(u/images/pre.cur),auto;" title="上一張"></a>
	<a onclick="return ajaxpage('apps.php?q=galbum&a=pre&cyid=$cyid&pid=$photo[pid]','next');" class="aNext" style="cursor:url(u/images/next.cur),auto;" title="下一張"></a>
	<table cellpadding="0" cellspacing="0" width="100%" style="table-layout:fixed;">
		<tr>
			<td height="400" style="vertical-align:middle">
				<div class="tac mt10 p10"><img id="imgview" src="" /></div>
			</td>
		</tr>
		<tr>
			<td class="p10 tac">
				<div class="f14">$photo[pintro]</div>
				<span class="s6">$photo[uploader] 上傳于 {$photo[uptime]} | $photo[hits] 瀏覽</span>
			</td>
		</tr>
	</table>
</div>
<img id="imgpreview" src="$photo[path]" style="position:absolute;top:-10000px;" />
<script type="text/javascript" src="js/app_comment.js"></script>
<div style="width:600px;margin:20px auto;">
<!--
EOT;
require_once PrintEot('m_comment');print <<<EOT
-->
</div>
<div class="c"></div>

<script type="text/javascript" src="js/pw_photolist.js"></script>
<script type="text/javascript">
function ImgClick()
{
	var url = getObj('imgview');
	if (url.parentElement){
		if (url.parentElement.tagName!="A"){
			if (url.src) window.open(url.src);
		}
	}else{
		if (url.src) window.open(url.src);
	}
}

var photolist = new photoList('img_list','$pid','$aid');
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 = '{$basename}a=view&cyid=$cyid&pid=' + rText[1] + '#g_navA';
			} else {
				var message = type == 'next' ? '已經是最後一張照片' : '已經是第一張照片';
				showDialog('warning',message,2);
			}
		} else {
			ajax.guide();
		}
	});
	return false;
}
var imgMaxWidth=540;
var preview = getObj('imgpreview');
var mainImg = getObj('imgview');
function imgLoad(){
	if(!preview.width){
		setTimeout(imgLoad,400);
		return;	
	}
	mainImg.width = Math.min(preview.width,imgMaxWidth);
	mainImg.src = preview.src;
	preview.onload=function(){
		imgLoad();
	};
	//preview.parentNode.removeChild(preview);
	//delete preview;
	if(!window.XMLHttpRequest)
		getElementsByClassName('aPre')[0].style.height=getElementsByClassName('aNext')[0].style.height=Math.max(mainImg.height+20,400)+'px';
}
imgLoad();
</script>
<!--script type="text/javascript" src="js/core/space.js"></script-->
<!--
EOT;
} elseif ($a == 'upload') {print <<<EOT
-->
<div class="g_navB">
	<span class="fr">
<!--
EOT;
if($a=="upload"){
	if($job=="flash")
	{
		$flash = 'class="current"';
		$normal = '';
		$choose_album ='';
	}else 
	{
		$flash = '';
		$normal = 'class="current"';
		$choose_album ='';
		
	}
}else if($a=='selalbum')
{
	$flash = '';
	$normal = '';
	$choose_album =' class="current" ';
}
print <<<EOT
-->
        <a href="apps.php?q=galbum&a=upload&cyid=$cyid&aid=$aid" $normal>普通上傳</a>&nbsp;　&nbsp;
        <a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash&aid=$aid" $flash>批量上傳</a>&nbsp;　&nbsp;
        <a href="apps.php?q=galbum&a=selalbum&cyid=$cyid&aid=$aid" $choose_album>個人相冊導入</a>&nbsp;　&nbsp;
        <a href="{$basename}cyid=$cyid">返回{$groupRight[modeset][galbum][title]}列表</a></span>
</div>
<!--
EOT;
	if($uploadAvailable){
print <<<EOT
-->
<div class="setpd">
	<p class="g_hD mb15">上傳照片</p>
<script src='js/photouploader.js'></script>
<script src="js/select.js"></script>
<script src="js/swfobject.js"></script>
<form action="{$basename}a=$a&cyid=$cyid" id="uploadPhotoForm" enctype="multipart/form-data" method="post">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="verify" value="$verifyhash" />
    <table width="70%" class="setTable vt">
    	<tr>
        	<th class="th">選擇相冊</th>
            <td class="td"><span class="dropdown mr20"><select name="aid" class="select_wa mr10" id="aidsel_info" onchange="getallowflash(this.value);">{$options}</select></span>
<!--
EOT;
if ($ifadmin) {print <<<EOT
-->
	<a style="cursor:pointer;" id="ajaxcreate" onclick="sendmsg('apps.php?q=galbum&a=create&cyid=$cyid&ajax=1&job=$job','',this.id);" class="mr20">創建新相冊</a>
<!--
EOT;
}print <<<EOT
-->
<span class="gray" id="allowflash"></span>
            </td>
        </tr>
<!--
EOT;
if ($job == 'flash'){
print <<<EOT
-->
        <tr>
        	<th class="th">選擇照片</th>
            <td class="td">
			<p class="mb5">單張照片不得大于{$o_maxfilesize}kb 按“ctrl”鍵選擇多個照片批量上傳</p>
            <div class="g_photosbox">
                <div id="viewimg" class="menu mb10" style="display:none;"></div>
                <object id="mutiupload" name="mutiupload" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="46">
                  <param name="movie" value="$imgpath/photouploader.swf?d=0706" />
				  <param name="wmode" value="transparent" />
                  <param name="FlashVars" value="url=$db_bbsurl%2Fjob.php%3Faction%3Dmutiuploadphoto"/>
                  <param name="allowScriptAccess" value="always" />
                  
                  <!--[if !IE]>-->
                  <object type="application/x-shockwave-flash" data="$imgpath/photouploader.swf?d=0706" width="250" height="46" FlashVars="url=$db_bbsurl%2Fjob.php%3Faction%3Dmutiuploadphoto" wmode="transparent"  allowScriptAccess="always">
                  <!--<![endif]-->
                    <p>你沒有安裝Flash!</p>
                  <!--[if !IE]>-->
                  </object>
                  <!--<![endif]-->
                </object>
<script>
swfobject.addLoadEvent(function(){
	getallowflash(getObj('aidsel_info').value);
	uploader.maxLength = {$o_maxfilesize};
	uploader.baseurl ='{$basename}cyid=$cyid&';
	uploader.init();
	
});
swfobject.registerObject('mutiupload','10.0.0','js/expressInstall.swf');
</script>
                <table width="450"><tr><td class="wname">文件名</td><td>描述</td><td width="15%">大小</td><td width="25%">上傳進度</td><td width="5%">刪</td></tr><tbody id="qlist"></tbody></table>
                <div id="attsize"></div>
            </div>
            </td>
        </tr>
<!--
EOT;
}else{print <<<EOT
-->
		<tr>
        	<th class="th">選擇照片</th>
        	<td class="td">
            	<p class="mb5">單張照片不得大于{$o_maxfilesize}kb</p>
                <div class="photoup">
                    <dl class="cc">
                        <dt><span><img id="preview_1" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" src="$imgpath/90.png"></span></dt>
                        <dd><p><input type="file"  name="photo_1" id="p_1" class="input" accept="image/*" onchange="preview_img(1);"/></p>
                        <p style="margin-top:8px;"><textarea id="pintro_1" name="pintro[1]" class="textareaA mb5"></textarea></p>
                        <span class="s6" id="pintro_1_warn">限255字節</span>
                        </dd>
                    </dl>
                    <dl class="cc">
                        <dt><span><img id="preview_2" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" src="$imgpath/90.png"></span></dt>
                        <dd><p><input type="file"  name="photo_2" id="p_2" class="input" onchange="preview_img(2);" /></p>
                        <p style="margin-top:8px;"><textarea id="pintro_2" name="pintro[2]" class="textareaA mb5"></textarea></p>
                        <span class="s6" id="pintro_2_warn">限255字節</span>
                        </dd>
                    </dl>
                    <dl class="photoup">
                        <dt><span><img id="preview_3"  style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" src="$imgpath/90.png"></span></dt>
                        <dd><p><input type="file"  name="photo_3" id="p_3" class="input" onchange="preview_img(3);"/></p>
                        <p style="margin-top:8px;"><textarea id="pintro_3" name="pintro[3]" class="textareaA mb5"></textarea></p>
                        <span class="s6" id="pintro_3_warn">限255字節</span>
                        </dd>
                    </dl>
                </div>
<!--
EOT;
if ($o_photos_gdcheck) {
$checkCode = L::loadClass('checkcode', 'site');
$checkCodeString = $checkCode->getCheckCodeTemplate();
print <<<EOT
-->
				<p>驗證碼:</p>
				<p>
				<span id="ckcode" style="display:none;margin-bottom:5px;"></span>
				</p>
$checkCodeString
				<input class="input" onfocus="showgd();" type="text" name="gdcode" id="gdcode" size="5" tabindex="3"  />
<div class="c mb10"></div>
<!--
EOT;
}
if($db_question && $o_photos_qcheck){
$qkey = array_rand($db_question);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" （答案︰".$db_answer[$qkey] . '）' : '');
print <<<EOT
-->
                <p>驗證問答: {$q_a}</p>
                <input class="input" name="qanswer" id="qanswer" size="25" tabindex="7" />
                <input type="hidden" name="qkey" id="qkey" value="$qkey" />
                <div class="c mb15"></div>
<!--
EOT;
}print <<<EOT
-->
				<div><span class="btn"><span><button type="submit">開始上傳</button></span></span><span class="bt"><span><button type="reset">取消</button></span></span></div>
            </td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
    </table>
</form>
</div>
<script>
window.onReady(function(){
	var photoselect = new sSelect(getObj('aidsel_info'));
})
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);

function getallowflash(aid) {
	setTimeout(function(){ajax.send('{$basename}a=getallowflash&cyid=$cyid&aid='+aid,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			if (rText[1] == 'notlimit') {
				getObj('allowflash').innerHTML = '請選擇相冊';
			} else if (rText[1]) {
				getObj('allowflash').innerHTML = '該相冊還可以上傳'+rText[1]+'張照片';
				try{
					uploader.maxLength = rText[1];
				}catch(e){}
				//getObj('allowflash2').innerHTML = '你還可以上傳'+rText[1]+'張照片';
			} else {
				getObj('allowflash').innerHTML = '請選擇相冊';
			}
		} else {
			ajax.guide();
			getObj('allowflash').innerHTML = '此相冊照片數量達到上限，無法上傳';
			try{
				uploader.maxLength = 0;
			}catch(e){}
		}
		try{
			uploader.setAlbumId(aid);
		}catch(e){}
	});},100);
	return false;
}

</script>
<!--
EOT;
	}else{
		print <<<EOT
-->
<div><div class="p15">該相冊暫不允許普通會員上傳</div></div>
<!--
EOT;
	}
} elseif ($a == 'selalbum') {
print <<<EOT
-->
<input type="hidden" value="currentaid" id="currentaid" name="currentAid" />
<div class="g_navB">
	<span class="fr"><a href="apps.php?q=galbum&a=upload&cyid=$cyid&aid=$aid">普通上傳</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash&aid=$aid">批量上傳</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=selalbum&cyid=$cyid&aid=$aid" class="current">個人相冊導入</a>&nbsp;　&nbsp;<a href="{$basename}cyid=$cyid">返回{$groupRight[modeset][galbum][title]}列表</a></span>
</div>
<div class="setpd"> 
	<p class="g_hD mb15"><span class="mr20">相冊導入</span><!--span class="fn f12">導入︰<span class="f12 b mr10">{$calbum[aname]}</span>現有{$calbum[photonum]}張照片</span--></p>
    <table width="100%" class="setTable vt">
    	<tr>
        	<th class="th">選擇相冊</th>
            <td class="td">
<form action="{$basename}a=$a&cyid=$cyid" id="uploadPhotoForm" enctype="multipart/form-data" method="post">
	<input type="hidden" name="step" value="3" />
	<input type="hidden" name="verify" value="$verifyhash" />
	<select name="aid" class="select_wa mr10" id="aidsel_info" onchange="getallowflash(this.value);">{$options}</select>
</form>
<!--
EOT;
if ($ifadmin) {print <<<EOT
-->
	<a id="ajaxcreate" onclick="sendmsg('apps.php?q=galbum&a=create&cyid=$cyid&ajax=1','',this.id);" style="cursor:pointer;" class="mr20">創建新相冊</a>
<!--
EOT;
}print <<<EOT
--><span class="s6" id="allowflash"></span>  
            </td>
        </tr>
        <tr>
        	<th class="th">選擇個人相冊</th>
            <td class="td">
<!--
EOT;
if (!empty($album)) {
print <<<EOT
-->
				<p>先選擇相冊名稱，然後選擇照片</p>
				<div class="r_photos3">
					<ul class="cc">
<!--
EOT;
foreach ($album as $key => $value) {
print <<<EOT
-->
						<li><a href="javascript:;" onclick="submitaction('{$basename}a=selphoto&cyid=$cyid&aid=$value[aid]{$url_extra}&selaid=');return false;" title="{$value[aname]}"><img src="$value[lastphoto]" /></a><span class="gray3"><a href="javascript:;" onclick="submitaction('{$basename}a=selphoto&cyid=$cyid&aid=$value[aid]{$url_extra}&selaid=');return false;">$value[sub_aname]</a><br />共{$value[photonum]}張照片</span></li>
<!--
EOT;
}
print <<<EOT
-->
					</ul>
				</div>
<!--
EOT;
} else {
print <<<EOT
-->
	<div class="f14">
		你還沒有創建個人相冊
	</div>
<!--
EOT;
}
print <<<EOT
-->
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
function getallowflash(aid) {
	getObj('currentaid').value = aid;
	setTimeout(function(){ajax.send('{$basename}a=getallowflash&cyid=$cyid&aid='+aid,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			if (rText[1] == 'notlimit') {
				getObj('allowflash').innerHTML = '請選擇相冊';
			} else if (rText[1]) {
				getObj('allowflash').innerHTML = '該相冊還可以上傳'+rText[1]+'張照片';
				//getObj('allowflash2').innerHTML = '你還可以上傳'+rText[1]+'張照片';
			} else {
				getObj('allowflash').innerHTML = '請選擇相冊';
			}
		} else {
			ajax.guide();
		}
	});},100);
	return false;
}
function submitaction(url){
	var aid = getObj('currentaid').value;
	location.href = url + aid;
}
</script>
<!--
EOT;
} elseif ($a == 'selphoto') {print <<<EOT
-->
<div class="g_navB">
	<span class="fr"><a href="apps.php?q=galbum&a=upload&cyid=$cyid&aid=$aid">普通上傳</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash&aid=$aid">批量上傳</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=selalbum&cyid=$cyid&aid=$aid" class="current">個人相冊導入</a>&nbsp;　&nbsp;<a href="{$basename}cyid=$cyid">返回{$groupRight[modeset][galbum][title]}列表</a></span>
</div>
<div class="setpd"> 
	<p class="g_hD mb15"><span class="mr20">相冊導入</span><!--span class="fn f12">導入︰<span class="f12 b mr10">{$calbum[aname]}</span>現有{$calbum[photonum]}張照片</span--></p>
    <table width="100%" class="setTable vt">
    	<tr>
        	<th class="th" style="width:110px;">選擇相冊</th>
            <td class="td">
<form action="{$basename}a=$a&cyid=$cyid" id="uploadPhotoForm" enctype="multipart/form-data" method="post">
	<input type="hidden" name="step" value="3" />
	<input type="hidden" name="verify" value="$verifyhash" />
	<select name="aid" class="select_wa mr10" id="aidsel_info" onchange="getallowflash(this.value);">{$options}</select>
</form>
<!--
EOT;
if ($ifadmin) {print <<<EOT
-->
	<a href="apps.php?q=galbum&a=create&ajax=1&cyid=$cyid" onclick="return ajaxurl(this);" class="mr20">創建新相冊</a>
<!--
EOT;
}print <<<EOT
--><span class="s6" id="allowflash"></span>  
            </td>
        </tr>
        <tr>
        	<th class="th">選擇要導入的照片</th>
            <td class="td"><p class="mb10"><a href="apps.php?q=galbum&cyid=$cyid">&raquo; 返回相冊列表 </a></p>      
<form action="{$basename}a=selphoto&cyid=$cyid" method="post">
<select name="selaid" style="width:200px;display:none;" class="fr">{$options}</select>
<input type="hidden" name="step" value="3" />
<input type="hidden" name="aid" value="$aid"/>
                <div class="g_listA g_listAB">
                    <ul class="cc">
<!--
EOT;
foreach ($cnpho as $key => $value) {
empty($value[pintro]) && $value[pintro] = '沒有照片描述';
$pintro = substrs($value[pintro],10);
print <<<EOT
-->	
      					<li><div class="aimg" onclick="selectPhoto(this)"><img style="cursor:pointer;" src="$value[path]" onload="resizeImg(this)" /></div><p><label for="sel_{$value[pid]}"><input  type="checkbox" id="sel_{$value[pid]}" name="selid[]" value="$value[pid]"   />$value[pintro]</label></p></li>
<!--
EOT;
}print <<<EOT
-->	  
                  </ul>
            </div>
			<div class="p15">$pages</div>
			<div class="c"></div>
            <div class="p15"><label for="checkall" class="mr10"><input name="checkall" id="checkall" type="checkbox" value="checkall" onclick="CheckAll(this.form)" /> 全選</label><span class="btn"><span><button type="submit">導 入</button></span></span></div>
</form>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
function selectPhoto(e){
	var input = e.parentNode.getElementsByTagName('input')[0];
	input.checked=!input.checked;
}
function getallowflash(aid) {
	setTimeout(function(){ajax.send('{$basename}a=getallowflash&cyid=$cyid&aid='+aid,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			if (rText[1] == 'notlimit') {
				getObj('allowflash').innerHTML = '請選擇相冊';
			} else if (rText[1]) {
				getObj('allowflash').innerHTML = '該相冊還可以上傳'+rText[1]+'張照片';
			} else {
				getObj('allowflash').innerHTML = '請選擇相冊';
			}
		} else {
			ajax.guide();
		}
	});},100);
	return false;
}
</script>
<!--
EOT;
} elseif ($a == 'create' || $a == 'edit') {
if ($a == 'create') {
$button = "創建相冊";
print <<<EOT
-->
<div class="g_navB">
    <span class=" fr">
		<a href="apps.php?q=galbum&cyid=$cyid&a=photolist">全部照片</a><!--
EOT;
if($ifadmin){print<<<EOT
-->&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=create&cyid=$cyid" class="current">創建相冊</a><!--
EOT;
}print<<<EOT
-->&nbsp;　&nbsp;<a href="{$basename}cyid=$cyid">返回{$groupRight[modeset][galbum][title]}列表</a>
	</span>
</div>
<div class="setpd"> 
	<p class="g_hD mb15">創建相冊</p>
<!--
EOT;
} else {
$button = "編輯相冊";
print <<<EOT
-->
<div class="g_navB">
    <p class=" fr">
		<a href="apps.php?q=galbum&a=edit&cyid=$cyid&aid=$aid" class="current">編輯相冊信息</a>&nbsp;　&nbsp;<a href="apps.php?q=galbum&a=upload&cyid=$cyid&job=flash&aid=$aid">上傳照片</a>&nbsp;　&nbsp;<a href="{$basename}cyid=$cyid">返回{$groupRight[modeset][galbum][title]}列表</a>
	</p>
</div>
<div class="setpd"> 
	<p class="g_hD mb15">編輯相冊信息</p>	
<!--
EOT;
}print <<<EOT
-->
<form action="{$basename}a=$a&cyid=$cyid" method="post">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="aid" value="$aid" />
    <table width="100%" class="setTable vt">
    	<tr>
        	<th class="th">相冊名稱<span class="s1">*</span></th>
            <td class="td"><input type="text" class="input input_wa mr10" name="aname" id="aname" value="$rt[aname]" /> <span class="s6" id="aname_warn">限 24 字節</span></td>
        </tr>
        <tr>
        	<th class="th">描述</th>
            <td class="td"><textarea name="aintro" class="textareaA mr10" id="aintro">{$rt[aintro]}</textarea><p class="s6" id="aintro_warn">限 255 字節</p></td>
        </tr>
        <tr>
        	<th class="th">可見度</th>
            <td class="td"><select name="private" class="select_wa"><option value="0" $select_0>全站用戶可見</option><option value="1" $select_1>僅成員可見</option></select></td>
        </tr>
        <tr>
        	<th class="th">群成員上傳照片</th>
            <td class="td"><select name="memopen" class="select_wa"><option value="1" ${'select2_1'}>允許</option><option value="0" ${'select2_0'}>不允許</option></select></td>
        </tr>
<!--
EOT;
if ($o_photos_gdcheck) {
$checkCode = L::loadClass('checkcode', 'site');
$checkCodeString = $checkCode->getCheckCodeTemplate();
print <<<EOT
-->
		<tr>
			<th class="th">驗證碼</th>
			<td class="td">
				<input class="input input_wc" onfocus="showgd();" type="text" name="gdcode" id="gdcode" tabindex="3"  /><br />
				<span id="ckcode" style="display:none;margin-bottom:5px;"></span>
$checkCodeString
			</td>
		</tr>
<!--
EOT;
}if($db_question && $o_photos_qcheck){
$qkey = array_rand($db_question);
list(,$showq)=explode("\t",$db_qcheck);
if($db_imagequestion){
	$question = '<img id="ckquestion" src="ckquestion.php?q='.$qkey.'&t='.$timestamp.'" align="top">';
}else{
	$question = $qkey<0 ? getMachineQuestion_1() :  $db_question[$qkey];
}
$q_a = $question.($showq && $qkey>0?" （答案︰".$db_answer[$qkey] . '）' : '');
print <<<EOT
-->
		<tr>
			<th class="th">驗證問答</th>
			<td class="td">
			{$q_a}<br />
			<input class="input input_wc" name="qanswer" id="qanswer" size="25" tabindex="7" />
			<input type="hidden" name="qkey" id="qkey" value="$qkey" />
			</td>
		</tr>
<!--
EOT;
}print <<<EOT
-->
        <tr>
        	<th class="th">&nbsp;</th>
            <td class="td"><span class="btn"><span><button  type="submit">{$button}</button></span></span></td>
        </tr>
    </table>
    </form>
</div>
<script type="text/javascript">
var charset = '$db_charset';
initCheckTextNum('aname','aname_warn',24);
initCheckTextNum('aintro','aintro_warn',255);

</script>
<!--
EOT;
}require_once(uTemplate::printEot('footer'));
?>-->