function stats_get_log_count

7.x stats.module stats_get_log_count($action = "", $action_array = "", $bool_distinct = false, $start_date = '', $end_date = '', $bool_students = true, $bool_mobile_only = false)
6.x stats.module stats_get_log_count($action = "", $action_array = "", $bool_distinct = false, $start_date = '', $end_date = '', $bool_students = true, $bool_mobile_only = false)
4.x stats.module stats_get_log_count($action = "", $action_array = "", $bool_distinct = false, $start_date, $end_date, $bool_students = true, $bool_mobile_only = false)
5.x stats.module stats_get_log_count($action = "", $action_array = "", $bool_distinct = false, $start_date, $end_date, $bool_students = true, $bool_mobile_only = false)

Used by the use_summary report. This function will simply return log counts for the specified parameters in the watchdog table.

_array

Parameters

unknown_type $action:

unknown_type $bool_distinct:

unknown_type $start_date:

unknown_type $end_date:

unknown_type $bool_students:

unknown_type $bool_mobile_only:

Return value

unknown

1 call to stats_get_log_count()
stats_report_flightpath_use_summary in modules/stats/stats.module
This report shows common usages in FlightPath by all users.

File

modules/stats/stats.module, line 629
This module displays statistics and reports for FlightPath

Code

function stats_get_log_count($action = "", $action_array = "", $bool_distinct = false, $start_date, $end_date, $bool_students = true, $bool_mobile_only = false) 
 {

  $action_line = " `type` = '$action' ";
  if (count($action_array) > 1) 
   {
    $action_line = "";
    $action_line .= "( ";
    foreach ($action_array as $action) 
     {
      $action_line .= " `type`='$action' OR";
    }
    $action_line = substr($action_line, 0, -2);
    $action_line .= ") ";
  }

  $count = "count(wid)";
  if ($bool_distinct) 
   {
    $count = "count(distinct `user_id`)";
  }

  $user_type = "";
  if ($bool_students) 
   {
    $user_type = " `is_student` = '1' ";
  }
  else {
    $user_type = " `is_faculty` = '1' ";
  }

  if ($bool_mobile_only) {
    $action_line .= "  AND is_mobile = '1' ";
  }

  $start_ts = strtotime($start_date);
  $end_ts = strtotime($end_date);

  $res = db_query("SELECT $count AS count FROM watchdog
					WHERE
						`timestamp` > '$start_ts' AND `timestamp` < '$end_ts'
					AND $user_type
					AND
						$action_line
					");
  $cur = db_fetch_array($res);
  return $cur ["count"] * 1;


}