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


PHP timetodate函数代码示例

本文整理汇总了PHP中timetodate函数的典型用法代码示例。如果您正苦于以下问题:PHP timetodate函数的具体用法?PHP timetodate怎么用?PHP timetodate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_list

 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $pages, $page, $pagesize, $offset, $pagesize, $MOD, $item, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $item = $r['num'];
     }
     $pages = pages($item, $page, $pagesize);
     $lists = $pids = $P = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('price.php?itemid=' . $r['pid']);
         $pids[$r['pid']] = $r['pid'];
         $lists[] = $r;
     }
     if ($pids) {
         $result = $this->db->query("SELECT * FROM {$this->table_product} WHERE itemid IN (" . implode(',', $pids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $P[$r['itemid']] = $r;
         }
         if ($P) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['unit'] = $P[$v['pid']]['unit'];
                 $lists[$k]['alt'] = $P[$v['pid']]['title'];
                 $lists[$k]['title'] = set_style($P[$v['pid']]['title'], $P[$v['pid']]['style']);
             }
         }
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:34,代码来源:price.class.php

示例2: get_list

 function get_list($condition, $order = 'listorder ASC,itemid ASC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         if ($r['areaid']) {
             $r['address'] = area_pos($r['areaid'], '') . $r['address'];
         }
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:25,代码来源:address.class.php

示例3: get_list

 function get_list($condition = '1', $order = 'listorder DESC, itemid DESC')
 {
     global $MODULE, $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     $GROUP = cache_read('group.php');
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['thumb'] = is_file(DT_ROOT . '/' . $MODULE[4]['moduledir'] . '/skin/' . $r['skin'] . '/thumb.gif') ? $MODULE[4]['linkurl'] . 'skin/' . $r['skin'] . '/thumb.gif' : $MODULE[4]['linkurl'] . 'image/nothumb.gif';
         $groupid = explode(',', substr($r['groupid'], 1, -1));
         $group = array();
         foreach ($groupid as $gid) {
             $group[] = $GROUP[$gid]['groupname'];
         }
         $r['group'] = implode('<br/>', $group);
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:26,代码来源:style.class.php

示例4: get_list

 function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $items, $TYPE, $special, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}", $cache);
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $cache);
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['alt'] = $r['title'];
         $r['title'] = set_style($r['title'], $r['style']);
         $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : '';
         $r['typeurl'] = $r['type'] ? rewrite($MOD['linkurl'] . 'type.php?tid=' . $r['typeid']) : '';
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:26,代码来源:item.class.php

示例5: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = $groupids = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $groupids[$r['gid']] = $r['gid'];
         $lists[] = $r;
     }
     if ($groupids) {
         $GRPS = array();
         $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $GRPS[$r['itemid']] = $r;
         }
         if ($GRPS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : '';
                 $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:35,代码来源:fans.class.php

示例6: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         if (strpos($r['content'], '<hr class="club_break" />') !== false) {
             $r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />'));
         }
         $r['title'] = get_intro($r['content'], 50);
         $r['alt'] = get_intro($r['content'], 500);
         $r['linkurl'] = $MOD['linkurl'] . 'goto.php?itemid=' . $r['itemid'];
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:reply.class.php

示例7: get_list

 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['title'] = set_style($r['title'], $r['style']);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('expert.php?itemid=' . $r['itemid']);
         $r['rate'] = $r['answer'] && $r['best'] < $r['answer'] ? dround($r['best'] * 100 / $r['answer'], 2, true) . '%' : '100%';
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:25,代码来源:expert.class.php

示例8: get_list

 function get_list($condition = '1', $order = 'listorder DESC, itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['title'] = set_style($r['title'], $r['style']);
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['typename'] = $TYPE[$r['typeid']]['typename'];
         $r['typeurl'] = $MOD['link_url'] . list_url($r['typeid']);
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:25,代码来源:link.class.php

示例9: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['content'] = nl2br($r['content']);
         $r['editdate'] = '--';
         if ($r['reply']) {
             $r['reply'] = nl2br($r['reply']);
             $r['editdate'] = timetodate($r['edittime'], 5);
         }
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:guestbook.class.php

示例10: nexttime

function nexttime($schedule, $time)
{
    if (strpos($schedule, ',') !== false) {
        list($h, $m) = explode(',', $schedule);
        $t = strtotime(timetodate($time, 3) . ' ' . ($h < 10 ? '0' . $h : $h) . ':' . ($m < 10 ? '0' . $m : $m) . ':00');
        return $t > $time ? $t : $t + 86400;
    } else {
        $m = intval($schedule);
        return $time + ($m ? $m : 1800) * 60;
    }
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:11,代码来源:cron.inc.php

示例11: get_list

 function get_list($condition, $order = 'itemid DESC')
 {
     global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum, $L;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     if ($items < 1) {
         return array();
     }
     $lists = $groupids = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         if ($r['typeid'] == 1) {
             $r['linkurl'] = "javascript:alert('" . $L['manage_has_del'] . "');";
         } else {
             $r['linkurl'] = $r['tid'] ? DT_PATH . 'api/redirect.php?mid=' . $MOD['moduleid'] . '&itemid=' . $r['tid'] : $MOD['linkurl'] . 'goto.php?itemid=' . $r['rid'];
         }
         $r['value'] = '';
         if ($r['typeid'] == 3) {
             $r['value'] = $r['content'] ? $L['manage_level'] . $r['content'] : $L['manage_cancel'];
         } else {
             if ($r['typeid'] == 4) {
                 $r['value'] = $r['content'] ? $r['content'] == 1 ? $L['manage_ontop_1'] : $L['manage_ontop_2'] : $L['manage_cancel'];
             } else {
                 if ($r['typeid'] == 5) {
                     $r['value'] = $r['content'] ? '<div style="width:10px;height:10px;line-height:10px;background:' . $r['content'] . ';">&nbsp;</div>' : $L['manage_cancel'];
                 }
             }
         }
         $groupids[$r['gid']] = $r['gid'];
         $lists[] = $r;
     }
     if ($groupids) {
         $GRPS = array();
         $result = $this->db->query("SELECT itemid,title,linkurl FROM {$this->db->pre}club_group WHERE itemid IN (" . implode(',', $groupids) . ")");
         while ($r = $this->db->fetch_array($result)) {
             $GRPS[$r['itemid']] = $r;
         }
         if ($GRPS) {
             foreach ($lists as $k => $v) {
                 $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : '';
                 $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'] . $GRPS[$v['gid']]['linkurl'] : '';
             }
         }
     }
     return $lists;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:52,代码来源:manage.class.php

示例12: get_list

 function get_list($condition, $order = 'listorder ASC,itemid ASC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $nums;
     $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
     $nums = $r['num'];
     $pages = pages($nums, $page, $pagesize);
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:14,代码来源:express.class.php

示例13: get_list

 function get_list($condition = 'status=3', $order = 'itemid DESC')
 {
     global $TYPE, $pages, $page, $pagesize, $offset, $L, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
         $items = $r['num'];
     }
     $pages = pages($items, $page, $pagesize);
     $lists = array();
     $result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['dcompany'] = set_style($r['company'], $r['style']);
         $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : $L['default_type'];
         $lists[] = $r;
     }
     return $lists;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:20,代码来源:friend.class.php

示例14: feedback

 function feedback($r)
 {
     global $DT_TIME, $L;
     $r or $r = $this->get_one();
     $message = array();
     $message['typeid'] = 0;
     $message['touser'] = $r['fromuser'];
     $message['title'] = lang($L['message_feedback_title'], array(dsubstr($r['title'], 20, '...')));
     $message['content'] = lang($L['message_feedback_content'], array($this->username, timetodate($DT_TIME, 5), $r['title'], timetodate($r['addtime'], 5), $r['content']));
     $this->send($message);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:11,代码来源:message.class.php

示例15: unset

 }
 if ($submit) {
     if ($item['islink']) {
         $post['islink'] = 1;
     } else {
         if (isset($post['islink'])) {
             unset($post['islink']);
         }
     }
     //$post['clear_link'] = $MOD['clear_link'];
     if ($do->pass($post)) {
         $CAT = get_cat($post['catid']);
         if (!$CAT || !check_group($_groupid, $CAT['group_add'])) {
             dalert(lang($L['group_add'], array($CAT['catname'])));
         }
         $post['addtime'] = timetodate($item['addtime']);
         $post['level'] = $item['level'];
         $post['fee'] = $item['fee'];
         $post['style'] = $item['style'];
         $post['template'] = $item['template'];
         $post['filepath'] = $item['filepath'];
         $post['note'] = $item['note'];
         $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add'];
         $post['status'] = get_status($item['status'], $need_check);
         $post['hits'] = $item['hits'];
         $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0;
         $post['clear_link'] = $MOD['clear_link'] ? 1 : 0;
         $post['get_introduce'] = $MOD['get_introduce'] ? 1 : 0;
         $post['introduce_length'] = $MOD['introduce_length'] ? $MOD['introduce_length'] : 0;
         if ($FD) {
             fields_check($post_fields);
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:my.inc.php


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