Last active
October 28, 2015 23:30
-
-
Save SvePu/7a280d52bbd29546ccef to your computer and use it in GitHub Desktop.
MyBB plugin to show username in header welcome block in user group style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disallow direct access to this file for security reasons | |
if(!defined("IN_MYBB")) | |
{ | |
die("Direct initialization of this file is not allowed."); | |
} | |
$plugins->add_hook("global_intermediate", "welcomeback_groupstyle_run"); | |
function welcomeback_groupstyle_info() | |
{ | |
return array( | |
"name" => "Welcomeback User Name in Group Style", | |
"description" => "", | |
"website" => "https://gist.github.com/SvePu/7a280d52bbd29546ccef", | |
"author" => "SvePu", | |
"authorsite" => "https://github.com/SvePu", | |
"version" => "1.0", | |
"guid" => "", | |
"codename" => "welcomeback", | |
"compatibility" => "*" | |
); | |
} | |
function welcomeback_groupstyle_run() | |
{ | |
global $lang, $mybb, $lastvisit; | |
if($mybb->user['uid'] != 0) | |
{ | |
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']), $mybb->user['uid']), $lastvisit); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment