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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2011, 04: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->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...
Reply With Quote
  #2  
Old 08-16-2012, 08: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:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03680 seconds
  • Memory Usage 2,198KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete