Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Keri'o klausimai.

Parašė Mandello· 2011 Sau. 22 10:01:28
#35

Sveiki. Gal galite padėti šiame kode įterpti kodą kuris šalia [ Iš viso narių: ] narių statistiko virš jo rodytu dar ir prisijungusius svečius.
Jai kam neaišku galite pažiūrti tinklapyje www.scream.lt statistikos panelėje.

 
<?php
//Failo pavadinimas online_users_panel.php
//Sukurimo data: 2010.11.15 16:46
//Kurtas Neaglezzz
//Skype assassin.k.
 
//JavaScript
echo "<link rel='stylesheet' type='text/css' href='".INFUSIONS."online_users_panel/javascript/Script.css' />
<script src='".INFUSIONS."online_users_panel/javascript/Script_01.js' type='text/javascript'></script>
<script src='".INFUSIONS."online_users_panel/javascript/Script_02.js' type='text/javascript'></script>";
//
 
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
 
$time_1= date('d');
$time_2= date('m');
$time_3= date('Y');
$time_4 = mktime(0,0,0,$time_2,$time_1,$time_3);
$time_5 = mktime(23,59,59,$time_2,$time_1,$time_3);
$time_6 = mktime(0,0,0,$time_2,$time_1-1,$time_3);
$time_7 = mktime(23,59,59,$time_2,$time_1-1,$time_3);
 
if ($settings['maintenance'] != "1") {
	$cond = ($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'");
	$result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user=".$cond."");
	if (dbrows($result) != 0) {
		$result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user=".$cond."");
	} else {
		$name = ($userdata['user_level'] != 0 ? $userdata['user_id'] : "0");
		$result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('$name', '".USER_IP."', '".time()."')");
	}
	$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-60)."");
	$naujokas = dbarray(dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
	$resultatas = dbquery("SELECT ton.*, tu.user_id,user_name FROM ".$db_prefix."online ton LEFT JOIN ".$db_prefix."users tu ON ton.online_user=tu.user_id");
	$guests = 0; $members = 0;
	while ($data = dbarray($resultatas)) {
		if ($data['online_user'] == "0") {
			$guests++;
		} else {
			$members++;
		}
	}
	$isvis = ($members+$guests);
 
	openside("Vartotojų statistika");
 
echo "
<br><img src='http://www.iconarchive.com/icons/fasticon/fast-icon-users/16/user-icon.png'><b>Narių Statistika:</b><br>";
 
 
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo "<span class='small'>&#194;°</span> ".$locale['on117']."<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side' title='".$data['user_name']."'>".trimlink($data['user_name'], 12)."</a><br />\n";$tag1= date('d');
$tag1= date('d');
$monat1= date('m');
$jahr1= date('Y');
$hanfang = mktime(0,0,0,$monat1,$tag1,$jahr1);
$hende = mktime(23,59,59,$monat1,$tag1,$jahr1);
$ganfang = mktime(0,0,0,$monat1,$tag1-1,$jahr1);
$gende = mktime(23,59,59,$monat1,$tag1-1,$jahr1);
 
$result = mysql_query("SELECT user_level FROM ".$db_prefix."users where user_level=103");
$num_rows = mysql_num_rows($result);
//display the result
echo "&#194;° Super Administratorių: ".$num_rows."</a><br>\n";
 
$result = mysql_query("SELECT user_level FROM ".$db_prefix."users where user_level=102");
$num_rows = mysql_num_rows($result);
//display the result
echo "&#194;° Administratorių: ".$num_rows."</a><br>\n";
$result = mysql_query("SELECT user_level FROM ".$db_prefix."users where user_level=102");
$num_rows = mysql_num_rows($result);
//display the result
echo "&#194;° Forumo Moderatorių: ".$num_rows."</a><br>\n";
$result = dbquery("SELECT count(group_id) FROM ".$db_prefix."user_groups");
echo "&#194;° Vartotojų grupių: [".dbresult($result, 0)."]<br>";
echo "<hr />\n".THEME_BULLET." ".$locale['global_014'].": ".number_format(dbcount("(user_id)", DB_USERS, "user_status<='1'"))."<br />\n";
echo "
<hr>
<b><img src='http://www.iconarchive.com/icons/dan-wiersma/solar-system/16/Earth-icon.png'>SvetainÄ—s Statistika:</b><br>";
$result = dbquery("SELECT count(news_id) FROM ".$db_prefix."news");
echo "&#194;° Naujienų: [".dbresult($result, 0)."]<br>";
$result = dbquery("SELECT count(download_id) FROM ".$db_prefix."downloads");
echo "&#194;° Siuntinių: [".dbresult($result, 0)."]<br>";
$result = dbquery("SELECT count(photo_id) FROM ".$db_prefix."photos");
echo "&#194;° Nuotraukų: [".dbresult($result, 0)."]<br>";
$result = dbquery("SELECT count(post_id) FROM ".$db_prefix."posts");
echo "&#194;° Forumo praneÅ&#161;imų: [".dbresult($result, 0)."]<br>";
$result = dbquery("SELECT count(comment_id) FROM ".$db_prefix."comments");
echo "&#194;° Komentarų: [".dbresult($result, 0)."]<br>";
$result = dbquery("SELECT count(shout_id) FROM ".$db_prefix."shoutbox");
echo "&#194;° Å aukyklos praneÅ&#161;imų: [".dbresult($result, 0)."]<br>";
$result = dbquery("SELECT count(poll_id) FROM ".$db_prefix."polls");
echo "&#194;° Apklausų: [".dbresult($result, 0)."]<br>";
 
echo "<br><img src= '".INFUSIONS."online_users_panel/images/on-off.png'> PrisijungÄ™:<br><br>";
 
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_lastvisit>'0' AND user_status='0' ORDER BY user_lastvisit DESC LIMIT 10");
 
echo "<table cellpadding='0' cellspacing='0' width='100%'>";
		if (dbrows($result) != 0) {
		while ($data = dbarray($result)) {
		$laikas = time() - $data['user_lastvisit'];
		$laikasoff ="<img src= '".INFUSIONS."online_users_panel/images/offline.png' title='Atsijunges'>";
		$laikason = "<img src= '".INFUSIONS."online_users_panel/images/online.gif' title='Prisijunges'>";
		$laikas1=sprintf("%2d",floor($laikas/604800));
		$laikas2=sprintf("%2d",floor($laikas/(60*60*24)));
 
 
		if ($laikas < 60){
		$laikas = $laikason;
		} elseif ($laikas < 360){
		$laikas = $laikasoff;
		} elseif ($laikas1 > 0){
		if ($laikas1 == 1) {}
		$laikas = $laikasoff;
		} elseif ($laikas2 > 0){
		if ($laikas2 == 1) {}
		$laikas = $laikasoff;
		} else {
		$laikas = $laikasoff;
		}
		$userimg = "<img src= '".INFUSIONS."online_users_panel/images/user.png'>";
		$spalvaR = "<span style='color:#b40101'>"; //Raudona
		$spalvaZ = "<span style='color:#6ab401'>"; //?alia
		$spalvaB = "<span style='color:#000000'>"; //Juoda
		if($data['user_level'] == 103){ $atsakymas=$userimg; $spalva=$spalvaR;}
		if($data['user_level'] == 102){ $atsakymas=$userimg; $spalva=$spalvaZ;}
		if($data['user_level'] == 101){ $atsakymas=$userimg; $spalva=$spalvaB;}
		echo "<tr>\n<td class='small' align='left'>\n";
		echo "$atsakymas<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='Vartotojas - ".$data['user_name']."' class='small'>\n";
		echo " $spalva".trimlink($data['user_name'], 30)."</a></span>";
		if (iMEMBER) {	
		echo "<a href='".BASEDIR."messages.php?msg_send=".$data['user_id']."' target='_blank'><img src= '".INFUSIONS."online_users_panel/images/pm.png' border='0' title='Siøsti PM &#254;inute' ></a>";
		}
		echo "</td><td class='small' align='right'>".$laikas."</td>\n</tr>\n";
 
 
 
	}
}
echo "</table>";
echo "
<br><img src='http://www.scream.lt/infusions/online_users_panel/images/coment.png'><b>Daugiausiai komentarų paraÅ&#161;Ä—:</b><br>";
$result=dbquery("SELECT user_name, user_location, user_icq, user_id, count(user_id) AS comment_count FROM ".$db_prefix."comments INNER JOIN
".$db_prefix."users ON comment_name=user_id GROUP BY user_name ORDER BY comment_count DESC LIMIT 0,5");
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
if(dbrows($result)!=0){
while($data=dbarray($result)){
echo "<tr><td class='small2' align='left'>  <img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=$data[user_id]' class='side'>";
echo "$data[user_name]</a></td><td class='small2' align='right'>[$data[comment_count]]</td></tr>";
}
}
echo "</table>";
echo "
<br><img src='http://www.scream.lt/infusions/online_users_panel/images/coment.png'><b>Å aukyklos aktyviausi:</b><br>";
$result=dbquery("SELECT user_name, user_location, user_icq, user_id, count(user_id) AS shout_count FROM ".$db_prefix."shoutbox INNER JOIN
".$db_prefix."users ON shout_name=user_id GROUP BY user_name ORDER BY shout_count DESC LIMIT 0,5");
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
if(dbrows($result)!=0){
while($data=dbarray($result)){
echo "<tr><td class='small2' align='left'> <img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=$data[user_id]' class='side'>";
echo "$data[user_name]</a></td><td class='small2' align='right'>[$data[shout_count]]</td></tr>";
}
}
echo "</table>";
 
 
	closeside();
}
?>