The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Please help me convert this code to vbb4
Thanks a lot. Code:
if ($vbulletin->options['on_off'] AND (THIS_SCRIPT=='showthread' OR THIS_SCRIPT=='showpost')){
$location = '$template_hook[postbit_userinfo_right_after_posts]';
$vbulletin->templatecache['postbit_legacy'] = str_replace($location,$location.fetch_template('postbit_point'),$vbulletin->templatecache['postbit_legacy']);
$vbulletin->templatecache['postbit_first'] = str_replace($location,$location.fetch_template('postbit_point'),$vbulletin->templatecache['postbit_first']);
$vbulletin->templatecache['postbit'] = str_replace($location,$location.fetch_template('postbit_point'),$vbulletin->templatecache['postbit']);
}
bump. --------------- Added [DATE]1335614520[/DATE] at [TIME]1335614520[/TIME] --------------- bump. |
|
#2
|
|||
|
|||
|
There's not enough information there. You might be able to do it by rendering the postbit_point template, but if it uses any varibles they would have to be registered to the template before rendering. Also, it's strange that a str_replace is used instead of just using the template hook, but it could be that the template couldn't be rendered at that point because some variables hadn't been set yet.
|
|
#3
|
|||
|
|||
|
Hook Location: parse_templates
Plugin PHP Code: PHP Code:
postbit_credits: Code:
<if condition="$bbuserinfo[userid]"> <div class="postbit_field"> <span class="postbit_text">Credits:</span> $post[credits] (<a href="credit_system.php?$session[sessionurl]do=maincreditsystem"><span class="postbit_text">$vbphrase[credit_tranfer] <span></a>) </div> </if> |
|
#4
|
|||
|
|||
|
Try this: First change template postbit_credits to:
Code:
<vb:if condition="$bbuserinfo[userid]">
<div class="postbit_field">
<span class="postbit_text">Credits:</span>
{vb:raw post.credits} (<a href="credit_system.php?{vb:raw session.sessionurl}do=maincreditsystem"><span class="postbit_text">{vb:rawphrase credit_tranfer}
<span></a>)
</div>
</vb:if>
Then, use hook location postbit_display_complete instead of parse_templates, and change the code to this: PHP Code:
|
| Благодарность от: | ||
| Easy5s.net | ||
|
#5
|
|||
|
|||
|
i'm try it but not work
![]() {vb:raw post.credits} not show |
|
#6
|
|||
|
|||
|
Hmm...I tested it and it works for me. I didn't get any actual number for credits because I don't have the rest of the mod installed, but I got "Credits: ( )" added to my postbit.
How did you make the changes, did you edit the xml file? |
|
#7
|
|||
|
|||
|
ok because at least one field in the user table
![]() and i want add {vb:raw post.credits} to header? thank advanced. |
|
#8
|
|||
|
|||
|
I don't understand.
Quote:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|