Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Image Resize [java]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2010-08-16 15:15:28
OK, I take no credit for this, its from tbdev, but works well on ttv2.05.



The image resize we were using caused the torrent details pages to load so slow it was no longer usable, so I looked for an alternative. I searched tt forums and didnt find anything, heres the code we used:

Download ncode_imageresizer.js and put in the directory on your server.

In header.php add before </head>

<script type="text/javascript" src="ncode_imageresizer.js"></script><script type="text/javascript">

<!--

NcodeImageResizer.MODE = 'newwindow';

NcodeImageResizer.MAXWIDTH = 600;

NcodeImageResizer.MAXHEIGHT = 0;

NcodeImageResizer.Msg1 = 'Click this bar to view the full image.';

NcodeImageResizer.Msg2 = 'This image has been resized. Click this bar to view the full image.';

NcodeImageResizer.Msg3 = 'This image has been resized. Click this bar to view the full image.';

NcodeImageResizer.Msg4 = 'Click this bar to view the small image.';

//-->

</script>



In your themes.css file before </style> Add

<!----- Image resizer css ---->table.ncode_imageresizer_warning {

background: #FFFFE1;

color: #000000;

border: 1px solid #CCC;

cursor: pointer;

}

table.ncode_imageresizer_warning td {

font-size: 12px;

color: red;

vertical-align: middle;

text-decoration: bold;

}

table.ncode_imageresizer_warning td.td1 {

padding: 5px;

}

table.ncode_imageresizer_warning td.td1 {

padding: 2px;

}

<!---- end resizer --->



NcodeImageResizer.MAXWIDTH = 600; <<--- change this to the max width you want.

functions.php Find

$s = preg_replace("/\[img\](http:\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png|\.bmp|\.jpeg))\[\/img\]/i", "<img border=0 src=\"\\1\">", $s);


Replace

$s = preg_replace("/\[img\](http:\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png|\.bmp|\.jpeg))\[\/img\]/i", "<img border=0 src=\"\\1\" alt=\"\"onload=\"NcodeImageResizer.createOn(this);\">", $s);


Find

$s = preg_replace("/\[img=(http:\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png|\.bmp|\.jpeg))\]/i", "<img border=0 src=\"\\1\">", $s);


Replace

$s = preg_replace("/\[img=(http:\/\/[^\s'\"<>]+(\.gif|\.jpg|\.png|\.bmp|\.jpeg))\]/i", "<img border=0 src=\"\\1\" alt=\"\"onload=\"NcodeImageResizer.createOn(this);\">", $s);



Image:

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=4161"]ncode_imageresizer.js[/url]

ncode_imageresizer.js
Download
error.gif
error.gif
Unknown User
2010-08-25 01:02:09
hm in all mine themes.css i cant finde </style>
Unknown User
2010-09-01 01:47:53
"Lakicevic Boris, post: 65082":
hm in all mine themes.css i cant finde </style>

Just put it in at the bottom mate, it will be fine. Mine must be slightly different. Basically anywhere after a }
Unknown User
2010-09-04 11:23:07
thnx m8 wil try like you say ;)
Unknown User
2010-09-05 20:58:31
hm wont work,dont know why?
Unknown User
2010-09-05 23:12:37
I just copied it straight in from the tbdev post mate, maybe the code is in the wrong place in header or theme css, both of mine are heavily modded.

I am trying it on ver 2.06 later this week, so I will go throught it again.

I just installed this one ver 2.06 and it works fine. It didnt have </style> in theme css, so i just put the code right at the bottom.
Unknown User
2010-10-24 20:41:36
It is not working for me

I use tt 2.6

edit: Ok i found it!!

It was on my header.php the problem!

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=4278"]functions.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=4279"]theme.css[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=4280"]header.php[/url]
functions.php
Download
theme.css
Download
header.php
Download
2010-10-26 15:43:26
fonctionne pas avec la version 2.06,ci correction stp mettre la  nouvelle proc
Unknown User
2011-03-11 23:54:40
work perfectly for me. thx

rename image "error.gif" save in folder "images"

save js file in root directory

and copy all modifications in file
Unknown User
2011-03-18 04:48:15
yup all working great here on v.2.06 fully modded
Unknown User
2011-08-12 22:29:36
Works perfect, thanks :angry:
Unknown User
2011-10-02 09:10:22
Works perfect, thanks! :angry:
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728