Created
March 17, 2013 14:40
-
-
Save Avalarion/5181814 to your computer and use it in GitHub Desktop.
Create WBBLite2 Hover for WerWarOnline ( WhoWasOnline )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hoverImage = document.createElement('img'); | |
$$('a.hoverImage').invoke('observe', 'mouseover', function(event) { | |
if(this.rel != '') { | |
hoverImage.src = 'wcf/images/avatars/'+this.rel; | |
hoverImage.setStyle({ | |
position: 'absolute', | |
left: event.pageX+'px', | |
top: (event.pageY+10)+'px', | |
display: 'block' | |
}); | |
document.body.appendChild(hoverImage); | |
} | |
}); | |
$$('a.hoverImage').invoke('observe', 'mouseout', function(event) { | |
hoverImage.setStyle({display:'none'}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @see UsersWasOnline::handleRow() | |
*/ | |
protected function handleRow($row, User $user) { | |
$this->usersWasOnlineTotal++; | |
if ($row['userID']) { | |
// members | |
$this->usersWasOnlineMembers++; | |
$founds = mysql_query('SELECT avatarID,avatarExtension FROM wcf1_avatar WHERE userID = '.intval($row['userID']).' LIMIT 1;'); | |
$found = mysql_fetch_assoc($founds); | |
$avatar = ''; | |
if($found !== FALSE){ | |
$avatar = 'avatar-'.$found['avatarID'].'.'.$found['avatarExtension']; | |
} | |
if ($this->isVisible($row, $user)) { | |
if (!$this->limitUsers || count($this->usersWasOnline) < $this->limitUsers) | |
$this->usersWasOnline[] = array('userID' => $row['userID'], 'plainname' => $row['username'], 'username' => $this->getFormattedUsername($row, $user), 'lastActivityTime' => $row['lastActivityTime'], 'avatar' => $avatar); | |
} | |
else { | |
$this->usersWasOnlineInvisible++; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="hoverImage" rel="{@$userWasOnline.avatar}" href="index.php?page=User&userID={@$userWasOnline.userID}{@SID_ARG_2ND}">{@$userWasOnline.username}</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment