MyBB Community Forums

Full Version: how to change postbit template one lin e
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all,

in postbit, there is one line :
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">

which outputs in html as :

<table cellspacing="1" cellpadding="4" border="0" id="post_78" style="margin-top: 5px;" class="tborder">


i want this line in html as :

<table cellspacing="1" cellpadding="4" border="0" id="post_78" style="margin-top: 5px; display: none;height: 0px; width: 0px;" class="tborder">


diffrence is this css to add : display: none;height: 0px; width: 0px;


i have to do it in pluing on runtime , how i can do it like , using eval or any other solution.

i do not want it permanant, so find and replacetemplateset is not recomended.


any clue or idea.

$plugins->add_hook("postbit", "hide_table_go");

function hide_table_go(){

if( hide_conditon){

what to do here or how to do it????????????
}
}
Use the pre_output_page hook :
function hide_table_go($page)
{
    if(THIS_SCRIPT == 'showthread.php' && hide_condition)
    {
        $page = str_replace('<table cellspacing="1" cellpadding="4" border="0" id="post_78" style="margin-top: 5px;" class="tborder">', 'replace with this', $page);
    }
    return $page;
}