Andraž Rihtar
Theme designer
Posts: 1,914
Joined: Aug 2009
Reputation: 8
|
[uPic] Image instead of Username
I've seen that a lot of MyBB forum owners wish to offer users to be able to use image instead of their username, but many of them don't know how to do it so it will work correctly or they're just afraid of messing up the forum and not knowing how to fix it. Well, this feature is called uPic and I'm making this tutorial so those of you who don't wish to wait for such plugin to be released to edit it on your own
Edited files:
- postbit (MyBB default postbit)
- postbit_classic (MyBB secondary postbit)
Whichever you are using, works with both. Names next to the postbits are just to help you indicate the right part of the tutorial
Easiest part of this tutorial
- Login to Admin CP using your username and password (duh!)
- Navigate yourself to Custom Profile Fields (Configuration -> Custom Profile Fields)
- Create new profile field and make sure to set its maximum length to anything you wish, keep it nice and long so almost any image url will fit (I'll use 100).
- Save the profile field
- Hoover your mouse over the profile field to see its id which is important for the template edit
So, now if you go to your User CP and Edit Profile, there you should be able to see the field you just created.
Easy part of this tutorial (MyBB default postbit)
- Login to Admin CP using your username and password (duh!)
- Navigate yourself to YOURTHEME templates (Templates & Style -> Templates -> YOURTHEME)
- Locate Post Bit Templates and expand it (Click its name or click Expand)
- Click the 1st template located in Post Bit Templates, its called postbit
- Find this part of code:
Replace above code with this one:
PHP Code:
<a href="{$post['profilelink_plain']}"><img src="{$post['fid<numberhere>']}" alt="{$post['username']}" /></a>
Replace <numberhere> with your Custom Profile Field number!
- Save your edit by clicking Save and Return to Listing button
At this point you're done if you don't allow users to use vertical postbit. Follow steps bellow if you use vertical postbit as well
Easy part of this tutorial (MyBB secondary postbit)
- Login to Admin CP using your username and password (duh!)
- Navigate yourself to YOURTHEME templates (Templates & Style -> Templates -> YOURTHEME)
- Locate Post Bit Templates and expand it (Click its name or click Expand)
- Click the 13th template located in Post Bit Templates, its called postbit_classic
- Find this part of code:
Replace above code with this one:
PHP Code:
<a href="{$post['profilelink_plain']}"><img src="{$post['fid<numberhere>']}" alt="{$post['username']}" /></a>
Replace <numberhere> with your Custom Profile Field number!
- Save your edit by clicking Save and Return to Listing button
At this point you're really finished. Enjoy this new feature of your board
Note that this only works in postbit and the username will not be formated (colors and other effects you specified in group settings). I will try to solve at least the "effects" problem, because it's quite important. Until then enjoy the current features.
Demo: Comming soon as possible
Credits:
- People who want this feature (wouldn't bother otherwise)
- Svizy (meh) for "making" it
Andraž Rihtar - Ex-Support Team Member
|
|
| 06-18-2010, 10:31 PM |
|
euantor
Designer/Themer
Posts: 604
Joined: Jun 2009
Reputation: 4
|
RE: [uPic] Image instead of Username
Hm. Nice tut I guess, but kind of pointless IMHO
|
|
| 06-18-2010, 11:07 PM |
|
Andraž Rihtar
Theme designer
Posts: 1,914
Joined: Aug 2009
Reputation: 8
|
RE: [uPic] Image instead of Username
(06-18-2010 11:07 PM)euantor Wrote: Hm. Nice tut I guess, but kind of pointless IMHO
Well, I made this tutorial just because I saw threads requesting for such edit/plugin here on MyBBS and on MyBB.com . If there wouldn't be any threads requesting this I would keep this for myself (yes, I'm that selfish! )
Andraž Rihtar - Ex-Support Team Member
|
|
| 06-18-2010, 11:39 PM |
|
Glas
Member
Posts: 146
Joined: Jul 2009
Reputation: 1
|
RE: [uPic] Image instead of Username
any demo?
nice tutorial btw
|
|
| 06-19-2010, 03:57 AM |
|
Andraž Rihtar
Theme designer
Posts: 1,914
Joined: Aug 2009
Reputation: 8
|
RE: [uPic] Image instead of Username
(06-19-2010 03:57 AM)Glas Wrote: any demo?
nice tutorial btw
No, I'm getting it soon as possible though and thanks
Andraž Rihtar - Ex-Support Team Member
|
|
| 06-19-2010, 08:13 AM |
|
LMCampbell
Junior Member
Posts: 16
Joined: May 2010
Reputation: 0
|
RE: [uPic] Image instead of Username
The Extra PHP code i can't see could you show it, as it makes it unable for me to scroll down to see.
This is for either of the.
|
|
| 06-24-2010, 02:53 AM |
|
Andraž Rihtar
Theme designer
Posts: 1,914
Joined: Aug 2009
Reputation: 8
|
RE: [uPic] Image instead of Username
(06-24-2010 02:53 AM)LMCampbell Wrote: The Extra PHP code i can't see could you show it, as it makes it unable for me to scroll down to see.
This is for either of the.
Extra PHP? There is no actual PHP involved in this
Andraž Rihtar - Ex-Support Team Member
|
|
| 06-28-2010, 12:05 AM |
|
Don+
Junior Member
Posts: 47
Joined: Aug 2010
Reputation: 0
|
RE: [uPic] Image instead of Username
Nice one, Thanks
|
|
| 08-21-2010, 10:02 AM |
|