Gäste werden nicht gezählt

Begonnen von umleitung, 26 April 2004, 22:38:07

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

umleitung

Hallo Leute, auf meiner Seite werden die Gäste nicht gezählt, da steht immer null und alle jubel jare mal ne 1. da stimmt auf jedenfall was nicht, den habe mal übere mehrere rechner das getestet.

wäre für einen tipp sehr dankbar.

habe das mx 2.1

Andi

Hi :)

meinst Du im Who_Online Block?
Haste mal nen Link zu Deiner Seite?
Existiert die Tabelle mx_visitors und steht da was drin?
schön´s Grüssle, Andi

umleitung

Die Seite ist grad down, wegen serverumzug.

hier der code

 
################# Einstell Variablen ############################################################################
$onlinelistsize=8; # Hoehe des Selectfeld der Onlinuser
$showbuddy=1;   # Buddylink (Messenger) anzeigen
# User, die nicht angezeigt werden sollen
# Namen mit Komma trennen!
$excludedusers ="Texsterdsgf, Knaxllerfgfd";
##################################################################################################################
$imagedir="images/maaxon";
$pm_module_name = "Private_Messages";
##################################################################################################################
#$checkpmtime=200000; # Intervall zum private Nachrichten abfragen, 0 wenn nicht abgefragt werden soll
$thisfile=basename(__file__);
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

$mxblockcache = FALSE;

global $prefix, $user_prefix, $bgcolor1, $bgcolor2, $bgcolor3, $txtcolor1, $txtcolor2;

if(file_exists("language/maaXoN/maaXoN-".$GLOBALS['currentlang'].".php")) {
include_once("language/maaXoN/maaXoN-".$GLOBALS['currentlang'].".php");
}
else {
include_once("language/maaXoN/maaXoN-english.php");
}
# Variablen initialisieren
if(substr(strtolower($GLOBALS['currentlang']), 0, 6) == "german"){ # Bilder fuer Buttons definieren (noch keine Bilder vorhanden!!)
$pmimagepath="modules/$pm_module_name/images/buttons/german";
}
else{
$pmimagepath="modules/$pm_module_name/images/buttons/english";
}

# Variablen initialisieren
$isseruser = 0;
$username = "";
if (mxIsUser()){
$isseruser = 1;
$cookie=mxGetUserSession();
$username = $cookie[1];
$uid = $cookie[0];
}

$isseradmin = mxIsAdmin();
# SQL-bedingung fuer excluded Users erstellen
$exusers = explode (",", $excludedusers);
if(!$isseradmin){
while (list($key, $val) = each($exusers)) {      
$xexusers[]=trim($val);
}
}
$xexusers[] = $GLOBALS['anonymous'];
$excludedusers = "'".join($xexusers,"','")."'";

# Anzahl aller User und hoechste uid ermitteln
$totalmembers=0;
$qry="select COUNT(uid), MAX(uid) from ${user_prefix}_users where user_stat=1;";
list($totalmembers, $lastuid) = sql_fetch_row(sql_query($qry));

# neusten User ermitteln
$lastuid = (empty($lastuid)) ? 0 : $lastuid;
$qry="select uname from ${user_prefix}_users where uid = $lastuid;";
$result = sql_query($qry); # neusten User ermitteln
list($lastuser) = sql_fetch_row($result);

$past = time()- MX_SETINACTIVE_MINS ;
# Alle Gaeste ermitteln
$guest_online_num=0;
$result = sql_query("SELECT Count(ip) FROM ${prefix}_visitors WHERE time>".$past." AND uid=0;");
list($guest_online_num) = sql_fetch_row($result);

# Alle User ermitteln, evtl auflisten
$member_online_num = 0;
$whoonlineselect = "";
$smallunmae = strtolower($username);
#$GLOBALS["mxSqlDebug"]      = 1;
#$result = sql_query("SELECT uname, uid, user_lastvisit FROM ${user_prefix}_users WHERE (user_lastvisit >= ".$past.") AND user_stat=1 order by uname");
/* $result = sql_query("SELECT u.uname
FROM ${user_prefix}_users As u LEFT JOIN ${prefix}_visitors AS v ON u.uid = v.uid
WHERE ((u.user_lastvisit >= ".$past.") AND (u.user_stat=1) AND (u.uname NOT IN ($excludedusers)) AND (v.uid=u.uid))
ORDER BY u.uname"); */
$result = sql_query("SELECT uname FROM ${user_prefix}_users
WHERE ((uname Not In (".$excludedusers.")) AND (user_lastvisit >= ".$past.") AND (user_stat=1) AND (user_lastmod<>'logout'))
ORDER BY uname");
#$GLOBALS["mxSqlDebug"]      = 0;
while (list($uname2) = sql_fetch_row($result)) {
$sel = (strtolower($uname2) == $smallunmae) ? " selected " : "";
$uname3 = mxCutString($uname2, 18, "..", ""); # Kurzen Usernamen erstellen
$whoonlineselect.="<option value=\"".$uname2."\" ".$sel." title=\"".$uname2."\">".$uname3."</option>\n"; # options fuer auswahlselect erstellen
$member_online_num++; # Anzahl User hochzaehlen
}

# Private Nachrichten
$countpm=0; $countpmunread=0;
if ($isseruser) { # Wenn aktueller User registriert ist (kein Gast)
$pmactiv = (mxModuleAllowed($pm_module_name)) ? 1 : 0; # feststellen ob pm-modul aktiv ist
if ($pmactiv){ # falls pm-modul aktiv ist
$qry="SELECT read_msg, Count(msg_id) FROM ${prefix}_priv_msgs WHERE to_userid=".$uid." group by read_msg;";
$result = sql_query($qry);
while (list($read_msg, $nums) = sql_fetch_row($result)) {
  if ($read_msg==0) { # wenn angemeldeter User
$countpmunread=$nums; # Anzahl ungelesene ermitteln
  }
else{
$countpm=$nums; #++; # Anzahl aller pm's ermitteln
}
}
}
#else{
#$checkpmtime=0; # private Nachrichten nicht abfragen!
# }
}

# Usergaestebuch
$content_ug = "";
if ($isseruser) { # Wenn aktueller User registriert ist (kein Gast)
if (mxModuleAllowed("UserGuest")){ # falls gaestebuch vorhanden
$qry="SELECT Count(gid) FROM ${prefix}_userguest WHERE touserid='".$uid."' and dummy=0;";
$result = sql_query($qry);
list($gbnewentries) = sql_fetch_row($result);
# Usergaestebuch
if(!empty($gbnewentries)){
$content_ug .= "<div align=\"left\"><a href=\"modules.php?name=UserGuest&op=view&touser=$username\">
<img src=\"$imagedir/tcake.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOGUESTBOOK."\"></a> \n
<b>$gbnewentries </b><a href=\"modules.php?name=UserGuest&op=view&touser=$username\">";
if($gbnewentries==1){
$content_ug .= ""._BWOGUESTBOOK1."";
}
else {
$content_ug .= ""._BWOGUESTBOOK2."";
}
$content_ug .= "</a></div>";
}
}
}

# weitere Variablen initialisieren zur Zeitberechnung :(
//Creating SQL parameter
$gestern = mktime(0, 0, 0, date ("m") , date ("d")-1, date("Y"));
$heute = mktime(0, 0, 0, date ("m") , date ("d"), date("Y"));

# Heute neu angemeldete User ermitteln
$qry = "SELECT COUNT(uid) from ${user_prefix}_users WHERE user_regtime >= $heute and user_stat=1 and uname not in($excludedusers);";
list($userCount) = sql_fetch_row(sql_query($qry));

# Gestern neu angemeldete User ermitteln
$qry = "SELECT COUNT(uid) from ${user_prefix}_users WHERE user_regtime >= $gestern and user_regtime < $heute and user_stat=1 and uname not in($excludedusers);";
list($userCount2) = sql_fetch_row(sql_query($qry));

# Ausgabe ...................................
$content = "\n<!-- $thisfile output start -->\n<div class=\"boxcontent\" align=\"center\">\n"
."<a href=\"modules.php?name=Your_Account\"><img src=\"$imagedir/people.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPICS."\"></a>\n"
."<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOTOTALMEMBERS."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$totalmembers</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOTODAYMEMBERS."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$userCount</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOYESTERDAYMEMBERS."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$userCount2</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOMEMBERS1."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$member_online_num</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOGUESTES."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$guest_online_num</b></td>\n</tr>\n"
."</table>\n";
if ($isseruser || $isseradmin) { # Wenn angemeldeter User oder Admin
# Onlineliste anzeigen wenn User online sind
if($member_online_num>0){
if($onlinelistsize>=$member_online_num) {$onlinelistsize=$member_online_num+1;}
$content .= "<div style=\"border: 0px; margin-bottom: 5px;\">"._BWOLATEMEMBER."<br>\n<A HREF=\"modules.php?name=Userinfo&uname=$lastuser\">$lastuser</a></div>\n";
if(!$isseruser || !$pmactiv){
$script = "";
}
else{
$script = " onDblClick=\"whob_clickit()\"";
$content .= "\n<!--\n";
$content .= "function whob_clickit(){\n";
$content .= " var y=document.onlineuserinfo.uname.selectedIndex; \n";
$content .= " var x=document.onlineuserinfo.uname.options[y].value; \n";
$content .= " window.open('modules.php?name=$pm_module_name&file=buddy&op=compose&to='+x, '".md5(time())."','left=370,top=150,width=360,height=200,toolbar=no,location=no,menubar=no,scrollbars=yes,resizeable=yes,status=no');\n";
$content .= " return false;\n";
$content .= " }\n//-->\n";
$content .= "\n";
}
#background-color: $bgcolor1; font-size: 9px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: $txtcolor1; width: 90%; border: 0px $bgcolor1;

$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n";
$content .= "\n<tr>\n<td colspan=\"2\" align=\"center\" class=\"boxcontent\">\n";
$content .= "<img src=\"$imagedir/guy_hand.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPICS."\" align=\"absmiddle\">\n<b>"._BWOONLINELIST."</b>\n<img src=\"$imagedir/girl_hand.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPICS."\" align=\"absmiddle\"><br>\n";
$content .= "</td>\n</tr>\n";
$content .= "\n<tr>\n<td colspan=\"2\" align=\"center\">"; # select-options verwenden
$content .= "<form action=\"modules.php?test\" name=\"onlineuserinfo\" method=\"get\" style=\"border: 0px; margin-bottom: 5px; margin-top: 0px;\">";
$content .= "<input type=\"hidden\" name=\"name\" value=\"Your_Account\">";
$content .= "<input type=\"hidden\" name=\"op\" value=\"userinfo\">";
$content .= "<select name=\"uname\" size=\"$onlinelistsize\" style=\" background-color: $bgcolor1; font-size: 9px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: $txtcolor1; width: 90%; cursor: hand; border: 1px solid $bgcolor2; text-decoration: none; padding-left: 1px; padding-top: 1px; padding-bottom: 1px;\" $script>".$whoonlineselect."</select>";
$content .= "<br>\n<input type=\"image\" src=\"$pmimagepath/info.gif\" alt=\""._BWOUSERINFO."\">";
$content .= "</form>\n";
$content .= "</td>\n</tr>\n";
$content .= "</table>\n";
}
# private messages
if (!empty($pmactiv)){
# pm Liste
$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n";
if ($countpm){
$content .= "\n<tr>\n<td colspan=\"3\" align=\"center\" class=\"boxcontent\"><a href=\"modules.php?name=Private_Messages\">"._BWOPMSG."</a></td>\n</tr>\n";
$content .= "\n<tr>\n<td align=\"center\" class=\"boxcontent\"><a href=\"modules.php?name=Private_Messages\"><img src=\"$imagedir/pmessage.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPMSG."\"></a></td>\n";
$content .= "<td valign=\"top\" class=\"boxcontent\">"._BWOPMSGALL.":<br>\n"._BWOPMSGUNREAD.":</td>\n";
$content .= "<td valign=\"top\" align=\"right\" class=\"boxcontent\"><b>".$countpm."</b><br>\n";
$content .= ($countpmunread) ? "<img src=\"images/menu/arrow-ani.gif\" alt=\"\" width=\"14\" height=\"9\" border=\"0\"> <b>".$countpmunread."</b>" : "<b>$countpmunread</b>";
$content .= "</td>\n</tr>\n";
}
else{
$content .= "<tr><td class=\"boxcontent\"><a href=\"modules.php?name=Private_Messages\"><img src=\"$imagedir/pmessage.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPMSG."\" hspace=\"0\"></a></td><td><a href=\"modules.php?name=Private_Messages\">"._BWOPMSG."</a></td></tr>\n";
}
$content .= "</table>\n";
# Buddy
if ($showbuddy){
$themedir = MX_THEME_DIR."/images";
$buddyimg = (file_exists($themedir."/buddy.gif")) ? $themedir."/buddy.gif" : $imagedir."/buddy.gif";
$buddyimg = mxCreateImage($buddyimg, _BWOBUDDIE, 0);
$windowname=md5($GLOBALS['sitename']);
$content .= "<a href=\"#\" onClick=\"window.open('modules.php?name=Private_Messages&file=buddy','$windowname','left=180, top=150, width=240,height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0'); return false;\">".$buddyimg."</a><br>\n";
}
}
# Usergaestebuch
$content .= $content_ug;
}
else{ # Gast no user
$content .= "<div align=\"justify\"><br>\n"._BWOASREGISTERED."</div>\n";
}

#if($isseruser && $checkpmtime>0 && $pmactiv){
# $checkpmfile="modules.php?name=$pm_module_name&file=buddy&op=check&ref_intervall=$checkpmtime";
# $content.= "";
# }

$content .= "</div>\n<!-- $thisfile output end -->\n";
# Blocktitel aus Sprachdatei auslesen
$blockfiletitle=_BWOMAAXONLINE;
?>