Log in

View Full Version : Can someone help me with this simple plugin?


ERuiz
02-17-2007, 04:12 PM
I am making a very simple plugin, to display on the memberlist page, how many flight hours a member has.

I made a plugin with the following code:


$pilotid = $vbulletin->userinfo['userid'];
$gettotalflights = $vbulletin->db->query_first("SELECT COUNT( IDPIREP ) as count_flights FROM pirep WHERE IDPilot = $pilotid ");
$totalflights = number_format($gettotalflights['count_flights']);


When I go to the memberslist page, all pilots show the same amount of flights flown, which equals MY amount of hours. I guess the code above is using MY userid, as I am the one viewing the page and it is calling for userinfo[] which is basically the userinfo of the person viewing the page.

How can I edit $pilotid = $vbulletin->userinfo['userid']; so that it shows each members results?

Thanks for any help,

ERuiz