So there are bound to be others out there looking for this coding solution I came up with the other day so I figured I would place it here for people to pick up and use if they wanted too. Anyone that has vBulletin and is familiar with GARS knows that it only shows across SHOWTHREAD and THREADDISPLAY and if you have the add-on VBA_CMPS. Well for me I wanted to see it most specifically on SEARCH items so I could a) make the search look and feel the same as the rest of the site and b) use this variable to ONLY show the ones with images in the search results, in effect not showing my older threads without having to delete them from the database. Here is the solution I came up with and for SEARCH you would place this code just after this in SEARCH.PHP. NOTE: This is for GARS 2.0 RC3c ONLY:
($hook = vBulletinHook::fetch_hook(‘search_results_threadbit’)) ? eval($hook) : false;
The code to paste is this:
// MUG5 GARS modification
$geek = array();
$geek2 = array();
$getgeek = $db->query_read(“SELECT byline, header_image FROM ” . TABLE_PREFIX . “gars WHERE threadid=” .$thread['threadid'] . “”);
while ($geeksql = $db->fetch_array($getgeek)) {
$geek[] = $geeksql['header_image'];
$geek2[] = $geeksql['byline'];
}
// MUG5 GARS modification
And that’s literally it within the PHP file. To show each you need to modify your theme file with $geek[0] to show your image URL and $geek2[0] to display the byline.