The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have a field that asks for a player's steam id while registering. We have a plugin for source that tracks a player's steam id and logs it into a database with their ip address. I also have a php file that accesses that steam id and will "echo" it depending on what ip they are on. So I would like to put that variable as the default value in a custom register field.
PHP file: Code:
<?PHP //GET PLAYER INFORMATION mysql_connect( "localhost", "protf2_servers", "password" ) or die( mysql_error() ); mysql_select_db( "protf2_servers" ) or die( mysql_error() ); $query = mysql_query("SELECT `steamid` FROM player_tracker WHERE `playerip`='$_SERVER[REMOTE_ADDR]'") or die(mysql_error()); $steamid = mysql_fetch_assoc($query); echo $steamid['steamid']; ?> Code:
ob_start(); require_once('/home/protf2/public_html/steamid.php'); $steamid = ob_get_contents(); ob_end_clean(); vB_Template::preRegister('register',array('steamid' => $steamid)); And when making a template, i would use {vb:raw steamid} to make that steam id variable show. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|