Chciałbym umiescic 3 mody w jednym panelu. Dokladniej :
- użytkowników online
- najwiecej użytkowników online
- info panel v2.0
Poprostu chodzi mi o wrzucenie do pierwszego panelu zwartosci dwóch pozostałym. Wiem jak wrzucic drugi do pierwszego, ale nie mam pojęcie jak zrobic ENTER pomiędzy nimi. Probowałem wpisac <br>, ale nic nie daje. Próbowałem też wpisac echo "<br>". przed pierwszą linijką skryptu "Najwięcej użytkownikó Online" $cond = ($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'"); Powstaje wtedy linijka przerwy, ale przed "Najwiecej userow: 2" dodaje się zmienna (w tym przpadku liczba 2) O.o Natomiast nie mam pojęcia którą czesc trzeciego skryptu trzeba wyciąc i wrzucic do pierwszego panelu.
Podam teraz zawartosc plików :
*online_users_panel.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
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 VALUES('$name', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-60)."");
openside($locale['010']);
$result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='0'");
echo $locale['011'].dbrows($result)."<br>\n";
$result = dbquery(
"SELECT ton.*, user_id,user_name FROM ".$db_prefix."online ton
LEFT JOIN ".$db_prefix."users tu ON ton.online_user=tu.user_id
WHERE online_user!='0'"
);
$result_members = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user<>'0'");
$members = dbrows($result_members);
if ($members != 0)
{
$i = 1;
echo $locale['012'];
while($om = dbarray($result_members))
{
$result_member = dbquery("SELECT * FROM ".$db_prefix."users WHERE `user_id`='".$om[online_user]."'");
$data = dbarray($result_member);
if($data[user_level]==103){
echo "<a style='color:#F75013;' href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'><B>@".$data['user_name']."</B></a>";
}
else if($data[user_level]==102){
echo "<a style='color:#B5DE21;' href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'><B>^".$data['user_name']."</B></a>";
}else{
echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'><B>~".$data['user_name']."</B></a>";
}
if ($i != $members) echo ", ";
$i++;
}
echo "<br>\n";
} else {
echo $locale['013']."<br>\n";
}
echo "<br>".$locale['014'].dbcount("(user_id)", "users", "user_status<='1'")."<br>\n";
if ($settings['admin_activation'] == "1") echo $locale['015'].dbcount("(user_id)", "users", "user_status='2'")."<br>\n";
$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 $locale['016']."<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>".$data['user_name']."</a>\n";
closeside();
$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 VALUES('".$name."', '".USER_IP."', '".time()."')");
}
if (isset($_POST['login'])) {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'");
} else if (isset($logout)) {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_ip='".USER_IP."'");
}
}
?>
*info_panel.php
<?
/*--------------------------------------------------------------------------+
| MOD: eXtreme InfoPanel dla PHP-Fusion v6
|---------------------------------------------
| author: eXtreme-fusion crew - (c) 2005
| web: http://extreme-fusion.pl
|---------------------------------------------
| Wycinanie kodu poza eXtreme-pack zabrionione.
| Jeœli po kopiowaniu coœ nie dzia³a - miej pretensje do siebie.
+--------------------------------------------------------------------------*/
echo "<script type='text/javascript' src='".INFUSIONS."info_panel/javascript/gpe.js' language='Javascript'></script>";
if (file_exists(INFUSIONS."info_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."info_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."info_panel/locale/English.php";
}
include LOCALE.LOCALESET."search.php";
opentable($locale['XXX_001']);
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr><td width='20%' valign='top'>";
echo "<div class='scapmain'>
<center><b> ° <a href='".INFUSIONS."info_panel/members.php'> ".$locale['XXX_002']."</a> ° </b></center>
</div>\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_lastvisit DESC LIMIT 0,8");
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="<nobr><font color='green'><b>OnLine</b></font></NOBR>";
}elseif($lastseen<360){
$lastseen="<nobr><font color='red'><b>OffLine</b></font></NOBR>";
}elseif($iW>0){
if($iW==1) $Text="".$locale['XXX_007']."";
elseif($iW==2 || $iW==3 || $iW==4) $Text="".$locale['XXX_011']."";
else $Text="".$locale['XXX_008']."";
$lastseen="<nobr>$iW $Text</NOBR>";
}elseif($iD>0){
if($iD==1) $Text="".$locale['XXX_009']."";
else $Text="".$locale['XXX_010']."";
$lastseen="<NOBR>$iD $Text</NOBR>";
}else{
$lastseen="$iH:$iM:$iS";
}
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>
<a href='".BASEDIR."profile.php?lookup=$data[user_id]'
onmouseover=\"gpe('text:<center><b>° ".$locale['XXX_017']." °</b></center><hr><b>".$locale['XXX_003'].":</b> ".$data['user_name']."<br><b>".$locale['XXX_004']."</b>: ".$data['user_location']."<br><b>".$locale['XXX_005'].":</b> ".$data['user_msn']."<br><b>".$locale['XXX_006'].":</b> ".$data['user_posts'].";')\">";
if ($data[user_level] == "103") {
$user = "<font color='#F75013'><b>@$data[user_name]</b></font>";
} else if ($data[user_level] == "102") {
$user = "<font color='#B5DE21'><b>^$data[user_name]</b></font>";
} else if ($data[user_level] == "101") {
$user = "~$data[user_name]";
}
echo "$user</a></td><td align=\"right\">".$lastseen."</td></tr></table>";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}
echo "</td></tr></table>";
// Search added for ease by Shedrock
echo"<hr><table border='0' width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td align='center' valign='bottom'>
<form name='searchform' method='post' action='".BASEDIR."search.php'>
".$locale['401']." <input type='text' name='stext' value='$stext' class='textbox' style='width:140px'>
<input type='submit' name='search' value='".$locale['408']."' class='button'><br>
<input type='radio' name='stype' value='a'".($stype == "a" ? " checked" : "")."> ".$locale['402']."
<br><input type='radio' name='stype' value='n'".($stype == "n" ? " checked" : "")."> ".$locale['403']."
<br><input type='radio' name='stype' value='d'".($stype == "d" ? " checked" : "")."> ".$locale['405']."
<br><input type='radio' name='stype' value='w'".($stype == "w" ? " checked" : "")."> ".$locale['406']."
<br><input type='radio' name='stype' value='m'".($stype == "m" ? " checked" : "")."> ".$locale['407']."
</form>
</td>
</tr>
</table>\n";
//
closeside();
?>
Oraz skrypt potrzebny do utworzenia Panelu "Najwięcej Użytkowników Online" :
openside("");
$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 VALUES('".$name."', '".USER_IP."', '".time()."')");
}
if (isset($_POST['login'])) {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'");
} else if (isset($logout)) {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_ip='".USER_IP."'");
}
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-60)."");
$result2 = dbquery("SELECT * FROM ".$db_prefix."najw ORDER BY naj_user DESC LIMIT 1");
$data2 = dbarray($result2);
$bylo = "".showdate('%d %B %Y %H:%M',$data2['naj_date'])."";
$ilosc_userow = $data2['naj_user'];
$wszystkich = "".number_format(dbcount("(online_user)", "online", "online_user!=''"))."";
$timme = time();
$result=dbquery("INSERT INTO ".$db_prefix."najw (naj_id, naj_user, naj_date) VALUES ('','$wszystkich', '$timme')");
$result=dbquery("DELETE FROM ".$db_prefix."najw WHERE naj_date!='".$data2['naj_date']."' ORDER BY naj_user LIMIT 1");
echo"<table border='0' cellspacing='1' cellpadding='0' width='100%' class='small'>
<tr>
<td class='small' colspan='2' align='left'>
Najwiecej userow: ".$ilosc_userow."</i>
</td>
</tr>
<tr>
<td class='small' colspan='2' align='left'>
Było: <i>".$bylo."</i>
</td>
</tr>
</table>";
closeside();
Edytowane przez Livo dnia 13.10.2006 15:27:47
|