vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   New Image Tag to reduce Imagesize (https://vborg.vbsupport.ru/showthread.php?t=94250)

utw-Mephisto 08-13-2005 10:00 PM

New Image Tag to reduce Imagesize
 
I had this done with Deaths with version 3.0.7 but it applies here as well of course.

This is not really professional but ey, it works for me :)

To post an image you usually use [IMG].

You can create another tag, let's say [IMGO] for oversized images.

Go to your admincp

Admincp => Custom BB Codes => Add New BB Code

Title : Whatever you want
Tag : imgo
Replacement : <a href="{param}" target="_blank"><img border="0" width="400" alt="Thumb resize." src="{param}" /></a>
Example : [imgo]http://img96.imageshack.us/img96/7499/gibraltar12804sx.jpg[/imgo] (you need an example otherwise it will displays only the link)
Description : Whatever you want
Use {option} : No
Button Image (Optional) : Well, optional

As I said, it is not the best, professional one, but usefull. The dark side of that one is when using with picture smaller than 400 pixel width :) It'll be resized also ....

Original Post / Version 3.0.7

TCM 08-18-2005 12:07 AM

Uh.... the height remains, so the image will be disorted. 'cause it's client-side, they'll still download the full filesize of the full image, which defeats the purpose of thumbnails in many applications. What's the point?

utw-Mephisto 08-18-2005 06:27 AM

The point is to avoid the forum being disorted (optic wise) ...

Jenta 08-23-2005 04:50 PM

Quote:

Originally Posted by TCM
Uh.... the height remains, so the image will be disorted. 'cause it's client-side, they'll still download the full filesize of the full image, which defeats the purpose of thumbnails in many applications. What's the point?

ive been using something similar for years and the images dont distort at all without a height attribute

HTML Code:

<a href="{param}" target="_blank"><img src="{param}" width="640" border="4" alt="Click the image to view the full version" /></a><div align="center"><b>Click the image to view the full version.</b></div>

Brinnie 08-27-2005 07:50 AM

It's "Dimensions"... Not filesize. Get it right.

ggiersdorf 08-30-2005 03:01 PM

Quote:

Originally Posted by Jenta
ive been using something similar for years and the images dont distort at all without a height attribute

HTML Code:

<a href="{param}" target="_blank"><img src="{param}" width="640" border="4" alt="Click the image to view the full version" /></a><div align="center"><b>Click the image to view the full version.</b></div>

where do you put that Jenta?

utw-Mephisto 08-30-2005 03:04 PM

Quote:

Originally Posted by ggiersdorf
where do you put that Jenta?

At "Replacement" ....

Wayne Luke 08-30-2005 04:22 PM

Quote:

Originally Posted by TCM
Uh.... the height remains, so the image will be disorted. 'cause it's client-side, they'll still download the full filesize of the full image, which defeats the purpose of thumbnails in many applications. What's the point?

Actually, this is a common technique. If you only specify one dimensional attribute, the browser will automatically scale the other to match.

ricker 09-11-2005 07:42 PM

Cool! Thanks for sharing.

Allan 09-11-2005 09:58 PM

Thanks you for sharing :)

akanevsky 10-10-2005 10:07 PM

Quote:

Actually, this is a common technique. If you only specify one dimensional attribute, the browser will automatically scale the other to match.
Really? That's useful, and I didn't know that :)

Ryan McBain 10-12-2005 05:46 AM

So what's the right way to do this step by step? I can't get this to work. When I do it, all I see is broken code and red X.

Ryan McBain 10-14-2005 10:17 PM

anyone?

utw-Mephisto 10-15-2005 01:12 AM

I put all the details in the first post which are running since vb3.5 RC1 on ut2007world.com ...

Be sure you have also insert an example, otherwise it won't work ..

PennylessZ28 10-15-2005 02:13 AM

How can I just replace the standard IMG tags with this?

utw-Mephisto 10-15-2005 02:16 AM

that would require file edits afaik ...

ggiersdorf 10-16-2005 07:44 PM

utw-Mephisto can you tell us what file edits and how?

utw-Mephisto 10-16-2005 08:54 PM

Good question, like out of my belly I would say <forum-root>/includes/class_bbcode.php

But I haven't checked the functions in there tbh .... I try to find something more specific, but until then, just take a look yourself, you might be faster finding what you need ;)

edit

I was close :)

There you go : https://vborg.vbsupport.ru/showthread.php?t=92882

ggiersdorf 10-17-2005 02:14 PM

hey Utw- Not sure if thats the same thing that link pust scroll bars on the screen. I would like to use this new custom BBCODE in place of the IMG tag or modify the IMG tag to do what this custome BBCOD does. Can this be done if so how!?

utw-Mephisto 10-17-2005 02:17 PM

The only way to change the [img] is in that file (class_bbcode.php) - I don't know another way ...

ggiersdorf 10-18-2005 11:58 AM

Quote:

Originally Posted by utw-Mephisto
The only way to change the [img] is in that file (class_bbcode.php) - I don't know another way ...

I understand that, but the link you sent me to was not a way to replace the IMG tag with this shrinking tag, it was a way to make the img tag leave the image the size it is but add scroll bars to it, I wanted a way to make the img tag by default (shrink the image) to size X

ricker 03-06-2006 04:29 PM

How do we specify that this new image tag (mine's called "sized") created can't be used in signatures? I've had someone find the loophole.

seg 03-10-2006 04:02 PM

There is "Allow [IMG] Code in Signatures" in vBulletin Options. Is there a loop hole to get around this?

Quote:

Originally Posted by ricker
How do we specify that this new image tag (mine's called "sized") created can't be used in signatures? I've had someone find the loophole.

I am sure others have done this. I wanted to restrict the image size, but allow readers to click out to the original image for copyright purposes. I adpated this code from: https://vborg.vbsupport.ru/showpost....6&postcount=22

In the file: /includes/class_bbcode.php

Find:
PHP Code:

return '<img src="' .  $link '" border="0" alt="" />'

Replace with:
PHP Code:

return '<table width="300 border="0"><tr><td><a href="' .  $link '" target="_blank"><img src="' .  $link '" border="0" alt="" style="max-width: 300px;" /></td></tr><tr><td><div align="center" style="font-size: 10px;"><a href="' .  $link '" target="_blank">View Original Image</a></div></table>'


beano33 04-11-2006 09:48 PM

Quote:

Originally Posted by HR3rdGen
How can I just replace the standard IMG tags with this?

Just turn them off in forums and signatures so they can't be used.

In the Add New BB Code field for Button Image put in the path for your insert image button.
eg. Button Image: images/editor/insertimage.gif

Then your editor toolbars will have the same button using the new bbcode.

G_Man 06-21-2006 12:21 AM

Worked a trick for me. Certainly not foolproof, but what is!?!? Fools are so ingenius afterall. ;)

Thanks

X-Vert 12-28-2006 04:17 PM

anyone here? lol

sorry for bringing back and old thread but I need some help.

I installed the new tags and they work great. Now... how can i get the tag image to show up in quick replies? It only shows up when ever I "Go Advanced".

Please reply asap, thanks !


All times are GMT. The time now is 01:26 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01411 seconds
  • Memory Usage 1,772KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (26)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete