09-29-2015, 05:11 PM
This "review" was requested by leefish.
A few small things:
A few small things:
-
PHP Code:
$showrefer_template['member_profile_showrefer'] ='<tr> <td class=\"trow1\" valign=\"top\"><strong>{\$lang->referrals} ({$memprofile[\'referrals\']})</strong></td> <td class=\"trow1\">{$showrefer_referrals}</td> </tr>'; $showrefer_template['member_profile_showrefer_avatar'] ='<img src={$useravatar[\'image\']} {$useravatar[\'width_height\']} style="margin-right:5px;max-width:20px;height:auto;"/>';
Be careful of over-escaping. \$ in a single quoted string will stay like that in the actual template!
-
PHP Code:
function showrefer_uninstall() { global $db; $db->delete_query("templates", "`title` = 'member_profile_showrefer'"); $db->delete_query("templates", "`title` = 'member_profile_showrefer_avatar'"); rebuild_settings(); }
rebuild_settings is unnecessary as no settings have been changed.
-
PHP Code:
$referrer = htmlspecialchars($user['referrer']); //Fetch Referrer uid $query = $db->simple_select("users", "uid,username" , "username = '".$db->escape_string($referrer)."'");
PHP Code:$new_user = htmlspecialchars($user_info['username']);
Though not really detrimental*, htmlspecialchars is unnecessary here.
* Usernames cannot contain HTML special characters except for the double-quote, but the MyBB parser unescapes it automatically, so largely a moot point -
PHP Code:
$pmsubject = "New member referred by you."; $pm_message = "Thanks for referring me. Check out my profile ";
The plugin makes use of language files, but these are hard coded...
- There's no limit to the number of users displayed in the referrers list. Unlikely to be many, I presume, but may be worth consideration