The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I am making a custom mod for someone and I'm stuck.
I made a link "battle_stats.php?bs=$post[userid]" in the postbit_legacy template and the userid shows up. In the battle_stats.php file what do I put in the query to receive that userid from the userfield? I am trying to make a pop-up window with certain profile fields. |
#2
|
|||
|
|||
![]()
I think you have to use $_GET to access a variable in a url. Also make sure you sanitize it before doing anything with it. (Globalize for 3.0 or $vbulletin->input->clean_array_gpc() for 3.5)
|
#3
|
|||
|
|||
![]()
This is for version 3.0.8
I have tried these three but they don't work Code:
$getstats = $DB_site->query("SELECT * FROM userfield WHERE userid='$post[userid]'")or die(mysql_error()); $stats = mysql_fetch_array($getstats); Code:
$getstats = $DB_site->query("SELECT * FROM userfield WHERE userid='$_GET[userid]'")or die(mysql_error()); $stats = mysql_fetch_array($getstats); Code:
$getstats = $DB_site->query("SELECT * FROM userfield WHERE userid='$userid'")or die(mysql_error()); $stats = mysql_fetch_array($getstats); |
#4
|
|||
|
|||
![]()
Your using some functions that have specific vbulletin functions
like mysql_fetch array equals PHP Code:
I suggest reading Brad's excellant tutorial located here You can also use PHP Code:
Globalize santizes variables to make sure they are holding the correct data types, this helps greatly with security. |
#5
|
|||
|
|||
![]()
I have tried the following but it gave me a blank white screen.
Code:
$DB_site->query_first |
#6
|
|||
|
|||
![]()
Here's an example of using it:
PHP Code:
|
#7
|
|||
|
|||
![]()
Oh!! I see.
I tried it with Code:
$getstats = $DB_site->query_first("SELECT * FROM userfield WHERE userid='".$userid."'"); $stats = $DB_site->fetch_array($getstats); Maybe I have to join tables together because the variable isn't being passed. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|