📄 index_pic.php
字号:
<?php
include_once( "inc/conn.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/function_picture.inc" );
include_once( "inc/amcy_main.inc" );
$width = 150;
$height = 100;
$parr['album_category'] = $rescp[$i]['PID'];
$des = "index_".$rescp[$i]['PID']."/";
$sql = "SELECT A.HTTP_URL,A.SERVER_PATH,A.ENCRYPT_NAME FROM ALBUM_ATTACHMENT A, ";
$sql .= " ALBUM_PHOTO P WHERE A.PID = P.ATTACHMENT AND P.ALBUM_SUBJECT = ".$rescp[$i]['PID']."";
$cursor = exequery( $connection, $sql );
$k = 0;
if ( $rowp = mysql_fetch_array( $cursor ) )
{
$fname = $rowp['ENCRYPT_NAME'];
$path = $rowp['SERVER_PATH'];
if ( $width == "" && $height )
{
$width = $width ? $width : 100;
$height = $height ? $height : 100;
}
$imginfo = dml_getimageinfo( $rowp['SERVER_PATH'] );
if ( 120 <= $imginfo['height'] )
{
$height = "120";
$scale = $imginfo['height'] / $imginfo['width'];
$width = floor( $height / $scale );
if ( 150 <= $width )
{
$width = "150";
$scale = $width / $height;
$height = floor( $width / $scale );
}
}
else
{
$height = $imginfo['height'];
if ( 150 <= $imginfo['width'] )
{
$width = 150;
}
else
{
$width = $imginfo['width'];
}
}
$src[$k] = createjpeg( $path, $fname, $des, $width, $height );
$file = substr( strrchr( $src[$k], ":" ), 1 );
$file = substr( strrchr( $file, "/" ), 1 );
$imgfile[$k] = "/cache/album/".$_SESSION['LOGIN_USER_ID']."/".$des.$file;
if ( 0 < $width )
{
$strw = " width=".$width;
}
if ( 0 < $height )
{
$strh = " height=".$height;
}
$j = $k + 1;
echo "<s";
echo "cript>\r\n imgUrl[";
echo $rescp[$i]['PID'];
echo "][";
echo $j;
echo "] = \"";
echo $imgfile[$k];
echo "\";\r\n</script>\r\n";
++$k;
}
if ( $k == 0 )
{
$imgfile[0] = "/images/album/default.gif";
}
echo "\r\n";
echo "<s";
echo "tyle type=\"text/css\">\r\n#pageBGDiv_";
echo $rescp[$i]['PID'];
echo " /*滑块容器的样式表*/\r\n{\r\nposition:relative;\r\ntop:0px; \r\nbackground:url(/general/Slider/img/slider_bg.gif) no-repeat; /*背景图片*/\r\nheight:17px; /*高度为 36px,背景图片的高*/\r\nwidth:102px; /*宽为 150px,背景图片的宽*/\r\nz-index:5;\r\n}\r\n#pageHandleDiv_";
echo $rescp[$i]['PID'];
echo " { /*滑块的样式表*/\r\n position:absolute; \r\n left: 0px; /* 设置左侧为0px */\r\n top: 2px; /* 是滑块处在中间位置 */\r\n cursor:default;\r\n width:9px; \r\n height:17px; \r\n}\r\n</style>\r\n<form name=\"Oneslideform_";
echo $rescp[$i]['PID'];
echo "\" id=\"Oneslideform_";
echo $rescp[$i]['PID'];
echo "\" >\r\n<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" align=\"center\" cellpadding=\"4\" bordercolor=\"#000000\">\r\n<TR>\r\n<TD bgcolor=\"#ffffff\" align=\"center\">\r\n<A href=\"javascript:Onetransport('";
echo $rescp[$i]['ALBUM_CATEGORY'];
echo "','";
echo $rescp[$i]['PID'];
echo "')\">\r\n<IMG src=\"";
echo $imgfile[0];
echo "\" \r\n id=\"Oneshow_";
echo $rescp[$i]['PID'];
echo "\" border=\"0\"></A>\r\n<!--";
echo "<s";
echo "cript language=\"javascript\">dakularButtons();</script>-->\r\n</TD>\r\n</TR>\r\n<tr>\r\n<td valign=\"top\">\r\n\r\n<!--\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td id=\"img";
echo $j;
echo "\" class=\"container\" align=\"center\">\r\n<div id='PhotoUrlList_";
echo $rescp[$i]['PID'];
echo "'></div>\r\n";
echo "<s";
echo "cript>\r\n function ShowUrlList(pid,page){\r\n if(imgUrl[pid].length<=1) return '';\r\n var dTotalPage=imgUrl[pid].length/2;\r\n var TotalPage;\r\n var MaxPerPage=6;\r\n if(imgUrl[pid].length%MaxPerPage==0){TotalPage=Math.floor(dTotalPage);}else{TotalPage=Math.floor(dTotalPage)+1;}\r\n if(page<1) page=1;\r\n if(page>TotalPage) page=TotalPage;\r\n var strPage='<table width=100% class=tborder align=center><tr>';\r";
echo "\n if (page > 1) {\r\n strPage+= \"<td width='5'><a href='javascript:ShowUrlList(\"+pid+\",\"+(page-1)+\")'><img src='/images/album/2.gif' border='0'></a></td>\";\r\n }\r\n if (page == 1) {\r\n MaxPerPage = MaxPerPage +1;\r\n }\r\n for(var i=(page-1)*MaxPerPage;i<imgUrl[pid].length&&i<page*MaxPerPage;i++){\r\n\tif (i==0){\r\n\t\ti =1;\r\n\t}\r\n\tstrPage+=\"<td width='36' id='img\"+i+\"' class='container' align='center'><a hre";
echo "f='#Title' onclick=Onechange(\"\r\n\t+i+\")><img src='\"+imgUrl[pid][i]+\"' border='0' border='0' height='35' width='35'></a></td>\";\r\n }\r\n if(TotalPage>1){\r\n\t if(page < TotalPage) {\r\n\t strPage+=\"<td width='70'><a href='javascript:ShowUrlList(\"+pid+\",\"+(page+1)+\")'><img src='/images/album/1.gif' border='0'></a></td>\";\r\n\t };\r\n\t \r\n\t \r\n }\r\n strPage+=\"<td> </td></tr></table>\";\r\n var PhotoUrlList = document.ge";
echo "tElementById(\"PhotoUrlList_\"+pid);\r\n \r\n PhotoUrlList.innerHTML=strPage;\r\n \r\n}\r\nShowUrlList('";
echo $rescp[$i]['PID'];
echo "',1);\r\n</script>\r\n</td>\r\n</tr></table>-->\r\n</td>\r\n</tr>\r\n<!--\r\n<TR>\r\n<TD bgcolor=\"#ffffff\">\r\n";
if ( 0 < $k )
{
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tr>\r\n<td>\r\n <a href=\"javascript:Oneap('";
echo $rescp[$i]['PID'];
echo "',document.Oneslideform_";
echo $rescp[$i]['PID'];
echo ".Oneslidebutton.value)\"><img src=\"/images/album/indexstart.gif\" border=\"0\" alt=\"播放\" id=\"play_";
echo $rescp[$i]['PID'];
echo "\"></a>\r\n <a href=\"javascript:Oneap('";
echo $rescp[$i]['PID'];
echo "','Stop')\"><img src=\"/images/album/indexstop.gif\" border=\"0\" alt=\"停止\"></a>\r\n <a href=\"javascript:Oneprevious('";
echo $rescp[$i]['PID'];
echo "','Oneshow_";
echo $rescp[$i]['PID'];
echo "')\"><img src=\"/images/album/indexprevious.gif\" border=\"0\" alt=\"上一个\"></a>\r\n <a href=\"javascript:Onenext('";
echo $rescp[$i]['PID'];
echo "','Oneshow_";
echo $rescp[$i]['PID'];
echo "')\"><img src=\"/images/album/indexnext.gif\" border=\"0\" alt=\"下一个\"></a>\r\n</td>\r\n<td>\r\n</td>\r\n</tr>\r\n</table>\r\n";
}
echo "</TD>\r\n</TR>\r\n-->\r\n</TABLE>\r\n<input type=\"hidden\" name=\"Oneslidebutton\" id=\"Oneslidebutton_";
echo $rescp[$i]['PID'];
echo "\">\r\n</form>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -