Vincinzerei |
08-19-2011 04:57 PM |
Postbit Template Question
Since the Problem of the last topic has been greatly solved with help from kh99 there is another question and another Problem showed up now.
using
PHP Code:
$templater = vB_Template::create('ddd_mod_reputation_comments'); $templater->register('postbit_reputation_given', $postbit_reputation_given); $templatevalues['insert_reputation_comment'] = $templater->render(); vB_Template::preRegister('postbit', $templatevalues); vB_Template::preRegister('postbit_legacy', $templatevalues);
would be the correct vb4 code..
but how to solve this
PHP Code:
<vb:if condition="$show['postbitbit_reputation_given']"> <br> <fieldset class="fieldset" style="border-color:#000000;"> <legend>{vb:rawphrase comments_on_this_post}:</legend> <div style="padding:12px"> {vb:raw postbit_reputation_given} </div> </fieldset> </vb:if>
{vb:raw postbit_reputation_given} would be the correct use for the template. But i can use this with
PHP Code:
<vb:if condition="$show['postbitbit_reputation_given']">
since it creates an error.
But i have to register the Variable to be able to use it. since
PHP Code:
$show['postbitbit_reputation_given']
dont bring me an output.
edit: also found another "problem" the parser seems to have changed in vb4
so
PHP Code:
if($thread['threadid']) { $post_reputations_bit = $this->registry->db->query_read(" SELECT user.username, reputation.reputation, reputation.reason FROM " . TABLE_PREFIX . "reputation AS reputation LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = reputation.whoadded) WHERE postid = ".$post['postid']." ORDER BY reputation.dateline" );
require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser =& new vB_BbCodeParser($this->registry, fetch_tag_list());
$postbit_reputation_given = ''; $show['postbit_reputation_given'] = false;
while ($post_reputation_bit=$this->registry->db->fetch_array($post_reputations_bit)) { if($post_reputation_bit['reputation'] > 0) { $postbit_reputation_given .= '<div><img src="' . $stylevar[imgdir_reputation] . '/reputation_pos.gif" border="0" /> ' . $post_reputation_bit['username'] . ': '; } elseif($post_reputation_bit['reputation'] == 0) { $postbit_reputation_given .= '<div><img src="' . $stylevar[imgdir_reputation] . '/reputation_balance.gif" border="0" /> ' . $post_reputation_bit['username'] . ': '; } else { $postbit_reputation_given .= '<div><img src="' . $stylevar[imgdir_reputation] . '/reputation_neg.gif" border="0" /> ' . $post_reputation_bit['username'] . ': '; }
$postbit_reputation_given .= $bbcode_parser->parse($post_reputation_bit['reason']) . '</div>'; $show['postbit_reputation_given'] = true;
the last section with the parse have to be done again. Badly i have no clue how to do it..
if some help can be provided, would be great.
edit2: couldnt really be the bbcode.. it work for the other template..
Problem solved...
|