![]() |
Is it possible to have this resize modification only affect bbcode parsing when it is called from the vBadvanced news.php module?
I'd like to do something like the following, but I'm not sure of the exact syntax and whether or not I can determine the page/script name within class_bbcode.php. EDIT: Nevermind, I got it working 5 seconds after I posted with the following: Code:
if (THIS_SCRIPT == 'adv_index'){ |
OK guys,
Here is the last revision of my code. Finaly got it working: Code:
/* Start hack Image RESIZE */ Check if the database server is online Check if the image is available Check the width of the image If > 600 width, resize to 600 and place a link under it to click for the orginal image It doesn't touch the image when =< 600 width. The problem with not being able to cope with spaces or ampersands in the url is solved. If you are gonna use this, be sure to add the three phrases. You can costumize the width that you want as limit for resizing by changing the three instanses of "600" in the code to the limit you want. I don't want to take credit for this code because I did nothing else than changing the existing code that was allready there :) Enjoy :) |
seems to make the pages take alot longer to load...or is it just me?
|
Quote:
|
Quote:
That's because each picture is validated and that's a extra process in opening the page. Pages with no pictures of just a few will not be affected. |
Quote:
With "under it" I meant that when you hoover over the picture you see a resize message and the cursor changes into a hand. Then you can click the picture for a larger image. If you want this text litteraly under the picture, you might try this: Find: Code:
return '<a href="' . $link . '" target="_blank"><img src="' . $link . '" border="0" alt="' . $vbphrase['click_for_larger_image'] . '" style="width: expression(this.width > 600 ? 600 : true);" /></a>'; Code:
return '<a href="' . $link . '" target="_blank"><img src="' . $link . '" border="0" alt="' . $vbphrase['click_for_larger_image'] . '" style="width: expression(this.width > 600 ? 600 : true);" /><br><br>' . $vbphrase['click_for_larger_image'] . '</a>'; Again, don't forget to add the vbphrases, or substitute in above code ' . $vbphrase['click_for_larger_image'] .' for hard coded text like "Click for larger image". |
Quote:
Find in the code of post #52 the next code: Code:
// Image not found Code:
// Image not found |
Your code is good, but I have a lot of pictures in my forums. It took some seconds to saw the thread while the pictures are checked before the thread would be visible. The user think my forum is slow. Any chance to modify this, because I know the original code was f*cking fast
|
Sorry A-handreas, as I said before I'm not realy a coder. I just combined two pieces of code to make another one and succeeded (to my own suprise) to make that work.
I lowered the time-out variable on the @fsockopen() command from 5 to 2. That might speed things up a little. But I'm not aware of php code that could do those checks faster. Maybe some *real* coders know a quicker way. |
so it this hack like what you get on invision power boards?
when someone posts and image linked from another site/gallery it will resize the image so it keeps the thread structure aligned? if so, how do i insert this code? whats the final code that works? |
All times are GMT. The time now is 03:48 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|