PDA

View Full Version : Newbie question returning a var to the postbit template


moosey
01-25-2003, 05:36 PM
bare with me here guys I've never used PHP strictly perl by trade and I've never hacked VBulletin ether so I'm not sure where to start what I'm trying to do should be simple


my @types = qw/lscripts presets plugins models/;
my %typeset;

foreach $type (@types) {

my $sth = $dbh->prepare("SELECT COUNT(*) FROM $type\_download WHERE $type\_author_id=?");
$sth->execute("$user{'userid'}");

$typeset{"$type"} = $sth->fetchrow;
}




Sorry for the perl i can translate the above into PHP but all I'm looking to do is return the typeset hash so it can be used with in the postbit template

As i say my PHP is limited and my knowledge of VBulletin is basically non existent, can someone point me in the right direction.

Thanks guys.

Xenon
01-26-2003, 10:20 AM
you have to edit admin/functions.php and add the code into the getpostbit section.

but i wouldn't do it, because one query per post extra isn't a good hack...