MyBB Community Forums

Full Version: Custom profile cover without plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

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

See my other guide about adding a postbit background:
https://community.mybb.com/thread-227832.html

Preview:
[Image: Hff9R1K.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:
(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 postbit. However, make sure to turn it on for profiles. Select viewable by all groups, editable by whom ever you want to be able to set a profile cover background.

Step 6:
Head over towards your templates and find your member 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:
style="background-image:url({$customfieldval}); 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
This is really good and I have implemented it on my website! I've actually wondered about this for a while now (same with the postbit one) and I'm really happy that you can do this without a plugin. Good job!
Thank you for your contribution Smile
i have a question if i have multiple custom profile fields how does mybb know which one to use?