The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Problem with If-Else If-Else Conditional in Plugin
I am having some issues with an If-Else If-Else that I have in a plugin for the postbit. The real kicker is it works on my own personal site, but it doesn't work on at least 3 other sites, running practically the exact same setup as me. From what I can tell, the conditional goes directly to the ELSE, but I am almost positive that the value being evaluated in the statement is being passed correctly. Here is the plugin code:
Code:
if(THIS_SCRIPT == 'showpost' OR THIS_SCRIPT == 'showthread') { switch ($vbulletin->options['postbittype']) { case 1: $pbq = "ORDER BY `main_vehicle` DESC LIMIT 1"; break; case 2: $pbq = "ORDER BY `main_vehicle` DESC LIMIT 1"; break; case 3: $pbq = "ORDER BY `vehicle_id` DESC LIMIT 10"; break; } $sql = $this->registry->db->query("select *, " . TABLE_PREFIX . "garage_user_vehicle.user_id AS PostUser from " . TABLE_PREFIX . "garage_user_vehicle LEFT JOIN " .TABLE_PREFIX . "garage_makes on (" .TABLE_PREFIX . "garage_user_vehicle.make_id=" .TABLE_PREFIX . "garage_makes.id) LEFT JOIN " .TABLE_PREFIX . "garage_models on (" .TABLE_PREFIX . "garage_user_vehicle.model_id=" .TABLE_PREFIX . "garage_models.id) WHERE " . TABLE_PREFIX . "garage_user_vehicle.user_id='" . $post['userid'] ."' " . $pbq); if($this->registry->db->num_rows($sql) > 0) { if($vbulletin->options['postbittype'] == 3) { while ($entry = $this->registry->db->fetch_array($sql)) { $newyr = substr($entry[made_year], -2); $template_hook['postbit_userinfo_right_after_posts'] .= "<div><a href=garage_vehicle.php?do=view_vehicle&id=$entry[vehicle_id]>'$newyr $entry[make] $entry[model]</a></div>"; } } else if($vbulletin->options['postbittype'] == 2) { $entry = $this->registry->db->fetch_array($sql); $newyr = substr($entry[made_year], -2); $template_hook['postbit_userinfo_right_after_posts'] .= "<div><img src='images/garage/car.png'><a href=garage.php?do=user_garage_view&id=$entry[PostUser]> $post[username]'s Garage</a></div>"; } else { $entry = $this->registry->db->fetch_array($sql); $newyr = substr($entry[made_year], -2); $template_hook['postbit_userinfo_right_after_posts'] .= "<div><a href=garage.php?do=user_garage_view&id=$entry[PostUser]>'$newyr $entry[make] $entry[model]</a></div>"; } } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|