<?php
/**
* FILE_NAME : open_onepic.php
*
* @copyright Copyright (c) www.shuangyulin.com
* @author 双鱼林设计
* @package 弹出单张图片选择窗口
* @subpackage
* @version QQ:287307421或254540457
*/

define('IN_WEB', TRUE);
	
require_once( str_replace('\\', '/', dirname(__FILE__)). '/include/global.php');

/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
    $_REQUEST['act'] = 'show';
} else {
    $_REQUEST['act'] = trim($_REQUEST['act']);
}

/*------------------------------------------------------ */
//-- 显示缩略图列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'show')
{
	$sql = $query = $piclist = '';
	
	$sql = "SELECT id,temname,thumbpath FROM {$dbprefix}pictures WHERE thumbpath !=''";
	$query = $DB->query($sql);
	while ($row = $DB->fetch_array($query))
	{
		//取出图片名的前半部分
		$ext = strrchr($row['temname'],'.');
		$row['thumb_name'] = basename($row['temname'],$ext);
		$row['thumb_name'] .= '_thumb'.$ext;
		$piclist[] = $row;
	}
	
	$smarty->assign("css_root", $css_root);
	$smarty->assign("piclist", $piclist); 
	
	$smarty->assign("txtName",$_REQUEST['txtName']);

	
	$smarty->display("open_onepic.html");
}
?>