Changeset 6579

Show
Ignore:
Timestamp:
06/22/10 23:01:47 (3 years ago)
Author:
nikrou
Message:

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

Location:
branches/2.1
Files:
5 modified

Legend:

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

    r6464 r6579  
    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 
  • branches/2.1/include/dblayer/functions_mysql.inc.php

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

    r6464 r6579  
    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{ 
  • branches/2.1/include/dblayer/functions_pgsql.inc.php

    r6511 r6579  
    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{ 
  • branches/2.1/include/dblayer/functions_sqlite.inc.php

    r6464 r6579  
    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{