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


PHP AZLib::word_limit方法代码示例

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


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

示例1: 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");
 }
开发者ID:duynhan07,项目名称:elink,代码行数:55,代码来源:ItemNew.php

示例2: draw

 function draw()
 {
     $this->beginForm();
     global $display;
     $display->add('created_time_from', Url::get('created_time_from'));
     $display->add('created_time_to', Url::get('created_time_to'));
     $display->add('sender_user_name', Url::get('sender_user_name'));
     $display->add('processed', Url::get('processed'));
     //search theo ngay thang nam
     $created_time_from = 0;
     $created_time_to = 0;
     if (Url::get('created_time_from')) {
         $date_arr = explode('-', Url::get('created_time_from'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_from = mktime(0, 0, 0, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     if (Url::get('created_time_to')) {
         $date_arr = explode('-', Url::get('created_time_to'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $created_time_to = mktime(23, 59, 59, (int) $date_arr[1], (int) $date_arr[0], (int) $date_arr[2]);
         }
     }
     $search_value = ' 1 ';
     if ($created_time_from) {
         $search_value .= ' AND time_post >= ' . $created_time_from;
     }
     if ($created_time_to) {
         $search_value .= ' AND time_post <= ' . $created_time_to;
     }
     // search ô textbox
     if (Url::get('sender_user_name') != '') {
         $search_value .= ' AND b.user_name like "%' . Url::get('sender_user_name') . '%" ';
     }
     if (Url::get('processed') == 1) {
         $search_value .= ' AND b.status = 0';
     }
     $item_per_page = 50;
     $sql_count = 'SELECT COUNT(*) AS total_item FROM `bad_content` AS b WHERE b.type = 1 AND ' . $search_value;
     $total = DB::fetch($sql_count, 'total_item', 0);
     $items = array();
     if ($total) {
         $limit = '';
         $paging = AZPagging::pagingSE($limit, $total, $item_per_page, 10, 'page_no', true, 'Phản hồi', 'Trang');
         $sql = 'SELECT i.name,i.transaction_type,i.category_id, b.id, b.admin_name, b.status, b.type,b.id_item, b.reason,b.user_id,b.user_name, b.note, b.time_post FROM `bad_content` b LEFT JOIN item i ON i.id = b.id_item WHERE b.type = 1 AND ' . $search_value . ' ORDER BY b.status, b.time_post DESC, b.type ASC ' . $limit;
         $result = DB::query($sql);
         if ($result) {
             while ($row = mysql_fetch_assoc($result)) {
                 $row['content'] = $row['name'];
                 $row['time_post'] = date('d/m/y H:i', $row['time_post']);
                 $row['content_tooltip'] = AZLib::remove_4_js(AZLib::filter_title($row['content']));
                 $row['content'] = AZLib::word_limit($row['content'], 12, '...');
                 $row['reason_tooltip'] = AZLib::remove_4_js(AZLib::filter_title($row['reason']));
                 $row['reason'] = AZLib::word_limit($row['reason'], 12, '...');
                 $row['note_tooltip'] = AZLib::remove_4_js(AZLib::filter_title($row['note']));
                 $row['note'] = AZLib::word_limit($row['note'], 12, '...');
                 $row['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $row['id_item'] . '&ebname=' . AZLib::safe_title($row['name']));
                 $row['del_link'] = Url::build_all(array('chk_id', 'del_all', 'cmd', 'id'), 'cmd=delete&id=' . $row['id']);
                 $items[$row['id']] = $row;
             }
         }
     } else {
         $paging = '';
     }
     $display->add('items', $items);
     $display->add('paging', $paging);
     $display->output('list');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:69,代码来源:ManageBadContent.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: on_submit

 function on_submit()
 {
     $gfsubmit = Url::get("gfsubmit");
     if ($gfsubmit) {
         $fgroup_id = (int) implode(array_keys($gfsubmit));
         if ($fgroup_id) {
             $fgroup = DB::select("filter_group", "id={$fgroup_id}");
             if ($fgroup) {
                 $gf_name = Url::get('gf_name');
                 $gf_pos = Url::get('gf_pos');
                 if (isset($gf_name[$fgroup_id], $gf_pos[$fgroup_id]) && $gf_name[$fgroup_id] && $gf_pos[$fgroup_id]) {
                     $gf_name = $gf_name[$fgroup_id];
                     $gf_pos = $gf_pos[$fgroup_id];
                     if ($fgroup['name'] != $gf_name || $fgroup['pos'] != $gf_pos) {
                         $max_pos = (int) DB::fetch("SELECT max(pos) AS max_pos FROM filter_group", 'max_pos', 0);
                         if ($gf_pos > $max_pos) {
                             $gf_pos = $max_pos;
                         } elseif ($gf_pos <= 0) {
                             $gf_pos = $fgroup['pos'];
                         }
                         DB::update('filter_group', array("name" => $gf_name, "pos" => $gf_pos), "id={$fgroup_id}");
                         if (DB::select('filter_group', "pos={$gf_pos} AND id!={$fgroup_id}")) {
                             DB::query("UPDATE filter_group SET pos=pos+1 WHERE pos>={$gf_pos} AND pos<={$fgroup['pos']} AND id!={$fgroup_id}");
                         }
                         AZLib::getFilters(1);
                     }
                 }
             }
         }
         Url::redirect_current(array('cmd', 'id'));
     }
     $submit = Url::get("submit");
     if ($submit == "Thêm nhóm thuộc tính") {
         $gfilter_name = Url::get('gfilter_name');
         $gfilter_pos = Url::get('gfilter_pos');
         if ($gfilter_name != '' && $gfilter_pos) {
             $gfilter_group = array('name' => $gfilter_name, 'catids' => $this->cat['id'], 'pos' => $gfilter_pos);
             $max_pos = (int) DB::fetch("SELECT max(pos) AS max_pos FROM filter_group", 'max_pos', 0);
             if ($gfilter_pos > $max_pos || $gfilter_pos <= 0) {
                 $gfilter_pos = $max_pos + 1;
             }
             $gfilter_group['pos'] = $gfilter_pos;
             $id = DB::insert('filter_group', $gfilter_group);
             if ($id && DB::select('filter_group', 'pos="' . $gfilter_pos . '" AND id!=' . $id)) {
                 DB::query('UPDATE filter_group SET pos=pos+1 WHERE pos>=' . $gfilter_pos . ' AND id!=' . $id);
             }
         }
         AZLib::getFilters(1);
         Url::redirect_current(array('cmd', 'id'));
     }
     $name = Url::get('name');
     $brief_name = Url::get('brief_name');
     $keywords = Url::get('keywords');
     $description = Url::get('description');
     $parent_id = Url::get('parent_id');
     $zoneids = Url::get('zoneids');
     $ref_id = Url::get('ref_id');
     $status = Url::get('status', 'HIDE');
     $position = Url::get('position');
     $tag_search = Url::get('tag_search');
     $price_str = trim(Url::get('price_str'));
     $recomend = trim(Url::get('recomend'));
     if ($price_str) {
         function check_price_str($price)
         {
             return Url::cdouble(trim($price));
         }
         $price_ar = array_unique(array_map('check_price_str', explode(",", $price_str)));
         $price_str = '';
         if ($price_ar) {
             asort($price_ar);
             foreach ($price_ar as $price) {
                 if ($price > 0) {
                     $price_str .= ($price_str != '' ? ',' : '') . $price;
                 }
             }
         }
     }
     $this->checkFormInput('Tên Danh mục', 'name', $name, 'str', true, '', 1, 255);
     $this->checkFormInput('Tên vắn tắt', 'brief_name', $brief_name, 'str', false, '', 1, 255);
     //$this->checkFormInput('Từ khoá','keywords',$keywords,'str',false,'',0,20);
     $this->checkFormInput('Mô tả', 'description', $description, 'str', false, '', 0, 250);
     if (Url::get('cmd') == 'edit' && $this->cat['parent_id'] == 0 && $parent_id && DB::select("category", 'parent_id=' . $this->cat['id'])) {
         $this->setFormError("parent_id", 'Không thể chuyển "Danh mục có danh mục con" thành một "Danh mục con" của "Danh mục khác" được!');
     }
     if (!$this->errNum) {
         $new_row = array('name' => $name, 'brief_name' => $brief_name ? $brief_name : $name, 'keywords' => AZLib::word_limit($keywords, 20, ''), 'description' => $description, 'parent_id' => $parent_id, 'ref_id' => $ref_id, 'status' => $status, 'tag_search' => $tag_search, 'img_server' => IMAGE_SERVER_NO, 'price_str' => $price_str, 'recomend' => $recomend);
         if (Url::get('cmd') == 'edit') {
             if ($position > 0 && $position != $this->cat['position']) {
                 $max_pos = (int) DB::fetch("SELECT max(position) AS max_pos FROM category WHERE parent_id=" . $parent_id, 'max_pos');
                 if ($position > $max_pos) {
                     $position = $max_pos + 1;
                 }
                 $new_row['position'] = $position;
             } else {
                 $position = $this->cat['position'];
             }
             $id = $this->cat['id'];
             DB::update('category', $new_row, 'id=' . $this->cat['id']);
             /*if($this->cat['parent_id']==0 && $parent_id){
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:CategoryEdit.php

示例5: show_mes_outbox

    function show_mes_outbox()
    {
        $search_text = AZLib::getParam('search_text');
        $is_archive = Url::get('is_archive', 0);
        $table_topics = 'message_topics';
        $table_text = 'message_text';
        $url_archive = '';
        $url_cmd = '';
        if ($is_archive) {
            $table_topics = $table_topics . '_archive';
            $table_text = $table_text . '_archive';
            $url_cmd = '?cmd=archive';
            $url_archive = '&is_archive=1';
        }
        $condition = $table_topics . '.mt_owner_id =' . User::id() . ' 
					AND ' . $table_topics . '.mt_vid_folder = "sent" 
					AND ' . $table_topics . '.mt_newest = 0';
        if ($search_text && $search_text != "Account thành viên") {
            $condition .= " AND mt_to_name LIKE '%{$search_text}%' ";
        }
        $str_content = '<form name="message">
						<div id="boxFunctions">
							Chọn: 
							<a style="cursor:pointer" id="select_all">Tất cả</a>,
							<a style="cursor:pointer" id="select_read">Đã đọc</a>,
							<a style="cursor:pointer" id="select_unchecked">Không chọn</a>
							<div id="boxFunctionRight">
								<div id="btn_del_mess" align="center" class="btnAllNewFeedback" onmouseout="this.className=\'btnAllNewFeedback\'"  onmouseover="this.className=\'btnAllNewFeedbackHover\'"  style="width:40px;">
									<div class="btnRightAllFeedback" align="center" style="width:40px"><a title="Xóa tất cả tin nhặn đã chọn" href="javascript:void(0)" onClick="return delMessage(0,\'true\',\'outbox\')">Xoá</a></div>
								</div>
							</div>
						</div>
						
						';
        $str_content .= '<table cellpadding="3" cellspacing="0" border="0" width="100%">';
        $sql_count = 'SELECT COUNT(mt_id) AS total_row FROM ' . $table_topics . ' WHERE ' . $condition;
        $total_item = DB::fetch($sql_count, 'total_row', 0);
        $item_per_page = 15;
        $limit = '';
        $divID = 'mess_content';
        $url_path = WEB_DIR . 'ajax.php?act=personal&code=show_mes_outbox' . $url_archive . '&search_text=' . $search_text;
        $paging = AZPagging::AjaxPaging($limit, $total_item, $item_per_page, 5, 'page_mes', '', false, false, $url_path, $divID, true);
        $sql = 'SELECT ' . $table_text . '.msg_id,	' . $table_text . '.msg_author_name, ' . $table_text . '.msg_date, ' . $table_text . '.msg_post, ' . $table_topics . '.mt_id, ' . $table_topics . '.mt_ref_id, 
					' . $table_topics . '.mt_title, ' . $table_topics . '.mt_from_id, ' . $table_topics . '.mt_owner_id, ' . $table_topics . '.mt_read, ' . $table_topics . '.mt_owner_name, ' . $table_topics . '.mt_to_name, 
					user.avatar_url, user.img_server 
				FROM ' . $table_text . ', ' . $table_topics . ', user 
				WHERE ' . $table_text . '.msg_id  = ' . $table_topics . '.mt_msg_id AND ' . $table_topics . '.mt_from_id = user.id AND ' . $condition . ' 
				ORDER BY ' . $table_text . '.msg_date DESC ' . $limit;
        //echo $sql;
        //exit;
        $result = DB::query($sql);
        $stt = 0;
        if ($result) {
            while ($row = mysql_fetch_assoc($result)) {
                if ($stt < $item_per_page) {
                    if ($row['mt_ref_id']) {
                        $sourceTitle = DB::select($table_topics, 'mt_id = ' . $row['mt_ref_id']);
                        if ($sourceTitle['mt_title']) {
                            $row['mt_title'] = $sourceTitle['mt_title'];
                        }
                        //else
                        //{
                        //	$sentTitle = DB::select($table_topics,'mt_mgsid = ' . $row['mt_ref_id']);
                        //}
                        $row["mt_id"] = $row['mt_ref_id'];
                        $row['mt_ref_id'] = 0;
                    }
                    if ($row['avatar_url']) {
                        $row['avatar_url'] = AZLib::getImageThumb($row['avatar_url'], 50, 50, 0, $row['img_server']);
                    } else {
                        $row['avatar_url'] = "style/images/50x50.gif";
                    }
                    //$row['msg_date'] = AZLib::duration_time($row['msg_date']);
                    $msg_date = date('H:i | ', $row['msg_date']);
                    if (date('d.m.y', $row['msg_date']) == date('d.m.y', TIME_NOW)) {
                        $msg_date .= '<font color="green">H&#244;m nay</font>';
                    } else {
                        $msg_date .= date('d.m.y', $row['msg_date']);
                    }
                    $row['msg_date'] = $msg_date;
                    $row['msg_post'] = preg_replace("/\n/", "<br />", $row['msg_post']);
                    $row['msg_post'] = strip_tags(AZLib::parseBBCode(AZLib::convert_one_br($row['msg_post'])), '<br />');
                    if (strlen($row['msg_post']) > 40) {
                        $row['msg_post_short'] = AZLib::word_limit($row['msg_post'], 40, ' ...');
                        //$row['msg_post_short'] = AZLib::cleanHtml(AZLib::word_limit($row['msg_post'],40,' ...'));
                    } else {
                        $row['msg_post_short'] = $row['msg_post'];
                        //$row['msg_post_short'] = AZLib::cleanHtml($row['msg_post']);
                    }
                    //$str_title = '<a onclick="fn_show_mes_detail('.$row["mt_id"].')" rel="history" href="message.html'.$url_cmd.'#outbox/'.$row["mt_id"].'" id="a_'.$row["mt_id"].'" title="Hiển thị chi tiết" >'.$row["mt_title"].'</a> - <span class="textMestime">'.$row['msg_date'].'</span>';
                    if ($row['mt_owner_id'] != User::id()) {
                        $strUser = '<a href="' . $row["mt_owner_name"] . '">' . $row["mt_owner_name"] . '</a>';
                    } else {
                        $strUser = '<a href="' . $row["mt_to_name"] . '">' . $row["mt_to_name"] . '</a>';
                    }
                    if ($row["mt_read"] == 0 && !$is_archive) {
                        $str_title = '<a onclick="detail_reload_jcache = true;fn_show_mes_detail(' . $row["mt_id"] . ',1,\'outbox\')" rel="history" id="a_' . $row["mt_id"] . '" href="message.html' . $url_cmd . '#outbox/' . $row["mt_id"] . '" title="Hiển thị chi tiết" ><b>' . $row["mt_title"] . '</b></a>';
                        $read_class = ' unreadMessage';
                    } else {
                        $str_title = '<a onclick="detail_reload_jcache = true;fn_show_mes_detail(' . $row["mt_id"] . ',1,\'outbox\')" rel="history" id="a_' . $row["mt_id"] . '" href="message.html' . $url_cmd . '#outbox/' . $row["mt_id"] . '" title="Hiển thị chi tiết">' . $row["mt_title"] . '</a>';
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ajax_personal.ajax.php

示例6: draw

 function draw()
 {
     global $display;
     $this->beginForm(false, "POST", false, Url::build_current());
     $key_word = Url::get('key_word');
     $condition = " status=1";
     $display->add('key_word', $key_word);
     if ($key_word) {
         $key_word_s = '';
         $arr = explode(' ', $key_word);
         if ($arr) {
             foreach ($arr as $key) {
                 $key = trim($key);
                 if ($key != '') {
                     $key_word_s .= ($key_word_s == '' ? '+' : ' +') . "{$key}";
                 }
             }
         }
         if ($key_word_s != '') {
             $condition .= " AND MATCH(title, des) AGAINST ('{$key_word_s}' IN BOOLEAN MODE)";
         }
         //$condition .= ' AND (title LIKE "%'.$key_word.'%" OR des LIKE "%'.$key_word.'%")';
     }
     $total_item = DB::count('document', $condition);
     $limit = '';
     $paging = AZPagging::paging_list($limit, $total_item, 10, 10, 'page_no', '', true, 'Tài liệu', 'Trang');
     $display->add('paging', $paging);
     $condition = 'WHERE' . $condition;
     $documents = array();
     $sql = 'SELECT * FROM document ' . $condition . ' ORDER BY id DESC ' . $limit;
     $re = DB::query($sql);
     if ($re) {
         $i = 1;
         while ($row = mysql_fetch_assoc($re)) {
             $row['title'] = stripslashes($row['title']);
             $row['des'] = AZLib::remove_4_js(AZLib::plainText(html_entity_decode($row['des'], ENT_QUOTES, "UTF-8")));
             $row['des'] = str_replace(array("'", "\""), array("", " "), $row['des']);
             $row['des'] = AZLib::word_limit($row['des'], 200, '');
             if (++$i % 2) {
                 $row['bgcolor'] = "#FFFFFF";
             } else {
                 $row['bgcolor'] = "#D9D9D9";
             }
             $row['time_m'] = $row['time_m'] ? date("d/m/Y", $row['time_m']) : '';
             if (User::is_admin()) {
                 $row['change'] = AZLib::button(Url::build_current(array('cmd' => 'change', 'id' => $row['id'], "href" => urlencode(Url::build_all()))), 'style/images/unexam.gif', 'Disable');
                 $row['edit'] = AZLib::button(Url::build('document', array('cmd' => 'edit', 'id' => $row['id'], "href" => urlencode(Url::build_all()))), 'style/images/edit.gif', 'Sửa tài liệu');
                 $row['delete'] = AZLib::buttonDel(Url::build_current(array('cmd' => 'delete', 'id' => $row['id'], "href" => urlencode('?' . $_SERVER['QUERY_STRING']))), 'style/images/delete.gif', 'Sửa tài liệu');
             }
             if ($row['url']) {
                 $row['document_detail'] = $row['url'];
             } else {
                 $row['document_detail'] = WEB_DIR . "download-{$row['id']}/" . AZLib::safe_title($row['title']) . ".html";
             }
             $documents[$row['id']] = $row;
         }
     }
     $display->add('documents', $documents);
     if (User::is_admin()) {
         $display->add("is_admin", 1);
     }
     $display->output('DocumentList');
     $this->endForm();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:64,代码来源:DocumentList.php

示例7: __construct


//.........这里部分代码省略.........
                         $ebname = "{$pcat['ebname']}-" . CGlobal::$allCategories[$ref_id]['ebname'];
                         if (CGlobal::$allCategories[$pid]['parent_id']) {
                             //DM cấp 3
                             $ppid = CGlobal::$allCategories[$pid]['parent_id'];
                             if (isset(CGlobal::$allCategories[$ppid])) {
                                 $ppcat = CGlobal::$allCategories[$ppid];
                                 $ebname = "{$ppcat['ebname']}-{$pcat['ebname']}-" . CGlobal::$allCategories[$ref_id]['ebname'];
                             }
                         }
                     }
                 }
                 Url::redirect_url(WEB_DIR . "c{$ref_id}/{$ebname}", 301);
             }
         }
         if (AZNet::$page['name'] == 'list_detail' && REWRITE_ON) {
             //tuannk add 2010.07.28 fix redirect 301 với các url link sai
             $ebname_req = Url::get("ebname");
             $page_no = (int) Url::get("page_no", 1);
             if ($page_no <= 1) {
                 $page_no = 0;
             }
             $ebname = '';
             $eburl = '';
             if (CGlobal::$curMainCat) {
                 $ebname = CGlobal::$curMainCat['ebname'];
                 if (CGlobal::$curLevel2Cat) {
                     $ebname .= "-" . CGlobal::$curLevel2Cat['ebname'];
                     $eburl = WEB_DIR . "c" . CGlobal::$curLevel2Cat['id'] . "/" . $ebname;
                 } else {
                     $eburl = WEB_DIR . "c" . CGlobal::$curMainCat['id'] . "/" . $ebname;
                 }
             }
             if ($ebname != '') {
                 if ($page_no) {
                     $eburl .= "/page-{$page_no}";
                 }
                 if (strpos($_SERVER['REQUEST_URI'], $eburl) !== 0 || $ebname_req != $ebname || isset($_GET['page_no']) && $page_no <= 1) {
                     Url::redirect_url($eburl, 301);
                 }
             }
         }
         if (CGlobal::$curLevel2Cat) {
             //Nếu có cả 2 cấp
             $str_catSub = CGlobal::$curLevel2Cat['name'] . ', ' . CGlobal::$curMainCat['name'];
             //Cho subcat
             if (CGlobal::$curLevel2Cat['keywords']) {
                 CGlobal::$keywords = CGlobal::$curLevel2Cat['keywords'];
             }
             if (CGlobal::$curLevel2Cat['description']) {
                 $meta_desc = CGlobal::$curLevel2Cat['description'];
             }
             //End Cho subcat
             if (CGlobal::$curMainCat['description']) {
                 $meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$curMainCat['description'];
             }
             //End Cho maincat
         } elseif (CGlobal::$curMainCat) {
             //Nếu chỉ có 1 cấp
             if (isset(CGlobal::$allCategories[CGlobal::$curMainCat['id']]) && isset(CGlobal::$subCategories[CGlobal::$curMainCat['id']])) {
                 $subCats = CGlobal::$subCategories[CGlobal::$curMainCat['id']];
                 foreach ($subCats as $catSub) {
                     if ($catSub['name']) {
                         $str_catSub .= ($str_catSub ? ', ' : '') . $catSub['name'];
                     }
                     if ($catSub['description']) {
                         $meta_desc .= ($meta_desc ? ', ' : '') . $catSub['description'];
                     }
                 }
             }
             $str_catSub .= ($str_catSub ? ', ' : '') . CGlobal::$curMainCat['name'];
             if (CGlobal::$curMainCat['keywords']) {
                 CGlobal::$keywords = CGlobal::$curMainCat['keywords'];
             }
             if (CGlobal::$curMainCat['description']) {
                 $meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$curMainCat['description'];
             }
         }
         //CGlobal::$curCategory
         if (AZNet::$page['name'] == 'item_detail') {
             if (Item::$item && Item::$item['status'] == 1) {
                 CGlobal::$meta_desc = AZLib::word_limit(AZLib::descriptionText(Item::$item['brief'] . ' ' . Item::$item['description']), 30, '');
             } elseif ($meta_desc) {
                 CGlobal::$meta_desc = $meta_desc;
             }
         } elseif ($meta_desc) {
             CGlobal::$meta_desc = $meta_desc;
         }
     }
     //limit character description and keyword
     CGlobal::$keywords = AZLib::word_limit(CGlobal::$keywords, 20, '');
     CGlobal::$meta_desc = AZLib::word_limit(CGlobal::$meta_desc, 250, '');
     //Gán title cho các trang trong!
     $page_title_arr = array();
     $page_title_arr['post_item'] = "Đăng sản phẩm";
     $page_title_arr['sign_in'] = "Đăng nhập - Đăng ký thành viên";
     if (isset($page_title_arr[AZNet::$page['name']])) {
         CGlobal::$website_title = $page_title_arr[AZNet::$page['name']] . ' | ' . CGlobal::$website_title;
     }
     $this->add_form(new HeaderForm());
 }
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:class.php

示例8: build_rss_cat

 function build_rss_cat($cat_id = '0', $cat_name = 'home', $limit = 100, $user_id = false)
 {
     $rss2 = '';
     // content of rss2 file
     // start:begin rss2
     $rss2 = '<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel>';
     $rss2 .= '<title>' . $cat_name . ' - ' . WEB_NAME . '</title>';
     $rss2 .= '<description>' . $cat_name . ' - ' . WEB_NAME . '</description>';
     //$rss2.= '<link>'.trim(XMLLib::_xml_encode_attribute(WEB_ROOT.'?page=list_detail&category_id='.$cat_id)).'</link>';
     //$cat_id ? $rss2.= '<link>'.WEB_ROOT.'?page=list_detail&category_id='.$cat_id.'</link>' : $rss2.='<link>'.WEB_ROOT.'?page=list_detail</link>';
     $rss2 .= '<link>' . WEB_ROOT . '</link>';
     //$rss2.= '<link>'.WEB_ROOT.'?page=list_detail&category_id='.$cat_id.'</link>';
     $rss2 .= '<copyright>' . WEB_NAME . ': http://' . strtolower(WEB_NAME) . ' , Powered  by AzNet Team: contact@aznetgroup.com</copyright>';
     $rss2 .= '<docs>http://backend.userland.com/rss</docs>';
     $rss2 .= '<generator>' . WEB_NAME . ':http://' . strtolower(WEB_NAME) . '/rss.html</generator>';
     $rss2 .= '<image><title>' . WEB_NAME . '</title><url>' . WEB_ROOT . 'style/img/header/logo.png</url><link>http://' . strtolower(WEB_NAME) . '</link><width>150</width><height>83</height></image>';
     $user_id ? $sql = "SELECT item.id, category_id, item.name, item.description, item.created_time \r\n\t\t\t\t\t\t\tFROM item WHERE status=1 AND user_id=" . $user_id . " \r\n\t\t\t\t\t\t\tORDER BY created_time DESC LIMIT 0,25" : ($sql = "SELECT item.id, category_id, item.name, item.description, item.created_time \r\n\t\t\t\t\t\t\tFROM item, category \r\n\t\t\t\t\t\t\tWHERE category.id = item.category_id AND item.status=1 \r\n\t\t\t\t\t\t\tAND (category_id='" . $cat_id . "' OR category.parent_id='" . $cat_id . "') \r\n\t\t\t\t\t\t\tORDER BY created_time DESC LIMIT 0," . $limit);
     $re = DB::query($sql);
     if ($re) {
         while ($item = mysql_fetch_assoc($re)) {
             $page = 'item_detail';
             $item['name'] = trim(XMLLib::_xml_encode_attribute(strip_tags(html_entity_decode($item['name']))));
             $item['description'] = trim(XMLLib::_xml_encode_attribute(strip_tags(html_entity_decode(AZLib::word_limit($item['description'], 150), ENT_QUOTES, "UTF-8"))));
             //$item['url'] = trim(XMLLib::_xml_encode_attribute(WEB_ROOT."?page=".$page."&id=".$item['id']."&category_id=".$item['category_id']."&ebname=".AZLib::safe_title($item['name'])));
             $item['url'] = WEB_ROOT . "p" . $item['id'] . "/" . AZLib::safe_title($item['name']) . ".html";
             //$item['url'] = AZLib::remove_4_js($item['url']);
             //rss2
             $rss2 .= "<item>";
             $rss2 .= "<title>" . $item['name'] . " - " . WEB_NAME . "</title>";
             $rss2 .= "<description>(" . WEB_NAME . ") - " . $item['description'] . "</description>";
             $rss2 .= "<link>" . $item['url'] . "</link>";
             $rss2 .= '<guid isPermaLink="True">' . $item['url'] . '</guid>';
             $rss2 .= "<pubDate>" . date("D, d M Y H:i:s", $item['created_time']) . " GMT</pubDate>";
             $rss2 .= "</item>";
         }
     }
     //content:end
     // end:begin
     $rss2 .= '</channel></rss>';
     // end:end
     return $rss2;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:42,代码来源:rss.xml.php

示例9: BuildPrint

 function BuildPrint($row)
 {
     Module::Module($row);
     ##################################################################################################
     $build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val'];
     if ($build_catids != '') {
         $arr = explode(',', $build_catids);
         $build_catids = '';
         if ($arr) {
             foreach ($arr as $catid) {
                 if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['status'] != 'HIDE') {
                     $build_catids .= ($build_catids != '' ? ',' : '') . $catid;
                     BuildPrint::$cats[$catid] = array('id' => $catid, 'name' => CGlobal::$allCategories[$catid]['name'], 'img' => AZLib::getImageThumb("category/{$catid}.gif", 40, 40, 0, 0), 'item_id' => 0, 'item_name' => '', 'item_url' => '', 'item_price' => '', 'item_warranty' => '', 'list_brief' => '');
                 }
             }
         }
     }
     self::$bcatid = (int) Url::get('bcatid');
     if (self::$bcatid) {
         if (isset(BuildPrint::$cats[self::$bcatid])) {
             self::$bcat = BuildPrint::$cats[self::$bcatid];
         } else {
             Url::redirect_current(array('mode'));
         }
     } else {
         self::$bcat = reset(BuildPrint::$cats);
         if (self::$bcat) {
             self::$bcatid = (int) self::$bcat['id'];
         }
     }
     ##################################################################################################
     $item_ids = '';
     $build_ids = isset($_SESSION['build_ids']) ? $_SESSION['build_ids'] : '';
     $build_price = 0;
     if ($build_ids != '') {
         $items = array();
         $re = DB::query("SELECT * FROM item WHERE id IN(" . $build_ids . ") AND status=1 AND price>0 AND quantity>0 ORDER BY find_in_set(category_id,'" . $build_catids . "')");
         if ($re) {
             while ($item = mysql_fetch_assoc($re)) {
                 if (isset(BuildPrint::$cats[$item['category_id']]) && BuildPrint::$cats[$item['category_id']]['item_id'] == 0) {
                     $item['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']);
                     BuildPrint::$price += $item['price'];
                     $item_ids .= ($item_ids != '' ? ',' : '') . $item['id'];
                     if (isset(CGlobal::$allCategories[$item['category_id']])) {
                         $item_url = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                     } else {
                         $item_url = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                     }
                     if ($item['list_brief'] == '') {
                         $item['list_brief'] = $item['brief'];
                     }
                     $item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']);
                     $item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']);
                     $item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, '');
                     BuildPrint::$items[$item['id']] = $item;
                     BuildPrint::$cats[$item['category_id']]['item_id'] = $item['id'];
                     BuildPrint::$cats[$item['category_id']]['item_name'] = $item['name'];
                     BuildPrint::$cats[$item['category_id']]['item_url'] = $item_url;
                     BuildPrint::$cats[$item['category_id']]['item_price'] = number_format($item['price'], 0, ',', '.');
                     BuildPrint::$cats[$item['category_id']]['item_warranty'] = $item['warranty'];
                     BuildPrint::$cats[$item['category_id']]['list_brief'] = $item['list_brief'];
                 }
             }
         }
     }
     $_SESSION['build_ids'] = "{$item_ids}";
     require_once 'forms/BuildPrint.php';
     $this->add_form(new BuildPrintForm());
 }
开发者ID:duynhan07,项目名称:elink,代码行数:69,代码来源:class.php

示例10: draw


//.........这里部分代码省略.........
                                             $link .= "&filter[{$get_gid}]={$get_fid}";
                                         }
                                     }
                                 }
                                 if (isset($this->filter_get[$fgid]) && $this->filter_get[$fgid] == $filter['id']) {
                                     if ($this->min) {
                                         $link .= "&min=" . $this->min;
                                     }
                                     if ($this->max) {
                                         $link .= "&max=" . $this->max;
                                     }
                                     $group_filter['filters'] = array($fid => array('link' => $link, 'name' => $filter['name'], 'count' => $pf_array[$fgid][$fid], 'remove' => 1));
                                     break;
                                 } else {
                                     $link .= "&filter[{$fgid}]={$filter['id']}";
                                     //$link = str_replace(array('?filter=&','?filter=','&filter='),array('?','',''),$link);
                                     if ($this->min) {
                                         $link .= "&min=" . $this->min;
                                     }
                                     if ($this->max) {
                                         $link .= "&max=" . $this->max;
                                     }
                                 }
                                 $group_filter['filters'][$fid] = array('link' => $link, 'name' => $filter['name'], 'count' => $pf_array[$fgid][$fid]);
                             }
                         }
                         if ($group_filter) {
                             $filter_groups[$fgid] = $group_filter;
                         }
                     }
                 }
             }
         }
         $display->add('url_filter', Url::build_current(array('mode', 'bcatid' => Build::$bcatid)));
         $display->add('cat_name', CGlobal::$allCategories[Build::$bcatid]['name']);
         if (isset(Build::$cats[Build::$bcatid]['next_id']) && Build::$cats[Build::$bcatid]['next_id']) {
             $display->add('next_url', Url::build_current(array('mode', 'bcatid' => Build::$cats[Build::$bcatid]['next_id'])));
         } else {
             $display->add('next_url', Url::build_current());
         }
         $display->add('recomend', str_replace(chr(13) . chr(10), "<br />", CGlobal::$allCategories[Build::$bcatid]['recomend']));
         $display->add('filter_groups', $filter_groups);
         $display->add('filter_price', $this->filter_price);
         $sql = 'SELECT * FROM item WHERE ';
         $where = '';
         $sql .= CGlobal::$item_condition . " ORDER BY price ASC";
         $total_row = DB::count("item", CGlobal::$item_condition);
         #######################################################################################
         #Paging
         $filter_get = Url::get('filter');
         $min = Url::get('min');
         $max = Url::get('max');
         $order = Url::get('order');
         $paging = AZPagging::paging_list($limit, $total_row, 10, 10, 'page_no', '', true, 'Linh kiện', 'Trang');
         $sql .= $limit;
         #Paging
         #######################################################################################
         $re = DB::query($sql);
         if ($re) {
             while ($item = mysql_fetch_assoc($re)) {
                 if (isset(CGlobal::$allCategories[$item['category_id']])) {
                     $item['href'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                 } else {
                     $item['href'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                 }
                 $item['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']);
                 if ($item['price']) {
                     $item['price'] = number_format($item['price'], 0, ',', '.') . " VNĐ";
                 } else {
                     $item['price'] = 'Liên hệ';
                 }
                 if ($item['list_brief'] == '') {
                     $item['list_brief'] = $item['brief'];
                 }
                 $item['list_brief'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($item['list_brief'], ENT_QUOTES, "UTF-8"))));
                 $item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']);
                 $item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']);
                 $item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, '');
                 $item['select'] = Url::build_current(array('bcatid' => $item['category_id'], 'mode', 'item_id' => $item['id']));
                 $items[$item['id']] = $item;
             }
         }
         $display->add('items', $items);
         $display->add('paging', $paging);
     }
     $display->add('bcats', Build::$cats);
     if (Build::$price) {
         $display->add('total_price', number_format(Build::$price, 0, ',', '.') . " VNĐ");
     }
     $display->add('bitems', Build::$items);
     $display->add('bcatid', Build::$bcatid);
     $display->add('cur_url', $_SERVER['REQUEST_URI']);
     $display->add("print_link", Url::open_popup(Url::build('build_print'), 1000, 800, false, false, false, false, false, 1, 1));
     $build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val'];
     $display->add('build_catids', $build_catids);
     $display->add('is_admin', User::is_admin());
     $display->add('begin_form', $this->beginForm(false, 'post', false, false, 1));
     $display->add('end_form', $this->endForm(1));
     $display->output('Build');
 }
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:Build.php

示例11: Build

 function Build($row)
 {
     Module::Module($row);
     ##################################################################################################
     $build_catids = @CGlobal::$configs['BuildCatIDs']['conf_val'];
     if ($build_catids != '') {
         $arr = explode(',', $build_catids);
         $build_catids = '';
         $last = 0;
         if ($arr) {
             foreach ($arr as $catid) {
                 if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['status'] != 'HIDE') {
                     $build_catids .= ($build_catids != '' ? ',' : '') . $catid;
                     Build::$cats[$catid] = array('id' => $catid, 'name' => CGlobal::$allCategories[$catid]['name'], 'recomend' => str_replace(chr(13) . chr(10), "<br />", CGlobal::$allCategories[$catid]['recomend']), 'img' => AZLib::getImageThumb("category/{$catid}.gif", 40, 40, 0, 0), 'item_id' => 0, 'item_name' => '', 'item_url' => '', 'item_price' => '', 'item_warranty' => '', 'list_brief' => '');
                     if ($last) {
                         Build::$cats[$last]['next_id'] = $catid;
                     }
                     $last = $catid;
                 }
             }
         }
     }
     self::$bcatid = (int) Url::get('bcatid');
     if (self::$bcatid) {
         if (isset(Build::$cats[self::$bcatid])) {
             self::$bcat = Build::$cats[self::$bcatid];
         } else {
             Url::redirect_current(array('mode'));
         }
     } else {
         self::$bcat = reset(Build::$cats);
         if (self::$bcat) {
             self::$bcatid = (int) self::$bcat['id'];
         }
     }
     ##################################################################################################
     $item_ids = '';
     $build_ids = isset($_SESSION['build_ids']) ? $_SESSION['build_ids'] : '';
     $build_price = 0;
     if ($build_ids != '') {
         $items = array();
         $re = DB::query("SELECT * FROM item WHERE id IN(" . $build_ids . ") AND status=1 AND price>0 AND quantity>0 ORDER BY find_in_set(category_id,'" . $build_catids . "')");
         if ($re) {
             while ($item = mysql_fetch_assoc($re)) {
                 if (isset(Build::$cats[$item['category_id']]) && Build::$cats[$item['category_id']]['item_id'] == 0) {
                     Build::$price += $item['price'];
                     $item_ids .= ($item_ids != '' ? ',' : '') . $item['id'];
                     if (isset(CGlobal::$allCategories[$item['category_id']])) {
                         $item_url = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                     } else {
                         $item_url = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
                     }
                     if ($item['list_brief'] == '') {
                         $item['list_brief'] = $item['brief'];
                     }
                     $item['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['list_brief']);
                     $item['list_brief'] = str_replace(array("'", "\""), array("", " "), $item['list_brief']);
                     $item['list_brief'] = AZLib::word_limit($item['list_brief'], 50, '');
                     Build::$items[$item['id']] = $item;
                     Build::$cats[$item['category_id']]['item_id'] = $item['id'];
                     Build::$cats[$item['category_id']]['item_name'] = $item['name'];
                     Build::$cats[$item['category_id']]['item_url'] = $item_url;
                     Build::$cats[$item['category_id']]['item_price'] = number_format($item['price'], 0, ',', '.') . " VNĐ";
                     Build::$cats[$item['category_id']]['item_warranty'] = $item['warranty'];
                     Build::$cats[$item['category_id']]['list_brief'] = $item['list_brief'];
                 }
             }
         }
     }
     $item_id = (int) Url::get('item_id');
     $bcatid = (int) Url::get('bcatid');
     if ($item_id && $bcatid) {
         $item = Item::get_item($item_id);
         if ($item && $item['status'] == 1 && $item['price'] > 0 && $item['quantity'] > 0 && isset(Build::$cats[$item['category_id']])) {
             if (!isset(Build::$items[$item['id']])) {
                 if (Build::$cats[$item['category_id']]['item_id'] > 0) {
                     unset(Build::$items[Build::$cats[$item['category_id']]['item_id']]);
                 }
                 Build::$items[$item['id']] = $item;
                 //$item_ids	.=	($item_ids!='' ? ',' : '')	.	$item['id'];
                 $item_ids = implode(',', array_keys(Build::$items));
                 $_SESSION['build_ids'] = "{$item_ids}";
                 $last = 0;
                 foreach (array_keys(Build::$cats) as $catid) {
                     if ($last == self::$bcatid) {
                         Url::redirect_current(array('mode', 'bcatid' => $catid), '#select_item');
                     }
                     $last = $catid;
                 }
             }
         }
         Url::redirect_current(array('mode', 'bcatid'));
     }
     $_SESSION['build_ids'] = "{$item_ids}";
     $cmd = Url::get('cmd');
     switch ($cmd) {
         case 'success':
             require_once 'forms/BuildSuccess.php';
             $this->add_form(new BuildSuccessForm());
             break;
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:class.php

示例12: processItem

 function processItem($item, $admin_item)
 {
     if (isset(CGlobal::$allCategories[$item['category_id']])) {
         $item['href'] = WEB_DIR . CGlobal::$allCategories[$item['category_id']]['nice_name'] . "/p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
     } else {
         $item['href'] = WEB_DIR . "p{$item['id']}/" . AZLib::safe_title($item['name']) . ".html";
     }
     $item['modify_time'] = date('H:i | d.m.y', $item['modify_time']);
     $item['price'] = AZLib::convertCurrency($item['price'], $item['currency_id']);
     $item['price_out'] = AZLib::convertCurrency($item['price_out'], $item['currency_id']);
     $item['currency_id'] = 1;
     $item['price_num'] = (int) $item['price'];
     if ($item['price']) {
         $item['price'] = number_format($item['price'], 0, ',', '.');
     } else {
         $item['price'] = '';
     }
     $item['price_title'] = 'Giá bán';
     if ($item['price_out'] > 0) {
         $item['price_out'] = number_format($item['price_out'], 0, ',', '.') . ($item['currency_id'] == ' ' ? ' ' . CGlobal::$currency[$item['currency_id']] : '');
     } else {
         $item['price_out'] = '0';
     }
     //$item['price'] 			= AZLib::convertCurrency($item['price'],			$item['currency_id']);
     //$item['price_out'] 		= AZLib::convertCurrency($item['price_out'],		$item['currency_id']);
     if ($admin_item) {
         $item['description'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($item['description'], ENT_QUOTES, "UTF-8"))));
         $item['description'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['description']);
         $item['description'] = str_replace(array("'", "\""), array("", " "), $item['description']);
         $item['description'] = AZLib::word_limit($item['description'], 200, '');
     }
     $item['name'] = AZLib::filter_title($item['name']);
     if ($item['img_url']) {
         $item['img_thumb_wl'] = AZLib::getImageThumb($item['img_url'], 180, 0, 1, $item['img_server']);
     } else {
         $item['img_url'] = '';
     }
     if (!CGlobal::$curLevel2Cat) {
         if (isset(CGlobal::$allCategories[$item['category_id']])) {
             $item['cat_name'] = CGlobal::$allCategories[$item['category_id']]['name'];
         } else {
             $item['cat_name'] = "ID: {$item['category_id']}";
         }
     }
     return $item;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:46,代码来源:ListItem.php

示例13: load_shop_label


//.........这里部分代码省略.........
        $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']])) {
                        $item['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $item['id'] . '&ebname=' . AZLib::safe_title(AZLib::word_limit($item['name'], 12, '')) . '&nice_name=' . CGlobal::$allCategories[$item['category_id']]['nice_name']);
                    } else {
                        $item['href'] = WEB_DIR . AZRewrite::formatUrl('?page=item_detail&id=' . $item['id'] . '&ebname=' . AZLib::safe_title(AZLib::word_limit($item['name'], 12, '')));
                    }
                    $tooltip = '';
                    $tooltip .= 'Xem: ' . $item['read_count'] . ' - Phản hồi: ' . $item['reply_count'];
                    $item['time_label'] = '';
                    $up_time = date('H:i | ', $item['up_time']);
                    if (date('d.m.y', $item['up_time']) == date('d.m.y', TIME_NOW)) {
                        $up_time .= '<font color="green">H&#244;m nay</font>';
                    } else {
                        $up_time .= date('d.m.y', $item['up_time']);
                    }
                    //$item['created_time'] = 'đăng '.AZLib::duration_time($item['up_time']);
                    $item['created_time'] = $up_time;
                    if ($item['price']) {
                        $item['price'] = number_format($item['price'], 0, ',', '.');
                        $item['currency_id'] = CGlobal::$currency[$item['currency_id']];
                    } else {
                        $item['price'] = '';
                        $item['currency_id'] = '';
                    }
                    $item['price_title'] = 'Giá bán';
                    if ($item['price_out'] > 0) {
                        $item['price_out'] = number_format($item['price_out'], 0, ',', '.') . ($item['currency_id'] == ' ' ? ' ' . CGlobal::$currency[$item['currency_id']] : '');
                    } else {
                        $item['price_out'] = '0';
                    }
                    $item['no_base_source'] = AZLib::remove_4_js(str_replace(array("<br>", "<br />"), '', $item['brief']));
                    $item['description'] = AZLib::plainText(AZLib::parseBBCode(html_entity_decode($item['description'], ENT_QUOTES, "UTF-8")));
                    $item['description'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $item['description']);
                    $item['description'] = str_replace(array("'", "\""), array("", " "), $item['description']);
                    $item['description'] = AZLib::word_limit($item['description'], 250, '');
开发者ID:duynhan07,项目名称:elink,代码行数:67,代码来源:ajax_shop.ajax.php


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