1
domineaux
Is there an image resizer hack for Newbb?
  • 2004/4/22 15:45

  • domineaux

  • Quite a regular

  • Posts: 389

  • Since: 2002/9/29


Looking for a hack that will resize any images linked or uploaded into the newbb. Working on a gamer site, and most of the users don't have tools for resizing before they put up images. Large images force the whole page large size and scrolling is required to use the whole page, regardless if all the other postings are normally sized.

]THIS IS A VERY AGGRAVATING ISSUE - I NEED A FIX

Over a year ago I asked this question, using the 1.+ versions of Xoops. I was just hoping someone might have addressed the issue by now.

Oh! I'll edit the posting after awhile. Just trying to communicate my issue. Please, don't get mad about this.

This is a real issue for building sites where the users are on high speed connections, have powerful computers, and expensive video cards,etc.

---------------------

Example of what I mean...

[img ]http://www.peak.ne.jp/xoops/uploads/photos/3.jpg[/img ]

Link broken by Davidl2

2
domineaux
Re: Is there an image resizer hack for Newbb?
  • 2004/4/22 16:02

  • domineaux

  • Quite a regular

  • Posts: 389

  • Since: 2002/9/29


This kinda stuff is common place. They say a picture is worth a thousand words...well it sure takes up more space than a thousand words. If you have more to day you have to scroll all the way right to read the whole document.

I realize the user can do a link to the graphic, but for the life of me I can't understand why they won't.

Human nature ain't my ballywick.

------------------

3
phppp
Re: Is there an image resizer hack for Newbb?
  • 2004/4/22 18:08

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Yes
at least, going to be yes

4
dashbord
Re: Is there an image resizer hack for Newbb?
  • 2004/4/30 2:22

  • dashbord

  • Just popping in

  • Posts: 39

  • Since: 2004/4/19


I made auto thumbnail for big images in newbb_fileup1115.zip
Please try this hack!

5
karuna
Re: Is there an image resizer hack for Newbb?
  • 2004/4/30 2:55

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


a hack from www.bbchen.org

let the images auto fit the table in newbb.

(1). add this function in /include/xoops.js

CODE
//Hack Begin==Add image-autoresizing feature===//
function CaricaFoto(img){
foto1= new Image();
foto1.src=(img);
Controlla(img);
}
function Controlla(img){
if((foto1.width!=0)&&(foto1.height!=0)){
viewFoto(img);
}else{
funzione="Controlla('\"+img+\"')";
intervallo=setTimeout(funzione,20);
}
}
function viewFoto(img){
largh=foto1.width;
altez=foto1.height;
stringa="width="+largh+",height="+altez;
finestra=window.open('','',stringa);
finestra.document.write ("<html><body leftmargin=0 topmargin=0>");
finestra.document.write ("<a href='java script:this.close()'><img border=0 src=");
finestra.document.write (img);
finestra.document.write ("></a></body></html>");
finestra.document.close();
return false;
}
//Hack End/*/




(2).in /class/module.textsanitizer.php

##find:

CODE
$replacements[] = '<img src="\\3" align="\\2" alt="" />';
$replacements[] = '<img src="\\1" alt="" />';
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\4" align="\\2" alt="\\4" />';
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\2" alt="\\3" />';


##replace it with:

CODE

$replacements[] = "<a href='java script:CaricaFoto(\"\\3\");'><img src='\\3' align='\\2' alt='点击查看大图' border=0 onload=\"java script:if(this.width>screen.width-540)this.width=screen.width-500\" /></a><br>";
$replacements[] = "<a href='java script:CaricaFoto(\"\\1\");'><img src='\\1' alt='点击查看大图' border=0 onload=\"java script:if(this.width>screen.width-540)this.width=540\" /></a><br>";
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\4" align="\\2" alt="\\4" />';
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\2" alt="\\3" />';



##find :

CODE
$patterns[] = "/java script:/si";
$replacements[] = "java script:";



##move it behand :

CODE

function &xoopsCodeDecode(&$text, $allowimage = 1)
{
$patterns = array();
$replacements = array();


##finish

6
phppp
Re: Is there an image resizer hack for Newbb?
  • 2004/4/30 4:22

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Test site for new release of newbb

You may find such features.

7
davidl2
Re: Is there an image resizer hack for Newbb?
  • 2006/5/28 3:43

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


(As this topic was reffered to in a more recent post, I've broken the link to the oversized image which was messing up the page )

8
phppp
Re: Is there an image resizer hack for Newbb?
  • 2006/5/28 6:37

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Plz be aware, the topic is deprecated.
There is already a more comprehensive hack for multimeida and image resize support.

Login

Who's Online

209 user(s) are online (112 user(s) are browsing Support Forums)


Members: 0


Guests: 209


more...

Donat-O-Meter

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

Latest GitHub Commits