_feedapi_store_stat

Versions
6
_feedapi_store_stat($id, $type, $val, $timestamp, $time = NULL, $update = FALSE)

Store statistics information

Parameters

$id A numerical id

$type A string which describes what we want to store. This is an identifier, think of as a variable name

$val This is the variable value

$timestamp Timestamp for the value

$time Optional, a string equivalent to the $timestamp

$update Boolean, TRUE if you'd like to modify an existing entry in the stat table

▾ 1 function calls _feedapi_store_stat()

_feedapi_invoke_refresh in contributions/feedapi/feedapi.module
Helper function for feedapi_invoke(). Refresh the feed, call the proper parsers and processors' hooks. Don't call this function directly, use feedapi_refresh() instead.

Code

contributions/feedapi/feedapi.module, line 1543

<?php
function _feedapi_store_stat($id, $type, $val, $timestamp, $time = NULL, $update = FALSE) {
  if (!$time) {
    $time = date("Y-m-d H:i", $timestamp);
  }
  if ($update) {
    db_query("UPDATE {feedapi_stat} SET value = %d, timestamp = %d WHERE time = '%s' AND type = '%s' AND id = %d", $val, $timestamp, $time, $type, $id);
  }
  if (!$update || !db_affected_rows()) {
    db_query("INSERT INTO {feedapi_stat} (id, value, time, timestamp, type) VALUES (%d, %d, '%s', %d, '%s')", $id, $val, $time, $timestamp, $type);
  }
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.