MyBB Community Forums

Full Version: [Request] Postbit Animated background
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
1. anyone can share this method tutorial ( animated or normal postbit background )??

[attachment=42618]


2. Is it possible that just ( for example = VIP usergroups ) change his postbit background ?

  • Many forums have been trained this method but no result to me Sad

ACP > Configuration > Custom Profile Fields > add a new field

Copy this
(http(s?):)|([/|.|\w|\s])*\.(?:jpg|png)|^$

[Image: nh2SZJD.png]

choose which groups can use it

[Image: 9tYqp9q.png]

style="background: url({$post['fid4']})

Add this code to whereever you want it to work in.

Make sure to replace the 4 with your own ID.

[Image: k6xjfGb.png]

then add a image url in UCP > edit profile

[Image: wzj2JMy.png]


[Image: DH376US.png]

[Image: I8mJlUf.gif]

//////////////////////////

If you want to display the same image from the postbit as a member profile background then just add this code to

Edit Template: member_profile

style="background-image: url({$memprofile['fid4']});

Or if you want to display a user's profile background in the memberlist

Edit Template: memberlist_user

style="background-image: url({$user['fid4']});

I'm not including any CSS.
(2020-02-29, 08:40 PM)Baltafar Wrote: [ -> ]ACP > Configuration > Custom Profile Fields > add a new field

Copy this
(http(s?):)|([/|.|\w|\s])*\.(?:jpg|png)|^$

[Image: nh2SZJD.png]

choose which groups can use it

[Image: 9tYqp9q.png]

style="background: url({$post['fid4']})

Add this code to whereever you want it to work in.

Make sure to replace the 4 with your own ID.

[Image: k6xjfGb.png]

then add a image url in UCP > edit profile

[Image: wzj2JMy.png]


[Image: DH376US.png]

[Image: I8mJlUf.gif]

//////////////////////////

If you want to display the same image from the postbit as a member profile background then just add this code to

Edit Template: member_profile

style="background-image: url({$memprofile['fid4']});

Or if you want to display a user's profile background in the memberlist

Edit Template: memberlist_user

style="background-image: url({$user['fid4']});

I'm not including any CSS.
thanks Baltafar. i have a problem. what mean whereever ? Where exactly do you mean ?

 Add this code to whereever you want it to work in.
style="background: url({$post['fid4']})

Make sure to replace the 4 with your own ID.

How did find My Own ID ???

[attachment=42619]

where this pic ???

You explained very hard : (  I couldn't understand it
When you create a new profile field, it will be assigned with a ID. Click on your new created profile field and check the URL.

This is my localhost URL

http://localhost/mybb/admin/index.php?module=config-profile_fields&action=edit&fid=4

what you need to look at is

fid=4

Where the fid=4 is the ID you need to assign to

style="background: url({$post['fidHERE']})

FID=4 is my ID. You have your own ID unless it is assigned as 4. Then u got nothing to worry about.

//////////////////////////

If you didn't understand what a URL is then

https://community.mybb.com/thread-226672-post-1344232.html#pid1344232

This is the current thread URL, and it has numbers in it. to identify the thread.

http://localhost/mybb/admin/index.php?module=config-profile_fields&action=edit&fid=4

That is my URL to the custom field which only has 1 number in it 4 as the identifier.
(2020-02-29, 09:39 PM)Baltafar Wrote: [ -> ]When you create a new profile field, it will be assigned with a ID. Click on your new created profile field and check the URL.

This is my localhost URL

http://localhost/mybb/admin/index.php?module=config-profile_fields&action=edit&fid=4

what you need to look at is

fid=4

Where the fid=4 is the ID you need to assign to

style="background: url({$post['fidHERE']})

FID=4 is my ID. You have your own ID unless it is assigned as 4. Then u got nothing to worry about.

//////////////////////////

If you didn't understand what a URL is then

https://community.mybb.com/thread-226672-post-1344232.html#pid1344232

This is the current thread URL, and it has numbers in it. to identify the thread.

http://localhost/mybb/admin/index.php?module=config-profile_fields&action=edit&fid=4

That is my URL to the custom field which only has 1 number in it 4 as the identifier.
i found it. 6
[attachment=42621] ok ?

now. i want to add this option just in postbit background, below avatar ( not profile page ).
What should I do ?
(2020-02-29, 09:51 PM)sarvin Wrote: [ -> ]
(2020-02-29, 09:39 PM)Baltafar Wrote: [ -> ]When you create a new profile field, it will be assigned with a ID. Click on your new created profile field and check the URL.

This is my localhost URL

http://localhost/mybb/admin/index.php?module=config-profile_fields&action=edit&fid=4

what you need to look at is

fid=4

Where the fid=4 is the ID you need to assign to

style="background: url({$post['fidHERE']})

FID=4 is my ID. You have your own ID unless it is assigned as 4. Then u got nothing to worry about.

//////////////////////////

If you didn't understand what a URL is then

https://community.mybb.com/thread-226672-post-1344232.html#pid1344232

This is the current thread URL, and it has numbers in it. to identify the thread.

http://localhost/mybb/admin/index.php?module=config-profile_fields&action=edit&fid=4

That is my URL to the custom field which only has 1 number in it 4 as the identifier.
i found it. 6
 ok ?

now. i want to add this option just in postbit background, below avatar ( not profile page ).
What should I do ?

You add this to your code.

Example:

 <div class="postbit_background_container">
 <div class="postbit_background" style="background: url({$post['fid4']})center center no-repeat; background-size:cover;"></div>
 </div>
LOOK HOW I SOLVE IT 

REALLY EASY

@sarvin

watch my above comment
(2020-02-29, 08:40 PM)Baltafar Wrote: [ -> ]ACP > Configuration > Custom Profile Fields > add a new field

Copy this
(http(s?):)|([/|.|\w|\s])*\.(?:jpg|png)|^$

[Image: nh2SZJD.png]

choose which groups can use it

[Image: 9tYqp9q.png]

style="background: url({$post['fid4']})

Add this code to whereever you want it to work in.

Make sure to replace the 4 with your own ID.

[Image: k6xjfGb.png]

then add a image url in UCP > edit profile

[Image: wzj2JMy.png]


[Image: DH376US.png]

[Image: I8mJlUf.gif]

//////////////////////////

If you want to display the same image from the postbit as a member profile background then just add this code to

Edit Template: member_profile

style="background-image: url({$memprofile['fid4']});

Or if you want to display a user's profile background in the memberlist

Edit Template: memberlist_user

style="background-image: url({$user['fid4']});

I'm not including any CSS.

DON'T USE THIS , IT IS VULNERABLE TO STORED XSS
Well, a lot of pipes really useless making the regexp foolish.
Using ^(https?):\/\/([\/.\w\-])*\.(jpg|png|gif)$ might be better

Peharps some chars can be added in the regexp, it actually allows only "a-z0-9./-"
Pages: 1 2