vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - Dynamic Picture Resize for [IMG] tag (https://vborg.vbsupport.ru/showthread.php?t=157228)

thincom2000 09-08-2007 03:00 PM

Quote:

Originally Posted by TECK (Post 1334537)
You are person no. 2 who requested the above feature. :)
Keep in mind this: There is no way (for now) to separate the [IMG] bbcode from actual postbit and signature. In other words, if you have a message because the image is resized, this message will show anywhere, including the signature, which will make users upset.

I will definitely not edit the code in several vBulletin files, just to avoid this feature in the signature... so be aware what you ask for. :)

Actually, there is a way. When $bbcode->parse() is called, the parser checks whether we are in the calendar, a pm, signature, etc (stored in $forumid). Directly afterwards the bbcode_parse_start hook is called, which you can in turn use to store this info in a way that can be passed to your function.

Also, check out $bbcode->do_parse() and the other subsequently called functions, because it is entirely possible to accomplish this mod without using any file edits (which I'm sure everyone would like). I'll install it such on my site and post the code when I am done.

xandizitxu 09-08-2007 03:34 PM

Got it to work sorry! Forgot just to set the vBulletin Options!


Quote:

Originally Posted by thincom2000 (Post 1334880)
Actually, there is a way. When $bbcode->parse() is called, the parser checks whether we are in the calendar, a pm, signature, etc (stored in $forumid). Directly afterwards the bbcode_parse_start hook is called, which you can in turn use to store this info in a way that can be passed to your function.

Also, check out $bbcode->do_parse() and the other subsequently called functions, because it is entirely possible to accomplish this mod without using any file edits (which I'm sure everyone would like). I'll install it such on my site and post the code when I am done.

That is what I'am looking for!

we_scooter 09-08-2007 04:39 PM

:)

I am a fan since HOMELITE for VB2
Definistely INSTALLED thanx TECK
miss TECKWIZARD.com;)

TECK 09-08-2007 04:42 PM

Quote:

Originally Posted by thincom2000 (Post 1334880)
Actually, there is a way. I'll install it such on my site and post the code when I am done.

Glad to see the hackers are still sharing their knowledge. :)

Personally, I will never use this approach. Inserting the code directly is way faster then using it on a hook. Plus, you will need to use all kind of preg_replaces in order to isolate the link.
I never understood why the hook obsession, they actually slow your server... a lot. Who cares if you edit the file and add a small piece of code.

I challenge you to show me a better and faster way, compared to the code I made.
If you win, I pay the beer... :)

thincom2000 09-08-2007 04:43 PM

Okay, here are the updates:
  • eliminated all file & CSS edits
  • added vBulletin Option to open in new window
  • added vBulletin Option for a "this image has been resized" message

In total, there may be 1 additional preg_replace, because the plugins bypass the original IMG bbcode handler. And the template is not eval'd on its own, keeping speed in mind.

Changes to the product file:
  • Added 3 plugins
  • Added 1 template (scroll to bottom for CSS)
  • Added 2 settings

Quote:

Originally Posted by TECK (Post 1334920)
I never understood why the hook obsession, they actually slow your server... a lot.

This is why my site only has one plugin for each hook, with one line of code each. This include()s plugins saved in the file system. :) I think I halved load times by spending a week doing that.

TECK 09-08-2007 04:44 PM

Quote:

Originally Posted by we_scooter (Post 1334919)
miss TECKWIZARD.com;)

Something really big is coming... in few months. :)
A new teckwizards site will evolve... be prepared.

TECK 09-08-2007 04:51 PM

Quote:

Originally Posted by thincom2000 (Post 1334921)
Okay, here are the updates ...

I win! You replaced my 4 lines of code with 285 execution processes. :D
However this is a very good solution, for people who don't want to edit their files.

Now, pay the beer! I'm in Montreal. :D

PixelFx 09-08-2007 04:56 PM

Hey tech long time no chat :D, nice hack :D got a client been looking for something like this for his blog :D

TECK 09-08-2007 06:48 PM

Quote:

Originally Posted by thincom2000 (Post 1334921)
This is why my site only has one plugin for each hook, with one line of code each. This include()s plugins saved in the file system. :) I think I halved load times by spending a week doing that.

Good call, I like your thinking. That is exactly what I do also... Lizard King can confirm how many times I insisted on this matter, for his site. :)
I suggested that to vBulletin team also, for their products. In Project Tools and Blog I replaced all their hook code with files. :)

While doing some benchmarks to emulate 10,000 users hitting a server, the results were shockingly better, compared to the code left in hooks.

Quote:

Originally Posted by PixelFx (Post 1334928)
Hey tech long time no chat :D, nice hack :D got a client been looking for something like this for his blog :D

Glad I could help, Robert. :)

pspmaster93 09-08-2007 10:19 PM

can you include a readme guide for updating from the previous version?


All times are GMT. The time now is 08:06 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.01149 seconds
  • Memory Usage 1,746KB
  • 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
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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