SQL code or ....???

dracula51

New Member
hi. im trying to create a php page which can be used like showthread.php file, i mean to view & post threads.

i took help from showthread.php & SHOWTHREAD & POSTBIT templates

but im facing trouble coz i cant understand few codes


at SHOWTHREAD & POSTBIT templete i saw these codes:

$post[avatarurl] = for user's avatar url

$post[musername] = shows poster name

$post[message] = shows posted message

now i need to add this codes in my new created PHP file
but what they r referring ? referring to which SQL code ?


now, can u provide me those SQL code, maybe like $post[message] = $db->query_read(" ...... which will work for the thread i want to read (myFile.php?t=threadid)

tnx in advance
 

bluescorpion

New Member
The $post variables you are referring to are vBulletin template variables and not PHP variables. They are used through out vBulletin but you normally can not use them in a php script. Look at some of the Plugin codes in your vBulletin installation to get an idea how how to use PHP code in vBulletin. You can not use PHP variable directly in templates but you can use it in a plugin and refer to it in the template. I think you can find examples of this if you search here for "using external pages". I am pretty sure it explains how to use php in templates.

HTH
 

dracula51

New Member
bluescorpion said:
The $post variables you are referring to are vBulletin template variables and not PHP variables. They are used through out vBulletin but you normally can not use them in a php script. Look at some of the Plugin codes in your vBulletin installation to get an idea how how to use PHP code in vBulletin. You can not use PHP variable directly in templates but you can use it in a plugin and refer to it in the template. I think you can find examples of this if you search here for "using external pages". I am pretty sure it explains how to use php in templates.

HTH

is there anyway to use those codes or similer codes in php file ???
plz help me. i need this badly
 

bluescorpion

New Member
yes, vbulletin has a set of variables that only work in templates but it also has a set that work when you doing php coding. They are all functionally equivalent but are used to do external programming. Try this page and try searching for "vBulletin API" (its a tutorial that is on a few sites now but came from vb.org. It has a lot of info about how to use variables in vBulletin.
 
Top