vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Automatically resize IMG tags in user signatures? (https://vborg.vbsupport.ru/showthread.php?t=321678)

jkotlowski 02-01-2016 03:50 PM

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.

MarkFL 02-01-2016 04:30 PM

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".

jkotlowski 02-01-2016 08:53 PM

Quote:

Originally Posted by MarkFL (Post 2563978)
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.

Dave 02-01-2016 09:03 PM

You could also just add
HTML Code:

.signaturecontainer img {max-width: 500px;}
To the CSS/additional.css template.

MarkFL 02-01-2016 10:08 PM

Quote:

Originally Posted by jkotlowski (Post 2564016)
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. :)

jkotlowski 02-01-2016 10:42 PM

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. :)

Replicant 02-02-2016 02:37 AM

Quote:

Originally Posted by jkotlowski (Post 2564022)
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.

jkotlowski 02-02-2016 10:21 AM

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. :)

MarkFL 02-02-2016 10:29 AM

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. :)

final kaoss 02-02-2016 10:30 AM

Try this.
Code:

#content img {
    max-width: 100px;
    width: 100%;
    height: auto;
}

*might be wrong, just waking up.


All times are GMT. The time now is 06:57 PM.

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.01737 seconds
  • Memory Usage 1,748KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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