MyBB Community Forums

Full Version: Profile Photo
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Quote:stupid question #1... can you give me an idea of how the template should look for "edit photo"?
You're right, I forgot the edit photo ('usercp_changephoto') template:
<html>
<head>
<title>$settings[bbname] - $lang->change_photo</title>
$headerinclude
</head>
<body>
$header
<form enctype="multipart/form-data" action="usercp.php" method="post">
<table width="$theme[tablewidth]" border="0" align="center">
<tr>
$usercpnav
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr>
<td class="tborder">
<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" width="100%">
<tr>
<td class="thead" colspan="3"><strong>$lang->change_photo</strong></td>
</tr>
<tr>
<td align="center" class="trow2" width="5%"></td>
<td class="trow2" width="40%"><strong>$lang->photo_upload</strong><br /><span class="smalltext">$lang->photo_upload_note</span></td>
<td class="trow2" width="55%"><input type="file" name="photoupload" size="25" value="" />$uploadedmsg</td>
</tr>
</table>
</td></tr></table>
<br />
<div align="center">
<input type="hidden" name="action" value="do_photo" />
<input type="submit" name="submit" value="$lang->update_photo" />
</div>
</td>
</tr>
</table>
</form>
$footer
</body>
</html>

The member profile template will look something like this:
...(profilefields & stuff)...
<tr><td colspan="3">
<br />
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr><td class="tborder">
<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" width="100%">
<tr>
<td colspan="2" class="thead"><strong>$lang->photo_title</strong></td>
</tr>
<tr><td class="trow1" align="center">
$photo</td></tr>
</table></td></tr></table</td></tr>
....
Quote:stupid question #2... any SQL queries need to be done? (i.e. creating mybb_photos table)
Done automatically on intialisation of the plugin I think.
Quote:stupid question #3... any other files need to be changed?
Just the usercpnav as I salready mentioned I think.

There are no stupid questions Wink
Juzzi Wrote:Done automatically on intialisation of the plugin I think.

Stupid question #4:

So, would I upload photo.php to inc/plugins? Or in the main directory? If in the main directory, how would I "initialize" it? I know you said the main directory, but you keep calling it a "plugin" and inc/plugins is where plugins supposedly go.

Stupid question #5:

You didn't mention about adding things to the language file. What terms would be added? Would these be added to member.lang.php or global.lang.php?

Forgive my noviceness (is that a word?), I'm still battling to learn this stuff. Shy
the language strings are done in the plugin. The photo.php I attached in this post must be placed in the inc/plugins folder. The code I pasted in that post must be put in a new photo.php in the main forums folder (and change the db stuff)... Good luck again Smile
I've done exactly as you have instructed, however the plugin you attached is not shown in the plugin manager. I'd also like to point out that the file you attached contains exactly the code you posted in that post. Perhaps you attached the wrong file.

Thanks again.
Ah! Stupid mistake, check the attachment now...
Awesome! I'll mess around with it later this morning. Shouldn't be a problem now, though.
I followed your directions.

The photo is not uploading for some reason. Sad
where can I find this plugin?
leealex Wrote:where can I find this plugin?

I've made something that could be used =P

/*

 * Profile Picture for MyBB 1.2.7
 * By: LeX-
 * Website: http://www.thingiej.be
 * Version: 1.0

*/

Install ::

* Upload pp.php to your forumroot.
* Upload inc/plugins/pp.php to your /inc/plugins/ folder.
* Upload inc/languages/english/pp.lang.php to your /inc/languages/english/ folder.
* Create A Folder [Where The Pictures Will Be] In Your Uploads Directory and CHMOD to 777.

* Go To Your PluginManager And Activate The Profile Picture Plugin.
* Go To Your Settings ... Look Into Profile Picture Settings And Change To Your Needs !.

After Install, a new link will be created in your UCP, under "Change Avatar", there will be "Change Profile Picture" ... click and go ! =P It has the same look as the Change Avatar so won't be that hard to understand how it works Wink And in the memberprofile there will be a new 'table' with the picture in it.
Well i loaded this and its great but the picture i uploaded into my profile is on everyone elses profile now?
Pages: 1 2 3 4 5