Quote:
Originally Posted by cinq
In response to this :
In /includes/functions_showthread.php
FIND:
Code:
// ###################### Start process_highlight_postbit #######################
function process_highlight_postbit($text, $words, $prepend)
ADD ABOVE:
Code:
###################### FOR GARAGE ICON #######################
function fetch_garageicon($userid)
{
global $DB_site, $garagecache;
if (!is_array($garagecache))
{
$garagecache = array();
$garage = $DB_site->query
("
SELECT gu.userid, user.userid
FROM " . TABLE_PREFIX ."vbgarage_users AS gu
LEFT JOIN " . TABLE_PREFIX ."user AS user ON gu.userid = user.userid
");
while($garagequeryarray = $DB_site->fetch_array($garagequery))
{
$garagecache["$garagequeryarray[userid]"] = $garagequeryarray;
}
$DB_site->free_result($garagequery);
}
if($garageinfo = $garagecache[$userid])
{
if ($garageinfo[userid])
{
return "$stylevar[imgdir_misc]/viewgarage.gif";
}
}
return FALSE;
}
###################### FOR GARAGE ICON #######################
SAVE AND UPLOAD THE FILE
In showthread.php in the root directory of your forums.
FIND:
Code:
$post['attachments'] = &$postattach["$post[postid]"];
ADD BELOW:
Code:
###################### FOR GARAGE ICON #######################
$post['garage'] = fetch_garageicon($post[userid]);
###################### FOR GARAGE ICON #######################
SAVE AND UPLOAD THE FILE
Now in your postbit template ( or postbit_legacy, whichever you are using )
Just add this whereever you want the icon image to show:
Code:
<if condition="$post[garage]">
<br><div><a href="$vboptions[bburl]/vbgarage.php?do=list&userid=$post[userid]" target="_blank">$post[garage]</a>
<br /></div></if>
Lastly, upload your image into your forum images directory, in the MISC folder.
NOT TESTED but it should work. Do feedback for any errors and I will amend the errors accordingly. Would be good if this post can be linked in the hack post under the modifications/addons bit.
Hope this helps 
|
cinq,
what modifications can I make to your edits that would allow me to use text, rather than an image? Perhaps in the dropdown box when a username is clicked that will say "View User's Garage," but only if that user has a garage.