Placing a customization under your postbit

TheVoid123

New Member
Where it has

Posts
Joindate


etc. underneath your avatar.

How would i go about, retreiving a number from a sql table for instance Number of kills on counter strike/ number of deaths, and place them underneath the post bit.

So it would be result

POsts = x

Joindate = x

CS 1.6 Kills = x
CS 1.6 Deaths = x

Average Kills Death Ratio= x

Etc.

Any help be very much appreciated.
 

bluescorpion

New Member
You will need to do a plugin to get the data you are needing then it is just a matter of placing the result in the postbit where you want it to appear. The plugin would look something like

$kills = $db->query_read("your query here ");
$deaths = $db->query_read("your query here ");

The join date and number of posts have a vb variable define so I don't think you need to do a query for them.

HTH
 

TheVoid123

New Member
Very useful, how would I tell the sql table to get the results for the particular person logged in.

Like i want each person to have their own thing, is the the SQL area? If so may I have an example?

Thanks
 

alexD

New Member
Your going to need to extend the user table to it allows that to be stored in the same table so when they login the data will display. Create a new plugin and type in UPDATE *name of user table here* Your info field here; so you can append this to the colums of your table and then have a it pulled on login Make a new template and put the quiery there and eval it as a variable and dont forget to cache the template and then put the variable in the postbit template. You could make a custom phrase as well for it if yyouo wonted to.
 

TheVoid123

New Member
THank you very much.

All info is appreciated, still sort of a beginner, any further elaboration would be highly appreciated!
 

alexD

New Member
I see well php wise for the math end just use this part.

<?php
int $wins = "$your query here";
int $deaths = "your query here";
int $ratio = "$death \ $wins";
/*you varablies hold the info from the quieres and then divide them returning the vaule without returning the left over or modulous strong typed avrabiles and isnt needed*/
?>

the queries should be updated so there BIGINT since they might become huge numbers.

Since your a noob I'll only fill in so much its always good to get hands on experince. My SQL isnt the best for vb they have there own system of calling them I'm sure someone here knows more on there quiery system and will help you out more then I have.
 

TheVoid123

New Member
Thank You!

I have that part down, with the php, its just adding it to the postbit i guess is what im syaing, how to get it there.
 
Top