I did the following to update the pic_username whenever the user changes their username or an admin does...
It seems to be working but grateful if the more advanced coders could cast an eye over this

Cheers
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
// We remove all stored login keys since the password has been updated
// and change the current one (if applicable)
if ( !empty($passwd_sql) )
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$sql = "UPDATE " . ALBUM_TABLE . "
SET pic_username = '" . str_replace("'", "''", $username) . "'
WHERE " . ALBUM_TABLE . ".pic_user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update album table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
//
// Update entry in DB
//
if( !$error )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = "UPDATE " . ALBUM_TABLE . "
SET pic_username = '" . str_replace("'", "''", $username) . "'
WHERE " . ALBUM_TABLE . ".pic_user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update album table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
// We remove all stored login keys since the password has been updated
// and change the current one (if applicable)
if ( !empty($passwd_sql) )
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$sql = "UPDATE " . ALBUM_TABLE . "
SET pic_username = '" . str_replace("'", "''", $username) . "'
WHERE " . ALBUM_TABLE . ".pic_user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update album table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
//
// Update entry in DB
//
if( !$error )
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = "UPDATE " . ALBUM_TABLE . "
SET pic_username = '" . str_replace("'", "''", $username) . "'
WHERE " . ALBUM_TABLE . ".pic_user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update album table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------