2009-05-27, 09:10 PM
Quick Description: Hello everyone. I am here to show you a little tutorial on how to implement an easy-to-use and configure system, which allows you to define maximum signature image widths and heights. This only affects the post view (not profiles or anything else) but it can be easily adapted to do so.
MyBB Version: 1.4.x Series
The Tutorial:
First off, log into your Administrative Control Panel (Admin CP) and navigate to the Configuration -> Board Settings area. Click on Add New Setting, and add the following information...
And click Add New Setting. Now you must add another setting; click Add New Setting again, and input these values:
Then click Add New Setting.
Next, navigate to your Templates & Styles section. Go to Templates, and open up your theme's templates. Go to the Post Bit Templates, open up the postbit template and find:
... and replace with:
Save your template(s) and do the EXACT SAME EDIT FOR THE postbit_classic template.
Once your template edits are complete, return to your settings (Show Thread Options) and configure your image settings (they should be near/at the top). If a signature image hits either of the limits, their image will only show at that size.
Have fun!
MyBB Version: 1.4.x Series
The Tutorial:
First off, log into your Administrative Control Panel (Admin CP) and navigate to the Configuration -> Board Settings area. Click on Add New Setting, and add the following information...
Quote:Title: Maximum Signature Image Width
Description: Use this setting to define the maximum WIDTH for displaying images in signatures.
Group: Show Thread Options
Identifier: max_sig_w
Type: Text
And click Add New Setting. Now you must add another setting; click Add New Setting again, and input these values:
Quote:Title: Maximum Signature Image Height
Description: Use this setting to define the maximum HEIGHT for displaying images in signatures.
Group: Show Thread Options
Identifier: max_sig_h
Type: Text
Then click Add New Setting.
Next, navigate to your Templates & Styles section. Go to Templates, and open up your theme's templates. Go to the Post Bit Templates, open up the postbit template and find:
{$post['signature']}
... and replace with:
<style type="text/css">
.signature img {
max-height: {$mybb->settings['max_sig_h']}px;
max-width: {$mybb->settings['max_sig_w']}px;
}
</style>
<div class="signature">
{$post['signature']}
</div>
Save your template(s) and do the EXACT SAME EDIT FOR THE postbit_classic template.
Once your template edits are complete, return to your settings (Show Thread Options) and configure your image settings (they should be near/at the top). If a signature image hits either of the limits, their image will only show at that size.
Have fun!