MyBB Community Forums

Full Version: [MyBB 1.4] - Usernamehistory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Plugin has been rewritten by me and is now much more professional as before.

Every time a username is changed through User/Admin CP, the entry will be stored in the database and will be displayed in the users profile. Entries can be deleted. Also a few settings are available just like "Show Formatted Usernames" and things like that.

http://www.mybbcoder.info/thema-2012.html
I find this being useful for my forum once 1.4 goes final. Smile

I assume if X user has no changes, it doesn't appear, right?
Nice plugin. I took a look at your code and I see your not taking advantage of the new uninstall/install procedures as well as a guid/compatibility. I assume you just want to keep it compatible with 1.2 until 1.4 comes out?
I've added 1 main thread for our plugins on mybb here so it wont be like twenty threads just one.
nice plugin

if someone wants to allow smods to do it also here how to do it

open usernamehistory.php

find
if($mybb->usergroup['cancp'] == 1)
replace with
if($mybb->usergroup['issupermod'] == 1)
Nice work on the plugin, Kioshi, and good work to ethernet for making one for super mods. Shy
(2008-07-11, 03:44 PM)Soshite Wrote: [ -> ]I find this being useful for my forum once 1.4 goes final. Smile

I assume if X user has no changes, it doesn't appear, right?

Mhh...Maybe I will only show the form for the staff and if an entry was added it shows the whole thing... Thanks for your suggestion.


(2008-07-11, 04:21 PM)Tikitiki Wrote: [ -> ]Nice plugin. I took a look at your code and I see your not taking advantage of the new uninstall/install procedures as well as a guid/compatibility. I assume you just want to keep it compatible with 1.2 until 1.4 comes out?

Yeah maybe... Confused as I said it's my first plugin and so I don't understand much of that atm. I used a 1.2 plugin as a "guidline" to make this one.

Note: I will change the plugin soon so it will only show the last 5 entries and I will add the delete entry function. Also I've take off the download so I can work on the new version.
Pretty good for a first plugin! Smile

If you want some suggestions, here's some:
- You only need to global a variable once in a function (ie, don't need to call global $db multiple times)
- For creating/dropping tables, you might want to use $db->write_query in preference to $db->query (as this ensures that the query performs a write operation) [this is only really important for large boards]

		$uid = intval($mybb->input['uid']);
		if(!$uid) $uid = $mybb->user['uid'];
You probably really shouldn't be doing that - if you don't get a $uid, die out, eg:

		$uid = intval($mybb->input['uid']);
		if(!$uid) error('The supplied uid is not valid.');
Also, be aware of what could happen if someone supplied an invalid UID, or even supplied text as the UID.
		$db->query("INSERT INTO ".TABLE_PREFIX."usernamehistory(id,uid,oldname,datechanged,cid) VALUES('', '$uid', '$oldname', '$time', '".$mybb->user['uid']."')");
Apart from $uid, $oldname isn't escaped, so if the old name contained quotes, there would be a query error.

As a general rule of thumb, be very wary of inputs into a DB query as they could either potentially be exploited, or may give undesired results.


Otherwise, this is great for a first effort. I hope you continue to develop plugins, and hope you get something useful out of it yourself!
Updated 6th December 2008
New Version is available. See first post pls.
Where are these changes displayed?
I saw them stored in the database, but they do not appear in the profile.
I guess it's because I'm using a custom theme but still... what changes do I have to make to the postbits?
Pages: 1 2