hallenberg
11-03-2011, 12:22 AM
In group.php...
// Render bits
$mygroup_bits = '';
foreach ($mygroups AS $mygroup)
{
$mygroup = prepare_socialgroup($mygroup, true);
$mygroup['canleave'] = can_leave_group($mygroup);
($hook = vBulletinHook::fetch_hook('group_list_mygroupsbit' )) ? eval($hook) : false;
$templater = vB_Template::create('socialgroups_mygroups_bit');
$templater->register('mygroup', $mygroup);
$templater->register('template_hook', $template_hook);
$mygroup_bits .= $templater->render();
}
..I'd like to use that hook to make decisions about which template bit to use, and/or to 'continue' over the foreach.. In fact there are various places where I'd like to break or skip a loop from within a hook.
Lo, I can't.. Or can I?
// Render bits
$mygroup_bits = '';
foreach ($mygroups AS $mygroup)
{
$mygroup = prepare_socialgroup($mygroup, true);
$mygroup['canleave'] = can_leave_group($mygroup);
($hook = vBulletinHook::fetch_hook('group_list_mygroupsbit' )) ? eval($hook) : false;
$templater = vB_Template::create('socialgroups_mygroups_bit');
$templater->register('mygroup', $mygroup);
$templater->register('template_hook', $template_hook);
$mygroup_bits .= $templater->render();
}
..I'd like to use that hook to make decisions about which template bit to use, and/or to 'continue' over the foreach.. In fact there are various places where I'd like to break or skip a loop from within a hook.
Lo, I can't.. Or can I?