Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kodas

Parašė legionas· 2010 Kov. 27 17:03:36
#1

<?php

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: online_users_panel.php
| Author: ptown67
| Website: http://pennerprofi.bplaced.net
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

if (!defined("IN_FUSION")) { die("Access Denied"); }

add_to_head("
<link rel='stylesheet' type='text/css' href='".INFUSIONS."online_users_panel/tooltip.css' />
<script src='".INFUSIONS."online_users_panel/jquery.tooltip.pack.js' type='text/javascript'></script>
<script type='text/javascript'>
$(function() {
$('#boxover a').tooltip({
track: true,
delay: 0,
showURL: false,
showBody: ' - ',
fade: 250
});
});
</script>
");

$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'"));
if (dbrows($result)) {
$result = dbquery("UPDATE ".DB_ONLINE." SET online_lastactive='".time()."' WHERE online_user=".($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'")."");
} else {
$result = dbquery("INSERT INTO ".DB_ONLINE." (online_user, online_ip, online_lastactive) VALUES ('".($userdata['user_level'] != 0 ? $userdata['user_id'] : "0")."', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-600)."");

openside($locale['global_010']);
$result = dbquery(
"SELECT ton.*, tu.user_id,user_name FROM ".DB_ONLINE." ton
LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id"
);
$guests = 0; $members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}

echo THEME_BULLET." ".$locale['global_011'].": ".$guests."<br />\n";
echo THEME_BULLET." ".$locale['global_012'].": ".count($members)."<br />\n";
echo "<hr />";

$result = dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_lastvisit DESC LIMIT 0,10");

echo "<div id='boxover'><table width='100%' cellpadding='0' cellspacing='0'>";
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {

$lastseen = time() - $data['user_lastvisit'];
$iW=sprintf("%2d",floor($lastseen/604800));
$iD=sprintf("%2d",floor($lastseen/(60*60*24)));
$iH=sprintf("%02d",floor((($lastseen%604800)%86400)/3600));
$iM=sprintf("%02d",floor(((($lastseen%604800)%86400)%3600)/60));
$iS=sprintf("%02d",floor((((($lastseen%604800)%86400)%3600)%60)));
if ($lastseen < 60){
$lastseen = "<img src='".INFUSIONS."online_users_panel/images/online.png' border='0' alt='Online' />";
} elseif ($lastseen < 600){
$lastseen = "<img src='".INFUSIONS."online_users_panel/images/10min.png' border='0' alt='10Min' />";
} else {
$lastseen = "<img src='".INFUSIONS."online_users_panel/images/offline.png' border='0' alt='Offline' />";
}

if ($data['user_level'] == 103) $userlevel = "Administratorius";
if ($data['user_level'] == 102) $userlevel = "Super Administratorius";
if ($data['user_level'] == 101) $userlevel = "Narys";
echo "<tr>\n<td class='side-small' align='left'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".trimlink($data['user_name'],30)." [".$userlevel."] - Prisiregistraves: ".showdate("longdate", $data['user_joined'])." - Paskutinis apsilankymas: ".showdate("longdate", $data['user_lastvisit'])."' class='side'>";
echo trimlink($data['user_name'],15)."</a></td><td class='side-small' align='right'>".$lastseen."</td></tr>";
}
}
echo "</table></div>";

echo "<hr />\n".THEME_BULLET." ".$locale['global_014'].": ".number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'"))."<br />\n";
if (iADMIN && checkrights("M") && $settings['admin_activation'] == "1") {
echo THEME_BULLET." <a href='".ADMIN."members.php".$aidlink."&amp;status=2' class='side'>".$locale['global_015']."</a>";
echo ": ".dbcount("(user_id)", DB_USERS, "user_status='2'")."<br />\n";
}
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".DB_USERS." WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo THEME_BULLET." ".$locale['global_016'].": <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>".trimlink($data['user_name'],15)."</a>\n";
closeside();
?>
............................................................................................................................
Kur reikia iterpti
ši koda kad
if (checkvip($data['user_vip'])) echo "<img src='".IMAGES."vip.png' alt='VIP Narys' title='VIP Narys'>";
ir paveiksliuką kad rodytų vip ženkliuka

Redagavo legionas· 2010 Kov. 27 17:03:41