2014-04-26, 06:26 PM
I have this code that checks if the URL entered is correct it works but the problem is it shows error and at the same time allows user filed to be updated I mean it doesn't stop update how to stop updating when error shows?
P.S.
I need a hook to
Could you please help me to adapt this code to work with new hook?
// Google Plus
function cpfbbcode_goo()
{
global $mybb, $db;
$uid = $mybb->user['uid'];
$googleplus = 'plus.google.com';
$ufid = $db->fetch_array($db->simple_select('userfields', 'fid7', 'ufid = '.$uid));
if($ufid['fid7'])
{
if(!strpos($ufid['fid7'], $googleplus))
{
error('The "Google Plus URL" input field contains non Google Plus URL please correct that or leave it empty!');
}
}
}
P.S.
$plugins->add_hook("usercp_do_profile_end", "cpfbbcode_goo");
I need a hook to
datahandler_user_update
because the update happens before usercp_do_profile_end
Could you please help me to adapt this code to work with new hook?