Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2016, 03:50 PM
jkotlowski jkotlowski is offline
 
Join Date: May 2015
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Automatically resize IMG tags in user signatures?

Hi, I thought for the longest that the sizing options for signatures in the admin CP allowed you adjust the max size of anything in the signature, BBcodes included. But it seems I was wrong.

Is there a method for automatically sizing IMG bbcode in the signature? I'd like to set a maximum of around 500 pixels in width, if possible.
Reply With Quote
  #2  
Old 02-01-2016, 04:30 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could create a plugin as follows:

Product: vBulletin

Hook Location: parse_templates

Title: Restrict size of images in signatures

Execution Order: 5

Plugin PHP Code:

PHP Code:
if (in_array(THIS_SCRIPT, array('showthread''private')))
{
    
$template_hook['headinclude_css'] .= '<style>.signaturecontainer img {max-width: 500px;}</style>';

Plugin is Active: Yes

Click "Save".
Reply With Quote
  #3  
Old 02-01-2016, 08:53 PM
jkotlowski jkotlowski is offline
 
Join Date: May 2015
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
You could create a plugin as follows:

Product: vBulletin

Hook Location: parse_templates

Title: Restrict size of images in signatures

Execution Order: 5

Plugin PHP Code:

PHP Code:
if (in_array(THIS_SCRIPT, array('showthread''private')))
{
    
$template_hook['headinclude_css'] .= '<style>.signaturecontainer img {max-width: 500px;}</style>';

Plugin is Active: Yes

Click "Save".
Hi, thanks for the reply.

I'm having some difficulty here. This would be implemented through the "Hooks & Products System" correct?

If so, there's no "parse_templates" in the hook location drop menu.
Reply With Quote
  #4  
Old 02-01-2016, 09:03 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could also just add
HTML Code:
.signaturecontainer img {max-width: 500px;}
To the CSS/additional.css template.
Reply With Quote
  #5  
Old 02-01-2016, 10:08 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jkotlowski View Post
Hi, thanks for the reply.

I'm having some difficulty here. This would be implemented through the "Hooks & Products System" correct?

If so, there's no "parse_templates" in the hook location drop menu.
I didn't notice this was a vB5 request...when you see this thread in the "New Posts" search, that information doesn't show up for some reason.

So yes, just add it to the additional CSS template as mentioned.
Reply With Quote
  #6  
Old 02-01-2016, 10:42 PM
jkotlowski jkotlowski is offline
 
Join Date: May 2015
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help, both of you. It seems there's a bug with VB 5.2.0 that doesn't allow me access to the template edits... lol.

I'll install the patch to fix that early in the morning when traffic is low and add it to my additional CSS then.
Reply With Quote
Благодарность от:
MarkFL
  #7  
Old 02-02-2016, 02:37 AM
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Location: Phoenix, Az. USA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jkotlowski View Post
Thanks for the help, both of you. It seems there's a bug with VB 5.2.0 that doesn't allow me access to the template edits... lol.

I'll install the patch to fix that early in the morning when traffic is low and add it to my additional CSS then.
FYI, even after the 5.2.1 patch, I had issues in AdminCP with Firefox but Chrome worked perfectly.
Reply With Quote
  #8  
Old 02-02-2016, 10:21 AM
jkotlowski jkotlowski is offline
 
Join Date: May 2015
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So... I've added the code to the additional.css section of my styles. And it doesn't seem to be having any effect on image sizes in the signature.

Code:
.thread-view .b-avatar--m {
    height: 130px;
    width: 130px;
}
.thread-view .b-avatar--m > img {
    max-height: 130px;
    max-width: 130px !important;
}

.l-small .topic-list-container .topic-list .cell-count {
    padding-bottom: 0;
}
.l-small .topic-list-container .topic-list .topic-item td.cell-lastpost {
    display: block;
    padding: 0 5px 5px;
}
.l-small .cell-lastpost .avatar {
    display: none;
}
.l-small .cell-lastpost .lastpost-by {
    font-size: 0.9em;
    color: #6A6A6A;
    display: inline;
}
.l-small .cell-lastpost .lastpost-by:before {
    content: "Last post ";
}
.l-small .cell-lastpost .post-date:before {
    content: "on ";
}

.restore table[align=center] {
    margin: 0 auto;
}
.signaturecontainer img {max-width: 500px;}
Am I supposed to add something to it...?

Thanks for the help.
Reply With Quote
  #9  
Old 02-02-2016, 10:29 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is possible your version of vB uses a different CSS class...please post a link to a page on your site where a signature is visible, and I will look at the page source.
Reply With Quote
  #10  
Old 02-02-2016, 10:30 AM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this.
Code:
#content img { 
    max-width: 100px;
    width: 100%;
    height: auto;
}
*might be wrong, just waking up.
Reply With Quote
Reply


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 07:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04502 seconds
  • Memory Usage 2,263KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete