Skip to content

Instantly share code, notes, and snippets.

@MissAllSunday
Created June 12, 2013 18:38
Show Gist options
  • Save MissAllSunday/5767907 to your computer and use it in GitHub Desktop.
Save MissAllSunday/5767907 to your computer and use it in GitHub Desktop.
Show an image on a submenu entry
// This is the normal code
function RateStats_menu(&$menu_buttons)
{
global $scripturl, $modSettings, $txt;
loadLanguage('RateStats');
$menu_buttons['profile']['sub_buttons']['rateStats'] = array(
'title' => !empty($modSettings['RateStats_menu_name']) ? $modSettings['RateStats_menu_name'] : $txt['RateStats_title_main'],
'href' => $scripturl . '?action=ratestats',
'show' => true,
);
}
// This is the modified version
function RateStats_menu(&$menu_buttons)
{
global $scripturl, $modSettings, $txt, $settings;
loadLanguage('RateStats');
$menu_buttons['profile']['sub_buttons']['rateStats'] = array(
'title' => (!empty($modSettings['RateStats_menu_name']) ? $modSettings['RateStats_menu_name'] : '<img align="absMiddle" src="'. $settings['images_url'] . '/menu_icons/box.png" alt="'. $txt['RateStats_menu_name'] .'"/>&nbsp; ' . $txt['RateStats_title_main']),
'href' => $scripturl . '?action=ratestats',
'show' => true,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment