letzte besucher

Begonnen von smartmusic, 13 Mai 2004, 14:53:35

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

smartmusic

hallo,

wie wäre es denn wenn man es als kleinen block hätte mit biep wer sich gerade dein profil angesehen hat???

JoergK

Ich könnte hier ne Anleitung posten für vkpMx 2.1 inkl. YA_Eweiterung v. 07.09.2003.
Bis auf ne abgewandelte Function hab ich alle Änderungen in /modules/Userinfo/view.php,
ergo Anzeige der letzten Besucher im Profil, nicht als Block.

Die bessere Variante is sicherlich die von NeMeSiSX2LC, wo die Änderungen über die
/includes/mx_userfunctions_options.php laufen, da man dann bei nem Update des vkp
nicht Gefahr läuft, seine Änderungen zu verlieren. Nur krieg ich's halt nich hin (s.o.).

Also wenn wer Interesse an meiner Variante hat ... Bitte melde Dich ... ;)
Gruß,
Jörg


Nobody is perfect ... so don't call me Nobody

tuningcar

ZitatAlso wenn wer Interesse an meiner Variante hat ... Bitte melde Dich ...

Immer her damit  ;)

Arbeite zwar mit der mx_userfunctions_options.php aber wenigstens habe ich mal einen Anfang  :thumbup:

JermaineBelgardio

Ich hab da auch Interesse dran. :)

JoergK

#64
Ok, Ihr hab's nich anders gewollt  ;D

Schritt 1 - Datenbank erweitern


  • Tabelle "mx_users" erweitern
ALTER TABLE `mx_users` ADD `user_click` BIGINT( 20 ) DEFAULT '0' NOT NULL;[/list]


  • Neue Tabelle mx_users_visit erstellen
CREATE TABLE `mx_users_visit` (
      `id` int(11) unsigned NOT NULL auto_increment,
      `uid` int(11) NOT NULL default '0',
      `vuid` int(11) NOT NULL default '0',
      `time` int(11) unsigned NOT NULL default '0',
      PRIMARY KEY  (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=1 ;

[/list]

Schritt 2 - Klickerfassung in /modules/Userinfo/view.php


  • Vor der eigentlichen Seitenausgabe
////////////////////////// Ausgabe der Daten ////////////////////////////////////////////////////
das einbauen:
 #################################################
 function VWGetSexusString($sexus = 0){
   $sexus = (empty($sexus)) ? 0 : (int)$sexus;
   switch ($sexus) {
     case 0: $out = mxCreateImage("images/nogender.gif", _YA_MALE); break;
     case 1: $out = mxCreateImage("images/f.gif", _YA_FEMALE); break;
     case 2: $out = mxCreateImage("images/m.gif", _YA_MALE); break;
   }
   return $out;
 }

 function mxdynatime(){
   $jetzt=time();
   $today = date("Ymd", time());
   $year = substr($today,0,4);
   $month = substr($today,4,2);
   $day = substr($today,6,2);
   $endetag=mktime(23,59,59,$month,$day,$year);
   $laufzeit=($endetag-$jetzt);
   return $laufzeit;
 }

 ob_start();
 $time = mxdynatime();
 if(!empty($_COOKIE["Profilaufruf".$uname.""])) {
   echo"";
 }else {
   $cookie = mxGetUserSession();
   if ($cookie[1] != $uname) {
     $deltime = time() - 60*60*24*2;
     sql_query("DELETE FROM ".$user_prefix."_users_visit WHERE time < '$deltime'");
     sql_query("UPDATE ".$user_prefix."_users SET user_click=user_click+1 where uname='$uname'");
     sql_query("INSERT INTO ".$user_prefix."_users_visit (uid, vuid, time) VALUES ('".$uinfo['uid']."', '".$cookie[0]."', '".time()."')");
   }
   setcookie("Profilaufruf".$uname."","Profilaufruf",time()+$time);
 }


Die function VWGetSexusString ist eine leichte Abwandlung des originals (vkpGetSexusString),
damit nur das Symbol, aber nicht noch der Text davor ausgegeben wird.[/list]

Schritt 3 - Zählerausgabe in /modules/Userinfo/view.php


  • An der Stelle, wo Ihr den Aufrufzähler angezeigt haben möchtet, folgendes einbauen:
 $clickuser = sql_query("SELECT user_click FROM ".$user_prefix."_users WHERE uid=".$uinfo['uid']." LIMIT 1");
 $click = sql_fetch_array($clickuser);
 echo "<center><strong>".$click[0]."</strong> Aufruf(e)<br /><br />\n";

[/list]

Schritt 4 - Ausgabe der letzten 10 Besucher in /modules/Userinfo/view.php


  • An der Stelle, wo Ihr die Ausgabe angezeigt haben möchtet, folgendes einbauen:
 OpenTable();
 echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" bgcolor=\"$bgcolor1\">\n";
 $visituser = sql_query("SELECT uid, vuid, time FROM ".$user_prefix."_users_visit WHERE uid=".$uinfo['uid']." ORDER BY time DESC LIMIT 10");
 if ($click[0] != 0){
   echo"<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\"><b>Die letzten 10 Besucher:</b></td>\n";
   echo "<td bgcolor=\"$bgcolor3\">&nbsp;</td><td bgcolor=\"$bgcolor3\">&nbsp;</td>\n";
   while($visit = sql_fetch_array($visituser)){
     $sqluser = sql_fetch_array(sql_query("SELECT * FROM ".$user_prefix."_users WHERE uid=".$visit['vuid'].""));
     $visit['time'] = date ("d.m.Y H:i", $visit['time']);
     if (!empty($sqluser['uname'])){
       echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\">&nbsp;</td><td bgcolor=\"$bgcolor3\" width=\"15%\">\n";
       echo "".VWGetSexusString($sqluser['user_sexus'])."<a href=\"modules.php?name=Userinfo&uname=".$sqluser['uname']."\">".$sqluser['uname']."</a></td>\n";
       echo "<td bgcolor=\"$bgcolor3\">".$visit['time']."</td></tr>\n";
     }else{
       echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\">&nbsp;</td><td bgcolor=\"$bgcolor3\" width=\"15%\">\n";
       echo "".VWGetSexusString($sqluser['user_sexus'])." Gast</td><td bgcolor=\"$bgcolor3\">".$visit['time']."</td></tr>\n";
     }
   }
 }
 echo "</table>";
 CloseTable();

Falls jemand mehr oder weniger als 10 Besucher anzeigen lassen will, einfach das LIMIT in der DB-Abfrage ändern:
$visituser = sql_query("SELECT uid, vuid, time FROM ".$user_prefix."_users_visit WHERE uid=".$uinfo['uid']." ORDER BY time DESC LIMIT 10");[/list]

Schritt 5 - Habe Fertig  8)

Das war's. Ich hoffe, bei Euch funzt's genausogut wie bei uns. Falls nicht, einfach melden.
Wär ebenfalls nett, wenn wer was schreiben würde, falls ich wo Mist gebaut hab  ;)

Nachtrag: Hab den (Tipp)Fehler (s.u.) korrigiert  ;)
Gruß,
Jörg


Nobody is perfect ... so don't call me Nobody

JermaineBelgardio

Hmm.. bei Schritt 4 hab ich Probleme. Hab den Code vor die Stelle kopiert, die mit //Listings eingeleitet wird. Erhalte dabei immer die folgende Fehlermeldung:

Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in /www/htdocs/v110447/gothic/modules/Userinfo/view.php on line 327

Fatal error: Call to undefined function: viewuserinfo() in /www/htdocs/v110447/gothic/modules/Userinfo/index.php on line 36

Was mach ich falsch?

JoergK

#66
Hierzu mal bitte die betroffene Zeile und jeweils 10 Zeilen davor und danach posten
Zitat von: JermaineBelgardio am 19 März 2005, 09:46:49
Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in /www/htdocs/v110447/gothic/modules/Userinfo/view.php on line 327

Zu
Zitat von: JermaineBelgardio am 19 März 2005, 09:46:49
Call to undefined function: viewuserinfo() in /www/htdocs/v110447/gothic/modules/Userinfo/index.php on line 36
check mal ab, in welcher Datei die function deklariert wird und includier die mal.
Is merkwürdig, dass der den Fehler jetzt bringt, wo doch die Änderungen nur in der
view.php gemacht werden/wurden ... oder haste anner index.php parallel
auch was für Dich geändert?

Das
Zitat von: JermaineBelgardio am 19 März 2005, 09:46:49
Hab den Code vor die Stelle kopiert, die mit //Listings eingeleitet wird.
Kommt in meiner view.php gar nich vor ... aber wir reden hier schon von der gleichen Versionskombi aus
vkpMx 2.1 (nicht 2.1.a) & YA v. 07.09.2003 (nicht YAplus - btw: kenn ich gar nicht, was aber nix heißt  ;)  )??
Gruß,
Jörg


Nobody is perfect ... so don't call me Nobody

JermaineBelgardio

Jepp, es ist das MX2.1 mit dem YA, welches standardmäßig dabei ist/war. Hab da keine Änderungen vorgenommen - zumindest weiss ich davon nix mehr.  ;D

Hier mal meine komplette view.php:


<?php // $Id: view.php,v 1.11 2003/11/17 13:00:40 EllselAn Exp $
/**********************************************************************/
/* vkpMx 2.0  Content Management System Platform                      */
/* ================================================================== */
/* Copyright (C) 2003 by the vkpMx & pragmaMx Developer Team          */
/* email:         team@pragmamx.org                                   */
/* homepage:      http://www.maax-design.de                           */
/* further sites: http://www.pragmaMx.org, http;//guggemahier.de, */
/*            http://www.marx-city.de, http://www.genutec-studios.de, */
/*            http://www.shiba-design.de, http://www.power-maax.de    */
/* ================================================================== */
/*   The vkpMx is distributed free of charge by maax-design.de.       */
/*   The use of this system is allowed until copyright information    */
/*   is shown perspicuous visible and correcty on all system pages.   */
/*   Sales, rent out and the use of single code parts from this       */
/*   system must be allowed by maax-design.de.                        */
/**********************************************************************/

if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
if (!
defined("mxYALoaded")) die ("You can't access this file directly...");


#################################################
function viewuserinfo($uinfo) {
global $prefix$user_prefix$bgcolor1$bgcolor2$bgcolor3$useuserpoints;
global $istheuser$privmsgactive$gbactiv$showall// fuer Unterfunktionen in mx_userfunctions_options.php
if (!isset($useuserpoints)) include("modules/Your_Account/config.php");

mxGetLangfile("Your_Account");

$uinfo mxPrepareCensored($uinfo);
#extract($uinfo);
#mxdebugfuncvars($uinfo);

$istheuser vkpUserIsThisTheUser($uinfo['uid']);
$showall = ($istheuser || mxIsAdmin()) ? 0;

$privmsgactive = (mxModuleAllowed("Private_Messages")) ? 0# feststellen ob pm-modul aktiv ist
$gbactiv = (mxModuleAllowed("UserGuest")) ? 0# feststellen ob gaestebuch vorhanden

$uinfo['url'] = mxCutHTTP($uinfo['url']);

// Signatur
if (!empty($uinfo['user_sig'])) {
if (@file_exists('modules/Private_Messages/bbfunctions.php')) {
include_once('modules/Private_Messages/bbfunctions.php');
$uinfo['user_sig'] = smile(bbencode(make_clickable($uinfo['user_sig'])));
}
$uinfo['user_sig'] = mxNL2BR($uinfo['user_sig']);
}

# Prüfem ob ein Avatar hochgeladen wurde:
if(!mxIsAvatarUploaded($uinfo['uname'])) {
$uinfo['user_avatar'] = (empty($uinfo['user_avatar']) || $uinfo['user_avatar']=="blank.gif") ? "" mxCreateImage(MX_PATH_AVATAR."/".$uinfo['user_avatar'], $uinfo['user_avatar']);
}
else {
$uinfo['user_avatar'] = mxIsAvatarUploaded($uinfo['uname'], TRUE);
}

// Private Nachrichten
$privmsgactive = (mxModuleAllowed("Private_Messages")) ? 0# feststellen ob pm-modul aktiv ist
if ($privmsgactive && $istheuser){ # falls pm-modul aktiv ist
$uinfo['countpm'] = 0;
$uinfo['countpmread'] = 0;
$uinfo['countpmunread'] = 0;
$qry="SELECT read_msg, Count(msg_id) FROM ${prefix}_priv_msgs WHERE to_userid='".intval($uinfo['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
$uinfo['countpmunread'] = $nums; # Anzahl ungelesene ermitteln
   }
else{
$uinfo['countpmread'] = $nums; # Anzahl gelesener pm's ermitteln
}
}
$uinfo['countpm'] = $uinfo['countpmread'] + $uinfo['countpmunread'];
$uinfo['contpm'] = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td nowrap><a href=\"modules.php?name=Private_Messages\"><b>".$uinfo['countpm']."</b></a>&nbsp;<a href=\"modules.php?name=Private_Messages\">"._YA_BWOPMSGALL."</a>";
if($uinfo['countpmunread']){
$uinfo['contpm'] .= "</td><td>,&nbsp;</td><td nowrap><a href=\"modules.php?name=Private_Messages\"><marquee behavior='alternate' direction='left' width='100' hspace='0' vspace='0' loop=''><b>".$uinfo['countpmunread']."</b>&nbsp;<b>"._YA_BWOPMSGUNREAD."</b></marquee></a>\n";
}
$uinfo['contpm'] .= "</td><td>&nbsp;&nbsp;*</td></tr></table>";
}

// Online oder Offline
$uinfo['online'] = ($istheuser) ? TRUE mxIsUserOnline($uinfo['uname']);
$uinfo['lastonline'] = ($uinfo['online']) ? "" mx_strftime(_DATESTRING,$uinfo['user_lastvisit']);
$img = ($uinfo['online']) ? "images/online.gif" "images/offline.gif";
$uinfo['online'] = mxCreateImage($img, (($uinfo['online']) ? _YES _NO));


// Newsletter
$resultx sql_query("SELECT status FROM ${prefix}_newsletter WHERE email='".mxAddSlashesForSQL($uinfo['email'])."' OR email='".mxAddSlashesForSQL($uinfo['femail'])."'");
list($status)=sql_fetch_row($resultx);
$uinfo['newsletter'] = (empty($status) || $status == 3) ? _NOTSUBSCRIBED _SUBSCRIBED;
$img = (empty($status) || $status == 3) ? "images/td.gif" "images/tu.gif";
$uinfo['newsletter'] = mxCreateImage($img$uinfo['newsletter'])."&nbsp;".$uinfo['newsletter']."\n";

// Userpunkte
#$uinfo['userpoints'] = 0;
$uinfo['hasuserpoints'] = "";
$uinfo['userpointsfaq'] = "";
if ($useuserpoints){
if (@file_exists("modules/Your_Account/userpoints.php")){
$uname $uinfo['uname'];
include_once("modules/Your_Account/userpoints.php");
$uinfo['hasuserpoints'] = $hasuserpoints;
#$uinfo['userpoints']    = $userpoints;
$uinfo['userpointsfaq'] = $userpointsfaq;
}
}

// Usergaestebuch
$gbactiv = (mxModuleAllowed("UserGuest")) ? 0# feststellen ob gaestebuch vorhanden
$uinfo['gbnewentries'] = 0;
if ($gbactiv){ # falls gaestebuch vorhanden
$qry="SELECT Count(gid) FROM ${prefix}_userguest WHERE touserid='".intval($uinfo['uid'])."' and dummy=0;";
$result sql_query($qry);
list($uinfo['gbnewentries']) = sql_fetch_row($result);
}

// Geburtstag
$bday explode('-',$uinfo['user_bday']);
$uinfo['user_bday'] = (@checkdate($bday[1], $bday[2], $bday[0])) ? vkpGetBdayString($uinfo['user_bday']) : "";

// Benutzergruppe
if (mxIsAdmin()) {
$result sql_query("SELECT access_title FROM ".$prefix."_groups_access WHERE access_id = ".intval($uinfo['user_ingroup'])."");
list($uinfo['usergroup']) = sql_fetch_row($result);
}


#################################################
  
function VWGetSexusString($sexus 0){
    
$sexus = (empty($sexus)) ? : (int)$sexus;
    switch (
$sexus) {
      case 
0$out mxCreateImage("images/nogender.gif"_YA_MALE); break;
      case 
1$out mxCreateImage("images/f.gif"_YA_FEMALE); break;
      case 
2$out mxCreateImage("images/m.gif"_YA_MALE); break;
    }
    return 
$out;
  }

  function 
mxdynatime(){
    
$jetzt=time();
    
$today date("Ymd"time());
    
$year substr($today,0,4);
    
$month substr($today,4,2);
    
$day substr($today,6,2);
    
$endetag=mktime(23,59,59,$month,$day,$year);
    
$laufzeit=($endetag-$jetzt);
    return 
$laufzeit;
  }

  
ob_start();
  
$time mxdynatime();
  if(!empty(
$_COOKIE["Profilaufruf".$uname.""])) {
    echo
"";
  }else {
    
$cookie mxGetUserSession();
    if (
$cookie[1] != $uname) {
      
$deltime time() - 60*60*24*2;
      
sql_query("DELETE FROM ".$user_prefix."_users_visit WHERE time < '$deltime'");
      
sql_query("UPDATE ".$user_prefix."_users SET user_click=user_click+1 where uname='$uname'");
      
sql_query("INSERT INTO ".$user_prefix."_users_visit (uid, vuid, time) VALUES ('".$uinfo['uid']."', '".$cookie[0]."', '".time()."')");
    }
    
setcookie("Profilaufruf".$uname."","Profilaufruf",time()+$time);
  }

////////////////////////// Ausgabe der Daten /////////////////////////////////////////////////////

include("header.php");
if ($istheuser) {
include_once("modules/Your_Account/navbar.php");
OpenTable();
nav(1);
CloseTable();
echo "<br>";
}
else {
OpenTable();
echo "<center>";
echo "<font class=\"title\">"._PERSONALINFO.": ".$uinfo['uname']."</font><br>";
echo "</center>";
CloseTable();
echo "<br>";
}
if (function_exists('viewuserinfo_option_1')) {
viewuserinfo_option_1($uinfo);
}
else {
OpenTable();
echo "<center>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$bgcolor1\">\n";
echo "<tr valign=\"top\"><td width=\"20%\" bgcolor=\"$bgcolor2\"><b>"._NICKNAME.":</b></td><td bgcolor=\"$bgcolor3\"><b>".mxPrepareToDisplay($uinfo['uname'])."</b></td></tr>\n";
if ($showall)              echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._UREALEMAIL.":</b></td><td bgcolor=\"$bgcolor3\"><a href=\"mailto:".mxPrepareToDisplay($uinfo['email'])."\"><b>".mxPrepareToDisplay($uinfo['email'])."</b></a> *</td></tr>\n";
if (!empty($uinfo['user_avatar']))  echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._AVATAR.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['user_avatar']."</td></tr>\n";
if (!empty($uinfo['femail']))       echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._UFAKEMAIL.":</b></td><td bgcolor=\"$bgcolor3\"><a href=\"mailto:".mxPrepareToDisplay($uinfo['femail'])."\">".mxPrepareToDisplay($uinfo['femail'])."</a></td></tr>\n";
if (!empty($uinfo['name']))    echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._UREALNAME.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['name'])."</td></tr>\n";
if (!empty($uinfo['user_sexus']))   echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._YA_USEXUS.":</b></td><td bgcolor=\"$bgcolor3\">".vkpGetSexusString($uinfo['user_sexus'])."</td></tr>\n";
if (!empty($uinfo['user_bday']))    echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._YA_UBDAY.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['user_bday']."&nbsp;, ".$uinfo['user_age']."&nbsp;"._YEARS."</td></tr>\n";
if (!empty($uinfo['url']))          echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._MYHOMEPAGE."</b></td><td bgcolor=\"$bgcolor3\"><a href=\"".mxPrepareToDisplay($uinfo['url'])."\" target=\"_blank\">".mxPrepareToDisplay($uinfo['url'])."</a></td></tr>\n";
if (!empty($uinfo['user_icq']))     echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._ICQ.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_icq'])."</td></tr>\n";
if (!empty($uinfo['user_aim']))     echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._AIM."</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_aim'])."</td></tr>\n";
if (!empty($uinfo['user_yim']))     echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._YIM.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_yim'])."</td></tr>\n";
if (!empty($uinfo['user_msnm']))    echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._MSNM.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_msnm'])."</td></tr>\n";
if (!empty($uinfo['user_from']))    echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._LOCATION.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_from'])."</td></tr>\n";
if (!empty($uinfo['user_occ']))     echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._OCCUPATION.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_occ'])."</td></tr>\n";
if (!empty($uinfo['user_intrest'])) echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._INTERESTS.":</b></td><td bgcolor=\"$bgcolor3\">".mxPrepareToDisplay($uinfo['user_intrest'])."</td></tr>\n";
if (!empty($uinfo['user_sig']))     echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._SIGNATURE.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['user_sig']."</td></tr>\n";
if (!empty($uinfo['bio']))          echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._EXTRAINFO.":</b></td><td bgcolor=\"$bgcolor3\">".mxNL2BR(mxPrepareToHTMLDisplay($uinfo['bio']))."</td></tr>\n";
if ($showall)                       echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._NEWSLETTER.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['newsletter']." *</td></tr>\n";
if ($uinfo['hasuserpoints']){
echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._GRANKS.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['hasuserpoints']." &nbsp;&nbsp;&nbsp;&nbsp;<span class=\"tiny\">".$uinfo['userpointsfaq']."</span></td></tr>\n";
}
if ($privmsgactive && $istheuser) {
echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._YA_BWOPMSG.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['contpm']."</td></tr>\n";
}
if ($gbactiv && $uinfo['gbnewentries'] && $istheuser){ # falls gaestebuch vorhanden und der User selbst
echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._GUESTBOOKVIEW.":</b></td><td bgcolor=\"$bgcolor3\"><b>".$uinfo['gbnewentries']."</b> "._YA_BWOPMSGUNREAD." *</td></tr>\n";
}
echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._USERSTATUS.":</b></td><td bgcolor=\"$bgcolor3\"><b>".$uinfo['online']."</b></td></tr>\n";
if (!empty($uinfo['lastonline'])) echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._YA_LASTONLINE.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['lastonline']."</td></tr>\n";
if (!empty($uinfo['usergroup']))  echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\"><b>"._YA_INGROUP.":</b></td><td bgcolor=\"$bgcolor3\">".$uinfo['usergroup']."</td></tr>\n";
echo "</table>";
if ($istheuser) {
echo "<br>* "._YA_ONLYYOUSEE."!<br>";
}

$clickuser sql_query("SELECT user_click FROM ".$user_prefix."_users WHERE uid=".$uinfo['uid']." LIMIT 1");
  $click sql_fetch_array($clickuser);
  echo 
"<center><strong>".$click[0]."</strong> Profilaufruf(e)<br /><br />\n";

if (mxIsAdmin()) {
echo "<br>[ <a href=\"admin.php?op=modifyUser&chng_uid=".$uinfo["uid"]."\">"._EDITUSER."</a> ]<br>";
}
echo "</font>";
echo "</center>";
CloseTable();
}
if (function_exists('viewuserinfo_option_2')) {
viewuserinfo_option_2($uinfo);
}
else {
// Usergaestebuch

// Nickpage
if (is_active("Nickpage")) {
/* Wenn Nickpagemodul AKTIV ...> Subroutine (sonst weiter in der Userinfo) */
$selnpdata mysql_query("select np_urlname, np_status from ".$prefix."_mynp_data where npuid='$uinfo[uid]'");
list($np_urlname$np_status) = mysql_fetch_row($selnpdata);
if ($np_urlname != "" && $np_status == 1) {
/* Wenn der User eine Page hat ...> weiter (sonst nichts machen) */
OpenTable();
echo "<center>";
echo "<a href=\"modules.php?name=Nickpage&file=nickpage&nick=$np_urlname\"><img src=\"images/menu/nickpage.gif\" border=\"0\"></a><br>";
echo "[ <a href=\"modules.php?name=Nickpage&file=nickpage&nick=$np_urlname\">Meine Nickpage ansehen</a> ]";
echo "</center>";
CloseTable();
}
/* Ende Link-Ausgabe */
}
/* Ende Nickpage - Routine */


if ($gbactiv && !$istheuser){
echo "<br>";
OpenTable();
echo "<center>";
echo "<a href=\"modules.php?name=UserGuest&op=view&touser=".$uinfo['uname']."\" alt=\"".$uinfo['uname'].""._GUESTBOOKPRIVMSG2."\" title=\"".$uinfo['uname'].""._GUESTBOOKPRIVMSG2."\"><img src=\"images/menu/guestbook.gif\" border=\"0\"></a><br>";
echo "[ <a href=\"modules.php?name=UserGuest&op=view&touser=".$uinfo['uname']."\">".$uinfo['uname'].""._GUESTBOOKPRIVMSG2."</a> ]";
echo "</center>";
CloseTable();
}
if (mxModuleAllowed("User_Fotoalbum") && !$istheuser){ # falls User Fotoalbum Modul vorhanden
echo "<br>";
OpenTable();
echo "<center>";
echo "<a href=\"modules.php?name=User_Fotoalbum&op=fotoview&uname=".$uinfo['uname']."\" alt=\"".$uinfo['uname'].""._FOTOALBUM."\" title=\"".$uinfo['uname'].""._GUESTBOOKPRIVMSG2."\"><img src=\"images/menu/fotoalbum.gif\" border=\"0\"></a><br>";
echo "[ <a href=\"modules.php?name=User_Fotoalbum&op=fotoview&uname=".$uinfo['uname']."\">".$uinfo['uname'].""._FOTOALBUM."</a> ]";
echo "</center>";
CloseTable();
}

if (mxModuleAllowed("JSM_Friendlist") && !$istheuser){
echo "<br>";
OpenTable();
echo "<center>";
echo "<a href=\"modules.php?name=JSM_friendlist&amp;op=addfriends&amp;friend=".$uinfo['uname']."\"><img src=\"images/menu/freunde.gif\" border=\"0\"></a><br>";
echo "<center>[ <a href=\"modules.php?name=JSM_friendlist&amp;op=addfriends&amp;friend=".$uinfo['uname']."\">".$uinfo['uname']." zur Freundesliste hinzufügen</a> ]</center>";
echo "</center>";
CloseTable();
}
// private Nachrichten
if ($privmsgactive) {
if (!$istheuser){
echo "<br>";
OpenTable();
echo "<center><br>";
$xuname = (mxIsUser() || mxIsAdmin()) ? $uinfo['uname'] : "";
echo
"<form action=\"modules.php\" method=\"post\">"
    ."<input type=\"hidden\" name=\"name\" value=\"Private_Messages\">"
    .""._USENDPRIVATEMSG.": <input type=\"text\" name=\"to_user\" size=\"20\" maxlength=\"25\" value=\"$xuname\">&nbsp;&nbsp;"
    ."<input type=\"hidden\" name=\"op\" value=\"send_to\">"
    ."<input type=\"submit\" name=\"submita\" value=\"Go\">"
    ."</form></center>";
CloseTable();
    }
}


// Listings
$result1 sql_query("select tid, sid, subject from ".$prefix."_comments where name='".intval($uinfo['uid'])."' order by tid DESC limit 0,10");
$view1 sql_num_rows($result1);

$result2 sql_query("select sid, title from ${prefix}_stories where informant='".mxAddSlashesForSQL($uinfo['uname'])."' AND `time` <= now() order by time DESC limit 0,10");
$view2 sql_num_rows($result2);

if (!empty($view1) || !empty($view2)){
echo "<br>";
OpenTable();
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
if ($view1){
echo "<td valign=\"top\"><b>"._LAST10COMMENTS." ".$uinfo['uname'].":</b><ul>";
while(list($tid$sid$subject) = sql_fetch_row($result1)) {
echo "<li><a href=\"modules.php?name=News&file=article&thold=-1&mode=flat&order=0&sid=$sid#$tid\">$subject</a><br>";
}
echo "</ul></td>";
}
if ($view2){
echo "<td valign=\"top\"><b>"._LAST10SUBMISSIONS." ".$uinfo['uname'].":</b><ul>";
while(list($sid$title) = sql_fetch_row($result2)) {
echo "<li><a href=\"modules.php?name=News&file=article&sid=".$sid."\">".$title."</a><br>";
}

echo "</ul></td>";
}
echo "</tr></table>";

CloseTable();

}
}
include("footer.php");
}


#viewuserinfo($uinfo);

?>



So und dort, wo ausgegeben wird, was der betreffende User zuletzt geschrieben hat, soll vorher (von mir aus auch anschließend) der Code hin, wer das Profil zuletzt aufgerufen hat. Aber wenn ich den beispielsweise hinter das letzte CloseTable(); einfüge, erhalte ich die Fehlermeldung wie weiter oben beschrieben.

JoergK

Ooops ... my fault  :-[

Am Ende der vorletzten Ausgabezeile von Schritte 4
echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\">&nbsp;</td><td bgcolor=\"$bgcolor3\" width=\"15%\">"

fehlt nen ;, korrekt müßte die also heissen:
echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\">&nbsp;</td><td bgcolor=\"$bgcolor3\" width=\"15%\">\n";

Peinlich, peinlich ... hatte mir ne Textdatei mit der Anleitung getippert und wohl da den Fehler mit reinkopiert  :-[

Fallste die Ausgabe als Unterstes haben möchtest, packste den Code besser da hin:
CloseTable();

}
}
     # Hier den Code für die letzten Besucher  einbauen
include("footer.php");
}


#viewuserinfo($uinfo);

?>


Mit der Korrektur sollte es dann funzen  ;)
Gruß,
Jörg


Nobody is perfect ... so don't call me Nobody

JermaineBelgardio

Jau, klappt. Ich danke! :)

JoergK

No prob, it's my pleasure  8)
Gruß,
Jörg


Nobody is perfect ... so don't call me Nobody

Musicman75

#71
wie kann man das denn abändern, damit die letzten 10 user angezeigt werden, unabhängig, wann sie auf dem profil waren und dann aber immer nur jeder username einmal, auch wenn der user mehrmals auf dem profil war.
Unaufgeforderte Support PMs & Emails werden ignoriert

Immer erst die Boardsuche verwenden und gegebenenfalls einen neuen Threat eröffnen, wenn das Problem noch nicht behandelt wurde!

tuningcar

Nach langem testen ( ich arbeite mit der userfunktions_options ) funktioniert es soweit das in die Datenbank ind der user_visit Daten eingetragen werden .  :thumbup:

Aber leider wird bei mir nichts angezeigt obwohl ich das das eingebaut habe :

#################################################
function VWGetSexusString($sexus = 0){
   $sexus = (empty($sexus)) ? 0 : (int)$sexus;
   switch ($sexus) {
     case 0: $out = mxCreateImage("images/nogender.gif", _YA_MALE); break;
     case 1: $out = mxCreateImage("images/f.gif", _YA_FEMALE); break;
     case 2: $out = mxCreateImage("images/m.gif", _YA_MALE); break;
   }
   return $out;
}

function mxdynatime(){
   $jetzt=time();
   $today = date("Ymd", time());
   $year = substr($today,0,4);
   $month = substr($today,4,2);
   $day = substr($today,6,2);
   $endetag=mktime(23,59,59,$month,$day,$year);
   $laufzeit=($endetag-$jetzt);
   return $laufzeit;
}

ob_start();
$time = mxdynatime();
if(!empty($_COOKIE["Profilaufruf".$uname.""])) {
   echo"";
}else {
   $cookie = mxGetUserSession();
   if ($cookie[1] != $uname) {
     $deltime = time() - 60*60*24*2;
     sql_query("DELETE FROM ".$user_prefix."_users_visit WHERE time < '$deltime'");
     sql_query("UPDATE ".$user_prefix."_users SET user_click=user_click+1 where uname='$uname'");
     sql_query("INSERT INTO ".$user_prefix."_users_visit (uid, vuid, time) VALUES ('".$uinfo['uid']."', '".$cookie[0]."', '".time()."')");
   }
   setcookie("Profilaufruf".$uname."","Profilaufruf",time()+$time);
}


was kann da noch sein ?

Fehlermeldungen sind keine  :-\

NeMeSiSX2LC

Da fehlt der ausgabe code
CMS-Version: pragmaMx 0.1.8, 1.20.4.5/2006-03-10     
PHP-Version: 5.1.2
MySQL-Version: 5.0.15-max-log
Server-Version: Apache/2.0.55
phpMyAdmin-Version: 2.7.0-pl1

tuningcar

Ich Depp  ::)

Habe ich vergessen zum reinschreiben , den habe ich auch eingefügt :

OpenTable();
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" bgcolor=\"$bgcolor1\">\n";
$visituser = sql_query("SELECT uid, vuid, time FROM ".$user_prefix."_users_visit WHERE uid=".$uinfo['uid']." ORDER BY time DESC LIMIT 10");
if ($click[0] != 0){
   echo"<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\"><b>Die letzten 10 Besucher:</b></td>\n";
   echo "<td bgcolor=\"$bgcolor3\">&nbsp;</td><td bgcolor=\"$bgcolor3\">&nbsp;</td>\n";
   while($visit = sql_fetch_array($visituser)){
     $sqluser = sql_fetch_array(sql_query("SELECT * FROM ".$user_prefix."_users WHERE uid=".$visit['vuid'].""));
     $visit['time'] = date ("d.m.Y H:i", $visit['time']);
     if (!empty($sqluser['uname'])){
       echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\">&nbsp;</td><td bgcolor=\"$bgcolor3\" width=\"15%\">\n";
       echo "".VWGetSexusString($sqluser['user_sexus'])."<a href=\"modules.php?name=Userinfo&uname=".$sqluser['uname']."\">".$sqluser['uname']."</a></td>\n";
       echo "<td bgcolor=\"$bgcolor3\">".$visit['time']."</td></tr>\n";
     }else{
       echo "<tr valign=\"top\"><td bgcolor=\"$bgcolor2\" width=\"30%\">&nbsp;</td><td bgcolor=\"$bgcolor3\" width=\"15%\">\n";
       echo "".VWGetSexusString($sqluser['user_sexus'])." Gast</td><td bgcolor=\"$bgcolor3\">".$visit['time']."</td></tr>\n";
     }
   }
}
echo "</table>";
CloseTable();


@ NeMeSiSX2LC , hast mal wieder lust meine userfunktions_options Anzusehen ?

Is ja nicht das erste mal   ::)

NeMeSiSX2LC

in den globals an anfang der function steht auch $user_prefix mit drin??
CMS-Version: pragmaMx 0.1.8, 1.20.4.5/2006-03-10     
PHP-Version: 5.1.2
MySQL-Version: 5.0.15-max-log
Server-Version: Apache/2.0.55
phpMyAdmin-Version: 2.7.0-pl1

tuningcar

#76
ja , steht drin   :(

hast pm  ;D

Edit ***


sollte nicht  in der Datenbank bei user_visit in uid was drinstehen , da steht bei mir nur 0 :

  id      uid      vuid      time
Ändern Löschen 5 0 4 1111759372
Ändern Löschen 6 0 4 1111759463
Ändern Löschen 7 0 4 1111759471
Ändern Löschen 8 0 4 1111759622
Ändern Löschen 9 0 476 1111759796
Ändern Löschen 10 0 0 1111760825
Ändern Löschen 11 0 476 1111765860
Ändern Löschen 12 0 4 1111767899
Ändern Löschen 13 0 0 1111769819
Ändern Löschen 14 0 4 1111770064
Ändern Löschen 15 0 4 1111770070
Ändern Löschen 16 0 0 1111772646
Ändern Löschen 17 0 569 1111772774
Ändern Löschen 18 0 2 1111772801
Ändern Löschen 19 0 569 1111772830
Ändern Löschen 20 0 569 1111772847
Ändern Löschen 21 0 4 1111774041

JoergK

Wenn nen Gast ein Profil aufgerufen hat, dann steht da ne "0" drin.
Gruß,
Jörg


Nobody is perfect ... so don't call me Nobody

NeMeSiSX2LC

Äh halt warum lasst ihr überhaupt zu das gäste da rein kommen?? regelt doch mit mxIsUser() das nur Mitglieder da drin sind.

Das mit den Gästen macht nur dann sinn wenn ihr die Profilaufrufe auch über diese Tabelle errechnen wollt.
CMS-Version: pragmaMx 0.1.8, 1.20.4.5/2006-03-10     
PHP-Version: 5.1.2
MySQL-Version: 5.0.15-max-log
Server-Version: Apache/2.0.55
phpMyAdmin-Version: 2.7.0-pl1

Liu-Kang

Da muß ich NeMeSiSX2Lc recht geben. Die Gäste sind in dieser Liste nicht sonderlich interessant.
Wie würde der Code dann lauten?