View file wu-engine/wu-actions/load_online.php

File size: 908B
<?php
require_once('../wu_init.php');
if (!wu_token()) { exit('wu-error'); }

$onl = mysqli_query($connect_db, "SELECT id,usr,url,ti FROM ".DB_PREFIX."_online");
while ($row = mysqli_fetch_assoc($onl)) {
if ($row['usr'] == 0) { $name = 'Гость'; $ava_link = '/wu-static/img/avatar_default.png'; }
if ($row['usr'] > 0) {$usr = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT uid,log,av FROM ".DB_PREFIX."_users WHERE uid = '$row[usr]' LIMIT 1")); $name = $usr['log']; if (empty($usr['av'])) { $ava_link = '/wu-static/img/avatar_default.png'; } else { $ava_link = '/wu-uploads/avatars/thumbs/'.$usr['av']; } }
?>
<li><a href="<?php echo $row['url']; ?>"><div class="user-face-img"><img src="<?php echo $ava_link; ?>" alt="Аватар пользователя <?php echo $name; ?>" class="user-face"></div><strong><?php echo $name; ?></strong><span><?php echo $row['ti']; ?></span></a></li>
<?php } ?>