Made a plugin that uses parse_templates hook and pulls database data. I pointed a preregister to postbit_legacy template variable. and in the postbit / postbit_legacy template i made a var called {vb:raw corp} just for anybody that doesn't know how.
Code:
//$connection is in another file to connect to the db...
if(!$connection) {
die("Database connection failed plugin:: connection: " . mysql_error());
}
$db_pluginselect2 = mysql_select_db("yoFrigginDB", $connection);
if (!$db_pluginselect) {
die("Database selection failed to pluginselect2: " . mysql_error());
}
$usernamefield1 = $vbulletin->userinfo['username'];
$corpname= mysql_query("SELECT * FROM members WHERE username = '$usernamefield1' ", $connection);
if (!$corpname)
{
die("Database selection plugin failedquery:corp: " . mysql_error());
}
while ($row = mysql_fetch_array($corpname))
{
$corp = $row["corporation"];
}
if(!$connection) {
die("Database connection failed plugin:: connection: " . mysql_error());
}
$db_pluginselect2 = mysql_select_db("YoFrigginDB", $connection);
if (!$db_pluginselect) {
die("Database selection failed to pluginselect2: " . mysql_error());
}
$usernamefield1 = $vbulletin->userinfo['username'];
$corpname= mysql_query("SELECT * FROM members WHERE username = '$usernamefield1' ", $connection);
if (!$corpname)
{
die("Database selection plugin failedquery:corp: " . mysql_error());
}
while ($row = mysql_fetch_array($corpname))
{
$corp = $row["corporation"];
}
$templater = vB_Template::create('postbit_legacy');
vB_Template::preRegister('postbit_legacy',array('corp' => $corp));
If anybody can improve upon this please do.....