MyBB Tutorials

Custom postbit background (no plugin)

Submitted by Perileos, , Thread ID: 207931

Thread Closed
02-06-2021, 12:42 PM
This post was last modified: 02-06-2021, 12:43 PM by Perileos
#1
Hello,

In this tutorial I will show you how to create a custom postbit background without using a plugin.
Please follow all steps carefully otherwise you will make a mistake, causing it not to work.

Preview:
https://i.imgur.com/Cuweu7u.png

Step 1:
Login to your ACP and head over to Configuration -> Custom profile fields

Step 2:
Press "add new profile field and add a title and description you wish. Make sure the field type is textbox.

Step 3:
Add this code into regular expression:
Code:
(https:)\/\/i\.imgur\.com\/\w+\.(png|jpe?g|gif)
Thanks to Omar Wink

Step 4:
Maximum length should be 31, all imgur links are 31 characters long. Put the display order to 1.

Step 5:
Turn off required, show on registration and display on profile. However, make sure to turn it on for postbits. Select viewable by all groups, editable by whom ever you want to be able to set a postbit background.

Step 6:
Head over towards your templates and find your postbit template.

Step 7:
This step is dependable on your theme so you might need to tailor it a small bit. Personally I created a new div but in some cases you could use it on the div's that are there. If you found out where you're going to want the background, add the following code to your div element:
Code:
style="background-image:url({$post['fieldvalue']}); height:200px;padding:10px;background-position:center;"

Step 8:
Try it out, see if it works or if it doesn't.


If you are encountering issues, make sure to use inspect element to determine where your issues are. I recommend to carefully look at step 7 as it has the most possibilities to create an issue.




If you need help or assistance, you can tweet me at @Perileos
My help/assistance is free as long as you can respect me and my time.

Kind regards,
A. Longbeach
Been working with MyBB since 2013. Been involved with several forum such as Crackingseal & Cracked.to

Users browsing this thread: 1 Guest(s)