Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] Who Referred ?
#11
persian Translate

update to V:1.3
All Right Reserved By Parsian Team Heart 


.zip   inc.zip (Size: 3.44 KB / Downloads: 91)
Reply
#12
Thank you, but rather than duplicating the entire plugin for two strings I will add admin cp language support and I can then add your new files as a translation.
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#13
This user has been denied support. This user has been denied support.
(2014-12-10, 12:18 AM)Leefish Wrote: Thank you, but rather than duplicating the entire plugin for two strings I will add admin cp language support and I can then add your new files as a translation.

Also, may I ask why you don't take tool of the memprofile variable instead of globals?

Just as a tip,

You could have added memprofile to the global and done
$whorefer_referrals = $lang->no_referrer;

if((int)$memprofile['referrer'] > 0 && ($referral = get_user($memprofile['referrer'])) && $referral['uid']) 
	$whorefer_referrals = build_profile_link(format_name(htmlspecialchars_uni($referral['username']), $referral['usergroup'], $referral['displaygroup']), $referral['uid']);

(Use it if u want, ignore the variable set in the if statement I like writing with less lines)
But yea, format_name adds the styling, and memprofile gives you an easier way instead of having to search everytime and makes you not have to use a join.
Beep Boop          
                                          ~ RIP Server 2014-2014
Reply
#14
ooh, that is really good thank you Big Grin

I shall update. Really, this could easily be in the core, especially as it is adding no joins now.
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#15
You shouldn't use get_user for this IMO.
Reply
#16
Why not Omar? Is it none performant?
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#17
v 1.3 translate

All right reserved Heart 


.zip   Persian.zip (Size: 807 bytes / Downloads: 81)
Reply
#18
Yay thank you Big Grin I shall go add the translation and of course credit


http://community.mybb.com/mods.php?action=view&pid=311
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#19
This user has been denied support. This user has been denied support.
(2014-12-12, 05:13 AM)Leefish Wrote: Why not Omar? Is it none performant?

Cuz it takes out the whole user row and not just the things you need.
As I said, I wrote it minimal so you'll have to use the db fetch.

Still imo, get_user should have a way to choose what fields you want to take out.
Basically

function get_user($uid, $field = '*')
{
	global $mybb, $db;
	static $user_cache;
	$uid = (int)$uid;
	if(!empty($mybb->user) && $uid == $mybb->user['uid'])
	{
		return $mybb->user;
	}
	elseif(isset($user_cache[$uid]))
	{
		return $user_cache[$uid];
	}
	elseif($uid > 0)
	{
		$query = $db->simple_select("users", $field, "uid = '{$uid}'");
		$user_cache[$uid] = $db->fetch_array($query);
		return $user_cache[$uid];
	}
	return array();
}

As it wouldn't really break anything.
Beep Boop          
                                          ~ RIP Server 2014-2014
Reply
#20
Is possible to style username?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)