Changeset 6578


Ignore:
Timestamp:
Jun 22, 2010, 11:01:05 PM (14 years ago)
Author:
nikrou
Message:

Bug 1738 fixed : hour function doesn't exists for database other than mysql.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/stats.php

    r6463 r6578  
    117117SELECT
    118118    date,
    119     hour(time) AS hour,
     119    '.pwg_db_get_hour('time').' AS hour,
    120120    MAX(id) AS max_id,
    121121    COUNT(*) AS nb_pages
  • trunk/include/dblayer/functions_mysql.inc.php

    r5982 r6578  
    581581}
    582582
     583function pwg_db_get_hour($date)
     584{
     585  return 'hour('.$date.')';
     586}
     587
    583588function pwg_db_get_date_YYYYMM($date)
    584589{
  • trunk/include/dblayer/functions_pdo-sqlite.inc.php

    r6463 r6578  
    4747
    4848  $link->sqliteCreateFunction('now', 'pwg_now', 0);
    49   $link->sqliteCreateFunction('hour', 'pwg_hour', 1);
    5049  $link->sqliteCreateFunction('unix_timestamp', 'pwg_unix_timestamp', 0);
    5150  $link->sqliteCreateFunction('md5', 'md5', 1);
     
    503502}
    504503
     504function pwg_db_get_hour($date)
     505{
     506  return 'strftime(\'%H\', '.$date.')';
     507}
     508
     509
    505510function pwg_db_get_date_YYYYMM($date)
    506511{
     
    572577}
    573578
    574 function pwg_hour($datetime)
    575 {
    576   return strftime('%H', $datetime);
    577 }
    578 
    579579function pwg_unix_timestamp()
    580580{
  • trunk/include/dblayer/functions_pgsql.inc.php

    r6510 r6578  
    545545}
    546546
     547function pwg_db_get_hour($date)
     548{
     549  return 'EXTRACT(HOUR FROM '.$date.')';
     550}
     551
    547552function pwg_db_get_date_YYYYMM($date)
    548553{
  • trunk/include/dblayer/functions_sqlite.inc.php

    r6463 r6578  
    5656
    5757  $link->createFunction('now', 'pwg_now', 0);
    58   $link->createFunction('hour', 'pwg_hour', 1);
    5958  $link->createFunction('unix_timestamp', 'pwg_unix_timestamp', 0);
    6059  $link->createFunction('md5', 'md5', 1);
     
    515514}
    516515
     516function pwg_db_get_hour($date)
     517{
     518  return 'strftime(\'%H\', '.$date.')';
     519}
     520
    517521function pwg_db_get_date_YYYYMM($date)
    518522{
     
    584588}
    585589
    586 function pwg_hour($datetime)
    587 {
    588   return strftime('%H', $datetime);
    589 }
    590 
    591590function pwg_unix_timestamp()
    592591{
Note: See TracChangeset for help on using the changeset viewer.