⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pixhow.php

📁 一个很好的同学录,PHP+TXT,没有数据库的网友的最好选择
💻 PHP
字号:
<?
session_start();
$pic_max_width=590;

if(!$_MYSQL_INC) include("conf_mysql.php");
$sql="update mc_pix set clicks=clicks+1 where id=".$_GET['pid'];
@mysql_query($sql,$Mylink);
$sql="select * from mc_pix where id=".$_GET['pid'];
$Myres=mysql_query($sql,$Mylink);
if(!$curpic=mysql_fetch_object($Myres)) {$error="该相片不存在!";include("inc_error.php");die();}
$list[2]=$curpic;
$sql="select * from mc_pix where id>".$_GET['pid']." order by id limit 2";
$Myres=mysql_query($sql,$Mylink);
if($row=mysql_fetch_object($Myres)) $list[1]=$row;
if($row=mysql_fetch_object($Myres)) $list[0]=$row;
$sql="select * from mc_pix where id<".$_GET['pid']." order by id desc limit 2";
$Myres=mysql_query($sql,$Mylink);
if($row=mysql_fetch_object($Myres)) $list[3]=$row;
if($row=mysql_fetch_object($Myres)) $list[4]=$row;

$title="班级相册";
include("inc_head.php");
echo '
<table border=0 cellpadding=0 cellspacing=0 bgcolor=#F4F3E5 style="border:10px solid #FFCE00">
  <tr> 
    <td width=148 rowspan=6 align="center" valign="top">
	<table border="0" cellspacing="0" cellpadding="0" width=110>
';
ksort($list);
foreach($list as $pic){
	$is_cur="";
	if($pic->ID==$curpic->ID) $is_cur=";border:2px solid #ff0000";
	$pic_owner=htmlspecialchars($pic->owner);
	$pic_size=round($pic->size/1024);
	print <<<p_lable1
	  <tr><td height=16></td></tr>
	  <tr>
		<td height=90 background="images/pic_bg.gif" align="center" valign="middle" style="padding:12 0 8 0{$is_cur}">
		  <a href="pixhow.php?pid={$pic->ID}"><img src="pix/s_{$pic->filename}.jpg"
alt="上传者: {$pic_owner}
文件名: {$pic->oldname}
大 小: {$pic_size}K
时 间: {$pic->time}
分辨率: {$pic->width}×{$pic->height}
点击数: {$pic->clicks}
点击查看原图"></a>
		</td>
	  </tr>
	  
p_lable1;
}
echo '
	</table>
	</td>
    <td width=2 rowspan=6 background="images/index_s_bg.gif"></td>
    <td width=592 height=24>
';
if(!$_CLASS_CONF) include("conf_class.php");
$sql="select size from mc_pix";
$Myres=mysql_query($sql,$Mylink);
$album_total=mysql_num_rows($Myres);
$album_used=0;
while($row=mysql_fetch_row($Myres)) $album_used+=$row[0];
$album_used=number_format($album_used/(1024*1024), 2, '.', '');		//把单位换为MB
$album_percent=round($album_used*100/$album_volumn);
$tmp_t=array(0=>".jpg",1=>".gif");
$fname=$curpic->filename.$tmp_t[$curpic->type];
echo "本相册已有相片 <font color=#FF6700>{$album_total}</font> 张, 总空间 <font color=#FF6700>{$album_volumn}MB</font> 已用 <font color=#FF6700>{$album_used}MB</font>, 所占空间 <span style='height:8;width:100;border:1 solid #8A7F72'><img src='images/red.gif' height=6 width={$album_percent}></span> {$album_percent}%";
echo '
	</td>
  </tr>
  <tr> 
    <td height=2 background="images/index_top_r_b_bg.gif"></td>
  </tr>
  <tr><td height=390 align="center"><a href="pix/'.$fname.'" target="_blank"><img src="pix/'.$fname.'"'.($curpic->width>$pic_max_width?(" width=".$pic_max_width):"").'></a></td></tr>
  <tr><td height=2 background="images/index_top_r_b_bg.gif"></td></tr>
  <tr><td><img src="images/tit_pic.gif" width=73 height=20></td></tr>
  <tr> 
    <td>
	<table width=520 border=0 align="center" cellpadding=0 cellspacing=0>
        <tr valign="top"> 
          <td height=24 colspan=2>上 传 者: <font color=#FF6700>'.htmlspecialchars($curpic->owner).'</font> 
              相片名称: <font color=#FF6700>'.$curpic->oldname.'</font>   上传时间: <font color=#FF6700>'.$curpic->time.'</font></td>
        </tr>
        <tr valign="top"><td height=24 colspan=2>人  气: '.$curpic->clicks.' 人次</td></tr>
        <tr valign="top"> 
          <td width=60 height=24>相片介绍:</td>
          <td width=460 class="wrap">'.nl2br(htmlspecialchars($curpic->brief)).'</td>
        </tr>
      </table>
	</td>
  </tr>
  <tr> 
    <td height=2 colspan=3 background="images/index_top_r_b_bg.gif"></td>
  </tr>
  <tr> 
    <td height=30 colspan=3> </td>
  </tr>
</table>
';
include("inc_foot.php");
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -