Skip to content

Instantly share code, notes, and snippets.

@SvePu
Last active October 28, 2015 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SvePu/7a280d52bbd29546ccef to your computer and use it in GitHub Desktop.
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
<?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