本文整理汇总了PHP中AZLib::safe_title方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::safe_title方法的具体用法?PHP AZLib::safe_title怎么用?PHP AZLib::safe_title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::safe_title方法的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;
$news_ids = '';
$hot_newss = array();
$configs = @CGlobal::$configs['NewsHomeHot']['conf_val'];
if ($configs) {
$configs = unserialize(stripslashes($configs));
$title_news = $configs['title'];
$news_ids = $configs['news_ids'];
} else {
$title_news = "TIN HOT";
$news_ids = '';
}
if ($news_ids != '') {
$re = DB::query("SELECT id, title, news_catid FROM news WHERE id IN({$news_ids}) AND status = 1 ORDER BY find_in_set(id,'{$news_ids}')");
if ($re) {
while ($news = mysql_fetch_assoc($re)) {
$news['title'] = stripslashes($news['title']);
$news['url'] = Url::build('news_detail', array('news_catid' => $news['news_catid'], 'news_id' => $news['id'], 'azname' => AZLib::safe_title($news['title'])));
$hot_newss[$news['id']] = $news;
}
}
}
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_news', $title_news);
$display->add('news_ids', $news_ids);
$display->add('hot_newss', $hot_newss);
$display->output("NewsHomeHot");
}
示例3: draw
function draw()
{
global $display;
$cats = array();
$display->add('url_add', Url::build_current(array('cmd' => 'add')));
/*
$display->add('url_edit',Url::build_current(array('cmd'=>'edit','id'=>$category['id'])));
$display->add('url_del',Url::build_current(array('cmd'=>'delete','id'=>$category['id'])));
$display->add('url_sort_up',Url::build_current(array('cmd'=>'move_home','dir'=>'move_home','id'=>$category['id'])));
$display->add('url_sort_low',Url::build_current(array('cmd'=>'move_home','dir'=>'move_end','id'=>$category['id'])));
*/
$posMin = 1;
$posMax = DB::count("news_categories");
$re = DB::query('SELECT * FROM news_categories ORDER BY position, id');
if ($re) {
$index = 0;
$column = 1;
while ($row = mysql_fetch_assoc($re)) {
$row['url'] = URL::build('news_list', array('news_catid' => $row['id'], 'azname' => AZLib::safe_title($row['name'])));
$row['edit'] = Url::build_current(array('cmd' => 'edit', 'id' => $row['id']));
$row['delete'] = Url::build_current(array('cmd' => 'delete', 'id' => $row['id']));
$row['move_home'] = '<a title="Chuyển lên trên cùng" href="' . Url::build_current(array('cmd' => 'move_home', 'id' => $row['id'])) . '">Move HOME</a>';
$row['move_end'] = '<a title="Chuyển xuống dưới cùng" href="' . Url::build_current(array('cmd' => 'move_end', 'id' => $row['id'])) . '">Move END</a>';
if ($row['position'] > $posMin) {
$row['move_up'] = '<a title="Chuyển lên" href="' . Url::build_current(array('cmd' => 'move_up', 'id' => $row['id'])) . '"><img src="style/img/admin/move_up.gif"></a>';
}
if ($row['position'] < $posMax) {
$row['move_down'] = '<a title="Chuyển xuống" href="' . Url::build_current(array('cmd' => 'move_down', 'id' => $row['id'])) . '"><img src="style/img/admin/move_down.gif"></a>';
}
$cats[$row['id']] = $row;
}
}
$display->add('cats', $cats);
$display->output("NewsAdminCats");
}
示例4: draw
function draw()
{
$this->beginForm();
global $display;
$user_id = intval(Url::get('user_id'));
$user_info = DB::select('user', 'id="' . $user_id . '"');
$display->add('created_time_from', Url::get('created_time_from'));
$display->add('created_time_to', Url::get('created_time_to'));
//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 created_time >= ' . $created_time_from;
}
if ($created_time_to) {
$search_value .= ' AND created_time <= ' . $created_time_to;
}
$item_per_page = 50;
$sql_count = 'SELECT COUNT(id) AS total_item FROM item WHERE user_id = "' . $user_id . '" 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, 'Sản phẩm', 'Trang');
$sql = 'SELECT * FROM item WHERE user_id = "' . $user_id . '" AND ' . $search_value . ' ORDER BY modify_time DESC ' . $limit;
$result = DB::query($sql);
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
$row['ebname'] = AZLib::safe_title($row['name']);
$row['modify_time'] = date('d/m/y H:i', $row['modify_time']);
$row['created_time'] = date('d/m/y H:i', $row['created_time']);
$row['del_link'] = Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac'), 'cmd=delete&id=' . $row['id'] . '&user_id=' . $row['user_id']);
$items[$row['id']] = $row;
}
}
} else {
$paging = '';
}
$display->add('user_info', $user_info);
$display->add('total_item', $total);
$display->add('items', $items);
$display->add('paging', $paging);
$display->output('item_list');
$this->endForm();
}
示例5: 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");
}
示例6: 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");
}
}
示例7: draw
function draw()
{
global $display;
$this->beginForm();
$display->add('url_add', Url::build_current(array('cmd' => 'add')));
$current_path = "<a href='" . URL::build('news_list', array('news_catid' => $this->row['id'], 'azname' => AZLib::safe_title($this->row['name']))) . "'>" . $this->row['name'] . "</a>";
$display->add('current_cat', $current_path);
$display->add('name', Url::get('name', $this->row['name']));
$display->add('position_option', AZLib::getOptionNum(1, DB::count("news_categories"), Url::get('position', $this->row['position'])));
$display->add('public', Url::get('public', $this->row['public'] ? 1 : 2));
$display->add('keywords', Url::get('keywords', $this->row['keywords']));
$display->add('description', Url::get('description', $this->row['description']));
$display->add('msg', $this->showFormErrorMessages(1));
$display->output("NewsAdminCatsEdit");
$this->endForm();
}
示例8: Document
function Document($row)
{
Module::Module($row);
$cmd = Url::get('cmd');
require_once "forms/DocumentList.php";
switch ($cmd) {
case 'delete':
$this->add_form(new Deletedocument());
break;
case 'change':
$this->add_form(new PublicdocumentForm());
break;
default:
$id = (int) Url::get('id');
$azname = trim(URL::get("azname", ''));
if ($id || $azname != '') {
if ($id && $azname != '') {
$document = DB::select("document", "id={$id}");
if ($document && $azname == AZLib::safe_title($document['title']) && $document['file_path']) {
$file_src = DATA_PATH . "document/{$document['file_path']}";
if (file_exists(ROOT_PATH . $file_src)) {
$ext = AZLib::getExtension($file_src);
if ($ext && strlen($ext) <= 5) {
$ext_app = substr($ext, 1);
if ($document['status'] == 1 || User::haveAnyPermission(ADMIN_DOCUMENT)) {
DB::query("UPDATE document SET down_num=down_num+1, time_last=" . TIME_NOW . " WHERE id={$id}");
DB::close();
header("Content-type: application/{$ext_app}");
header("Content-Disposition: attachment; filename=" . date("Y.m.d-H\\hi", $document['time_m']) . "-{$id}-{$azname}{$ext}");
readfile(ROOT_PATH . $file_src);
exit;
}
}
}
}
}
header("HTTP/1.0 404 Not Found");
echo "<h1>404 - Not Found!<br />Return to <a href='" . WEB_ROOT . "'>" . WEB_NAME . "</a></h1>";
exit;
}
$this->add_form(new ListdocumentForm());
break;
}
}
示例9: 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();
}
示例10: draw
function draw()
{
global $display;
$cat_newss = array();
$news_cat_id = Url::get('news_catid', 'id', 0);
AZLib::getNewsCats();
$display->add('news_cat_id', $news_cat_id);
if (CGlobal::$allNewsCategories) {
foreach (CGlobal::$allNewsCategories as $news_cat) {
if ($news_cat['public']) {
$news_cat['url'] = URL::build('news_list', array('news_catid' => $news_cat['id'], 'azname' => AZLib::safe_title($news_cat['name'])));
$cat_newss[$news_cat['id']] = $news_cat;
}
}
}
$display->add('cat_newss', $cat_newss);
$display->add('is_admin', User::have_permit(ADMIN_NEWS));
$display->output("NewsMenu");
}
示例11: 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");
}
示例12: 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();
}
示例13: 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");
}
示例14: ItemDetail
function ItemDetail($row)
{
Module::Module($row);
require_once 'core/se.php';
if (Item::$id == -1) {
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
}
AZLib::checkItem();
if (Item::$item) {
if (Item::$item['display']) {
if (REWRITE_ON) {
//tuannk add 2010.07.28 fix redirect 301 với các url link sai
$nice_name1 = '';
if (Item::$item['category_id'] && isset(CGlobal::$allCategories[Item::$item['category_id']]) && CGlobal::$allCategories[Item::$item['category_id']]) {
$nice_name1 = CGlobal::$allCategories[Item::$item['category_id']]['nice_name'];
}
$url_detail = WEB_DIR . $nice_name1 . "/p" . Item::$item['id'] . "/" . AZLib::safe_title(Item::$item['name']) . ".html";
if ($nice_name1 != '' && strpos($_SERVER['REQUEST_URI'], $url_detail) !== 0) {
Url::redirect_url($url_detail, 301);
}
}
CGlobal::$website_title = Item::$item['name'];
CGlobal::$website_title .= ' - ' . AZLib::titlePath(Item::$item['category_id']);
if (Item::$item['status'] == 2) {
if (User::have_permit(ADMIN_ITEM)) {
CGlobal::$website_title = 'Tin đang ẩn';
} else {
Item::$item['display'] = 0;
}
}
Item::update_read_count();
}
}
require_once 'forms/ItemDetail.php';
$this->add_form(new ItemDetailForm());
}
示例15: draw
function draw()
{
global $display;
AZLib::getCats();
$this->beginForm();
$item = Item::get_item($this->booking_vip['item_id']);
if (!$item || $item && $item['status'] == -1) {
$this->setFormError("item_id", "Tin không tồn tại!");
} else {
$display->add('item_name', stripslashes($item['name']));
$display->add('item_link', Url::build('item_detail', array('id' => $item['id'], 'ebname' => AZLib::safe_title($item['name']))));
}
$top_catid = $item['level_1_catid'];
$cat_id = $item['category_id'];
$display->add('msg', $this->showFormErrorMessages(1));
$display->add('item_id', $this->booking_vip['item_id']);
if ($this->booking_vip['top_cat']) {
$display->add('category', 1);
} else {
if ($this->booking_vip['cat_id']) {
$display->add('category', 2);
}
}
$display->add('num_contract', $this->booking_vip['num_contract']);
$display->add('top_cat_name', CGlobal::$allCategories[$top_catid]['name']);
$display->add('cat_name', CGlobal::$allCategories[$cat_id]['name']);
$display->add('note', stripslashes(Url::get("note", $this->booking_vip['note'])));
$display->add('time_start', Url::get("time_start", date('d-m-Y', $this->booking_vip['time_start'])));
if ($this->booking_vip['time_end']) {
$display->add('time_end', Url::get("time_end", date('d-m-Y', $this->booking_vip['time_end'])));
} else {
$display->add('time_end', Url::get("time_end", ''));
}
$display->output('EditBookingVip');
$this->endForm();
}