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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,985
  • Total Topics: 21,321
  • Online today: 814
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 1092
  • Total: 1093
  • @rjen

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.


This website is proudly hosted on Crocweb Cloud Website Hosting.