Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Sig image size control Details »»
Sig image size control
Version: 1.00, by Herman Herman is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-23-2002 Last Update: Never Installs: 54
 
No support by the author.

I wrote this hack so i could obviously do what the title says.

When installed it you get an option in vb option of max height and width.

If a user's sig is too big, then when you look at their sig it'll say sorry this image is too large. And if the link doesn't work, then it'll say sorry that image doesn't exist. Thnx.. Don't forget to back up the databases!

[edit]This new one gets rid of the queries.. but, you have to submit your vbulletin options after installing the hack in order for it to work.[/edit]

[edit]Update again, this fixes smooties prob's with it images being set to unlimited[/edit]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 06-24-2002, 05:12 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Ok, the one setting that needs to be changed for this to work is:
Under Posting Code allowances (vB code / HTML / etc):
Maximum images per post/signature: (This needs to be set to 1.)
Works just fine for me.. I have images set to 10 per post/sig, and It only kills the images that are too big.. For instance, if I have it set to 100x500, (default), and I add two images in my sig, one that is 320x240, and one that is 64x64, the 64x64 one stays, but the 320x240 one gets the message that its too big...
Reply With Quote
  #13  
Old 06-24-2002, 05:24 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, ok. So this can be set to anything but 0 for it to work? Because at 0, it doesn't.
Reply With Quote
  #14  
Old 06-24-2002, 05:36 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, here is how it works.

1. You update your profile

2. Before the BBCODE processor, a special function catches all img tags.

3. The function, called size_check, checks to see if the file exists, if it does, it gets the max size and width out of the configuration of your board, and checks to see if the image width is bigger first in width, then in height:
PHP Code:
    if ($im_width $max_sig_width)
        {
        return 
"[i]Sorry, image size exceeds maximum width of ".$max_sig_width.".[/i]";
        }

    if (
$im_height $max_sig_height)
        {
        return 
"[i]Sorry, image size exceeds maximum height of ".$max_sig_height.".[/i]";
        } 
4. It returns the image in BBCODE notation if it is ok, otherwise, it returns the message shown above.

5. The bbcode processes it like normal!


I wasn't sure about your question about setting it to 0.. I wasn't sure what that was refering to...
Reply With Quote
  #15  
Old 06-24-2002, 05:38 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just so you know: instead of using this:
Code:
  $max_height = $DB_site->query_first("SELECT value FROM setting where varname=\"maxsigheight\"");
  $max_width = $DB_site->query_first("SELECT value FROM setting where varname=\"maxsigwidth\"");
You can just use $maxsigwidth and $maxsigheight (globalize them in the function). BUT, you MUST Submit the vBulletin Options page in the Admin CP for this to work.

Anyway, I'll probably install this here later, looks good.
Reply With Quote
  #16  
Old 06-24-2002, 05:43 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea... I was trying to figure that out.. but every single time I tried to global those variables, it wouldn't work. They would return NULL. I didn't know you had to submit the vbulletin options again...lol. I'll edit the post and submit a revision.
Reply With Quote
  #17  
Old 06-24-2002, 05:52 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I installed this here, with some modifications, and it's working great. Great job Herman!
Reply With Quote
  #18  
Old 06-24-2002, 05:53 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
I wasn't sure about your question about setting it to 0.. I wasn't sure what that was refering to...
In my admin cp, i had maximum images/sigs per post set to zero. So, users could post unlimited images with img tag. But, the hack won't work with it set to zero. Anything but zero, and it works fine. That's what my post was about, and why I couldn't get it to work the first time. Now it works great. Will you be updating the original file with Firefly's changes, and if we have this installed, what needs to be changed?
Reply With Quote
  #19  
Old 06-24-2002, 05:58 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BTW, it would be really cool if you could control the amount of images in the signature, and in the posts separately. Like allow only one img tag in the sig, but a different amount in the posts.
Reply With Quote
  #20  
Old 06-24-2002, 05:58 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will update the original file in a sec here.. and I'll post again with changes.
Reply With Quote
  #21  
Old 06-24-2002, 06:20 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just download the new update, and replace the whole size_check function in members.php with the new one.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:07 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.06048 seconds
  • Memory Usage 2,303KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete