ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10992


Ignore:
Timestamp:
Mar 11, 2009, 3:03:42 PM (11 years ago)
Author:
nakasone
Message:

#2099:1日あたりのメッセージ数を管理画面に表示する機能の取り込み

Location:
OpenPNE/trunk/webapp/modules/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/modules/admin/lib/smarty_plugins/function.t_assign_sns_info.php

    r6527 r10992  
    2525        'info_diary_count_today' => _getDiaryCountToday(),
    2626        'info_diary_count_yesterday' => _getDiaryCountYesterday(),
     27        'info_message_count_today' => _getMessageCountToday(),
     28        'info_message_count_yesterday' => _getMessageCountYesterday(),
    2729    );
    2830
     
    107109}
    108110
     111/**
     112 * 今日のメッセージ件数
     113 */
     114function _getMessageCountToday()
     115{
     116    $today = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d'), date('Y')));
     117
     118    $sql = 'SELECT COUNT(*) FROM c_message WHERE r_datetime >= ?';
     119    $params = array($today);
     120    return db_get_one($sql, $params);
     121}
     122
     123/**
     124 * 前日のメッセージ件数
     125 */
     126function _getMessageCountYesterday()
     127{
     128    $yesterday = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')));
     129    $today = date('Y-m-d H:i:s', mktime(0, 0, 0, date('m'), date('d'), date('Y')));
     130
     131    $sql = 'SELECT COUNT(*) FROM c_message WHERE r_datetime >= ? AND r_datetime < ?';
     132    $params = array($yesterday, $today);
     133    return db_get_one($sql, $params);
     134}
     135
    109136?>
  • OpenPNE/trunk/webapp/modules/admin/templates/inc_dashboard.tpl

    r8385 r10992  
    1515    <dt>今日の({$WORD_DIARY})数</dt>
    1616    <dd>({$sns_info.info_diary_count_today|number_format})件 (前日({$sns_info.info_diary_count_yesterday|number_format})件)</dd>
     17    <dt>今日のメッセージ数</dt>
     18    <dd>({$sns_info.info_message_count_today|number_format})件 (前日({$sns_info.info_message_count_yesterday|number_format})件)</dd>
    1719</dl>
    1820            </div>
Note: See TracChangeset for help on using the changeset viewer.