📄 open_control.php
字号:
<?php
include_once( "inc/conn.php" );
include_once( "inc/auth.php" );
echo "\r\n<html>\r\n<head>\r\n<title>图片管理</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\r\n";
echo "<s";
echo "cript>\r\nfunction open_pic(pic_id,sub_dir,file_name,img_width,img_height)\r\n{\r\n aWidth=screen.availWidth-19;\r\n aHeight=screen.availHeight-58;\r\n if(img_height+75<= aHeight)\r\n window_height=img_height+75;\r\n else\r\n window_height=aHeight;\r\n \r\n if(img_width+40<= aWidth)\r\n window_width=img_width+40;\r\n else\r\n window_width=aWidth;\r\n\r\n window_top=(aHeight-window_height)/2;\r\n";
echo " window_left=(aWidth-window_width)/2;\r\n\r\n window_top=0;\r\n window_left=0;\r\n window_width=aWidth;\r\n window_height=aHeight;\r\n \r\n// self.moveTo(window_left,window_top);\r\n// self.resizeTo(window_width+10,window_height+32);\r\n parent.open_main.location=\"open_main.php?PIC_ID=\"+pic_id+\"&SUB_DIR=\"+sub_dir+\"&FILE_NAME=\"+file_name;\r\n location=\"open_control.php?PIC_ID=\"+pic_id+\"&SUB_DIR=\"+s";
echo "ub_dir+\"&FILE_NAME=\"+file_name;\r\n}\r\n\r\nfunction save_pic()\r\n{\r\n \r\n}\r\n</script>\r\n</head>\r\n\r\n<body>\r\n";
$IMG_TYPE_STR = "gif,jpg,png,swf,swc,psd,tiff,bmp,iff,jp2,jpx,jb2,jpc,xbm,wbmp,";
$connection = openconnection( );
$query = "SELECT * from PICTURE where PIC_ID={$PIC_ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PIC_PATH = $ROW['PIC_PATH'];
}
if ( $SUB_DIR != "" && substr( $PIC_PATH, strlen( $PIC_PATH ) - 1, 1 ) == "/" )
{
$FILE_PATH = $PIC_PATH.$SUB_DIR;
}
else
{
$FILE_PATH = $PIC_PATH."/".$SUB_DIR;
}
$CUR_DIR = $FILE_PATH."/";
$dh = opendir( $CUR_DIR );
$C = 0;
while ( false !== ( $CUR_FILE = readdir( $dh ) ) )
{
$DIR = "";
$FILE_TYPE = substr( strrchr( $CUR_FILE, "." ), 1 );
$FILE_TYPE = strtolower( $FILE_TYPE );
if ( !is_file( $CUR_DIR.$CUR_FILE ) || !find_id( $IMG_TYPE_STR, $FILE_TYPE ) )
{
}
else if ( $PRE_FILE == $FILE_NAME )
{
$PRE_FILE = $PRE_PRE_FILE;
$NEXT_FILE = $CUR_FILE;
}
else
{
$PRE_PRE_FILE = $PRE_FILE;
$PRE_FILE = $CUR_FILE;
}
}
if ( $NEXT_FILE == "" )
{
$PRE_FILE = $PRE_PRE_FILE;
}
echo "<center>\r\n<table border=\"0\" width=\"80%\" cellspacing=\"0\" cellpadding=\"0\" class=\"small\">\r\n<tr>\r\n<td width=\"20%\" align=\"center\" valign=\"center\"> \r\n<A href=\"down.php?PIC_ID=";
echo $PIC_ID;
echo "&SUB_DIR=";
echo $SUB_DIR;
echo "&FILE_NAME=";
echo $FILE_NAME;
echo "\"><img src=\"/images/save.gif\" width=\"30\" height=\"25\" title=\"保存图片\" border=\"0\"></A>\r\n</td>\r\n<td width=\"40%\" align=\"center\" valign=\"center\">\r\n";
if ( $PRE_FILE != "" )
{
$PRE_FILE_PATH = $CUR_DIR.$PRE_FILE;
$PRE_IMG_ATTR = getimagesize( $PRE_FILE_PATH );
echo "<A href=\"javascript:open_pic(";
echo $PIC_ID;
echo ",'";
echo $SUB_DIR;
echo "','";
echo $PRE_FILE;
echo "',";
echo $PRE_IMG_ATTR[0];
echo ",";
echo $PRE_IMG_ATTR[1];
echo ");\"><img src=\"/images/pre_pic.gif\" width=\"30\" height=\"25\" title=\"上一张\" border=\"0\"></A> \r\n";
}
echo "\r\n";
if ( $NEXT_FILE != "" )
{
$NEXT_FILE_PATH = $CUR_DIR.$NEXT_FILE;
$NEXT_IMG_ATTR = getimagesize( $NEXT_FILE_PATH );
echo "<A href=\"javascript:javascript:open_pic(";
echo $PIC_ID;
echo ",'";
echo $SUB_DIR;
echo "','";
echo $NEXT_FILE;
echo "',";
echo $NEXT_IMG_ATTR[0];
echo ",";
echo $NEXT_IMG_ATTR[1];
echo ");\"><img src=\"/images/next_pic.gif\" width=\"30\" height=\"25\" title=\"下一张\" border=\"0\"></A>\r\n";
}
echo "</td>\r\n<td width=\"20%\" align=\"center\" valign=\"center\">\r\n<A href=\"javascript:parent.close();\"><img src=\"/images/close.gif\" width=\"30\" height=\"25\" title=\"关闭窗口\" border=\"0\"></A> \r\n</td>\r\n</center>\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -