vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Use data from php in postbit_legacy (https://vborg.vbsupport.ru/showthread.php?t=74911)

DRJ 01-23-2005 05:30 AM

Use data from php in postbit_legacy
 
I am not sure how to get this to work or if it would be possible. What I want to do is get some information from a db and add that to each post below the users post count. We have a knowledge base and I want to show something like

Posts: 150
Kb Entries: 3

This will get the kb total

$query="select count(kb_id) from kbentries where kb_approved=1 and coder_id=".$userinfo['userid'];
$result=mysql_query($query);
$row=mysql_fetch_row($result);
$RankKB=$row[0];

But where should I put that to be able to use it in the postbit?

Thanks

cinq 01-23-2005 05:42 AM

Just place the $RankKB variable in your template.

DRJ 01-23-2005 05:59 AM

Right, but where should I put the code so the variable is calculated?

Thanks

sabret00the 01-23-2005 08:05 AM

you can put it in the functions showthread if you like :)

DRJ 01-23-2005 08:18 AM

would the code work if it is in the phpinclude_start? I put it there but when I used the variable it had not value (or at least nothing was displayed).

Thanks


All times are GMT. The time now is 02: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.04860 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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