本文整理汇总了PHP中AZLib::getImageThumb方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::getImageThumb方法的具体用法?PHP AZLib::getImageThumb怎么用?PHP AZLib::getImageThumb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::getImageThumb方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: draw
function draw()
{
global $display;
$cat_newss = array();
$display->add('is_admin', User::have_permit(ADMIN_NEWS));
$display->add('url_home', WEB_DIR);
$display->add('time_now', News::displayTime());
$display->add('cat_name', $this->news_cat['name']);
$display->add('cat_url', URL::build('news_list', array('news_catid' => $this->news_cat['id'], 'azname' => AZLib::safe_title($this->news_cat['name']))));
$condition = ' status=1 ';
$total = DB::count("news", $condition);
$limit = '';
//$pagging = AZPagging::paging_list($limit,20,'page_no');
$pagging = AZPagging::paging_list($limit, $total, 20);
$re = DB::query('SELECT * FROM news WHERE ' . $condition . ' ORDER BY id DESC' . $limit);
if ($re) {
while ($news = mysql_fetch_assoc($re)) {
$news['title'] = stripslashes($news['title']);
$news['brief'] = stripslashes($news['brief']);
$news['url'] = Url::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
if ($news['image']) {
$news['image'] = AZLib::getImageThumb($news['image'], 150, 0, 0, $news['img_server']);
}
$news['news_h'] = date('H:i', $news['time_created']);
$news['news_d'] = date('d-m-Y', $news['time_created']);
$news['admin_link'] = News::admin_link($news);
$cat_newss[$news['id']] = $news;
}
}
$display->add('pagging', $pagging);
$display->add('cat_newss', $cat_newss);
$display->output("NewsPage");
}
示例2: draw
function draw()
{
global $display;
if (User::id() != 0) {
if (User::$current->data["avatar_url"] != "") {
$avatar = '<img src="' . AZLib::getImageThumb(User::$current->data["avatar_url"], 100, 100, 0, User::$current->data["img_server"]) . '" />';
} else {
$avatar = '<img src="style/images/no_avatar_item.gif" width="94" height="94"/>';
}
$display->add('avatar', $avatar);
$display->add('user_name', User::$current->data["user_name"]);
$display->add('get_cmd', Url::get('cmd'));
$display->add('get_action', Url::get('action'));
$display->add('get_page', Url::get('page'));
$display->add('get_page', AZNet::$page['name']);
$display->add('get_cmd', Url::get('cmd'));
$display->add('user_name', User::user_name());
$display->add('can_edit_blast', User::is_admin() || !User::is_block());
$blast = User::$current->data['blast'];
$avatar_link = '';
$avatar_url = 'style/images/no_avatar_item.gif';
if (User::$current->data['avatar_url'] != '') {
$avatar_link = "http://" . CGlobal::$img_server[User::$current->data['img_server']] . User::$current->data['avatar_url'];
$avatar_url = AZLib::getImageThumb(User::$current->data['avatar_url'], 80, 80, 0, User::$current->data['img_server']);
}
if ($blast == '') {
$blast = '...';
} else {
$blast = ' ' . $blast;
if (strpos($blast, 'http://')) {
$user_blast = $blast;
while (strpos($user_blast, 'http://')) {
$tmp = substr($user_blast, strpos($user_blast, 'http://'));
if (strpos($tmp, ' ') || strpos($tmp, '<')) {
if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
$blast_url = substr($tmp, 0, strpos($tmp, '<'));
} else {
$blast_url = substr($tmp, 0, strpos($tmp, ' '));
}
} else {
$blast_url = $tmp;
}
$user_blast = str_replace($blast_url, '', $user_blast);
}
$new_blast_url = ' <a rel="nofollow" href="' . $blast_url . '" target="_blank">Click here</a>';
$blast = substr($user_blast . $new_blast_url, 1);
}
}
$display->add('avatar_link', $avatar_link);
$display->add('avatar_url', $avatar_url);
$display->add('blast', $blast);
$display->add('user_id', User::id());
$TopMenu = $display->output('TopMenu', true, 'Personal');
$display->add('TopMenu', $TopMenu);
$display->output('change_pass', false, 'Personal');
} else {
Url::redirect('home');
}
}
示例3: draw
function draw()
{
global $display;
$this->beginForm();
$user = $this->user;
if ($user['show_home_phone'] == 0) {
$user['show_home_phone'] = '';
} else {
$user['show_home_phone'] = '(Đã ẩn)';
}
if ($user['show_email'] == 0) {
$user['show_email'] = '';
} else {
$user['show_email'] = '(Đã ẩn)';
}
if ($user['email_alert'] == 0) {
$user['email_alert'] = '';
} else {
$user['email_alert'] = '(Nhận email thông báo)';
}
if ($user['birth_day']) {
$arrBirtday = explode('-', $user['birth_day']);
$user['birth_day'] = $arrBirtday['2'] . '-' . $arrBirtday['1'] . '-' . $arrBirtday['0'];
}
if ($user['avatar_url'] != "") {
$user['avatar_url'] = '<img src="' . AZLib::getImageThumb($user['avatar_url'], 100, 100, 0, $user['img_server']) . '" />';
} else {
$user['avatar_url'] = '<img src="style/images/no_avatar_item.gif" width="94" height="94" />';
}
$user['create_time'] = date('d/m/y H:i', $user['create_time']);
$user['reg_ip'] = ($user['reg_ip'] ? "RegIP: <b>{$user['reg_ip']}</b>" : '') . ($user['last_ip'] ? "LastIP: <b>{$user['last_ip']}</b>" : '');
if ($user['block_time'] > TIME_NOW || $user['block_time'] == -1) {
if ($user['block_time'] != -1) {
$user['status'] = "<font color=red><b>" . date('H:i d/m/y', $user['block_time']) . '</b></font>';
} else {
$user['status'] = '<font color=red><b>Khóa vĩnh viễn</b></font>';
}
} elseif ($user['invalid_time']) {
$user['status'] = "<font color=red><b>Đang bị kiểm duyệt</b></font>";
} else {
$user['status'] = "Bình thường";
}
$display->add('msg', $this->showFormErrorMessages(1));
$display->add('user', $user);
$openids = array();
$re = DB::query("SELECT id, openid_url FROM openid WHERE user_id=" . $user['id']);
if ($re) {
while ($openid = mysql_fetch_assoc($re)) {
$openid['openid'] = $openid['openid_url'];
$openids[$openid['id']] = $openid;
}
}
$display->add('openids', $openids);
$display->add('user', $user);
$display->output('UserDetail');
$this->endForm();
}
示例4: draw
function draw()
{
global $display;
$item_ids = '';
$item_news = array();
$configs = @CGlobal::$configs['ItemNew']['conf_val'];
if ($configs) {
$configs = unserialize(stripslashes($configs));
$title_new = $configs['title'];
$item_ids = $configs['item_ids'];
} else {
$title_new = "SẢN PHẨM MỚI";
$item_ids = '';
}
if ($item_ids) {
$re = DB::query("SELECT * FROM item WHERE id IN({$item_ids}) AND status = 1 ORDER BY find_in_set(id,'{$item_ids}')");
if ($re) {
while ($product = mysql_fetch_assoc($re)) {
if ($product['img_url']) {
$product['image'] = AZLib::getImageThumb($product['img_url'], 160, 150, 0, $product['img_server']);
} else {
$product['image'] = "";
//"style/images/no-images-35x35.gif";
}
if (isset(CGlobal::$allCategories[$product['category_id']])) {
$product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
} else {
$product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
}
$product['name'] = stripslashes($product['name']);
if ($product['list_brief'] == '') {
$product['list_brief'] = $product['brief'];
}
$product['list_brief'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($product['list_brief'], ENT_QUOTES, "UTF-8"))));
$product['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $product['list_brief']);
$product['list_brief'] = str_replace(array("'", "\""), array("", " "), $product['list_brief']);
$product['list_brief'] = AZLib::word_limit($product['list_brief'], 50, '');
$product['list_brief'] = '<b>' . str_replace(array("'", "\""), array("", " "), $product['name']) . '</b><br />' . $product['list_brief'];
$product['price_num'] = $product['price'];
$product['price'] = AZLib::getPrice($product['price'], $product['currency_id']);
$item_news[$product['id']] = $product;
}
}
}
if (User::is_admin()) {
$display->add("is_admin", 1);
$display->add("msg", $this->showFormErrorMessages(1));
$display->add('begin_form', $this->beginForm(true, 'post', false, false, 1));
$display->add('end_form', $this->endForm(true));
}
$display->add('title_new', $title_new);
$display->add('item_ids', $item_ids);
$display->add('item_news', $item_news);
$display->output("ItemNew");
}
示例5: draw
function draw()
{
global $display;
$display->add('get_cmd', Url::get('cmd'));
$display->add('get_action', Url::get('action'));
$display->add('get_page', Url::get('page'));
echo '<script language="javascript">
var url_root = "' . WEB_ROOT . '"
</script>';
$display->add('get_page', AZNet::$page['name']);
$display->add('get_cmd', Url::get('cmd'));
$display->add('user_name', User::user_name());
$display->add('can_edit_blast', User::is_admin() || !User::is_block());
$blast = User::$current->data['blast'];
$avatar_link = '';
$avatar_url = 'style/images/no_avatar_item.gif';
if (User::$current->data['avatar_url'] != '') {
$avatar_link = "http://" . CGlobal::$img_server[User::$current->data['img_server']] . User::$current->data['avatar_url'];
$avatar_url = AZLib::getImageThumb(User::$current->data['avatar_url'], 80, 80, 0, User::$current->data['img_server']);
}
if ($blast == '') {
$blast = '...';
} else {
$blast = ' ' . $blast;
if (strpos($blast, 'http://')) {
$user_blast = $blast;
while (strpos($user_blast, 'http://')) {
$tmp = substr($user_blast, strpos($user_blast, 'http://'));
if (strpos($tmp, ' ') || strpos($tmp, '<')) {
if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
$blast_url = substr($tmp, 0, strpos($tmp, '<'));
} else {
$blast_url = substr($tmp, 0, strpos($tmp, ' '));
}
} else {
$blast_url = $tmp;
}
$user_blast = str_replace($blast_url, '', $user_blast);
}
$new_blast_url = ' <a rel="nofollow" href="' . $blast_url . '" target="_blank">Click here</a>';
$blast = substr($user_blast . $new_blast_url, 1);
}
}
$display->add('avatar_link', $avatar_link);
$display->add('avatar_url', $avatar_url);
$display->add('blast', $blast);
$display->add('user_id', User::id());
$TopMenu = $display->output('TopMenu', true, 'Personal');
$display->add('TopMenu', $TopMenu);
$display->output('success', false, 'Personal');
}
示例6: draw
function draw()
{
global $display;
$avatar_link = '';
$avatar_url = 'style/images/no_avatar_item.gif';
if (User::$current->data['avatar_url'] != '') {
$avatar_link = "http://" . CGlobal::$img_server[User::$current->data['img_server']] . User::$current->data['avatar_url'];
$avatar_url = AZLib::getImageThumb(User::$current->data['avatar_url'], 80, 80, 0, User::$current->data['img_server']);
}
$display->add('full_name', User::$current->data['full_name']);
$display->add('avatar_link', $avatar_link);
$display->add('avatar_url', $avatar_url);
$display->add('user_name', User::user_name());
$display->output('DashboardLeftNav');
}
示例7: draw
function draw()
{
if (Item::$item && isset(Item::$item['display']) && Item::$item['display']) {
global $display;
$re = DB::query("SELECT relate_id FROM item_relate WHERE item_id = " . Item::$item['id']);
$relate_ids = '';
$relate_arrs = array();
if ($re) {
while ($relate = mysql_fetch_assoc($re)) {
$relate_ids .= ($relate_ids != '' ? "," : "") . $relate['relate_id'];
}
}
if ($relate_ids) {
$re = DB::query("SELECT * FROM item WHERE id IN({$relate_ids}) AND status = 1 ORDER BY item_order");
$relate_ids = '';
if ($re) {
while ($product = mysql_fetch_assoc($re)) {
$relate_ids .= ($relate_ids != '' ? ',' : '') . $product['id'];
if ($product['img_url']) {
$product['image'] = AZLib::getImageThumb($product['img_url'], 180, 0, 0, $product['img_server']);
} else {
$product['image'] = "";
//"style/images/no-images-35x35.gif";
}
if (isset(CGlobal::$allCategories[$product['category_id']])) {
$product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
} else {
$product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
}
$product['name'] = stripslashes($product['name']);
$product['price'] = AZLib::getPrice($product['price'], $product['currency_id']);
$relate_arrs[] = $product;
}
}
}
$display->add('relate_ids', $relate_ids);
$display->add('relate_arrs', $relate_arrs);
$display->add('item_detail', Item::$item);
$display->add("share_url", urlencode("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
$display->add('WEB_NAME', WEB_NAME);
if (User::have_permit(ADMIN_ITEM)) {
$display->add('is_admin', 1);
$display->add('begin_form', $this->beginForm(false, 'post', false, false, 1));
$display->add('end_form', $this->endForm(true));
}
$display->output("ItemRelate");
}
}
示例8: draw
function draw()
{
global $display;
$display->add('msg', $this->showFormErrorMessages(1));
$display->add("customer_name", stripslashes(URL::get('customer_name', Cart::$cart['customer_name'])));
$display->add("customer_email", stripslashes(URL::get('customer_email', Cart::$cart['customer_email'])));
$display->add("customer_phone", stripslashes(URL::get('customer_phone', Cart::$cart['customer_phone'])));
$display->add("customer_address", stripslashes(URL::get('customer_address', Cart::$cart['customer_address'])));
$display->add("customer_note", stripslashes(URL::get('customer_note', Cart::$cart['customer_note'])));
//$quantity_total =0;
$price_total = 0;
$cart_items = array();
if (Cart::$cart_items) {
foreach (Cart::$cart_items as $cart_item_id => $cart_item) {
$item = Cart::$items[$cart_item['item_id']];
if (isset(CGlobal::$allCategories[$item['category_id']])) {
$cart_item['url'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
} else {
$cart_item['url'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
}
$cart_item['name'] = $item['name'];
$cart_item['price_num'] = $item['price'];
$cart_item['price'] = number_format($item['price'], 0, ',', '.');
if ($item['img_url']) {
$cart_item['img_url'] = AZLib::getImageThumb($item['img_url'], 120, 120, 0, $item['img_server']);
} else {
$item['img_url'] = '';
}
$cart_item['row_total'] = $cart_item['checked'] ? number_format($item['price'] * $cart_item['quantity'], null, null, '.') . ' VNĐ' : '';
$price_total += $cart_item['checked'] ? $item['price'] * $cart_item['quantity'] : 0;
//$quantity_total += $cart_item['checked'] ? $cart_item['quantity'] : 0;
$cart_items[$cart_item['id']] = $cart_item;
}
}
//$display->add('quantity_total',number_format($quantity_total,null,null,'.'));
$display->add('price_total', number_format($price_total, null, null, '.'));
$display->add('url_finish', Url::build_current(array('cmd' => 'finish')));
$display->add('cart_items', $cart_items);
$display->add('cart_id', "Cart_" . Cart::$cart['id']);
$this->beginForm();
$display->output('CartFinish');
$this->endForm();
}
示例9: draw
function draw()
{
global $display;
if (User::is_admin()) {
$display->add("is_admin", 1);
}
$display->add('url_home', WEB_DIR);
$display->add('time_create', News::displayTime($this->news['time_created']));
$display->add('title', stripslashes($this->news['title']));
$display->add('brief', stripslashes($this->news['brief']));
$display->add('content', stripslashes($this->news['content']));
$display->add('pen_name', stripslashes($this->news['pen_name']));
if ($this->news['source'] != '') {
$display->add('source', " ( theo <i>" . stripslashes($this->news['source']) . "</i> )");
} else {
$display->add('source', "");
}
if (User::have_permit(ADMIN_NEWS)) {
$display->add('admin_link', News::admin_link($this->news));
}
if ($this->news['image']) {
$display->add('img_full_url', "http://" . CGlobal::$img_server[$this->news['img_server']] . $this->news['image']);
$display->add('img_max_path', AZLib::getImageThumbMax($this->news['image'], '', 1, $this->news['img_server']));
$display->add('image_title', stripslashes($this->news['image_title']));
$display->add('image_url', AZLib::getImageThumb($this->news['image'], 180, 0, 0, $this->news['img_server']));
//AZLib::safe_title($this->news['title']))
$display->add('image_oringin', $this->news['image']);
}
$news_cart = CGlobal::$allNewsCategories[$this->news['news_catid']];
$display->add('news_home_link', Url::build('news'));
if ($news_cart) {
$display->add('cat_link', Url::build('news', array('news_catid' => $news_cart['id'], 'azname' => AZLib::safe_title($news_cart['name']))));
$display->add('cat_name', $news_cart['name']);
}
$display->add("share_title", urlencode(CGlobal::$website_title));
$display->add("share_url", "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$display->add("share_des", urlencode(trim(CGlobal::$meta_desc)));
$display->output("NewsDetail");
}
示例10: draw
function draw()
{
global $display;
$display->add('msg', $this->showFormErrorMessages(1));
$quantity_total = 0;
$price_total = 0;
$cart_items = array();
if (Cart::$cart_items) {
foreach (Cart::$cart_items as $cart_item_id => $cart_item) {
$item = Cart::$items[$cart_item['item_id']];
if (isset(CGlobal::$allCategories[$item['category_id']])) {
$cart_item['url'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
} else {
$cart_item['url'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
}
$cart_item['name'] = $item['name'];
$cart_item['price_num'] = $item['price'];
$cart_item['price'] = number_format($item['price'], 0, ',', '.');
if ($item['img_url']) {
$cart_item['img_url'] = AZLib::getImageThumb($item['img_url'], 120, 120, 0, $item['img_server']);
} else {
$item['img_url'] = '';
}
$cart_item['row_total'] = $cart_item['checked'] ? number_format($item['price'] * $cart_item['quantity'], null, null, '.') . ' VNĐ' : '';
$cart_item['delete'] = Url::build_current(array('cmd' => 'delete', 'id' => $cart_item['id']));
$price_total += $cart_item['checked'] ? $item['price'] * $cart_item['quantity'] : 0;
$quantity_total += $cart_item['checked'] ? $cart_item['quantity'] : 0;
$cart_items[$cart_item['id']] = $cart_item;
}
}
$display->add('quantity_total', number_format($quantity_total, null, null, '.'));
$display->add('price_total', number_format($price_total, null, null, '.'));
$display->add('url_finish', Url::build_current(array('cmd' => 'finish')));
$display->add('cart_items', $cart_items);
$display->add("print_link", Url::open_popup(Url::build('cart_print', array('id' => Cart::$cart['id'])), 1000, 800, false, false, false, false, false, 1, 1));
$this->beginForm();
$display->output('Cart');
$this->endForm();
}
示例11: draw
function draw()
{
global $display;
$home_newss = array();
$display->add('is_admin', User::have_permit(ADMIN_NEWS));
$display->add('url_home', WEB_DIR);
$display->add('time_now', News::displayTime());
$one_cart = '';
AZLib::getNewsCats();
if (CGlobal::$allNewsCategories) {
foreach (CGlobal::$allNewsCategories as $news_catid => $news_cat) {
if ($news_cat['public']) {
$newss = array();
$re = DB::query("SELECT * FROM news WHERE status=1 AND news_catid={$news_catid} ORDER BY id DESC LIMIT 0,4");
if ($re) {
$i = 1;
while ($news = mysql_fetch_assoc($re)) {
if ($i == 1) {
if ($news['image']) {
$news['image'] = AZLib::getImageThumb($news['image'], 150, 0, 0, $news['img_server']);
}
$i++;
}
$news['url'] = URL::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
$news['news_h'] = date('H:i', $news['time_created']);
$news['news_d'] = date('d-m-Y', $news['time_created']);
$newss[$news['id']] = $news;
}
}
if ($newss) {
$home_newss[$news_catid] = array('name' => $news_cat['name'], 'url' => URL::build('news_list', array('news_catid' => $news_catid, 'azname' => AZLib::safe_title($news_cat['name']))), 'newss' => $newss);
}
}
}
}
$display->add('home_newss', $home_newss);
$display->output("NewsHome");
}
示例12: draw
//.........这里部分代码省略.........
}
if ($created_time_to) {
$search_value .= ($search_value != '' ? ' AND ' : ' WHERE') . ' time <= ' . $created_time_to;
}
}
$display->add('created_time_from', $current_time_from);
$display->add('created_time_to', $current_time_to);
$item_per_page = 120;
$sql_count = 'SELECT count(*) AS total_img FROM item_image ' . $search_value;
$total = DB::fetch($sql_count, 'total_img', 0);
$items = array();
if ($total) {
$limit = '';
$paging = AZPagging::pagingSE($limit, $total, $item_per_page, 10, 'page_no', true);
$sql = 'SELECT id,img_server, img_url,item_id, title, des, time, user_name, user_id, img_server FROM `item_image`';
$sql .= $search_value . ' ORDER BY id ASC ' . $limit;
$item_ids = '';
$re = DB::query($sql);
if ($re) {
while ($row = mysql_fetch_assoc($re)) {
$row['link_gallery'] = WEB_DIR . AZRewrite::formatUrl('?page=gallery&user_id=' . $row['user_id'] . '&year=' . date('Y', $row['time']) . '&month=' . (int) date('m', $row['time']) . '&day=' . (int) date('d', $row['time']));
if (date('d.m.y', $row['time']) == date('d.m.y', TIME_NOW)) {
$row['time'] = date('H:i', $row['time']);
} elseif (date('y', $row['time']) == date('y', TIME_NOW)) {
$row['time'] = date('d/m H:i', $row['time']);
} else {
$row['time'] = date('d/m/y H:i', $row['time']);
}
//if(!eregi('/',$row['img_url'])){
// $row['link_img']='http://'.CGlobal::$img_server[$row['img_server']].'uploaded/items/'.$row['img_url'];
//}
//else{
$row['link_img'] = 'http://' . CGlobal::$img_server[$row['img_server']] . $row['img_url'];
//}
if ($row['item_id']) {
$item_ids .= ($item_ids ? ',' : '') . $row['item_id'];
if (isset($row['name'])) {
$row['item_link'] = WEB_DIR . AZRewrite::formatUrl("?page=item_detail&id={$row['item_id']}&ebname=" . AZLib::safe_title($row['name']));
if (date('d.m.y', $row['created_time']) == date('d.m.y', TIME_NOW)) {
$row['created_time'] = date('H:i', $row['created_time']);
} elseif (date('y', $row['created_time']) == date('y', TIME_NOW)) {
$row['created_time'] = date('d/m H:i', $row['created_time']);
} else {
$row['created_time'] = date('d/m/y H:i', $row['created_time']);
}
} else {
$row['item_link'] = WEB_DIR . AZRewrite::formatUrl("?page=item_detail&id={$row['item_id']}");
$row['created_time'] = '';
}
$row['title'] = stripslashes($row['title']);
} else {
$row['title'] = stripslashes($row['des']);
$row['created_time'] = '';
$row['item_link'] = '';
}
$row['image_thumb'] = AZLib::getImageThumb($row['img_url'], 110, 0, 1, $row["img_server"]);
$row['image_max'] = AZLib::getImageThumbMax($row['img_url'], $row['title'], 1, $row["img_server"]);
$row['images_url_root'] = 'http://' . CGlobal::$img_server[$row['img_server']];
$row['del_link'] = Url::build_all(array('chk_id', 'del_all', 'cmd', 'id'), 'cmd=delete&id=' . $row['id']);
$items[$row['id']] = $row;
}
if ($item_ids) {
$all_items = array();
$sql = "SELECT id, name, created_time FROM item WHERE id IN({$item_ids})";
$re = DB::query($sql);
if ($re) {
while ($item = mysql_fetch_assoc($re)) {
$all_items[$item['id']] = $item;
}
}
foreach ($items as &$item_img) {
if ($item_img['item_id'] && isset($all_items[$item_img['item_id']])) {
$item_img['item_link'] = WEB_DIR . AZRewrite::formatUrl("?page=item_detail&id={$item_img['item_id']}&ebname=" . AZLib::safe_title($all_items[$item_img['item_id']]['name']));
if (date('d.m.y', $all_items[$item_img['item_id']]['created_time']) == date('d.m.y', TIME_NOW)) {
$item_img['created_time'] = date('H:i', $all_items[$item_img['item_id']]['created_time']);
} elseif (date('y', $all_items[$item_img['item_id']]['created_time']) == date('y', TIME_NOW)) {
$item_img['created_time'] = date('d/m H:i', $all_items[$item_img['item_id']]['created_time']);
} else {
$item_img['created_time'] = date('d/m/y H:i', $all_items[$item_img['item_id']]['created_time']);
}
} else {
$item_img['item_link'] = '';
$item_img['created_time'] = '';
}
}
}
}
} else {
$paging = '';
}
AZLib::my_setcookie("page_img_id", Url::get("page_no") != "" ? intval(Url::get("page_no")) : 1, 60 * 60 * 24 * 365 + TIME_NOW);
$display->add("uri", CGlobal::$request_uri);
$display->add("images_url_root", 'http://' . CGlobal::$img_server[IMAGE_SERVER_NO]);
$display->add('user_name', Url::get('user_name'));
$display->add('item_title', Url::get('item_title'));
$display->add('items', $items);
$display->add('paging', $paging);
$display->output('ManageImage');
$this->endForm();
}
示例13: draw
function draw()
{
global $display;
$display->add('msg', $this->showFormErrorMessages(1));
if ($this->cart['user_id']) {
$display->add("user_name", $this->cart['user_name']);
}
$display->add("user_id", $this->cart['user_id']);
$display->add("customer_name", stripslashes(URL::get('customer_name', $this->cart['customer_name'])));
$display->add("customer_email", stripslashes(URL::get('customer_email', $this->cart['customer_email'])));
$display->add("customer_phone", stripslashes(URL::get('customer_phone', $this->cart['customer_phone'])));
$display->add("customer_address", stripslashes(URL::get('customer_address', $this->cart['customer_address'])));
$display->add("customer_note", stripslashes(URL::get('customer_note', $this->cart['customer_note'])));
$display->add("note", stripslashes(URL::get('note', $this->cart['note'])));
//$quantity_total =0;
$price_total = 0;
$cart_items = array();
if ($this->cart_items) {
foreach ($this->cart_items as $cart_item_id => $cart_item) {
$item = $this->items[$cart_item['item_id']];
if (isset(CGlobal::$allCategories[$item['category_id']])) {
$cart_item['url'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
} else {
$cart_item['url'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
}
$cart_item['name'] = $item['name'];
$cart_item['price_num'] = $item['price'];
$cart_item['price'] = number_format($item['price'], 0, ',', '.');
if ($item['img_url']) {
$cart_item['img_url'] = AZLib::getImageThumb($item['img_url'], 120, 120, 0, $item['img_server']);
} else {
$item['img_url'] = '';
}
$cart_item["delete"] = Url::build_current(array('cmd', 'id', 'act' => 'del_item', 'ci_id' => $cart_item['id']));
$cart_item['row_total'] = $cart_item['checked'] ? number_format($item['price'] * $cart_item['quantity'], null, null, '.') . ' VNĐ' : '';
$price_total += $cart_item['checked'] ? $item['price'] * $cart_item['quantity'] : 0;
//$quantity_total += $cart_item['checked'] ? $cart_item['quantity'] : 0;
$cart_items[$cart_item['id']] = $cart_item;
}
}
$display->add('price_total', number_format($price_total, null, null, '.'));
$display->add('url_finish', Url::build_current(array('cmd' => 'finish')));
$display->add('cart_items', $cart_items);
//1:Chưa cập nhật; 2: Đã gửi đơn hàng ; 3: Đã TT; 4: Hủy đơn hàng; 5: Đã duyệt
$status_arr = array(6 => "--Tất cả--", 2 => "Đã gửi đơn hàng", 1 => "Chưa cập nhật", 3 => "Đã Thanh toán", 5 => "Đã duyệt", 4 => "Đã hủy");
$display->add("status_option", AZLib::getOption($status_arr, $this->cart['status']));
$display->add('cart_id', "Cart_" . $this->cart['id']);
$display->add("time_create", date('d/m/Y H:i:s', $this->cart['time_create']));
$display->add("time_change", date('d/m/Y H:i:s', $this->cart['time_change']));
if ($this->cart['time_finish']) {
$display->add("time_finish", date('d/m/Y H:i:s', $this->cart['time_finish']));
} else {
$display->add("time_finish", "Chưa hoàn thành!");
}
$this->beginForm();
$display->output('CartEdit');
$this->endForm();
}
示例14: stripslashes
if (isset($all_items[$topcid]['subs'][$seccid])) {
if ($item['quantity']) {
$item['quantity'] = "Có hàng";
} else {
$item['quantity'] = "<font color=red>Call</font>";
}
if ($item['price']) {
if ($item['currency_id'] == 2) {
$item['price'] = $item['price'] * CGlobal::$exchange;
}
$item['price'] = Url::currency_format($item['price']);
} else {
$item['price'] = "Liên hệ";
}
if ($item['img_url']) {
$item['img_url'] = $url . AZLib::getImageThumb($item['img_url'], 80, 80, 0, $item['img_server']);
} else {
$item['img_url'] = '';
}
$item['name'] = stripslashes($item['name']);
$item['list_brief'] = stripslashes($item['list_brief']);
$item['url'] = WEB_ROOT . CGlobal::$allCategories[$seccid]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
unset($all_check_items[$topcid]['subs'][$seccid]);
$all_items[$topcid]['subs'][$seccid]['items'][$item['id']] = $item;
}
}
}
if ($all_check_items) {
foreach ($all_check_items as $topid => $topcat) {
if ($topcat['subs']) {
foreach ($topcat['subs'] as $sid => $scat) {
示例15: draw
function draw()
{
global $display;
$item_cat_ids = '';
$offer_cats = array();
$item_cats = array();
$item_cat_offer = array();
$configs = @CGlobal::$configs['ItemOffer']['conf_val'];
if ($configs) {
$configs = unserialize(stripslashes($configs));
} else {
$configs = array('title' => "SẢN PHẨM KHUYẾN MẠI", 'item_cat_offer' => array());
}
foreach (CGlobal::$subCategories as $top_id => $sub_cats) {
if (isset(CGlobal::$allCategories[$top_id]) && CGlobal::$allCategories[$top_id]['parent_id'] == 0) {
$topcat = CGlobal::$allCategories[$top_id];
if ($topcat['status'] == "HOME") {
$item_ids = isset($configs['item_cat_offer'][$top_id]) ? $configs['item_cat_offer'][$top_id] : '';
if ($item_ids) {
$item_cat_ids .= ($item_cat_ids != '' ? ',' : '') . $item_ids;
}
$arr = array('id' => $top_id, 'name' => "<a href='" . WEB_DIR . "c{$topcat['id']}/{$topcat['ebname']}'>{$topcat['name']}</a>", 'item_ids' => $item_ids, 'sub' => array(), 'sub_display' => 0);
foreach ($sub_cats as $sid => $subcat) {
$item_ids = isset($configs['item_cat_offer'][$sid]) ? $configs['item_cat_offer'][$sid] : '';
if ($item_ids) {
$arr['sub_display'] = 1;
$item_cat_ids .= ($item_cat_ids != '' ? ',' : '') . $item_ids;
}
$arr['sub'][$sid] = array('id' => $sid, 'name' => "<a href='" . WEB_DIR . "c{$subcat['id']}/{$topcat['ebname']}-{$subcat['ebname']}'>{$subcat['name']}</a>", 'item_ids' => $item_ids);
}
$item_cat_offer[$top_id] = $arr;
}
}
}
if ($item_cat_ids) {
$re = DB::query("SELECT * FROM item WHERE id IN({$item_cat_ids}) AND status = 1 ORDER BY find_in_set(id,'{$item_cat_ids}')");
if ($re) {
while ($product = mysql_fetch_assoc($re)) {
if ($product['img_url']) {
$product['image'] = AZLib::getImageThumb($product['img_url'], 235, 150, 0, $product['img_server']);
} else {
$product['image'] = "";
//"style/images/no-images-35x35.gif";
}
if (isset(CGlobal::$allCategories[$product['category_id']])) {
$product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
} else {
$product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
}
$product['name'] = stripslashes($product['name']);
$product['price_num'] = $product['price'];
$product['price'] = AZLib::getPrice($product['price'], $product['currency_id']);
if ($product['price_out']) {
if ($product['price_num'] < $product['price_out']) {
$product['sale_off'] = floor(100 * ($product['price_out'] - $product['price_num']) / $product['price_out']);
}
$product['price_out'] = AZLib::getPrice($product['price_out'], $product['currency_id']);
}
//level_1_catid
//$topcat_id =
if (isset($configs['item_cat_offer'][$product['level_1_catid']]) && in_array($product['id'], explode(',', $configs['item_cat_offer'][$product['level_1_catid']]))) {
$offer_cats[$product['level_1_catid']] = CGlobal::$allCategories[$product['level_1_catid']];
$item_cats[$product['level_1_catid']][$product['id']] = $product;
}
if (isset($configs['item_cat_offer'][$product['category_id']]) && in_array($product['id'], explode(',', $configs['item_cat_offer'][$product['category_id']]))) {
$offer_cats[$product['category_id']] = CGlobal::$allCategories[$product['category_id']];
$item_cats[$product['category_id']][$product['id']] = $product;
}
}
}
}
if (User::is_admin()) {
$display->add("is_admin", 1);
$display->add("msg", $this->showFormErrorMessages(1));
$display->add('begin_form', $this->beginForm(true, 'post', false, false, 1));
$display->add('end_form', $this->endForm(true));
}
$display->add('title_offer', $configs['title']);
$display->add('item_cat_offer', $item_cat_offer);
$display->add('item_cats', $item_cats);
$display->add('offer_cats', $offer_cats);
################################################################################################################
#ADV config
$config = @CGlobal::$configs['AdvItemOffer']['conf_val'];
$status = 0;
$url_detail = '';
$type_display = 1;
if ($config != '') {
$config_arr = explode("\n", $config);
$status = (int) $config_arr[0];
$url_detail = $config_arr[1];
$type_display = (int) $config_arr[2];
}
if ($status) {
//Bật
if ($type_display == 1) {
$display->add('adv_banner', DATA_PATH . 'adv/AdvItemOffer.gif');
} else {
$display->add('adv_banner', DATA_PATH . 'adv/AdvItemOffer.swf');
}
//.........这里部分代码省略.........