vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Check for valid linked image and resize if too large (https://vborg.vbsupport.ru/showthread.php?t=53433)

QiQme 09-06-2003 07:59 PM

This doesn't work for me at all :(

If i change:

if ($img_size[0]> 400) {

to

if ($img_size[0]< 400) {

It works but that's the other way ;)

It just don't resize with if ($img_size[0]> 400) {

Any ideas ?

Xxman 01-01-2004 10:11 PM

Quote:

Originally Posted by QiQme
This doesn't work for me at all :(

If i change:

if ($img_size[0]> 400) {

to

if ($img_size[0]< 400) {

It works but that's the other way ;)

It just don't resize with if ($img_size[0]> 400) {

Any ideas ?

The same problem...

MaDCaT75 01-02-2004 03:39 AM

good idea but doesnt work good....

CVMagic 01-02-2004 09:11 AM

Quote:

Originally Posted by Erwin
Using getimagesize WILL increase server load as the image needs to be downloaded, then MySQL needs to check the image size, and resize it on the fly if it's too big, and then display it... just so you know.

I was actually thinking about making a hack like this with that exact method, what you should do is make postings.php and edit.php check for images, <img> and the bb tag form, 1st check if the image using any dynamic tags if it does then leave it be, then with the images that are not you make both scripts change the tags so something like "/postimage.php?postid=1234&imageid=2" then download them and resize them with gd or otherwise, you can look at my hack https://vborg.vbsupport.ru/showthread.php?t=59410 as an example how to, then you store both the original and the resized copy over to a new table that looks somewhat like the ones used for attachments, and reason being you'd want to store the original is to allow the admins if they want to disable this hack to have regular sized images put back in their place and also incase the image becomes a dead link in the future your board will still keep a copy of it, but also what you can do is just store the url of the original if you dont want to do that or both if you really want to give more options to admins. Oh and by the way on the posting data make sure that you somehow marker the dynamic images so later on when your doing the on the fly check for these your script wont also check the ones you created for the resized copies. Now as for editing, when a post is submitted you delete any and all entries that previously was there using something like "DELETE FROM imagestable WHERE postid='$post[id]'" That was on the posting side of the processing now for the showthread.php end, now Just check for the images with your special markers and force them with i dont know javascript or something I actually dont have the slightest clue on how to do checking and resizing on the fly that wont kill the performance aside from actually attaching the image a " NAME='postid1234imageid5' " and having an OnLoad="" javascript right in the image to resize it accourdingly. Well thats my idea on how to go about it, its not perfect but its a better method than going about it on the fly.

Xxman 01-02-2004 12:06 PM

Thanks a lot CVNMagic , but i'm not an expert coder .. I look for an hack that resize on-the-fly linked images not images as attachmate , anyone know that a hack working already exist ??

QiQme 01-02-2004 05:31 PM

Hi,

I use the following file as the solution.

I'm sure someone here can make this better but it's a start.

In the zip file is a image.js and a html file as an example.

Greetz

Xxman 01-02-2004 09:40 PM

Sorry , but I'm not sure to have understood.

MindTrix 01-02-2004 09:46 PM

Not understood what mate?

Xxman 01-02-2004 09:59 PM

Quote:

Originally Posted by MindTrix
Not understood what mate?

How can I use the QiQme suggestion , and implementing it into some php script of Vbulletin ..

QiQme 01-02-2004 10:04 PM

Just look at the html file.

See the code used.

Paste <script type="text/javascript" src="http://www.yoursite.com/image.js"></script> in the header of your vbulletin site

Paste <SCRIPT language=javascript>check_images();</SCRIPT> in the footer of your vbulletin site

Upload the image.js to your server

and that's about it


All times are GMT. The time now is 06:13 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.01041 seconds
  • Memory Usage 1,739KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete