vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   $template_hook['postbit_userinfo_right'] not working (https://vborg.vbsupport.ru/showthread.php?t=285328)

Kyojii 07-08-2012 03:16 PM

$template_hook['postbit_userinfo_right'] not working
 
This is a continuation of my other question.

PHP Code:

$template_hook['postbit_userinfo_right'] .= "something here"

Using the above code at the hook location process_templates_complete doesn't seem to do anything. Would anyone know why?

Lynne 07-08-2012 05:04 PM

If it's a continuation of another question, then you should be posting it with the other question.

That plugin location won't work. It needs to be one of the postbit_* plugins.

Kyojii 07-08-2012 05:14 PM

Thanks, but I tried at both postbit_display_start and postbit_display_complete. With the same results.

Lynne 07-08-2012 05:19 PM

Did you try looking at this in the default style? Or did you verify that your custom style actually has that template hook in the postbit template you are using on your site?

Kyojii 07-08-2012 05:21 PM

I can confirm that every style has that template hook.

Code:

{vb:raw template_hook.postbit_userinfo_right}

Lynne 07-08-2012 05:34 PM

1 Attachment(s)
I just tested putting that into a hook using the postbit_display_complete hook location and it worked fine in a default template:

https://vborg.vbsupport.ru/attachmen...1&d=1341772441

Kyojii 07-08-2012 05:48 PM

Hm you're right that does work, the only other thing I think it could be is the if statements.

PHP Code:

if ($post['field12'] > 0){ 

Hm, $post['field12'] (like used in templates) nor $bbuserinfo['field12'] seem to work. :\

--------------- Added [DATE]1341775474[/DATE] at [TIME]1341775474[/TIME] ---------------

What's really strange is if I put:
PHP Code:

if ($post['field12'] > 0){
$result true;
}
else{
$result false;
}
$template_hook['postbit_userinfo_right'] .= $result

It outputs nothing.

Lynne 07-08-2012 06:27 PM

true and false are not strings. Try putting a word in there:
$result = "true";

Kyojii 07-09-2012 12:54 AM

Got it, the problem was that it wasn't storing the fields as their integers like in the database but rather their value.


All times are GMT. The time now is 09:52 AM.

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.01112 seconds
  • Memory Usage 1,730KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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