I've been toying with this system for a while but what I really wanted to do was to get the awards to display via a bbcode tag.
I started by modifying the code a bit to get the awards to display below the signature area in the main body of a user's post but decided I wanted to give them more flexibility and give them some bbcode they could use to display their awards.
I added the following into class_bbcode.php
Code:
// [RIBBONS]
$tag_list['no_option']['ribbons'] = array(
'callback' => 'handle_bbcode_ribbons',
'strip_empty' => false,
'parse_option' => true
);
Code:
/**
* Handles a [RIBBONS] tag. TG Ribbons.
*
*/
function handle_bbcode_ribbons($ribbontext)
{
global $db, $vbulletin;
$ribbontext = str_replace(array('<br>', '<br />', '\\"'), array('', '', '"'), $ribbontext);
$templaterib = 'tgribbons_display';
eval('$html = "' . fetch_template($templaterib) . '";');
return $html;
}
Needles to say, it didn't do what I was hoping for. I created a new template called "tgribbons_display" using the code that I had placed in my postbit_legacy template and used the bbcode handler to display that template.
Well. Nothing shows up at all. I'm assuming that I'm missing some key step in pulling this off, such as making sure that the appropriate code is also executing to query the DB to display the awards when I call my template. Just to make sure I had the bbcode handler working I tried calling another template that just displays text and it worked fine.
Any ideas what I'm missing or what I could do to be able to use my custom bbcode tag to display the awards?