ERuiz
04-07-2007, 03:24 PM
Hello everyone. I have created a very crude plugin (first ever attempt), which essentially displays a result for each member shown on the Member List.
Here is the custom plugin:
$pilotid = $userinfo['userid'];
$pilotid = "VAA".$pilotid;
$getlatestpirep = $db->query_read("SELECT * FROM pirep WHERE pilot_id = '$pilotid' ORDER BY date DESC LIMIT 1");
while ($row = $db->fetch_array($getlatestpirep)) {
$latest_pirep = "<a href=\"../livedispatch/pirep_details.php?pirep_id=".$row['pirep_id']."\">".$row['flight_number']."</a>";
}
The problem I am getting, is that once a member does not return a null value, it will display the result for all members after him having the same result.
If you go HERE (http://www.virtualaa.com/component/option,com_wrapper/Itemid,41/), you will see that all members AFTER my name, have the same result for that field column.
In that case, since I am the ONLY member with a flight submitted, my name should be the only one displaying the latest flight.
Can someone see what I could be doing wrong?
Here is how the plugin is setup:
Hook Location: memberlist_bit
Thanks for any help...
UPDATE! Nevermind, I got it working. :)
Here is the custom plugin:
$pilotid = $userinfo['userid'];
$pilotid = "VAA".$pilotid;
$getlatestpirep = $db->query_read("SELECT * FROM pirep WHERE pilot_id = '$pilotid' ORDER BY date DESC LIMIT 1");
while ($row = $db->fetch_array($getlatestpirep)) {
$latest_pirep = "<a href=\"../livedispatch/pirep_details.php?pirep_id=".$row['pirep_id']."\">".$row['flight_number']."</a>";
}
The problem I am getting, is that once a member does not return a null value, it will display the result for all members after him having the same result.
If you go HERE (http://www.virtualaa.com/component/option,com_wrapper/Itemid,41/), you will see that all members AFTER my name, have the same result for that field column.
In that case, since I am the ONLY member with a flight submitted, my name should be the only one displaying the latest flight.
Can someone see what I could be doing wrong?
Here is how the plugin is setup:
Hook Location: memberlist_bit
Thanks for any help...
UPDATE! Nevermind, I got it working. :)