number of threads from 24h
duhol Offline
Junior Member
**
Posts: 34
Joined: Mar 2011
Post: #1
number of threads from 24h
Hi
How to get number of threads wrote from 24 hours?
THX
10-09-2011 03:48 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: number of threads from 24h
I think you'll find the similar (not exactly the same) method in today's top poster in stats.php

10-09-2011 05:20 AM
Find all posts by this user Quote this message in a reply
duhol Offline
Junior Member
**
Posts: 34
Joined: Mar 2011
Post: #3
RE: number of threads from 24h
Could you help me to change that code. I'm not good in this Smile
10-09-2011 08:00 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: number of threads from 24h
The number of threads created today can be found in the AdminCP home.

My Blog
10-09-2011 08:36 AM
Find all posts by this user Quote this message in a reply
duhol Offline
Junior Member
**
Posts: 34
Joined: Mar 2011
Post: #5
RE: number of threads from 24h
i have something like this, but it give me new threads from midnight Ouch

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
		$last_dateline = 0;
		$start_dateline = TIME_NOW-(60*60*24*30);
		$end_dateline = TIME_NOW;

	
	$query = $db->simple_select("stats", "*", "dateline >= '".intval($start_dateline)."' AND dateline <= '".intval($end_dateline)."'", array('order_by' => 'dateline', 'order_dir' => 'asc'));
	while($stat = $db->fetch_array($query))
	{
		if($last_dateline)
		{
			$stat['change_threads'] = ($stat['numthreads'] - $stats[$last_dateline]['numthreads']);
			$threads_a_day = my_number_format($stat['change_threads']);
		}
		$stats[$stat['dateline']] = $stat;
		
		$last_dateline = $stat['dateline'];
	}

10-09-2011 05:50 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: number of threads from 24h
You need to select a count() from the threads table, not the stats table.
Also I think 60*60*24*30 gives you 1 month, not 1 day.

My Blog
10-09-2011 08:22 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #7
RE: number of threads from 24h
(10-09-2011 08:36 AM)ZiNgA BuRgA Wrote:  The number of threads created today can be found in the AdminCP home.

Ugh... How stupid I am to not thinking about that page, Yumi Oops

10-10-2011 01:26 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: number of threads from 24h
No-one ever looks at the ACP home, lol.

My Blog
10-10-2011 08:38 AM
Find all posts by this user Quote this message in a reply
duhol Offline
Junior Member
**
Posts: 34
Joined: Mar 2011
Post: #9
RE: number of threads from 24h
Could you help me to modify that code to get number of threads
(the same number when i click - misc.php?action=getdaily) Smile
10-11-2011 03:16 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #10
RE: number of threads from 24h
You can find the query in admin_folder/modules/home/index.php file.
Where do you want it to be displayed?

10-11-2011 03:54 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: