MyBB Community Forums

Full Version: Need help with modification..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Since there's no modification for this, I will need help creating it.

I want it so that in the postbit, where your username goes above every post, that there's an if condition. Something like..

if images/userimages/USERNAME.png exists
<img src="images/userimages/USERNAME.png">
else
USERNAME
end if

Can someone help me do this? I haven't done PHP in so long, I don't know what to do. I want it so if there's an image, titled "Mike.png", then for every post Mike makes, instead of displaying his username, it displays that image. Same as all other users.
Bump! Anyone know how to do this?
It would be better to use a plugin for this Smile
Php doesn't work in templates, without Yumi's plugin.
Ah, well can someone help me do something like this?

Basically what I want it to do, is when a user posts, search a certain directory (/userimages/), but a file with the posters username.png. If there isn't one, then show the username, if there is, then show the image.
Bump.

I need any kind of help. I really want this done, however I need to do it.
here you go. threw this together.
  • assumes JPEG format (.jpg extension)
  • assumes default folder is in \images\usernames, which you will need to create
  • assume image names are "user_XXX.jpg" where XXX is the UID of the user. I'd use username, but since its possible to change usernames, this is easier and would require no maintenance.
  • does not handle the image uploads, etc.

its for MyBB 1.6
It does not appear to work. I uploaded this file to /inc/plugins, and activited it. It still says "Install / Activate" beside it.
you using 1.4 or 1.6? its working on my 1.6 test site.

try the new version attached here. i just updated this as i missed a "." in the default image path.

plus here is a screen cap of it on my site. ignore the missing group image, this is a sandbox site)
Very odd.. It's still not working for some reason. Now I can activate it, but it won't show the user image (just the username).

I have images/usernames/user_1.jpg uploaded..

Edit: Yes, I'm using 1.6.
edit the image path to include a leading period './images/usernames/'

i left that out of the previous file and corrected it in the most current version of the plugin
Pages: 1 2