<!--<?php
if($job=='album'){print <<<EOT
-->
  <div style="width:82%; float:right">
	<div class="t" style="margin-right:0; width:99%">
	  <table cellpadding="0" cellspacing="0" width="100%">
		<tr><td class="h">{$cn_name}相册</td></tr>
		<tr class="tr2"><td class="f_two"><a href="$basename&cyid=$cyid&job=creatalbum">创建相册</a></td></tr>
		<tr class="f_one tr3">
		  <td class="tac">
<!--
EOT;
foreach($albumdb as $value){
$value[atypename] = $value[atype]==1 ? '公共相册' : ($value[atype]==2 ? '个人相册[公开]' : '个人相册[私人]');print <<<EOT
-->
			<div class="tips" style="width:30%; margin-left:2px" >
			  <table width="100%" cellpadding="0" cellspacing="0">
				<tr>
				  <td rowspan="4"><a href="$basename&cyid=$cyid&job=viewalbum&aid=$value[aid]"><img src="$value[lastphoto]" width="100" height="100"></a></td>
				  <td>$value[username]</td>
				</tr>
				<tr><td>相片数 ($value[photonum])</td></tr>
				<tr><td>$value[atypename]</td></tr>
				<tr><td>$value[crtime]</td></tr>
				<tr>
				  <td><a href="$basename&cyid=$cyid&job=viewalbum&aid=$value[aid]">$value[aname]</a></td>
				  <td>
<!--
EOT;
if($value[uid]==$winduid || $admindb[$winduid] || $groupid==3){print <<<EOT
-->
					[<a href="$basename&job=editalbum&cyid=$cyid&aid=$value[aid]">编辑</a>]
					[<a href="$basename&job=delalbum&cyid=$cyid&aid=$value[aid]">删除</a>]
<!--
EOT;
}print <<<EOT
-->
				  </td>
				</tr>
			  </table>
			</div>
<!--
EOT;
}print <<<EOT
-->
		  </td>
		</tr>
	  </table>
	</div>
  </div>
</div>
<!--
EOT;
}elseif($job=='creatalbum' || $job=='editalbum'){
$jobname = $job=='creatalbum' ? '创建相册' : '编辑相册';print <<<EOT
-->
  <div style="width:82%; float:right">
	<form action="$basename&job=$job" method="post">
	<input name="step" type="hidden" value="2" />
	<input name="cyid" type="hidden" value="$cyid" />
	<input name="aid" type="hidden" value="$aid" />
	<div class="t" style="margin-right:0; width:99%">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="2" class="h"><a href="$basename&cyid=$cyid&job=album">{$cn_name}相册</a> -> $jobname</td></tr>
		<tr class="f_one tr3">
		  <td width="20%">相册名称</td>
		  <th><input name="aname" type="text" class="input" value="$aname" /></th>
		</tr>
		<tr class="f_one tr3">
		  <td>相册说明</td>
		  <th><textarea name="aintro" cols="50%" rows="5">$aintro</textarea></th>
		</tr>
		<tr class="f_one tr3">
		  <td>相关属性</td>
		  <th>
			<input type="radio" name="atype" value="1" $check_1 $disable /> 公共相册（只有管理员才能创建，任意本{$cn_name}成员均可上传）<br /> 
			<input type="radio" name="atype" value="2" $check_2 /> 个人开放相册（只有本人可以上传，任何本{$cn_name}成员均可见）<br />
			<input type="radio" name="atype" value="3" $check_3 /> 个人私有相册（只有本人可以上传，只有个人可以浏览）
		  </th>
		</tr>
<!--
EOT;
if($job!='editalbum'){print <<<EOT
-->
		<tr class="f_one tr3">
		  <td>说明</td>
		  <th>创建相册需要{$moneyname}{$cn_camoney}，每个相册最多可以拥有{$cn_maxphotonum}张相片。个人最多可以创建{$cn_albumnum2}个相册，{$cn_name}则最多拥有{$cn_albumnum}个相册。</th>
		</tr>
<!--
EOT;
}print <<<EOT
-->
	  </table>
	</div>
	<div class="tac" style="padding:5px"><input class="btn" type="submit" name="Submit" value="提 交" /></div>
	</form>
  </div>
</div>
<!--
EOT;
}elseif($job=='viewalbum'){print <<<EOT
-->
  <div style="width:82%; float:right">
	<div class="t" style="margin-right:0; width:99%">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td class="h"><a href="$basename&cyid=$cyid&job=album">{$cn_name}相册</a> -> $albumdb[aname]</td></tr>
		<tr class="tr2">
		  <td>
		    <span class="fr">$albumdb[username] 创建于 $albumdb[crtime]</span>
<!--
EOT;
if($albumdb[uid]==$winduid || $albumdb['atype']==1 || $groupid==3){print <<<EOT
-->
			<a href="$basename&job=addphoto&cyid=$cyid&aid=$aid">上传相片</a>
<!--
EOT;
}if($albumdb[uid]==$winduid || $admindb[$winduid] || $groupid==3){print <<<EOT
-->
			<a href="$basename&job=editalbum&cyid=$cyid&aid=$aid">编辑相册</a>
			<a href="$basename&job=delalbum&cyid=$cyid&aid=$aid">删除相册</a>
<!--
EOT;
}print <<<EOT
-->
		  </td>
		</tr>
		<tr class="tr3">
		  <td>
<!--
EOT;
foreach($photos as $value){print <<<EOT
-->
			<div class="tips" style="width:16%; margin-left:6px"><a href="$basename&cyid=$cyid&job=viewphoto&aid=$aid&pid=$value[pid]#p"><img src="$value[path]" width="100" height="100" vspace="5" style="border:#FFFFFF 3px solid" /><br />$value[pname]</a><br />$value[uploader] 上传</div>
<!--
EOT;
}print <<<EOT
-->
		  </td>
		</tr>
		<tr class="tr3 f_two"><th colspan="2">相册简介: $albumdb[aintro]</th></tr>
	  </table>
	</div>
	<div style="text-align:right;margin-right:15px;">$pages</div>
  </div>
</div>
<!--
EOT;
}elseif($job=='delalbum'){print <<<EOT
-->
  <div style="width:82%; float:right">
	<form action="$basename&job=delalbum" method="post">
	<input name="step" type="hidden" value="2" />
	<input name="cyid" type="hidden" value="$cyid" />
	<input name="aid" type="hidden" value="$aid" />
	<div class="t" style="margin-right:0; width:99%">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td class="h">删除确定</td></tr>
		<tr class="tr2">
		  <td><font color=red>注意:</font> 删除前请确定相册内没有图片，如存在，请先把图片删除。</td>
		</tr>
		<tr class="f_one tr3">
		  <td>是否删除此相册($aname)？</td>
		</tr>
	  </table>
	</div>
	<div class="tac" style="padding:5px">
	  <input class="btn" type="submit" name="Submit" value="提 交" />
	  <input class="btn" type="button" onclick="location.href='$basename&cyid=$cyid&job=album'" value="取 消" />
	</div>
	</form>
  </div>
</div>
<!--
EOT;
}elseif($job=='addphoto' || $job=='editphoto'){print <<<EOT
-->
  <div style="width:82%; float:right">
	<form action="$basename&job=$job&" method="post" enctype="multipart/form-data">
	<input type="hidden" name="step" value="2" />
	<input type="hidden" name="cyid" value="$cyid" />
	<input type="hidden" name="pid" value="$pid" />
	<input type="hidden" name="oldaid" value="$aid" />
	<div class="t" style="margin-right:0; width:99%">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr><td colspan="2" class="h"><a href="$basename&cyid=$cyid&job=album">{$cn_name}相册</a> -> <a href="$basename&cyid=$cyid&job=viewalbum&aid=$aid">$aname</a> -> 相片上传</td></tr>
		<tr class="tr3 f_one">
		  <td>相册名称</td>
		  <th>
			<span id="choosealbum">$aname<input type="hidden" name="aid" value="$aid" />
			<a class="abtn" unselectable="on" onclick="Choosealbum()">选择</a></span>
		  </th>
		</tr>
		<tr class="tr3 f_one">
		  <td>图片名称</td>
		  <th><input name="pname" type="text" class="input" value="$pname" /></th>
		</tr>
		<tr class="tr3 f_one">
		  <td width="20%">内容描述</td>
		  <th><textarea name="pintro" rows="5" cols="50">$pintro</textarea></th>
		</tr>
<!--
EOT;
if($job=="addphoto"){print <<<EOT
-->
		<tr class="tr3 f_one">
		  <td>上传图片</td>
		  <th><input name="photo" type="file" class="input file" size="50" /></th>
		</tr>
<!--
EOT;
}else{print <<<EOT
-->
		<tr class="tr3 f_one">
		  <td>编辑图片</td>
		  <th id="att_$pid"><span id="attach_$pid" onmouseover="att.show('$pid');"><font color="red"><b>$pname</b></font>&nbsp;({$size}K)</span><span id="show_$pid" style="margin-left:1px"><a id="md_$pid" class="abtn" onclick="att.modify($pid)">更新</a><span id="atturl_$pid" style="display:none">$path</span><div id="viewimg" class="menu" style="display:none;"></div><script type="text/javascript" language="JavaScript" src="js/ajax_attach.js"></script><script type="text/javascript" language="JavaScript" src="js/upload.js"></script></th>
		</tr>
<!--
EOT;
}print <<<EOT
-->
	  </table>
	</div>
	<div class="tac" style="padding:5px">
	  <input name="step" type="hidden" id="step" value="2" />
	  <input type="submit" name="Submit" value="提 交" class="btn" />
	</div>
	</form>
<script language="JavaScript">
function Choosealbum(){
	getObj('choosealbum').innerHTML = '<select name="aid" id="aid">$albumselect</select>';
}
</script>
  </div>
</div>
<!--
EOT;
}elseif($job=='viewphoto'){print <<<EOT
-->
<div class="bdbA">
	<div id="breadcrumbs">
		<a class="crumbs-item gray3" href="$db_bfn" title="$db_bbsname"><strong>$db_bbsname</strong></a><a class="crumbs-item gray3" href="$basename&cyid=$cyid&job=view"><i> </i>$alldb[cname]</a><a class="crumbs-item gray3" href="$basename&job=viewalbum&cyid=$cyid&aid=$aid"><i> </i>$thisdb[aname]</a><span class="crumbs-item current"><i> </i><strong>$thisdb[pname]</strong></span>
	</div>
</div>
<div style="height:10px"></div>
<div class="t">
  <a name="p"></a>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr><td colspan="2" class="h">图片名称: <a id="pname" href="$basename&cyid=$cyid&job=viewphoto&aid=$aid&pid=$pid#p">$thisdb[pname]</a></td></tr>
	<tr class="tr2">
	  <td style="padding-bottom:4px;">
<!--
EOT;
if($thisdb[uid]==$winduid || $admindb[$winduid] || $groupid==3){print <<<EOT
-->
		<a id="delphoto" style="cursor:pointer;" onClick="checkset('$basename&job=delphoto&cyid=$cyid&pid=$pid')">删除</a>
		<a id="editphoto" href="$basename&job=editphoto&cyid=$cyid&pid=$pid">修改</a>
<!--
EOT;
}print <<<EOT
-->
	  </td>
	  <td class="tar" style="padding-bottom:4px;"><a style="cursor:pointer;" onclick="copyUrl();" class="abtn" unselectable="on">复制此相片地址，发送给好友</a></td>
	</tr>
	<tr class="tr3 f_one">
	  <td valign="top" width="75%">
		<div><a style="cursor:pointer;" onClick="preimg();"><img src="$hkimg/previous.gif" alt="上一张" align="absmiddle"></a> &nbsp; 第 <span id="thisps">{$thisp}</span> / {$count} 张相片&nbsp; <a style="cursor:pointer;" onClick="nextimg();"><img src="$hkimg/next.gif" alt="下一张" align="absmiddle"></a></div>
		<div id="loading" style="color:white;background-color:blue;position:absolute;padding:5px;display:none;top:250px;left:300px;"><label id="DownloadInfo" style="display:block;color:#FFF;">正在加载图片，请稍候...</label></div>
		<div id="path" style="display:block;padding:10px;text-align:center;margin:auto;"></div>
	  </td>
	  <td valign="top" width="25%">
		<div style="border:#E3BE67 1px dashed;background-color:#FFFFD2;padding:5px;text-align:left; line-height:180%; margin-bottom:10px;">
		  相片所有: <span id="uploader">$thisdb[uploader]</span><br />
		  上传时间: <span id="uptime">$thisdb[uptime]</span><br />
		  图片说明: <span id="pintro" style="display:block">$thisdb[pintro]</span>
		</div>
		<div id="small" style="border:#E3E3E3 1px dashed ; background-color:#F4F9FA;padding:5px;width:250px;margin:auto; text-align:center">
<!--
EOT;
foreach($sphotodb as $key => $value){
++$key;print <<<EOT
-->
		  <a style="cursor:pointer;" onclick="showimg($key);"><img src="$value[small]" width="100" height="100" style="border:#E3E3E3 2px solid; padding:3px; margin:auto;"></a>
<!--
EOT;
}print <<<EOT
-->
		</div>
	  </td>
	</tr>
  </table>
</div>
<script language="JavaScript" type="text/javascript">
<!--
EOT;
foreach($photodb as $key => $value){print <<<EOT
-->
var image$key = '$value'.split("\t");
<!--
EOT;
}print <<<EOT
-->
var thisp = $thisp;
var newimg;
function showimg(num){
	newimg = new Image();
	--num;
	document.getElementById('pname').href = '$basename&cyid=$cyid&job=viewphoto&aid=$aid&pid=' + imagepid[num] + '#p';
	document.getElementById('pname').innerHTML = imagepname[num];
	if (document.getElementById('delphoto')) {
		var temp = '$basename&job=delphoto&cyid=$cyid&pid=' + imagepid[num];
		document.getElementById('delphoto').onclick = function(){checkset(temp)};
		document.getElementById('editphoto').href = '$basename&job=editphoto&cyid=$cyid&pid=' + imagepid[num];
	}
	document.getElementById('uploader').innerHTML = imageuploader[num];
	document.getElementById('uptime').innerHTML = imageuptime[num];
	document.getElementById('pintro').innerHTML = imagepintro[num];
	document.getElementById('thisps').innerHTML = num+1;
	document.getElementById('loading').style.display = '';
	newimg.src = imagepath[num];
	checkLoadFinished(1);
}
function checkLoadFinished(count) {
	if (count > 1000) {
		document.getElementById('DownloadInfo').innerHTML = '发生错误，加载图片超时';
		return;
	}
	var state = '';
	if (document.all) {
		state = newimg.readyState;
	} else if (newimg.complete) {
		state = 'complete';
	}
	if (state!='complete') {
		window.setTimeout("checkLoadFinished(" + (count + 1) + ")",30);
		return;
	}
	var MaxW = 600;
	var MaxH = 500;
	if (newimg.width > MaxW || newimg.height > MaxH) {
		var dW = 0;
		var dH = 0;
		if ((newimg.width/MaxW) > (newimg.height/MaxH)) {
			dW = MaxW;
			dH = Math.round(dW/newimg.width*newimg.height);
		} else {
			dH = MaxH;
			dW = Math.round(dH/newimg.height*newimg.width);
		}
		if (dW > 0 && dH > 0) {
			newimg.width = dW;
			newimg.height = dH;
		}
	}
	var childs = document.getElementById('path').childNodes;
	for (var i = 0; i < childs.length;++i) {
		document.getElementById('path').removeChild(childs[i]);
	}
	newimg.style.border = "#E3E3E3 3px solid";
	document.getElementById('path').appendChild(newimg);
	document.getElementById('loading').style.display="none";
	scroll(0,145);
}
function nextimg(){
	if (thisp >= imagepid.length) {
		return false;
	}
	thisp++;
	showimg(thisp);
}
function preimg(){
	if (thisp<2) {
		return false;
	}
	thisp--;
	showimg(thisp);
}
function checkset(chars){
	if (!confirm("您确认要删除此图片。")) {
		return false;
	}
	location.href = chars;
}
function copyUrl(){
	var content = '$db_bbsurl/$basename&u=$winduid&cyid=$cyid&job=viewphoto&aid=$aid&pid=' + imagepid[thisp-1] + '\\r\\n这张照片不错~ 推荐给你看一下啦 ~~~';
	window.clipboardData.setData("Text",content);
	alert("按 CTRL+V，粘贴到 QQ 或 MSN 上发给好友吧 *^-^* ");
}
showimg(thisp);
</script>
<!--
EOT;
}print <<<EOT
-->
<div class="c" style="width:100%"></div>
<!--
EOT;
?>-->