当前位置: 首页>>代码示例>>PHP>>正文


PHP AZLib::duration_time方法代码示例

本文整理汇总了PHP中AZLib::duration_time方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::duration_time方法的具体用法?PHP AZLib::duration_time怎么用?PHP AZLib::duration_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AZLib的用法示例。


在下文中一共展示了AZLib::duration_time方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: draw

 function draw()
 {
     global $display;
     $this->beginForm();
     $display->add('url_admin', Url::build_current());
     $display->add('msg', $this->showFormErrorMessages(1));
     if ($this->contact['name']) {
         $email = stripslashes($this->contact['name']) . " ";
     }
     if ($this->contact['address']) {
         $email .= "( " . stripslashes($this->contact['address']) . ") ";
     }
     $email .= '<a href="mailto:' . $this->contact['email'] . '"><font color=blue>' . $this->contact['email'] . "</font></a>";
     $display->add('email', $email);
     $display->add('date', date('H:i:s d/m/Y', $this->contact['time']));
     $display->add('date2', AZLib::duration_time($this->contact['time']));
     $display->add('content', stripslashes($this->contact['content']));
     $display->add('reply_content', stripslashes(Url::get('reply_content')));
     $display->add('subject', stripslashes(Url::get('subject')));
     if ($this->contact['reply_content']) {
         $display->add('replied_content', stripslashes($this->contact['reply_content']));
     } else {
         $display->add('replied_content', "Chưa có");
     }
     $display->output('FeedbackReply');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:27,代码来源:FeedbackReply.php

示例2: draw

 function draw()
 {
     global $display;
     $keyword = Url::get('keyword');
     $display->add('keyword', $keyword);
     $display->add('export_link', Url::build_current(array('cmd' => 'export')));
     $where = '1';
     if ($keyword != '') {
         $where .= ' AND email LIKE "%' . $keyword . '%"';
     }
     $total_item = DB::count('news_letter_email', $where);
     $limit = '';
     $item_per_page = 40;
     $page_no = (int) Url::get('page_no');
     $pagging = AZPagging::paging_list($limit, $total_item, $item_per_page, 10);
     $re = DB::query('SELECT * FROM news_letter_email WHERE ' . $where . ' ORDER BY id ' . $limit);
     $news_letter_emails = array();
     $i = 0;
     if ($page_no <= 0) {
         $page_no = 1;
     }
     if ($re) {
         while ($item = mysql_fetch_assoc($re)) {
             $item['time_add'] = date('H:i', $item['time_add']) . ' ngày ' . date('d/m/Y', $item['time_add']) . '<br />Cách đây ' . AZLib::duration_time($item['time_add']);
             $item['delete'] = AZLib::buttonDel(Url::build_current(array('cmd' => 'delete', 'id' => $item['id'])), 'style/images/admin/delete.gif', 'Loại bỏ Email này khỏi danh sách!');
             $i++;
             $item['i'] = $i + ($page_no - 1) * $item_per_page;
             $news_letter_emails[$item['id']] = $item;
         }
     }
     $display->add('pagging', $pagging);
     $display->add('news_letter_emails', $news_letter_emails);
     $display->add('count', $total_item);
     $this->beginForm();
     $display->output("NewsLetterAdmin");
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:37,代码来源:NewsLetterAdmin.php

示例3: get_feed_notify_bar

 function get_feed_notify_bar()
 {
     AZLib::getCats();
     $json = "";
     if (!User::is_login()) {
         $json = '({"msg":"no_login"})';
         echo $json;
         exit;
     }
     $item_comment_ids = "";
     //Id các phản hồi giao dịch
     $user_comment_ids = "";
     //Id các lưu bút
     $entry_comment_ids = "";
     //Id các bài viết
     /*$follow_ids			= "";//Id các theo đuôi*/
     $blast_user_ids = "";
     // Id các balst
     $arr_data = array();
     $user = User::getUser(User::id());
     if ($user["total_pm"]) {
         // neu co PM moi
         $arr_data = array("new_pm" => $user["total_pm"]);
     }
     $where = "WHERE user_id = " . User::id();
     $limit = " LIMIT 20";
     $sql = "SELECT * FROM feed {$where} ORDER BY time DESC {$limit}";
     $re = DB::query($sql);
     if ($re) {
         while ($feed = mysql_fetch_assoc($re)) {
             if ($feed['type'] == 1 || $feed['type'] == 2) {
                 // phan hoi
                 $item_comment_ids .= ($item_comment_ids != '' ? ',' : '') . $feed['ref_id'];
             } elseif ($feed['type'] == 3) {
                 // luu but
                 $user_comment_ids .= ($user_comment_ids != '' ? ',' : '') . $feed['ref_id'];
             } elseif ($feed['type'] == 5 || $feed['type'] == 6) {
                 // bai viet
                 $entry_comment_ids .= ($entry_comment_ids != '' ? ',' : '') . $feed['ref_id'];
             }
             /*elseif($feed['type']==7){// theo duoi						
             			$follow_ids.=($follow_ids!=''?',':'').$feed['ref_id'];
             		}*/
         }
     }
     //Phản hồi giao dịch
     $item_comment_arr = array();
     if ($item_comment_ids != '') {
         $item_ids = "";
         $re = DB::query("SELECT time, item_id, parent_id, COUNT(item_id) AS total_comment FROM comment WHERE id IN({$item_comment_ids}) GROUP BY item_id");
         if ($re) {
             while ($comment = mysql_fetch_assoc($re)) {
                 $item_ids .= ($item_ids != '' ? ',' : '') . $comment['item_id'];
                 $comment['time'] = AZLib::duration_time($comment['time']);
                 $item_comment_arr[$comment['item_id']] = $comment;
             }
             if ($item_comment_arr && $item_ids) {
                 // Query de lay ID va Tieu de tin
                 $re = DB::query("SELECT id, name, level_1_catid FROM item WHERE id IN({$item_ids})");
                 while ($item = mysql_fetch_assoc($re)) {
                     if ($item["id"] == $item_comment_arr[$item["id"]]["item_id"]) {
                         $item_comment_arr[$item["id"]]["item_name"] = AZLib::word_limit($item["name"], 7, '...');
                         $ebname = AZLib::safe_title($item['name']);
                         if (isset(CGlobal::$allCategories[$item['level_1_catid']])) {
                             $cat_name = CGlobal::$allCategories[$item['level_1_catid']]['name'];
                             $item_comment_arr[$item["id"]]["url_link"] = WEB_DIR . AZLib::safe_title($cat_name) . "/p{$item['id']}/{$ebname}.html";
                         } else {
                             $item_comment_arr[$item["id"]]["url_link"] = WEB_DIR . "/p{$item['id']}/{$ebname}.html";
                         }
                     }
                 }
             }
         }
         if ($item_comment_arr) {
             $item_comment_arrs["comment"] = $item_comment_arr;
             $arr_data += $item_comment_arrs;
         }
     }
     // End Phan hoi giao dich
     //Luu but
     $total_comment_arr = array();
     if ($user_comment_ids != '') {
         $re = DB::query("SELECT time, COUNT(id) AS total_comment_user FROM comment_user WHERE id IN({$user_comment_ids}) GROUP BY receiver_user_id ORDER BY time DESC");
         if ($re) {
             $comment_user = mysql_fetch_assoc($re);
             $total_comment_arr["total"] = $comment_user["total_comment_user"];
             $total_comment_arr['time'] = AZLib::duration_time($comment_user['time']);
             $total_comment_arr["url_link"] = WEB_DIR . 'Shop/' . User::user_name() . '/Luu-but';
         }
         if ($total_comment_arr) {
             $total_comment_arrs["comment_user"] = $total_comment_arr;
             $arr_data += $total_comment_arrs;
         }
     }
     //End Luu but
     // Theo duoi
     /*$follow_arr = array();
     		if($follow_ids!=''){
     			$re = DB::query("SELECT id, follower_name, time FROM follow WHERE id IN($follow_ids) ORDER BY time DESC");			
     			if($re){				
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ajax_user.ajax.php

示例4: show_user_comment_line

    function show_user_comment_line()
    {
        $c_user_id = (int) Url::get('c_user_id');
        $c_u_id = (int) Url::get('u_id');
        $group_id = (int) Url::get('group_id');
        $json = "";
        if (!User::is_login()) {
            $json = '({"msg":"no_login"})';
            echo $json;
            exit;
        }
        if (User::is_block()) {
            $json = '({"msg":"no_perm"})';
            echo $json;
            exit;
        }
        if ($c_user_id && $c_u_id) {
            $json = '({"msg":"success"';
            $all_user_comments = array();
            $all_users = array();
            $user = User::getUser($c_u_id);
            if ($user) {
                $re = DB::query("SELECT * FROM (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT id, time, content, sender_user_id, sender_user_name FROM comment_user WHERE sender_user_id=" . User::id() . " AND receiver_user_id={$c_u_id} AND id<{$c_user_id} ORDER BY id DESC LIMIT 20)\r\n\t\t\t\t\t\t\t\t\t\t\t\tUNION \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT id, time, content, sender_user_id, sender_user_name FROM comment_user WHERE sender_user_id={$c_u_id} AND receiver_user_id=" . User::id() . " AND id<{$c_user_id} ORDER BY id DESC LIMIT 20)\r\n\t\t\t\t\t\t\t\t\t\t\t\t)  AS u_comment\r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY id ASC LIMIT 20");
                $uids = '';
                if ($re) {
                    while ($u_comment = mysql_fetch_assoc($re)) {
                        $u_comment['time'] = AZLib::duration_time($u_comment['time']);
                        $uids .= ($uids ? ',' : '') . $u_comment['sender_user_id'];
                        $all_user_comments[] = $u_comment;
                    }
                }
                if ($uids != '') {
                    $re = DB::query("SELECT id, avatar_url, img_server FROM user WHERE id IN({$uids})");
                    if ($re) {
                        while ($u_user = mysql_fetch_assoc($re)) {
                            //$all_users[$u_user['id']]=$u_user['avatar_url'];
                            $all_users[$u_user['id']] = $u_user;
                        }
                    }
                }
                if ($all_user_comments) {
                    $json .= ',"c_user_line":"' . addslashes('<div style="padding:8px 6px;background-color:#ECEFF6;margin-bottom:2px;border-bottom:1px solid #ccc;font-size:11px">mạnh lưu bút với <a href="' . $user['user_name'] . '" target="_blank"><font color="#3C5899"><b>' . $user['user_name'] . '</b></font></a> - <span onclick="c_user_back(' . $group_id . ');" class="o_action">thu gọn</span></div>');
                    foreach ($all_user_comments as $u_comment) {
                        if (isset($all_users[$u_comment['sender_user_id']]['avatar_url']) && $all_users[$u_comment['sender_user_id']] && $all_users[$u_comment['sender_user_id']]['avatar_url']) {
                            $u_comment['avatar_url'] = 'http://' . CGlobal::$img_server[$all_users[$u_comment['sender_user_id']]['img_server']] . 'thumb_wl/50/' . $all_users[$u_comment['sender_user_id']]['avatar_url'];
                        } else {
                            $u_comment['avatar_url'] = 'style/images/54x54.gif';
                        }
                        $json .= addslashes(str_replace(array(chr(13), chr(10)), ' ', '
				        							<div class="o_sub_item">
								                            <div class="o_f_content">
								                            	<img src="' . $u_comment['avatar_url'] . '" width="25" height="25" border="0" align="left" style="margin:0 6px 6px 0"/>
							                                	<a href="' . WEB_DIR . $u_comment['sender_user_name'] . '" target="_blank">
										                            ' . $u_comment['sender_user_name'] . '
										                            </a> viết  <span class="o_time">' . $u_comment['time'] . '</span><br />
										                            ' . AZLib::parseBBCode($u_comment['content']) . '
							                                </div>
							                                <div style="clear:left"><span></span></div>
					                               		</div>'));
                    }
                    $json .= '"})';
                } else {
                    $json .= ',"c_user_line":""})';
                }
                echo $json;
                exit;
            }
        }
        $json = "({'msg':'no_perm'})";
        echo $json;
        exit;
    }
开发者ID:duynhan07,项目名称:elink,代码行数:72,代码来源:ajax_shop_giaodich.ajax.php

示例5: show_all_notify


//.........这里部分代码省略.........
                         $total_unread++;
                     }
                     $entry_arr[$entry['id']] = $entry;
                 }
             }
         }
     }
     if ($user_ids_ar) {
         $user_ids = implode(',', $user_ids_ar);
         if ($user_ids != '') {
             $re = DB::query("SELECT id, user_name, blast, avatar_url,img_server FROM user WHERE id IN({$user_ids})");
             if ($re) {
                 while ($user = mysql_fetch_assoc($re)) {
                     if ($user['avatar_url']) {
                         $user['avatar_url'] = 'http://' . CGlobal::$img_server[$user['img_server']] . 'thumb/50_50/' . $user['avatar_url'];
                     } else {
                         $user['avatar_url'] = 'style/images/54x54.gif';
                     }
                     $user_arr[$user['id']] = $user;
                 }
             }
         }
     }
     //Phản hồi giao dịch
     if ($item_comment_ids != '') {
         $re = DB::query("SELECT * FROM comment WHERE id IN({$item_comment_ids})");
         if ($re) {
             while ($comment = mysql_fetch_assoc($re)) {
                 $comment['content'] = AZLib::parseBBCode(stripslashes($comment['content']));
                 $comment['s_content'] = AZLib::plainText($comment['content']);
                 if (strlen($comment['s_content']) > 20) {
                     $comment['s_content'] = AZLib::word_limit($comment['s_content'], 10, '..');
                 }
                 $comment['time'] = AZLib::duration_time($comment['time']);
                 if (!$comment['status']) {
                     $total_unread++;
                 }
                 $item_comment_arr[$comment['id']] = $comment;
             }
         }
     }
     //Lưu bút
     if ($user_comment_ids != '') {
         $re = DB::query("SELECT * FROM comment_user WHERE id IN({$user_comment_ids})");
         if ($re) {
             while ($comment = mysql_fetch_assoc($re)) {
                 $comment['content'] = AZLib::parseBBCode(stripslashes($comment['content']));
                 $comment['s_content'] = AZLib::plainText($comment['content']);
                 if (strlen($comment['s_content']) > 20) {
                     $comment['s_content'] = AZLib::word_limit($comment['s_content'], 10, '..');
                 }
                 $comment['time'] = AZLib::duration_time($comment['time']);
                 if (!$comment['status']) {
                     $total_unread++;
                 }
                 $user_comment_arr[$comment['id']] = $comment;
             }
         }
     }
     if ($pm_ids != '' && $pm_ids != 0) {
         //Tin nhắn
         $re = DB::query("SELECT mt.*, msg.msg_post as content FROM (SELECT mt_id AS id, mt_msg_id, mt_title, mt_ref_id , mt_from_id AS sender_user_id, mt_date AS time, mt_read AS status FROM message_topics WHERE mt_id IN({$pm_ids})) AS mt LEFT JOIN message_text AS msg ON mt.mt_msg_id = msg.msg_id");
         if ($re) {
             while ($comment = mysql_fetch_assoc($re)) {
                 $comment['content'] = AZLib::parseBBCode(stripslashes($comment['content']));
                 $comment['s_content'] = AZLib::plainText($comment['content']);
开发者ID:duynhan07,项目名称:elink,代码行数:67,代码来源:ajax_personal.ajax.php

示例6: draw

 function draw()
 {
     global $display;
     $status_arr = array('0' => 'Chưa trả lời / phản hồi', '1' => 'Đã phản hồi / phản hồi', '2' => 'Tất cả');
     $status = (int) Url::get('status', 0);
     $display->add('url_admin', Url::build_current());
     $display->add('status_option', AZLib::getOption($status_arr, $status));
     $item_per_page_arr = array('20' => '20', '50' => '50', '100' => '100', '150' => '150', '200' => '200', '300' => '300', '500' => '500');
     $item_per_page = (int) Url::get('row_per_page', 20);
     $display->add('row_per_page_option', AZLib::getOption($item_per_page_arr, $item_per_page));
     $from_date_arr[-1] = '--Từ ngày--';
     for ($i = 30; $i >= 0; $i--) {
         $time_from = mktime(0, 0, 0, date('m', TIME_NOW), date('d', TIME_NOW), date('Y', TIME_NOW)) - $i * 24 * 3600;
         $from_date_arr[$time_from] = date('d/m/Y', $time_from);
     }
     $to_date_arr[-1] = '--Đến ngày--';
     for ($i = 0; $i <= 30; $i++) {
         $time_to = mktime(23, 59, 59, date('m', TIME_NOW), date('d', TIME_NOW), date('Y', TIME_NOW)) - $i * 24 * 3600;
         $to_date_arr[$time_to] = date('d/m/Y', $time_to);
     }
     $from_date = Url::get('from_date', -1);
     $to_date = Url::get('to_date', -1);
     $display->add('from_date_option', AZLib::getOption($from_date_arr, $from_date));
     $display->add('to_date_option', AZLib::getOption($to_date_arr, $to_date));
     $sql = ' 1 ';
     if ($from_date > -1) {
         $sql .= " AND time>=" . $from_date;
     }
     if ($to_date > -1) {
         $sql .= " AND time<=" . $to_date;
     }
     $txt_ykien = Url::get('txt_ykien', '');
     if ($txt_ykien != '') {
         $sql .= " AND content like '%{$txt_ykien}%'";
     }
     $display->add('txt_ykien', $txt_ykien);
     if ($status != 2) {
         $sql .= ' AND  status=' . $status;
     }
     $num_of_row = DB::count('feedback', $sql);
     $limit = '';
     $display->add('pagging', AZPagging::paging_list($limit, $num_of_row, $item_per_page, 10, 'page_no', '', true, 'Liên hệ'));
     $page_no = (int) Url::get('page_no', 1);
     if ($page_no <= 0) {
         $page_no = 1;
     }
     $i = 0;
     $all_feedbacks = array();
     $sql = "SELECT * FROM feedback WHERE {$sql} ORDER BY id DESC {$limit}";
     $re = DB::query($sql);
     if ($re) {
         while ($row = mysql_fetch_assoc($re)) {
             $email = '';
             if ($row['name']) {
                 $email = stripslashes($row['name']) . " ";
             }
             if ($row['address']) {
                 $email .= "( " . stripslashes($row['address']) . ") ";
             }
             $email .= '<a href="mailto:' . $row['email'] . '"><font color=blue>' . $row['email'] . "</font></a>";
             $row['email'] = $email;
             $row['date'] = date("d/m/Y H:i:s", $row['time']);
             $row['date2'] = AZLib::duration_time($row['time']);
             $row['url_del'] = AZLib::buttonDel(Url::build_current(array('id' => $row['id'], 'cmd' => 'delete')), 'style/images/delete.gif', 'Xóa ý kiến');
             $row['url_reply'] = Url::build_current(array('id' => $row['id'], 'cmd' => 'reply'));
             if ($row['reply_content']) {
                 $row['reply_content'] = stripslashes($row['reply_content']);
             } else {
                 $row['reply_content'] = "Chưa có";
             }
             if (!$row['status']) {
                 $row['exam'] = AZLib::button(Url::build_current(array('id' => $row['id'], 'cmd' => 'exam')), 'style/images/exam.gif', 'Duyệt liên hệ');
             } else {
                 $row['exam'] = AZLib::button(Url::build_current(array('id' => $row['id'], 'cmd' => 'unexam')), 'style/images/unexam.gif', 'Bỏ duyệt liên hệ');
             }
             if ($i % 2 == 0) {
                 $row['bgcolor'] = '#FFFFFF';
             } else {
                 $row['bgcolor'] = '#CCFF99';
             }
             $i++;
             $row['i'] = ($page_no - 1) * $item_per_page + $i;
             $all_feedbacks[$row['id']] = $row;
         }
     }
     $display->add('all_feedbacks', $all_feedbacks);
     $this->beginForm();
     $display->output("FeedbackAdmin");
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:90,代码来源:FeedbackAdmin.php


注:本文中的AZLib::duration_time方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。