help with postbit template
whenever we clicked a thread to view, we can see who post the thread or reply, where they register, their location ...on the left hand side of the forum..
how can i add one more thing below the username for eg. birth date so that every user can know when they are born when they view the thread... this is how i change in the administration part..
in the postbit template, i add this:
<?php
<smallfont>Birth Date: <b>$birth</b></smallfont><br>
?>
below this:
<?php
<normalfont><b>$post[username]</b></normalfont><br>
<smallfont>$post[usertitle]</smallfont><br>
?>
and in showthread.php, i add few lines of code....
<?php
//get birthdate
$get=$DB_site->query(\"SELECT uid, birth from personal where uid=$bbuserinfo[userid]\");
$numrows_gettotal = mysql_num_rows($get);
if ($numrows_gettotal > 0)
{
list ($uid, $birth) = mysql_fetch_row($get);
}
?>
before this code:
<?php
eval(\"dooutput(\\"\".gettemplate(\"showthread\").\"\\");\");
?>
the result is, it only show 'Birth Date: ' under usertitle but nv show the birthdate...
wat is wrong with my code?? pls help...
Mark Hensler posted this at 03:25 — 19th February 2002.
He has: 4,048 posts
Joined: Aug 2000
Just add this:
Birth Date: $post[birthday]
Output:
Birth Date: YYYY-MM-DD
joyce posted this at 05:28 — 19th February 2002.
They have: 164 posts
Joined: Nov 2001
but i retreived the data from showthread.php using this:
<?php
//get birthdate
$get=$DB_site->query(\"SELECT uid, birth from personal where uid=$bbuserinfo[userid]\");
$numrows_gettotal = mysql_num_rows($get);
if ($numrows_gettotal > 0)
{
list ($uid, $birth) = mysql_fetch_row($get);
}
?>
if i use $post[birthday], how would it know wat is $post[birthday]??
Mark Hensler posted this at 07:39 — 19th February 2002.
He has: 4,048 posts
Joined: Aug 2000
vB aparently creates an associative array with the fields of the user table as the keys. 'birthday' is a field in the user table, so $postbit[birthday] is part of the array.
Mark Hensler
If there is no answer on Google, then there is no question.
joyce posted this at 09:27 — 19th February 2002.
They have: 164 posts
Joined: Nov 2001
birthdate is just an eg, wat if i want to display something from a table which i created myself??
Mark Hensler posted this at 19:43 — 19th February 2002.
He has: 4,048 posts
Joined: Aug 2000
Oh. I'm not sure. The code you have is what I would have tried, but then again, I'm not familiar with the vB source.
Have you asked over at http://www.vbulletin.org?
You'll probably get the best results over there.
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.