找回密码
 注册账户
查看: 2386|回复: 11

版主能不能帮忙找一个图片上传的程序

[复制链接]
龙哥 发表于 2007-6-25 01:49:19 | 显示全部楼层 |阅读模式
最好是可以生成论坛贴图代码的那种:loveliness:
棋子 发表于 2007-6-25 06:20:17 | 显示全部楼层
是不是这样的东西 www.uploadbar.cn
棋子 发表于 2007-6-25 06:24:13 | 显示全部楼层
如果你要简单的 自己写个就好了 这东西也不难的说
棋子 发表于 2007-6-25 06:25:23 | 显示全部楼层
  1. <?php
  2. $file_types_array=array("jpg");
  3. $max_file_size=1048576;
  4. $upload_dir="../guild";

  5. function uploaderFILES($num_of_uploads=1, $file_types_array=array("JPG"), $max_file_size=1048576, $upload_dir="../guild"){
  6. if(!is_numeric($max_file_size)){
  7. $max_file_size = 1048576;
  8. }
  9. foreach($_FILES["file"]["error"] as $key => $value)
  10. {
  11.   if($_FILES["file"]["name"][$key]!="")
  12.   {
  13.     if($value==UPLOAD_ERR_OK)
  14.     {
  15.       $origfilename = $_FILES["file"]["name"][$key];
  16.       $filename = explode(".", $_FILES["file"]["name"][$key]);
  17.       $filenameext = $filename[count($filename)-1];
  18.       unset($filename[count($filename)-1]);
  19.       $filename = implode(".", $filename);
  20.       $filename = substr($filename, 0, 15).".".$filenameext;
  21.       $file_ext_allow = FALSE;
  22.       for($x=0;$x<count($file_types_array);$x++){
  23.         if($filenameext==$file_types_array[$x])

  24.         {
  25.           $file_ext_allow = TRUE;

  26.         }
  27.       } // for
  28.       if($file_ext_allow){
  29.         if($_FILES["file"]["size"][$key]<$max_file_size){

  30.           if(move_uploaded_file($_FILES["file"]["tmp_name"][$key], $upload_dir.$filename)){
  31. echo('<br><br><font color="blue">'.$filename."</font> was successful <br />");
  32.           }
  33.           else { echo('<br><br><font color="#FF0000">'.$origfilename."</font> was not successfully uploaded <br />");}
  34.         }
  35.         else  { echo('<br><br><font color="#FF0000">'.$origfilename."</font> was too big, not uploaded <br />"); }
  36.       } // if
  37.       else{ echo('<br><br><font color="#FF0000">'.$origfilename." </font>had an invalid file extension<br />");  }
  38.     }
  39.     else{ echo('<br><br><font color="#FF0000">'.$origfilename." </font>was not successfully uploaded<br />");  } // else
  40.   }
  41. }
  42. } // funtion

  43. /////////////////////////////////////////

  44. if(isset($_POST["submitted"])){
  45. uploaderFILES($num_of_uploads, $file_types_array, $max_file_size, $upload_dir);

  46. }
  47. // Close the FTP connection
  48. ftp_close($conn_id);
  49. ?>


  50. <?php
  51. $imgdir = '../guild'; // the directory, where your images are stored
  52. $allowed_types = array('png','jpg','jpeg','gif'); // list of filetypes you want to show
  53. $dimg = opendir($imgdir);

  54. while($imgfile = readdir($dimg))
  55. {
  56.     if(in_array(strtolower(substr($imgfile,-3)),$allowed_types))
  57.     {
  58.         $a_img[] = $imgfile;
  59.         sort($a_img);
  60.         reset ($a_img);
  61.     }
  62. }
  63. $totimg = count($a_img); // total image number
  64. for($x=0; $x < $totimg; $x++)
  65. {
  66.     $size = getimagesize($imgdir.'/'.$a_img[$x]);
  67.     // do whatever
  68.     $halfwidth = ceil($size[0]/2);
  69.     $halfheight = ceil($size[1]/2);
  70.     echo "<img src= '$imgdir/$a_img[$x]'>";
  71.     echo 'link: [url]http://eye-candy-guild.ueuo.com/guild/'.[/url]$a_img[$x].' width: '.$size[0].' height: '.$size[1].'<br />';
  72. }

  73. ?>
复制代码
 楼主| 龙哥 发表于 2007-6-26 01:09:48 | 显示全部楼层
一楼演示那个就可以,可以提供吗?最好是GGAD效果好一点的
棋子 发表于 2007-6-26 06:43:17 | 显示全部楼层

回复 #5 龙哥 的帖子

那个给你也没有用  需要服务器支持 ico加密的  和zend加密一样  用不了的
 楼主| 龙哥 发表于 2007-6-26 06:53:34 | 显示全部楼层

回复 #6 无心的棋子 的帖子

那有没有好的替代品哇?:Q
棋子 发表于 2007-6-26 16:23:32 | 显示全部楼层

回复 #7 龙哥 的帖子

以前我改了一个 英文的 后来空间给别人了 所以丢了 现在找8到了 :L
您需要登录后才可以回帖 登录 | 注册账户

本版积分规则

存档|黑屋|手机|网络实验室 本站服务器由美国合租以及IDCLayer国际数据提供!!!

GMT+8, 2026-6-10 04:32 , Processed in 0.014432 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表