<?php
if(!is_object($vbulletin))
{
     exit;
}
$hook_query_fields = ",
lastpost_user.userid AS lastposterid, lastpost_user.avatarrevision AS avatarrevision, user.avatarrevision AS post_avatarrevision,
lastpost_customavatar.width AS avwidth, lastpost_customavatar.height AS avheight,
post_customavatar.width AS post_avwidth, post_customavatar.height AS post_avheight,
NOT ISNULL(post_customavatar.userid) AS post_customavatar,
NOT ISNULL(lastpost_customavatar.userid) AS hascustom
";
$hook_query_joins = "
LEFT JOIN " . TABLE_PREFIX . "user AS lastpost_user ON(lastpost_user.username = thread.lastposter)
LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid)
LEFT JOIN " . TABLE_PREFIX . "avatar AS post_avatar ON(post_avatar.avatarid = user.avatarid)
LEFT JOIN " . TABLE_PREFIX . "customavatar AS lastpost_customavatar ON(lastpost_customavatar.userid = lastpost_user.userid)
LEFT JOIN " . TABLE_PREFIX . "customavatar AS post_customavatar ON(post_customavatar.userid = thread.postuserid)
";
?>