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¤ËGDĄŞĄ×Ą·ĄçĄó¤¬É¬ÍפǤą

//2/7 ĄŐĄˇĄ¤ĄëĚľ˝¤Ŕµ

function thumb_create($src$W$H$thumb_dir="./"){

    global 
$gd_ver;

    

  
// ˛čÁü¤ÎÉý¤Čąâ¤µ¤ČĄżĄ¤Ą×¤ňĽčĆŔ

  
$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¤ňĄµĄÝˇĽĄČ¤·¤Ć¤¤¤Ę¤¤¤«ˇ˘Ą˝ˇĽĄą¤¬¸«¤Ä¤«¤ę¤Ţ¤»¤ó
phpinfo()¤ÇGDĄŞĄ×Ą·ĄçĄó¤ňłÎǧ¤·¤Ć¤Ż¤Ŕ¤µ¤¤"
);

  
// ĄęĄµĄ¤Ąş

  
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){

      
// ˝ĐÎϲčÁüˇĘĄµĄŕĄÍĄ¤ĄëˇË¤ÎĄ¤ĄáˇĽĄ¸¤ňşîŔ®¤·ˇ˘¸µ˛čÁü¤ňĄłĄÔˇĽ¤·¤Ţ¤ąˇŁ(GD2.0ÍŃ)

      
$im_out ImageCreateTrueColor($out_w$out_h);

      
$resize ImageCopyResampled($im_out$im_in0000$out_w$out_h$size[0], $size[1]);

    } else {

      
// (GD2.0°Ę˛Ľ

      
$im_out ImageCreate($out_w$out_h);

      
ImageCopyResized($im_out$im_in0000$out_w$out_h$size[0], $size[1]);

    }

  
// ĄµĄŕĄÍĄ¤Ąë˛čÁü¤ňĄÖĄéĄ¦Ą¶¤Ë˝ĐÎϡ˘Ęݸ

  
$filename substr($srcstrrpos($src,"/")+1);

  
$filename substr($filename0strrpos($filename,"."));

  
ImageJPEG($im_out$thumb_dir.$filename.".jpg");

  
//ImagePNG($im_out, $thumb_dir.$filename.".png");

  // şîŔ®¤·¤żĄ¤ĄáˇĽĄ¸¤ňÇË´ţ

  
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!



Login

Who's Online

142 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits