TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 01:26:02 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 46
  • Total: 46

statistik block erweitern

Started by whitesox, May 13, 2009, 09:58:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

whitesox

ok poste das hier mal im deutschen forum (sry wenn ich das im englishen schon gepostet habe):

ich möchte gerne im statistikblock abfragen wieviele posts HEUTE geschrieben wurden. wie stell ich das codemässig am besten an ?

thx

cx_one

Also ganz so einfach wie ich zuerst gedacht hatte ist es nicht.

Hab mal eine Quick & Dirty Lösung gebastelt.

Datei: Sources/TPortal.php nach if($show)
{
// some tests to minimize sql calls
ca. Zeile 540 bei SMF1.1.9 TP1.0beta4
if($row['type'] == 3)
{
    require_once 'Stats.php';
    getDailyStats('YEAR(date) = '.date('Y').' AND MONTH(date) IN ('.date('n').') AND DAY(date) IN ('.date('j').')');
}

einfügen.

Datei: Themes/default/TPBlocks.template.php nach if(isset($context['TPortal']['userbox']['stats_all']))
// more stats
echo '
<h5 class="stats"><a href="'.$scripturl.'?action=stats">'.$txt['tp-stats'].'</a></h5>
<ul>
<li>'. $txt[489].': '.$modSettings['totalMessages']. '</li>
<li>'. $txt[490].': '.$modSettings['totalTopics']. '</li>
ca. Zeile 840 bei SMF1.1.9 TP1.0beta4
<li>Today Posts: '.$context['monthly'][date('Ym')]['days'][0]['new_posts']. '</li>
einfügen. "Today Posts" musst noch durch einen passenden deutschen Ausdruck ersetzten.


Keine schöne Lösung aber sollte funktionieren.