1

Topic: Hooks after printing html code?

An example from viewtopic.php:

while (...)
{
(...)
    ($hook = get_hook('vt_row_pre_display')) ? eval($hook) : null;
?>
        <div class="<?php echo implode(' ', $pun_page['item_status']) ?>">
            <div class="postmain">
(...)
            </div>
        </div>
<?php
    ($hook = get_hook('vt_row_end_display')) ? eval($hook) : null; // this should be added
}

And now from hooks vt_row_pre_display and vt_row_end_display we can modify output html code like this:

vt_row_pre_display:

    $contents = ob_get_contents();
    ob_end_clean();
    ob_start();

vt_row_end_display:

    $contents2 = ob_get_contents();
    ob_end_clean();
    $contents2 = str_replace('<div class="entry-content">', '<div class="entry-content" id="entry-'.$cur_post['id'].'">', $contents2);
    ob_start();
    echo $contents.$contents2;

Is it possible to add to PunBB?

Re: Hooks after printing html code?

Good idea to add this.

Re: Hooks after printing html code?

+1

Re: Hooks after printing html code?

It does open a lot of possibility's, great idea for a hook.

Re: Hooks after printing html code?

Yep I like this one as well. Would it have any impact on performance?