Halfhidden
12-09-2010, 07:05 PM
Hi, please, please, please can someone help me understand what has happened.
I'm trying to convert an old (abandoned) module. I have got it working ok and even upgraded the plugin for it... but I'm stuck with the following lines of code:
This is what the code is:
eval('$commentbits .= "' . fetch_template('adv_gallery_commentbit') . '";');
}
}
set_commentbits();
//eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_gallery_comments') . '";');
Now I read as much as I could find and understand that this old VB3 code called a hook and VB4 cannot do this any longer. So I tried to do this...
// eval('$commentbits .= "' . fetch_template('adv_gallery_commentbit') . '";');
$templater = vB_Template::create('adv_gallery_commentbit');
$templater->register('commentbits',$commentbits);
//$commentbits = $commentbits->render();
//return $commentbits;
}
}
set_commentbits();
//eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_gallery_comments') . '";');
$templater = vB_Template::create('adv_gallery_commentbit');
$templater->register('commentbit', $commentbit);
$home[$mods['modid']]['content'] = $templater->render();
But it did not work..... how can I get this to work?
--------------- Added 1291999548 at 1291999548 ---------------
--------------- Added 1291999828 at 1291999828 ---------------
I have read some more article but am still very much stuck and could do with some help.
I'm trying to convert an old (abandoned) module. I have got it working ok and even upgraded the plugin for it... but I'm stuck with the following lines of code:
This is what the code is:
eval('$commentbits .= "' . fetch_template('adv_gallery_commentbit') . '";');
}
}
set_commentbits();
//eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_gallery_comments') . '";');
Now I read as much as I could find and understand that this old VB3 code called a hook and VB4 cannot do this any longer. So I tried to do this...
// eval('$commentbits .= "' . fetch_template('adv_gallery_commentbit') . '";');
$templater = vB_Template::create('adv_gallery_commentbit');
$templater->register('commentbits',$commentbits);
//$commentbits = $commentbits->render();
//return $commentbits;
}
}
set_commentbits();
//eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_gallery_comments') . '";');
$templater = vB_Template::create('adv_gallery_commentbit');
$templater->register('commentbit', $commentbit);
$home[$mods['modid']]['content'] = $templater->render();
But it did not work..... how can I get this to work?
--------------- Added 1291999548 at 1291999548 ---------------
--------------- Added 1291999828 at 1291999828 ---------------
I have read some more article but am still very much stuck and could do with some help.