UBB.Dev
Posted By: blaaskaak [7.4] Keep log of custom title changes - 10/27/2008 2:51 PM
We work with a system where users request a title in a topic, and we set it for them.

Since it's a favor, and something they can demand we put restrictions on how often they can change that title.

This hack updates the usernotes of a user with every membertitle change so we can keep track of it.

open /admin/changeuser.php
find:
Code

if (preg_match("/Moderator/",$user['USER_MEMBERSHIP_LEVEL'])) {
$user_title = preg_replace("<","<",$user_title);
} // end if

Replace with:
Code
if (preg_match("/Moderator/",$user['USER_MEMBERSHIP_LEVEL'])) {
$usertitle = preg_replace("<","<",$usertitle);
} // end if

// Get current member title on the user we are editing
$query = "
select USER_CUSTOM_TITLE
from {$config['TABLE_PREFIX']}USER_PROFILE
where USER_ID = ?
";
$sth = $dbh->do_placeholder_query($query,array($uid),__LINE__,__FILE__);
list($current_title) = $dbh->fetch_array($sth);

if ($current_title != $usertitle) {
$notes .="\n".date("d/m/Y")." customtitle change (\"$current_title\" => \"$usertitle\")";
}

You might want to change the date format.
Posted By: AllenAyres Re: [7.4] Keep log of custom title changes - 10/29/2008 3:56 AM
Pretty cool Yarp, thanks thumbsup
© UBB.Developers