Latest News:
Latest Mods: Latest Tutorials:


 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[uPic] Image instead of Username
Author Message
Andraž Rihtar
Theme designer


Posts: 1,901
Joined: Aug 2009
Reputation: 8
Post: #1
[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
  1. Login to Admin CP using your username and password (duh!)
  2. Navigate yourself to Custom Profile Fields (Configuration -> Custom Profile Fields)
  3. 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).
  4. Save the profile field
  5. 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)
  1. Login to Admin CP using your username and password (duh!)
  2. Navigate yourself to YOURTHEME templates (Templates & Style -> Templates -> YOURTHEME)
  3. Locate Post Bit Templates and expand it (Click its name or click Expand)
  4. Click the 1st template located in Post Bit Templates, its called postbit
  5. Find this part of code:
    PHP Code:
    {$post['profilelink']} 
    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!
  6. 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)
  1. Login to Admin CP using your username and password (duh!)
  2. Navigate yourself to YOURTHEME templates (Templates & Style -> Templates -> YOURTHEME)
  3. Locate Post Bit Templates and expand it (Click its name or click Expand)
  4. Click the 13th template located in Post Bit Templates, its called postbit_classic
  5. Find this part of code:
    PHP Code:
    {$post['profilelink']} 
    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!
  6. 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
Posting Freak



Posts: 881
Joined: Jun 2009
Reputation: 7
Post: #2
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,901
Joined: Aug 2009
Reputation: 8
Post: #3
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: 147
Joined: Jul 2009
Reputation: 1
Post: #4
RE: [uPic] Image instead of Username
any demo?
nice tutorial btw
06-19-2010, 03:57 AM
Andraž Rihtar
Theme designer


Posts: 1,901
Joined: Aug 2009
Reputation: 8
Post: #5
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
Post: #6
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,901
Joined: Aug 2009
Reputation: 8
Post: #7
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+
Member


Posts: 59
Joined: Aug 2010
Reputation: 0
Post: #8
RE: [uPic] Image instead of Username
Nice one, Thanks
08-21-2010, 10:02 AM
1master1
Member


Posts: 89
Joined: Aug 2010
Reputation: 0
Post: #9
RE: [uPic] Image instead of Username
thanks
02-24-2011, 09:05 AM
junaidpk
Junior Member


Posts: 28
Joined: Jul 2011
Reputation: 0
Post: #10
RE: [uPic] Image instead of Username
This is a nice tutorial... my members will be glad to see this change
07-07-2011, 05:23 PM
 




User(s) browsing this thread: 2 Guest(s)