Changeset 6464


Ignore:
Timestamp:
Jun 4, 2010, 9:39:02 PM (10 years ago)
Author:
nikrou
Message:

Bug 1717 fixed : SQLite: access failure on Admin > Tools > History
hour function doesn't exists
Merge from trunk.

Location:
branches/2.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/admin/stats.php

    r6364 r6464  
    117117SELECT
    118118    date,
    119     HOUR(time) AS hour,
     119    hour(time) AS hour,
    120120    MAX(id) AS max_id,
    121121    COUNT(*) AS nb_pages
     
    123123  WHERE summarized = \'false\'
    124124  GROUP BY
     125    date,
     126    hour
     127  ORDER BY
    125128    date ASC,
    126     HOUR(time) ASC
     129    hour ASC
    127130;';
    128131$result = pwg_query($query);
  • branches/2.1/include/dblayer/functions_pdo-sqlite.inc.php

    r6342 r6464  
    4747
    4848  $link->sqliteCreateFunction('now', 'pwg_now', 0);
     49  $link->sqliteCreateFunction('hour', 'pwg_hour', 1);
    4950  $link->sqliteCreateFunction('unix_timestamp', 'pwg_unix_timestamp', 0);
    5051  $link->sqliteCreateFunction('md5', 'md5', 1);
     
    571572}
    572573
     574function pwg_hour($datetime)
     575{
     576  return strftime('%H', $datetime);
     577}
     578
    573579function pwg_unix_timestamp()
    574580{
  • branches/2.1/include/dblayer/functions_sqlite.inc.php

    r6342 r6464  
    5656
    5757  $link->createFunction('now', 'pwg_now', 0);
     58  $link->createFunction('hour', 'pwg_hour', 1);
    5859  $link->createFunction('unix_timestamp', 'pwg_unix_timestamp', 0);
    5960  $link->createFunction('md5', 'md5', 1);
     
    583584}
    584585
     586function pwg_hour($datetime)
     587{
     588  return strftime('%H', $datetime);
     589}
     590
    585591function pwg_unix_timestamp()
    586592{
Note: See TracChangeset for help on using the changeset viewer.