1
Kiki1
problem with image
  • 2005/2/28 21:43

  • Kiki1

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/3/14


when i go to upload picture to the forum the picture is small


http://www.croportal.net/uploads/thumbs/Kristijan_1109616633_00021264.jpg

why is that. the normaly picture is big

2
Kiki1
Re: problem with image
  • 2005/2/28 21:46

  • Kiki1

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/3/14


can i in modules/newbb/ change something here


thumbs.php FILE


<?php
//&#260;µ&#260;&#341;&#260;Í&#260;¤&#260;ëÍ&#323;´&#344;&#380;ô
//PHP¤ËGD&#260;&#350;&#260;×&#260;·&#260;ç&#260;ó¤¬É¬ÍפǤ&#261;
//2/7 &#260;&#336;&#260;&#711;&#260;¤&#260;ë&#282;&#318;&#733;¤&#340;µ
function thumb_create($src$W$H$thumb_dir="./"){
    global 
$gd_ver;
    
  
// &#731;&#269;Áü¤ÎÉý¤&#268;&#261;⤵¤&#268;&#260;&#380;&#260;¤&#260;פ&#328;&#317;&#269;&#262;&#340;
  
$size GetImageSize($src);
  switch (
$size[2]) {
    case 
: return false; break;
    case 
$im_in = @ImageCreateFromJPEG($src); break;
    case 
$im_in ImageCreateFromPNG($src);  break;
  }
  if (!
$im_in) die("GD¤&#328;&#260;µ&#260;Ý&#711;&#317;&#260;&#268;¤·¤&#262;¤¤¤&#280;¤¤¤«&#711;&#728;&#260;&#733;&#711;&#317;&#260;&#261;¤¬¸«¤Ä¤«¤&#281;¤&#354;¤»¤ó<br>phpinfo()¤ÇGD&#260;&#350;&#260;×&#260;·&#260;ç&#260;ó¤&#328;&#322;Îǧ¤·¤&#262;¤&#379;¤&#340;¤µ¤¤");
  
// &#260;&#281;&#260;µ&#260;¤&#260;&#351;
  
if ($size[0] > $W || $size[1] > $H) {
    
$key_w $W $size[0];
    
$key_h $H $size[1];
    (
$key_w $key_h) ? $keys $key_w $keys $key_h;
    
$out_w $size[0] * $keys;
    
$out_h $size[1] * $keys;
  } else {
    
$out_w $size[0];
    
$out_h $size[1];
  }
  if (
$gd_ver == 2){
      
// &#733;&#272;Î&#270;&#731;&#269;Áü&#711;&#280;&#260;µ&#260;&#341;&#260;Í&#260;¤&#260;ë&#711;ˤÎ&#260;¤&#260;á&#711;&#317;&#260;¸¤&#328;&#351;î&#340;®¤·&#711;&#728;¸µ&#731;&#269;Áü¤&#328;&#260;&#322;&#260;Ô&#711;&#317;¤·¤&#354;¤&#261;&#711;&#321;(GD2.0Í&#323;)
      
$im_out ImageCreateTrueColor($out_w$out_h);
      
$resize ImageCopyResampled($im_out$im_in0000$out_w$out_h$size[0], $size[1]);
    } else {
      
// (GD2.0°&#280;&#731;&#317;
      
$im_out ImageCreate($out_w$out_h);
      
ImageCopyResized($im_out$im_in0000$out_w$out_h$size[0], $size[1]);
    }
  
// &#260;µ&#260;&#341;&#260;Í&#260;¤&#260;ë&#731;&#269;Áü¤&#328;&#260;Ö&#260;é&#260;¦&#260;¶¤Ë&#733;&#272;Î&#270;&#711;&#728;&#280;ݸ
  
$filename substr($srcstrrpos($src,"/")+1);
  
$filename substr($filename0strrpos($filename,"."));
  
ImageJPEG($im_out$thumb_dir.$filename.".jpg");
  
//ImagePNG($im_out, $thumb_dir.$filename.".png");
  // &#351;î&#340;®¤·¤&#380;&#260;¤&#260;á&#711;&#317;&#260;¸¤&#328;ÇË´&#355;
  
ImageDestroy($im_in);
  
ImageDestroy($im_out);
}
?>

3
Kiki1
Re: problem with image
  • 2005/2/28 21:48

  • Kiki1

  • Not too shy to talk

  • Posts: 118

  • Since: 2004/3/14


i also use this fo file upload in forum


/***********************************************************
Module Name : newbb hack for file upload
Auther      : Y.Sakai ( webmaster@bluemooninc.biz )
Company     : Bluemoon inc. ( http://www.bluemooninc.biz )
Start date  : 08,Mar,2004
Last update : 30,Apr,2004
***********************************************************/
I modified XOOPS forum module to more easyly about file upload and attach.
You can upload directly and attach automatically.
It's just overwrite newbb folder. (Recommend backup before!)
v1.0.1 Added simple forumform.
v1.0.2 denied MIME type executable and html file upload.
v1.0.3 I changed rejecting process MIME to watching extension name.
V1.0.4 Added newbb_fileup.txt and xoopscode.php. omit the  original files.
V1.0.5 Added notify check box to simple form. 
V1.0.6 Change the uploaded file name for add type problem.(Security update.)
V1.1.0 I made fileup.ini.php for parameter.(default form, max upload size, check MIME type etc...)
V1.1.1 Added Max file size parameter for private forum.
V1.1.2 I deleted mb_strings function. but still can use multi-byte strings. ( it'
s good for non mb_string support servers. )
V1.1.3 Bug fix about switching form on reply.
V1.1.4 Bug fix about switching form Http Get Method.
V1.1.5 Support multi-byte file name and Guest upload option. ( Use CarefllyAnyone can do that. )
V1.1.6 Add upload title stringsSmilies for simple form at fileup.ini.php.
V1.1.7 Add download.php for sanitize decode about uploadfile.
V1.1.8 Fix download.php for file size problem.
V1.1.9 Add guest download option. (Thanks Tiro!)
V1.1.10 Support download icon. ( Use ./newbb/images/phpBB/attachment.gif )
V1.1.11 Add upload usage message for upload in fileup.ini.php.
V1.1.12 Fix the Excel file download problem.
V1.1.13 Fix disappear download icon at flat mode.
V1.1.14 Add download icon and UPLOADS parameter on fileup.ini.php.
V1.1.15 Support thumbnail for JPG and PNG attached files.
V1.1.16 Cut the uploader's name when downloading.
**************
How to Install
**************
1.Backup all files about (XOOPS_ROOT./module/newbb) folder.
2.Extract these hack files. (XOOPS_ROOT./module)
3.Move 1 file to XOOPS_ROOT./include
    Move _xoops_include_xoopscodes.php to XOOPS_ROOT./include
    Rename xoopscodes.php to xoopscodes.php.org
    Rename _xoops_include_xoopscodes.php to xoopscodes.php
4.Customize the fileup.ini.php, if you need some changes.
5.Cerate thumbnail folder (XOOPS_ROOT./uploads/thumbs).
Done!