本文整理汇总了PHP中tools::niceShort方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::niceShort方法的具体用法?PHP tools::niceShort怎么用?PHP tools::niceShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::niceShort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
if (isset($_SESSION['user_id'])) {
$user_id = $_SESSION['user_id'];
$autobids = array();
$autobids_data = $this->exec_all("SELECT * FROM " . _DB_PREFIX_ . "autobids WHERE user_id=" . $user_id . " ORDER BY id DESC");
$i = 0;
foreach ($autobids_data as $data) {
$auction = $this->exec_one("SELECT id, product_id, price FROM " . _DB_PREFIX_ . "auctions WHERE id=" . $data['auction_id'] . "");
$autobids[$i]['id'] = $data['id'];
$autobids[$i]['auction_id'] = $auction['id'];
$autobids[$i]['auction_price'] = $auction['price'];
$autobids[$i]['auction_leader'] = $auction['id'];
$autobids[$i]['minimum_price'] = $data['minimum_price'];
$autobids[$i]['maximum_price'] = $data['maximum_price'];
$autobids[$i]['total_bids'] = $data['total_bids'];
$autobids[$i]['bids'] = $data['bids'];
$autobids[$i]['active'] = $data['active'];
$autobids[$i]['date'] = tools::niceShort($data['created']);
$i++;
}
$this->smarty->assign(array('autobids' => $autobids));
$this->smarty->display('user/autobids.tpl');
} else {
tools::setFlash(ERROR_LOGIN, 'error');
tools::redirect('/user/login');
}
}
示例2: count
}
}
if ($auction['type'] == 4) {
$auction['price'] = $auction['fixed_price'];
}
if ($auction['type'] == 8 && $auction['status_id'] == 1) {
$bid_pred_nb = $db->getRow("SELECT count(id) AS total FROM " . DB_PREFIX . "bids WHERE auction_id = :auction_id AND debit > 0", array('auction_id', $auction['id']));
$auction['bid_pred_nb'] = $bid_pred_nb['total'];
}
if (!empty($_GET['histories'])) {
$res = $db->getRows("SELECT b.id, b.user_id, b.price, b.description, b.debit, b.created, u.username FROM " . DB_PREFIX . "bids b, " . DB_PREFIX . "users u WHERE b.credit = 0 AND b.user_id = u.id AND b.auction_id = " . $auction['id'] . " ORDER BY b.id DESC LIMIT 10");
if ($res) {
$bid_histories_result = array();
foreach ($res as $row) {
$bid_history['Bid']['id'] = $row['id'];
$bid_history['Bid']['created'] = tools::niceShort($row['created']);
$bid_history['Bid']['description'] = $row['description'];
$bid_history['Bid']['username'] = utf8_encode($row['username']);
$bid_history['Bid']['amount'] = $row['price'] . '€';
$bid_histories_result[] = $bid_history;
}
$result['Histories'] = $bid_histories_result;
}
}
$result['Auction'] = $auction;
// writing data to the application cache
if (!empty($_GET['histories'])) {
$auction = tools::writeCache('auction_view_' . $value, $result);
} else {
$auction = tools::writeCache('auction_' . $value, $result);
}