vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Postbit Template Question (https://vborg.vbsupport.ru/showthread.php?t=268782)

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->registryfetch_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...

Hippy 08-16-2012 08:46 PM

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


All times are GMT. The time now is 12:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01237 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete