The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Cant Pull Avatars from the Database?
For the comments on one of my mods, I am using the following code to pull avatars from comment bits... (they should really make the code width boxes bigger)
Code:
$comments = $db->query_read(" SELECT comment.*, IF(NOT ISNULL(user.userid), user.username, comment.postusername) AS username, user.avatarrevision AS avatarrevision, avatar.avatarpath AS avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline AS avatardateline, customavatar.width_thumb AS width_thumb, customavatar.height_thumb AS height_thumb FROM " . TABLE_PREFIX . "videocomment AS comment LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = comment.postuserid) LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid) WHERE comment.videoid = '" . $videoinfo['videoid'] . "' AND comment.state = 'visible' ORDER BY comment.dateline DESC LIMIT " . ($limitlower - 1) . ", $perpage "); $bbcode_parser_comment =& new vB_BbcodeParser($vbulletin, fetch_tag_list()); $thumb = true; while ($comment = $db->fetch_array($comments)) { $comment['message'] = $bbcode_parser_comment->parse($comment['message'], 'videodirectory_reply'); $comment['date'] = vbdate($vbulletin->options['dateformat'], $comment['dateline']); $comment['time'] = vbdate($vbulletin->options['timeformat'], $comment['dateline']); $show['deletionlink'] = ($permissions['videodirectorypermissions'] & $vbulletin->bf_ugp_videodirectorypermissions['canmoderate']); fetch_musername($comment); if (!empty($comment['avatarpath'])) { $comment['avatar'] = array($comment['avatarpath']); } else if ($comment['hascustom']) { $avatarurl = array('hascustom' => 1); if ($vbulletin->options['usefileavatar']) { $comment['avatarurl'] = $vbulletin->options['avatarurl'] . ($thumb ? '/thumbs' : '') . "/avatar{$comment['postuserid']}_{$comment['avatarrevision']}.gif"; } else { $comment['avatarurl'] = "image.php?u=$comment[postuserid]&dateline=$comment[avatardateline]" . ($thumb ? '&type=thumb' : '') ; } } if ($thumb) { if ($comment['width_thumb'] AND $comment['height_thumb']) { $avatarwidth = $comment['width_thumb']; $avatarheight = $comment['height_thumb']; } } if (empty($comment['avatarurl'])) { $comment['avatarurl'] = $stylevar['imgdir_misc'] . '/unknown.gif'; } eval('$commentbits .= "' . fetch_template('video_commentbit') . '";'); } Code:
<img src="http://www.waltdisneyboards.com/avatars/wdbarnyvee.gif?dateline=1228446000&type=thumb" class="alt2 avatar" border="0" alt="WDBArnyVee" /> However, its just not displaying it on that page. Is there something I am missing? Do I need to give this script permission to display avatars from the database or something? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|