I'm trying to add the avatar of the user to their own portfolio page, Madclouds, Wolf, do you guys have any idea how i would go about doing that? Here's some code that's used in other parts of vbulletin to get the poster avatar url:
PHP Code:
$getnews = $db->query_read("
SELECT " . iif($mod_options['portal_news_showrating'], 'IF(votenum >= ' . $vbulletin->options['showvotes'] . ', votenum, 0) AS numbvote, IF(votenum >= ' . $vbulletin->options['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
thread.threadid, post.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=thread.replycount, thread.replycount+1, views) AS views, thread.forumid, post.postid, pagetext, allowsmilie
" . iif ($mod_options['portal_news_showsignature'], ', showsignature, sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages, sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight') . "
" . iif ($mod_options['portal_news_showicon'] , ',thread.iconid AS threadiconid, iconpath AS threadiconpath') . "
" . iif ($mod_options['portal_news_showavatar'] , ', avatarpath, NOT ISNULL(customavatar.filedata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision') . "
" . iif ($mod_options['portal_news_showsubscribed'] AND $vbulletin->userinfo['userid'] , ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed ') . "
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN " . TABLE_PREFIX . "postparsed AS postparsed ON (postparsed.postid = post.postid AND postparsed.styleid = " . intval(STYLEID) . " AND postparsed.languageid = " . intval(LANGUAGEID) . ")
" . iif ($mod_options['portal_news_showicon'] , 'LEFT JOIN ' . TABLE_PREFIX . 'icon AS icon ON (icon.iconid = thread.iconid)') . "
" . iif ($mod_options['portal_news_showavatar'] OR $mod_options['portal_news_showsignature'],
'LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON (user.userid = post.userid)
') . "
" . iif ($mod_options['portal_news_showsignature'],
'LEFT JOIN ' . TABLE_PREFIX . 'sigparsed AS sigparsed ON (sigparsed.userid = user.userid AND sigparsed.styleid = ' . intval(STYLEID) . ' AND sigparsed.languageid = ' . intval(LANGUAGEID) . ')
LEFT JOIN ' . TABLE_PREFIX . 'sigpic AS sigpic ON (sigpic.userid = post.userid)') .
iif ($mod_options['portal_news_showavatar'] , '
LEFT JOIN ' . TABLE_PREFIX . 'avatar as avatar ON (avatar.avatarid = user.avatarid)
LEFT JOIN ' . TABLE_PREFIX . 'customavatar as customavatar ON (customavatar.userid = user.userid)
') . "
" . iif ($mod_options['portal_news_showsubscribed'] AND $vbulletin->userinfo['userid'] , ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = \'' . $vbulletin->userinfo['userid'] . '\')') . "
WHERE thread.threadid IN(" . implode(',', $newstids) . ")
" . iif($ignusers, 'AND thread.postuserid NOT IN(' . $ignusers . ')') . "
$mods[exforums]
GROUP BY post.postid
ORDER BY " . iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline', 'thread.dateline', $mod_options['portal_news_orderby']) . " $mod_options[portal_news_direction]
$newslimit
");
// News Avatar
if ($mod_options['portal_news_showavatar'])
{
if ($news['avatarpath'])
{
$news['avatarpath'] = $vbulletin->options['bburl'] . '/' . $news['avatarpath'];
}
else if ($news['hascustom'])
{
if ($vbulletin->options['usefileavatar'])
{
$news['avatarpath'] = $vbulletin->options['bburl'] . '/' . $vbulletin->options['avatarurl'] . '/avatar' . $news['postuserid']. '_' . $news['avatarrevision'] . '.gif';
}
else
{
$news['avatarpath'] = $vbulletin->options['bburl'] . '/image.php?' . $session['sessionurl'] . 'u=' . $news['postuserid'] . '&dateline=' . $news['avatardateline'];
}
}
}
it should be possible to integrate this with the portfolio mod, if you download the .zip package you'll find the userpage.php file where the code adjustments should be made.