Quote:
Originally Posted by Andreas
Can you give a concreate example of an Add-on so it is easier to understand what exactly you are talking abount?
|
Sure.. it's my
Advanced Application Forms..
Here's a snippet of the code to add an application type to the community menu...
Code:
while($application = $vbulletin->db->fetch_array($applications))
{
if ($vbulletin->options['advapp_inmenu'] && $vbulletin->userinfo['posts'] >= intval($application['postcount']) && is_member_of($vbulletin->userinfo, explode(',', $application['usergroup'])) && $application['community'] && $application['active'])
{
$template_hook['navbar_community_menu_end'] .= '<li><a href="application-forms.php?appid=' . $application['appid'] . '" title="' . $application['description'] . '">' . $application['type'] . '</a></li>';
}
}
Don't get me wrong. I can create the menu in the database when the application is created. It just seems like more work to me.
This reminds me of the addition of the <vb:each> in templates...
Nobody is going to tell me that reading a database, parse the data to build an array, sending that array to the template and parsing it a second time is faster than bulding/formating the array and sending it in all one lump piece of data to the template. It's just not possible. Two parses take double the time. But that's a different topic.