Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2011, 03:57 PM
Vincinzerei Vincinzerei is offline
 
Join Date: Jun 2010
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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...
Reply With Quote
  #2  
Old 08-16-2012, 07:46 PM
Hippy's Avatar
Hippy Hippy is offline
 
Join Date: Dec 2001
Location: USA, New Jersey
Posts: 2,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What did you do to fix this ?
the parse should be
[code]$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());[/ code]
correct ?
what else did you do ?

thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:39 AM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.