龙哥 发表于 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

<?php
$file_types_array=array("jpg");
$max_file_size=1048576;
$upload_dir="../guild";

function uploaderFILES($num_of_uploads=1, $file_types_array=array("JPG"), $max_file_size=1048576, $upload_dir="../guild"){
if(!is_numeric($max_file_size)){
$max_file_size = 1048576;
}
foreach($_FILES["file"]["error"] as $key => $value)
{
if($_FILES["file"]["name"][$key]!="")
{
    if($value==UPLOAD_ERR_OK)
    {
      $origfilename = $_FILES["file"]["name"][$key];
      $filename = explode(".", $_FILES["file"]["name"][$key]);
      $filenameext = $filename;
      unset($filename);
      $filename = implode(".", $filename);
      $filename = substr($filename, 0, 15).".".$filenameext;
      $file_ext_allow = FALSE;
      for($x=0;$x<count($file_types_array);$x++){
      if($filenameext==$file_types_array[$x])

      {
          $file_ext_allow = TRUE;

      }
      } // for
      if($file_ext_allow){
      if($_FILES["file"]["size"][$key]<$max_file_size){

          if(move_uploaded_file($_FILES["file"]["tmp_name"][$key], $upload_dir.$filename)){
echo('<br><br><font color="blue">'.$filename."</font> was successful <br />");
          }
          else { echo('<br><br><font color="#FF0000">'.$origfilename."</font> was not successfully uploaded <br />");}
      }
      else{ echo('<br><br><font color="#FF0000">'.$origfilename."</font> was too big, not uploaded <br />"); }
      } // if
      else{ echo('<br><br><font color="#FF0000">'.$origfilename." </font>had an invalid file extension<br />");}
    }
    else{ echo('<br><br><font color="#FF0000">'.$origfilename." </font>was not successfully uploaded<br />");} // else
}
}
} // funtion

/////////////////////////////////////////

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

}
// Close the FTP connection
ftp_close($conn_id);
?>


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

while($imgfile = readdir($dimg))
{
    if(in_array(strtolower(substr($imgfile,-3)),$allowed_types))
    {
      $a_img[] = $imgfile;
      sort($a_img);
      reset ($a_img);
    }
}
$totimg = count($a_img); // total image number
for($x=0; $x < $totimg; $x++)
{
    $size = getimagesize($imgdir.'/'.$a_img[$x]);
    // do whatever
    $halfwidth = ceil($size/2);
    $halfheight = ceil($size/2);
    echo "<img src= '$imgdir/$a_img[$x]'>";
    echo 'link: http://eye-candy-guild.ueuo.com/guild/'.$a_img[$x].' width: '.$size.' height: '.$size.'<br />';
}

?>

龙哥 发表于 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
页: [1] 2
查看完整版本: 版主能不能帮忙找一个图片上传的程序