本文整理汇总了PHP中CGlobal::shop_setting方法的典型用法代码示例。如果您正苦于以下问题:PHP CGlobal::shop_setting方法的具体用法?PHP CGlobal::shop_setting怎么用?PHP CGlobal::shop_setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGlobal
的用法示例。
在下文中一共展示了CGlobal::shop_setting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unserialize
function load_shop_label()
{
if (!CGlobal::$user_profile) {
User::check_get_user();
}
if (CGlobal::$user_profile) {
$mode_default = 'comment';
if (!CGlobal::$shop_setting) {
if (CGlobal::$user_profile['shop_setting']) {
CGlobal::$shop_setting = unserialize(stripslashes(CGlobal::$user_profile['shop_setting']));
}
if (!CGlobal::$shop_setting) {
CGlobal::$shop_setting = array('shop_name' => CGlobal::$user_profile['full_name'] ? CGlobal::$user_profile['full_name'] : CGlobal::$user_profile['user_name'], 'default_mode' => 1, 'default_layout' => 1, 'item_list_mode' => 0, 'adv_banner' => '');
}
}
if (CGlobal::$shop_setting && !isset(CGlobal::$shop_setting['default_layout'])) {
CGlobal::$shop_setting['default_layout'] = 1;
}
if (Url::get("mode") == "comment" || CGlobal::$shop_setting['default_mode'] == 2) {
CGlobal::$website_title = 'Lưu bút - Shop ' . CGlobal::$user_profile['user_name'];
}
if (!CGlobal::$shop_setting['default_mode']) {
if (Url::get('mode') == 'shop' || DB::select('item', 'user_id=' . CGlobal::$user_profile['id'] . ' AND status=1')) {
//Nếu có sp, mặc định là vào shop
CGlobal::$shop_setting['default_mode'] = 1;
$mode_default = 'shop';
} else {
//Nếu ko có sản phẩm, mặc định vào lưu bút
CGlobal::$shop_setting['default_mode'] = 2;
$mode_default = 'comment';
}
} else {
if (CGlobal::$shop_setting['default_mode'] == 1) {
$mode_default = 'shop';
} else {
$mode_default = 'comment';
}
}
}
if (CGlobal::$shop_label) {
CGlobal::$website_title .= ' | ' . CGlobal::$shop_label['name'];
$this->label_id = CGlobal::$shop_label['id'];
} else {
$this->label_id = (int) Url::get('label_id', 0);
if ($this->label_id) {
CGlobal::$shop_label = DB::select("label", "id=" . $this->label_id);
}
if (!CGlobal::$shop_label) {
$this->label_id = 0;
}
}
$page_shop_item = (int) Url::get('page_shop_item', 1);
$label_id = (int) Url::get("label_id", 0);
$list_type = (int) Url::get("list_type", 0);
global $display;
$display->add('top_level_id', $label_id);
$display->add('list_type', $list_type);
$display->add('can_edit', User::have_permit(ADMIN_ITEM) || User::id() == CGlobal::$user_profile['id']);
$status_check = User::id() == CGlobal::$user_profile['id'] || User::have_permit(ADMIN_ITEM) ? ' status IN(0,1,2,3,4,5)' : ' status =1';
if ($label_id) {
$total_item = DB::fetch('SELECT count(*) AS total_row FROM label_item AS L JOIN item AS I ON L.item_id=I.id AND I.' . $status_check . ' AND I.user_id=' . CGlobal::$user_profile['id'] . ' WHERE L.user_id=' . CGlobal::$user_profile['id'] . ' AND L.label_id=' . $label_id, 'total_row', 0);
} else {
$total_item = DB::fetch('SELECT count(*) AS total_row FROM item WHERE ' . $status_check . ' AND user_id=' . CGlobal::$user_profile['id'], 'total_row', 0);
}
$pagging = '';
$items = array();
$divID = 'shop_item';
$item_per_page = 0;
if ($total_item) {
$item_per_page = 9;
$limit = '';
$url_path = WEB_DIR . 'ajax.php?act=shop&code=load_shop_label&user_id=' . CGlobal::$user_profile['id'] . '&label_id=' . $label_id . (!$list_type ? '' : '&list_type=' . $list_type);
$pagging = AZPagging::AjaxPaging($limit, $total_item, $item_per_page, 5, 'page_shop_item', '', false, false, $url_path, $divID, true);
if ($label_id) {
$display->add('label_name', CGlobal::$shop_label['name']);
$select = 'SELECT I.id, I.name,I.sapo, I.user_name, I.user_id,I.description,I.category_id, I.read_count, I.reply_count, I.currency_id, I.price, I.province_id, I.up_time,I.price_out, I.brief, I.img_url, I.status, I.state, I.img_server
FROM label_item AS L JOIN item AS I ON L.item_id=I.id AND I.' . $status_check . ' AND I.user_id=' . CGlobal::$user_profile['id'] . ' WHERE L.user_id=' . CGlobal::$user_profile['id'] . ' AND L.label_id=' . $label_id . ' ORDER BY shop_order, up_time DESC' . $limit;
} else {
$select = 'SELECT id, name, sapo, user_name, user_id, description, category_id, read_count, reply_count, currency_id, price, brief, img_url, province_id, up_time, price_out, status, state, img_server,sticky FROM item WHERE ' . $status_check . ' AND user_id=' . CGlobal::$user_profile['id'] . ' ORDER BY shop_order, up_time DESC' . $limit;
}
$re = DB::query($select);
if (User::is_login()) {
$wids = User::get_wishlist('wish_list_items');
$w_items = array();
if ($wids) {
$w_items = explode(',', $wids);
}
}
if ($re) {
AZLib::getProvinces();
AZLib::getCats();
$item_ids = '';
while ($item = mysql_fetch_assoc($re)) {
$item['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']);
$item['price_out'] = AZLib::convertCurrency($item['price_out'], $item['currency_id']);
$item['currency_id'] = 1;
if ($item['img_url']) {
$item['image_url'] = AZLib::getImageThumb($item['img_url'], 200, 200, 0, $item['img_server']);
}
if (isset(CGlobal::$allCategories[$item['category_id']])) {
//.........这里部分代码省略.........