Thread Rating:
  • 1 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show Referrals in Profile Review

Please note that this is pretty much a negative criticism post, rather than a balanced review as mentioned in this thread. Also be aware that stuff posted here may be highly subjective.
Please feel free to criticise this post, however.

Plugin Reviewed: Show Referrals in Profile
Plugin Version: 1.2 (last updated 3rd September 2015)
Plugin Author: LeeFish
Author Message
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #1
Show Referrals in Profile Review
This "review" was requested by leefish.

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:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    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

My Blog
09-29-2015 05:11 PM
Find all posts by this user Quote this message in a reply


Messages In This Thread
Show Referrals in Profile Review - ZiNgA BuRgA - 09-29-2015 05:11 PM

Forum Jump: