/[gentoo-src]/gentoo-stats/stats.inc.php
Gentoo

Diff of /gentoo-stats/stats.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.3
2/** 2/**
3 * Gentoo stats 3 * Gentoo stats
4 * Written by Meir Kriheli <mksoft@gentoo.org> 4 * Written by Meir Kriheli <mksoft@gentoo.org>
5 * Based on gentoo-stats by Maik Schreiber <blizzy@gentoo.org> 5 * Based on gentoo-stats by Maik Schreiber <blizzy@gentoo.org>
6 * 6 *
7 * $Id: stats.inc.php,v 1.2 2003/04/29 14:30:55 mksoft Exp $ 7 * $Id: stats.inc.php,v 1.3 2003/04/29 16:26:14 mksoft Exp $
8 * 8 *
9 * vim: set tabstop=4 shiftwidth=4: 9 * vim: set tabstop=4 shiftwidth=4:
10 */ 10 */
11 11
12/********** Config section *****************/ 12/********** Config section *****************/
17$db_pass = 'a45fgt34'; 17$db_pass = 'a45fgt34';
18 18
19// numbers of days considering the user is active 19// numbers of days considering the user is active
20$active_days = 14; 20$active_days = 14;
21$max_accepted_cpu_mhz = 4000; 21$max_accepted_cpu_mhz = 4000;
22$bar_width = 250;
22 23
23/********** End of config section **********/ 24/********** End of config section **********/
24 25
25require_once('DB.php'); 26require_once('DB.php');
26require_once('Smarty.class.php'); 27require_once('Smarty.class.php');
112 } 113 }
113 else { 114 else {
114 return false; 115 return false;
115 } 116 }
116} 117}
118
119function getKnownProfilesCount() {
120 global $db,$active_days;
121
122 $sql= "SELECT count(*) FROM t_users WHERE (pr_id IS NOT NULL) AND (u_last_update IS NOT NULL) " .
123 "AND (TO_DAYS(NOW()) - TO_DAYS(u_last_update) <= $active_days)";
124
125 $totalUsers = $db->getOne($sql);
126
127 if (!DB::isError($totalUsers)) {
128 return $totalUsers;
129 }
130 else {
131 return false;
132 }
133}
134
117?> 135?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20