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,970
  • Latest: bynw
Stats
  • Total Posts: 196,047
  • Total Topics: 21,336
  • Online today: 374
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 191
  • Total: 192
  • @rjen

Fixing a Problem with Stats

Started by haktanir, March 03, 2007, 04:46:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

haktanir

Okay I had to delete a bunca of messages from a forum, but later wanted to show the messages total as the one before the deletions.

From the SMF forum, I found out that if I add:
$context['num_posts'] += 20000;
where 20000 is the number of posts I want to be added to what it currently shows, then I get the correct one.

However, when I look at the TP Stats block on the left menu, I see that the number is updated only when I got to the Stats page. On any other page, I see the old number of posts.

Could anyone help me tweak TP Stats block to show the updated one on each page?

G6Cad

Im not sure how to do that, i think the number of posts are fetched from the DB, but you can chek the Tportalblocks.php in the sources directory and see if and what the calls for the members could be for TP

akulion

yup theoritically u can add it as a mathematical function to the Tportalblocks.php where the stats block is defined

khoking


haktanir

Quote from: khoking on March 04, 2007, 12:50:47 PM
hmm...cheating? :P
No because my Monthly Summary shows the correct statistics. I'm jst trying to make the forum total match that.

JPDeni

There's two ways that you can do this.

The first way is to go into the database itself (via phpMyAdmin, or however else you access your database) and find the smf_settings table. Look for totalMessages in the "variable" column. Edit the record and add 20000 to the value in the "value" column.

The second way is to open Load.php (in your Sources directory). After


while ($row = mysql_fetch_row($request))
$modSettings[$row[0]] = $row[1];
mysql_free_result($request);


add


$modSettings['totalMessages'] += 20000;


Either way, you'll want to remove the code you added in Stats.php.

haktanir

Thank you very much. :)

I had already tried the first method you mentioned, that does not work for me as after some period of time, the statistics go back to the old one.

But the second method has worked. :)

G6Cad

Glad to see you sorted it out in the end :)
Please post the answer on SMF in your post there to, it can be good for them to know to if some one else wants the same thing some time :)

JPDeni

Quoteafter some period of time, the statistics go back to the old one.
Ah. The script must recount the number of posts from time to time. Good to know.

Glad I was able to help. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.