vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   automatic change large image form [img] to [bimg] (https://vborg.vbsupport.ru/showthread.php?t=280879)

home9000 03-30-2012 06:48 AM

automatic change large image form [img] to [bimg]
 
I do not know if there is hack can do :

automatic change large image form [img] to [bimg]

BirdOPrey5 03-30-2012 03:56 PM

There are a number of image resizer mods out there that will resize large images automatically- I've never seen a separate bbcode for big images.

home9000 03-30-2012 06:31 PM

thanks BirdOPrey5 for your fast reply

I do not want to resize the image
I need to make image as link if it's large so the page will load faster
I think this will be good for SEO

BirdOPrey5 03-30-2012 07:20 PM

OK well at least I understand the logic now.

This would be pretty easy to do be editing the bbcode file but the problem is it would need to request the file size of remote files on every page load, from a remote server. That will likely lead to much longer times for page loads, not save any time.

Thinking out loud the only practical way to do this would be when the new post is first saved- do a check for each image and if it is bigger than X bytes in size replace the [img] code with [url] code. This way the delay is only going to happen when a user submits a new post.

The major limit of this would be that if the remote file changed from a small image to a big image (or big to small) the post would remain hard-coded as an image or url based on when the post was first made. Someone would need to manually edit the post to fix that if it was a problem.

Does [bimg] bbcode you talk about do anything different then a regular [url] bbcode?

home9000 03-30-2012 07:42 PM

I agree with you BirdOPrey5, The only way to do it have to be when the new post is first saved

[bimg] = regular [url] bbcode

if it's difficult to know the file size then the image dimension is ok

changing the file later I think will be rear for most of the cases so we can ignore it

BirdOPrey5 03-30-2012 09:54 PM

File size will be easier to find then the dimensions, and file size is more important on how fast a page loads anyway. I see an admincp setting where you can set the max file size in kilobytes and any images larger than that value will be replaced with [url] links instead. If I get fancy maybe I'll put the file-size next to the link. Like....

http://somedomain.com/image.jpg (251 kb)


I will probably play with this but no promises on how soon I can do it- if someone else comes along willing to try it I will gladly defer to them.

home9000 03-31-2012 03:08 AM

Thanks BirdOPrey5

hopefully you do it by yourself
I prefer if you make it like

Large Image (251 kb)

BirdOPrey5 04-15-2012 10:31 PM

Check it out: https://vborg.vbsupport.ru/showthrea...57#post2320457 :)

home9000 04-19-2012 07:31 AM

Thanks BirdOPrey5

Well done :D


All times are GMT. The time now is 04:55 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01233 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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