Witam,
mam połączony vbulletin i joomla poprzez pomost bbpixel. W box'ie użytkownika na Joomla powinien być widoczny avatar z vbulletin, ale niestety widoczny jest tylko tekst alt- "avatar" (w przypadku kiedy użytkownik nie ma ustawionego avataru, nie pojawia się tekst alt)
KOD ODPOWIEDZIALNY ZA USER BOX:
Kod:
function viewUserInfoBox($user_id, $url=""){
global $database;
$myDB = $database;
//get vb user info
$query = "SELECT count(pmtextid) as inmsgs FROM ".$this->_vb_db_prefix."pm WHERE userid='{$user_id}' AND folderid=0";
$myDB->setQuery($query);
//die($myDB->getQuery());
//$myDB->query();
$row = $myDB->loadRow();
$inMsg = $row['0'];
$query = "SELECT userid as id, username as name, pmunread as new_msg, pmtotal as total_msg, salt, avatarid FROM ".$this->_vb_db_prefix."user WHERE userid='{$user_id}' LIMIT 1";
$myDB->setQuery($query);
//die($myDB->getQuery());
//$myDB->query();
$row = $myDB->loadRow();
if($row!=null){
$logouthash = md5("{$row[0]}{$row[4]}{$this->forumCookieSalt}");
$new_msg = intval($row[2]);
$strCotrol = BBPIXEL_MY_CONTROL;
$strForum = BBPIXEL_MY_FROUM;
$strPost = BBPIXEL_NEW_POST;
$strLogout = BBPIXEL_LOG_OUT;
$strHello = BBPIXEL_HELLO;
$strInbox = BBPIXEL_INBOX;
$url = (!empty($url) and strlen($url)) > 12 ? $url : $this->_mb_url;
$urlLogout = $this->_vb_forum_url."/login.php?do=logout&logouthash={$logouthash}&redirect=$url";
//Add-on Wrapper function
if (!$this->wrapperID) {
$urlUser = $this->_vb_forum_url."/member.php?userid={$row[0]}";
$urlInbox = $this->_vb_forum_url."/private.php";
$urlUCP = $this->_vb_forum_url."/usercp.php";
$urlBoard = $this->_vb_forum_url."/index.php";
$urlNewPost = $this->_vb_forum_url."/search.php?do=getnew";
$urlMsg = $this->_vb_forum_url."/";
} else {
$urlUser = $this->_mb_url."/index.php?option=com_wrapper&Itemid=".$this->wrapperID."&bbact=member.php?userid-{$row[0]}";
$urlInbox = $this->_mb_url."/index.php?option=com_wrapper&Itemid=".$this->wrapperID."&bbact=private.php";
$urlUCP = $this->_mb_url."/index.php?option=com_wrapper&Itemid=".$this->wrapperID."&bbact=usercp.php";
$urlBoard = $this->_mb_url."/index.php?option=com_wrapper&Itemid=".$this->wrapperID."&bbact=index.php";
$urlNewPost = $this->_mb_url."/index.php?option=com_wrapper&Itemid=".$this->wrapperID."&bbact=search.php?do-getnew";
$urlMsg = $this->_mb_url."/index.php?option=com_wrapper&Itemid=".$this->wrapperID."&bbact=";
}
//private messgages
if($new_msg == 0){
$msg = BBPIXEL_NO_MSG;
}else{
$msg = sprintf(BBPIXEL_HAVE_MSG, $urlMsg, $new_msg);
if($new_msg >1){
$msg .= "s";
}
}
//Avatar process
$avatarid = $row['5'];
$query = "SELECT avatarpath FROM ".$this->_vb_db_prefix."avatar WHERE avatarid='{$avatarid}' LIMIT 1";
$myDB->setQuery($query);
$avt = $myDB->loadRow();
$avatarpath = $avt['0'];
$timeNow = time();
if ($avatarid) {
$avatarImg = '<div align="center"><a target="_blank" href="'.$urlUser.'"><img src="'.$this->_vb_forum_url.'/'.$avatarpath.'" alt="Avatar" title="Avatar" border="0" /></a></div>';
} else {
$avatarImg = '<div align="center"><a target="_blank" href="'.$urlUser.'"><img src="'.$this->_vb_forum_url.'/image.php?u='.$row[0].'&dateline='.$timeNow.'" alt="Avatar" title="Avatar" border="0" /></a></div>';
}
return <<<EOF
{$avatarImg}
<div>{$strHello}, <a href="{$urlUser}">{$row[1]}</a>!</div>
<div><!--new msg-->{$msg}</div>
<div><!--private msg--><a href="{$urlInbox}" class="mainlevel">{$strInbox} [{$inMsg}]</a></div>
<div><!--user control--><a href="{$urlUCP}" class="mainlevel"> {$strCotrol}</a></div>
<div><!--forum url--><a href="{$urlBoard}" class="mainlevel">{$strForum}</a></div>
<div><!--new posts--><a href="{$urlNewPost}" class="mainlevel">{$strPost}</a></div>
<div><!--logout--><a href="{$urlLogout}" class="mainlevel">{$strLogout}</a></div>
EOF;
}
}
Niestety nie mogę sobie z tym poradzić. Może ktoś zna rozwiązanie?
w załączniku zdjęcie box'u użytkownika