PDA

View Full Version : Query another DB for Info in Vbulletin 3.0.7


reefland
09-21-2005, 10:52 PM
I have a database which differs from my vb database that I want to query for info and show a link in the users postbit if the row exists. Can this be done inside the vbulleting template system or would this have to go into the showthread.php file? I would rather avoid the file mod if possible.

The query would be simply:

require ('second/db/connect.php');
$DBQuery;
$exists = mysql_query("SELECT * FROM homepage WHERE userid=$bbuserinfo[userid]");
if (mysql_num_rows($exists) > 0) {
$loglink = "<a href=\"link.php\">Log</a>";
}


Any ideas? How would I also get $loglink into the postbit template?

Marco van Herwaarden
09-22-2005, 03:35 AM
It would save you a lot of headaches if you didn't put that info in a seperate database.

You can not put PHP in a template, you will have to modify php files for that. After you queried the data in the script, you can use $loglink in your template.