Erweiterte Statistik

Helmchen
Hack Name: Erweiterte Statistik
Hack Ersteller: Helmchen
Forenversion: WBB 2.3
Getestet mit: wbb 2.3.6

Beschreibung:
Die Statistik wird um folgende Punkte erweitert:
- Anzahl der Beiträge pro Mitglied
- Anzahl gesperter und nicht freigeschalteter Benutzer
- Anzahl der Männl u. Weibl Benutzer, sowie anzahl der Benutzer ohne Angabe

Damit die Statistik sichtbar ist, muss sie ganz normal vorher im ACP aktiviert werden !


Copyright ist denke ich klar ...
-> ansonsten siehe Readme ^^


Have a nice day everyone ^_^
----


weiter zum Download
golf3forum.de
habe kein Template was sich index_stats schimpft habe die version 2.3.5 gibt es die erst mit der Version 2.3.6???

MfG

Marcel
Helmchen
sry XD
ist das normale index template XD
Hab das bei der Anpassung übersehen Augenzwinkern
golf3forum.de
ne das hat nicht geklappt

jetzt sieht es so aus habe alles so eingebaut wie du es nach der Anleitung geschrieben hast
Helmchen
häng mal den Inhalt deines index templates in net textdatei an...
Da bin ich ja gespannt ... XD
Habs ja auch in meinem Forum eingabut .... XD
golf3forum.de
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
<?xml version="1.0" encoding="{$lang->items['LANG_GLOBAL_ENCODING']}"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{$lang->items['LANG_GLOBAL_DIRECTION']}" lang="{$lang->items['LANG_GLOBAL_LANGCODE']}" xml:lang="{$lang->items['LANG_GLOBAL_LANGCODE']}">
<head>
<title>$master_board_name | {$lang->items['LANG_START_TITLE']}</title>
$headinclude
</head>

<body>
 $header
<table cellpadding="{$style['tableincellpadding']}" cellspacing="{$style['tableincellspacing']}" border="{$style['tableinborder']}" style="width:{$style['tableinwidth']}" class="tableinborder">
 <if($wbbuserdata['userid']==0)>
  <then>
   <tr>
    <td class="tablea" align="left"><span class="normalfont"><b>{$lang->items['LANG_START_WELCOME_TITLE']}</b></span></td>
   </tr>
   <tr>
    <td class="tableb" align="left" style="text-align: justify"><span class="smallfont">{$lang->items['LANG_START_WELCOME']}</span></td>
   </tr>
  </then>
  <else>
   <tr>
    <td class="tablea"><table style="width:100%" cellspacing="0" cellpadding="0" border="0">
     <tr class="tablea_fc">
      <td align="left"><span class="smallfont">$timearea <b>$usercbar_username</b> <a href="logout.php?u=$wbbuserdata[userid]{$SID_ARG_2ND}">{$lang->items['LANG_START_LOGOUT']}</a><br /><b><a href="search.php?action=new{$SID_ARG_2ND}">{$lang->items['LANG_START_NEWPOSTS']} $lastvisitdate <span class="time">$lastvisittime</span>.</span></td>
      <td align="right"><span class="smallfont">{$lang->items['LANG_START_CURRENTTIME']} <span class="time">$currenttime</span>.<br />{$lang->items['LANG_START_TIMEZONE']}</span></td>
     </tr>           

    </table></td>
   </tr>
  </else>
 </if>


 
</table><br />
<table cellpadding="{$style['tableincellpadding']}" cellspacing="{$style['tableincellspacing']}" border="{$style['tableinborder']}" style="width:{$style['tableinwidth']}" class="tableinborder">
 <tr>
  <td class="tabletitle"><span class="smallfont">&nbsp;</span></td>
  <td class="tabletitle" style="width:<if($hide_modcell==0)><then>80</then><else>100</else></if>%" align="left"><span class="smallfont"><b>{$lang->items['LANG_START_BOARDS']}</b></span></td>
  <td class="tabletitle" align="center"><span class="smallfont"><b>{$lang->items['LANG_START_POSTS']}</b></span></td>
  <td class="tabletitle" align="center"><span class="smallfont"><b>{$lang->items['LANG_START_THREADS']}</b></span></td>
  <td class="tabletitle" align="center" nowrap="nowrap"><span class="smallfont"><b>{$lang->items['LANG_START_LASTPOST']}</b></span></td>
  <if($hide_modcell==0)><then><td class="tabletitle" style="width:20%" align="center"><span class="smallfont"><b>{$lang->items['LANG_START_MODERATORS']}</b></span></td></then></if>
 </tr>
 
 $boardbit
 
 <if($showuseronline==1)>
  <then>
<if($wbbuserdata['jgs_chat_admin_admin']=="1" || $wbbuserdata['jgs_chat_user_ein']=="1")><then>
<tr>
	<td class="tabletitle" colspan="<if($hide_modcell==0)><then>6</then><else>5</else></if>" align="left">
	<script type="text/javascript">
	<!--
	function BoardChat(url, width, height) {
		var Win = window.open(url,"Window$popup_erweiterung",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no,left=0,top=0' );
	}
	//-->
	</script>	
	<span class="smallfont"><a href="javascript:BoardChat('jgs_chat.php?sid=$session[hash]',800,600)"><b>{$lang->items['LANG_GLOBAL_JGSCHAT']}</b></a></span></td> 
</tr>
<tr>
	<td <if($gesamt_online_chat!="0")><then>rowspan="2"</then></if> class="tableb" align="center"><img src="{$style['imagefolder']}/online.gif" alt="" border="0" title="" /></td>
	<td colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" class="tablea" align="left"><span class="smallfont">{$lang->items['LANG_START_JGSCHATZURZEIT']} $ist_sind $gesamt_online_chat $erW {$lang->items['LANG_START_JGSCHATUNTERWEGS']}</span></td>
</tr>
<if($gesamt_online_chat!="0")><then>
<tr>
	<td class="tablea" colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" align="left"><span class="smallfont">$online_chat</span></td>
</tr>
</then></if>
</then></if>
   <tr>
    <td class="tabletitle" colspan="<if($hide_modcell==0)><then>6</then><else>5</else></if>" align="left"><span class="smallfont"><b><a href="wiw.php{$SID_ARG_1ST}">{$lang->items['LANG_START_SHOWUSERONLINE']}</a></b></span></td> 
   </tr>
   <tr>
    <td rowspan="2" class="tableb" align="center"><img src="{$style['imagefolder']}/online.gif" alt="" title="" /></td>
    <td colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" class="tablea" align="left"><span class="smallfont">{$lang->items['LANG_START_USERONLINE']}</span></td>
   </tr>
   <tr>
    <td class="tablea" colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" align="left"><span class="smallfont"><if($useronline=="")><then>&nbsp;</then></if>$useronline</span></td>
   </tr>	
  
  </then>
 </if>
  <if($showpmonindex==1 && $wbbuserdata['userid']!=0 && $wbbuserdata['can_use_pms']==1 && $wbbuserdata['receivepm']==1)>
  <then>
   <tr>
    <td class="tabletitle" align="left" colspan="<if($hide_modcell==0)><then>6</then><else>5</else></if>"><span class="smallfont"><b>{$lang->items['LANG_START_PM']}</b></span></td>
   </tr>
   <tr>
    <td align="center" class="tableb"><if($countnew>0)>
     <then><img src="{$style['imagefolder']}/on.gif" alt="{$lang->items['LANG_START_NEWPM']}" title="{$lang->items['LANG_START_NEWPM']}" /></then>
     <else><img src="{$style['imagefolder']}/off.gif" alt="{$lang->items['LANG_START_NONEWPM']}" title="{$lang->items['LANG_START_NONEWPM']}" /></else>
    </if></td>
    <td align="left" colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" class="tablea"><span class="smallfont"><b><a href="pms.php{$SID_ARG_1ST}">{$lang->items['LANG_START_PMIN']}</a></b><br />{$lang->items['LANG_START_PMS']}</span></td>
   </tr>  
  
  </then>
 </if>
 
 <if(isset($birthdaybit) || isset($eventbit))>
  <then>
   <tr>
    <td class="tabletitle" align="left" colspan="<if($hide_modcell==0)><then>6</then><else>5</else></if>"><span class="smallfont"><b>{$lang->items['LANG_START_SHOWEVENTS']}</b></span></td>
   </tr>
   
   <if(isset($birthdaybit))>
    <then>
     <tr>
      <td class="tableb" align="center"><img src="{$style['imagefolder']}/birthday.gif" alt="" title="" border="0" /></td>
      <td class="tablea" colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" align="left"><span class="smallfont"><b>{$lang->items['LANG_START_BIRTHDAY']}</b><br />$birthdaybit</span></td>
     </tr>
    </then>
   </if>
   
   <if(isset($eventbit))>
    <then>
     <tr>
      <td class="tableb" align="center"><img src="{$style['imagefolder']}/events.gif" alt="" title="" border="0" /></td>
      <td class="tablea" colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" align="left"><span class="smallfont"><b>{$lang->items['LANG_START_TODAYEVENT']}</b><br />$eventbit</span></td>
     </tr>
    </then>
   </if> 
  </then>
 </if>
 
 <if($showstats==1)>
  <then>
   <tr>
    <td class="tabletitle" align="left" colspan="<if($hide_modcell==0)><then>6</then><else>5</else></if>"><span class="smallfont"><a href="statsinfo.php{$SID_ARG_1ST}"><b>{$lang->items['LANG_START_STATISTIC']}</b></a></span></td> 
   </tr>
   <tr>
    <td class="tableb" align="center"><img src="{$style['imagefolder']}/stats.gif" alt="" border="0" /></td
    <td colspan="<if($hide_modcell==0)><then>5</then><else>4</else></if>" class="tablea" align="left"><span class="smallfont">{$lang->items['LANG_START_STATISTIC_MEMBERS']} $stats[usercount](darunter $gespuser&nbsp; und $na Benutzer) | {$lang->items['LANG_START_STATISTIC_THREADS']} $stats[threadcount] | {$lang->items['LANG_START_STATISTIC_POSTS']} $stats[postcount] ({$lang->items['LANG_START_STATISTIC_AVERAGE']} $postperday {$lang->items['LANG_START_STATISTIC_POSTPERDAY']})<br />
    {$lang->items['LANG_START_STATISTIC_NEWESTMEMBER']} <a href="profile.php?userid=$stats[lastuserid]{$SID_ARG_2ND}">$stats[username]</a>  | durchschnittlich $bu Beiträge pro Mitglied.<br>
    Von den Benutzern sind $gm männlich, $gw weiblich und $gka Benutzer haben dies nicht angeben.</span></td>
   </tr>
  </then>
 </if>
  
</table>

<if($wbbuserdata['userid']==0)>
 <then>
  <br /><a name="login" id="login"></a>
  <if($allowloginencryption==1)><then>
  <script type="text/javascript" src="js/sha1.js"></script>
  <script type="text/javascript" src="js/crypt.js"></script>
  </then></if>
  <form method="post" action="login.php" name="loginform"<if($allowloginencryption==1)><then> onsubmit="return encryptlogin(this);"</then></if>>
  <input type="hidden" name="send" value="send" />
  <input type="hidden" name="sid" value="$session[hash]" />
  <if($allowloginencryption==1)><then>
  <input type="hidden" name="authentificationcode" value="$session[authentificationcode]" />
  <input type="hidden" name="crypted" value="false" /></then></if>
  <table cellpadding="{$style['tableincellpadding']}" cellspacing="{$style['tableincellspacing']}" border="{$style['tableinborder']}" style="width:{$style['tableinwidth']}" class="tableinborder">
   <tr>
    <td class="tabletitle" align="left"><span class="smallfont"><b>{$lang->items['LANG_START_LOGIN']}</b></span></td> 
   </tr>
   <tr>
    <td class="tableb"><table cellpadding="0" cellspacing="5" align="center" class="tableb_fc">
     <tr>
      <td><span class="smallfont">{$lang->items['LANG_START_USERNAME']}</span></td>
      <td><span class="smallfont"><input type="text" name="l_username" maxlength="50" size="20" class="input" tabindex="1" />&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
      <td><span class="smallfont">{$lang->items['LANG_START_PASSWORD']} (<a href="forgotpw.php{$SID_ARG_1ST}">{$lang->items['LANG_START_LOSTPW']}</a>):</span></td>
      <td><span class="smallfont"><input type="password" name="l_password" maxlength="30" size="20" class="input" tabindex="2" />&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
	  <if($allowloginencryption==1)><then>
      <td><span class="smallfont"><label for="checkbox1">{$lang->items['LANG_GLOBAL_ENCRYPT_TRANSFER']}</label></span></td>
      <td><span class="smallfont"><input type="checkbox" id="checkbox1" name="activateencryption" onclick="activate_loginencryption(document.loginform);" />&nbsp;&nbsp;&nbsp;&nbsp;</span></td></then></if>
      <td><input type="submit" value="{$lang->items['LANG_START_LOGIN']}" class="input" tabindex="3" /></td>
     </tr>
    </table></td>
   </tr>
  </table></form>
  <if($allowloginencryption==1)><then>
  <script type="text/javascript">
   <!--
    activate_loginencryption(document.loginform);
   //-->
  </script></then></if>
 </then>
</if>

<table style="width:{$style['tableinwidth']}">
 <tr>
  <td align="right"><span class="smallfont"><a href="search.php?action=24h{$SID_ARG_2ND}">{$lang->items['LANG_START_CURRENT_THREADS']}</a> | <a href="rules.php{$SID_ARG_1ST}">{$lang->items['LANG_RULES_TITLE_LINK']}</a> | <a href="search.php?action=polls{$SID_ARG_2ND}">{$lang->items['LANG_START_CURRENT_POLLS']}</a> | <a href="markread.php{$SID_ARG_1ST}">{$lang->items['LANG_START_MARKREAD_ALL']}</a><if($show_archive == 1)><then> | <b><a href="archive/index.html">{$lang->items['LANG_START_ARCHIVE']}</a></b> | <a href="impressum.php">Impressum</a></then></if></span></td>
 </tr>
</table><br />
<table>
 <tr align="center">
  <td><img src="{$style['imagefolder']}/on.gif" alt="{$lang->items['LANG_START_NEW_POSTS']}" title="{$lang->items['LANG_START_NEW_POSTS']}" border="0" /></td>
  <td><span class="smallfont">{$lang->items['LANG_START_NEW_POSTS']}&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
  <td><img src="{$style['imagefolder']}/off.gif" alt="{$lang->items['LANG_START_NONEW_POSTS']}" title="{$lang->items['LANG_START_NONEW_POSTS']}" border="0" /></td>
  <td><span class="smallfont">{$lang->items['LANG_START_NONEW_POSTS']}&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
  <td><img src="{$style['imagefolder']}/offclosed.gif" alt="{$lang->items['LANG_START_BOARD_CLOSED']}" title="{$lang->items['LANG_START_BOARD_CLOSED']}" border="0" /></td>
  <td><span class="smallfont">{$lang->items['LANG_START_BOARD_CLOSED']}&nbsp;&nbsp;&nbsp;&nbsp;</span></td>
  <td><img src="{$style['imagefolder']}/link.gif" alt="{$lang->items['LANG_START_BOARD_LINK']}" title="{$lang->items['LANG_START_BOARD_LINK']}" border="0" /></td>
  <td><span class="smallfont">{$lang->items['LANG_START_BOARD_LINK']}</span></td>
 </tr>
</table>

$footer
</body>
</html>
draXyde
bei mir funktioniert der hack auch einwandfrei hatte mich erst auch nur
gefragt (index_stat) ^^
aber mit nen bisschen hilft man sich in dem board schnell aus Augenzwinkern

Nen super Hack ein a das Teil weiter so Augenzwinkern
Fishy64
Posts pro user da wird die Kommastelle als Punkt angezeigt was leicht irretiert, denn der punkt ist allgemein als 100er markierung. Wie kann ich daraus nun ein Komma machen als

ø 43.51 Beiträge pro Mitglied soll so angezeigt werden ø 43,51 Beiträge pro Mitglied

bisherige versuche scheiterten, hab lediglich von 3 auf 2 Stellen nach dem Komma reduziert
Helmchen
Versuchs mal spaßenshalber mit str_replace

also ersetze:

code:
1:
2:
3:
 $posts2 = $db->query_first("SELECT COUNT(postid) AS posts FROM bb".$n."_posts");


durch:

code:
1:
2:
3:
4:
 $posts2 = $db->query_first("SELECT COUNT(postid) AS posts FROM bb".$n."_posts");
$post2 = str_replace(".",",",$post2);


Habs net getestet, aber ne andere Variante fällt mir im mom auch net ein großes Grinsen
Fishy64
geht damit auch nicht, leider
nanox_1
fuzt einwandfrei

nur würde ich gerne hinterMitglieder: 19 noch nen leerzeichen haben wollen
und bei 9.316 Beiträge das man das nur 2 stellig macht zb. in diesen fall 9,3 Beiträge

Mitglieder: 19(darunter 0 gesperrte und 0 nicht freigeschaltete Benutzer) | Themen: 121 | Beiträge: 189 (durchschnittlich 15,42 Beiträge/Tag)
Unser neuestes Mitglied heißt: Horst | durchschnittlich 9.316 Beiträge pro Mitglied.
Von den Benutzern sind 3 männlich, 0 weiblich und 16 Benutzer haben dies nicht angeben.
Fishy64
habe nun die Lösung für mein problem gefunden um aus dem Punkt ein Komma zu machen:

code:
1:
$bu=sprintf("%.2f",$anzahlposts / $anzahluser);


darunter:

code:
1:
$bu = str_replace(".",",",$bu);
nanox_1
danke

leerzeichen habsch auch gefunden wo

so in der TPL
$stats[usercount] (darunter $gespuser&nbsp; und $na Benutzer) |
Lerena
Zitat:
Original von golf3.de
ne das hat nicht geklappt

jetzt sieht es so aus habe alles so eingebaut wie du es nach der Anleitung geschrieben hast


gibts dafür schon eine lösung? hab das problem nämlich auch. FF zeigts korrekt an. nur IE nicht.

edit: Fehler gefunden. helmchen hat wohl vergessen ein tr zu schließen.

suche in de rindex.tpl:

<td class="tableb" align="center"><img src="{$style['imagefolder']}/stats.gif" alt="" border="0" />

und ersetze dahinter das </td

durch

</td>

fertisch... großes Grinsen
Crash75
Hab noch ein drittes Geschlecht eingefügt, wie bekomme ich das hin, das es auch angezeigt wird.

$gwfrage = $db->query("SELECT gender FROM bb".$n."_users WHERE gender='3'");
$gt=mysql_num_rows($gtfrage);

hab das eingefügt und in der index.tpl

, $gt Teenager aber es wird leider keine anzahl angezeigt!
Ghostmaster
Die User müssen dieses Geschlecht auch irgendwo wählen können. Augenzwinkern Können sie das? Wenn nicht, wird es auch schwer einen Wert auszugeben.
Crash75
Das ist alles erledigt, die können das wählen. Habe drei User die das Geschlecht haben.

Aber es wird nicht angezeigt.

schau selber

www.nrwfamilien.de

Da steht 60 Mama´s, 16 Papa´s, Teenager und 0 haben dies Angebeben.
Ghostmaster
Probier das hier mal:
code:
1:
2:
3:
$gtfrage = $db->query("SELECT gender FROM bb".$n."_users WHERE gender='3'");
$gt=mysql_num_rows($gtfrage);
Crash75
ups hab nen gw nicht in gt geändert, ich bin doch eine schäle einbahnstraße. danke
Ghostmaster
Hab den Fehler auch erst zufällig gesehen. Irre
Kein Problem. Augenzwinkern