本文整理汇总了PHP中AZLib类的典型用法代码示例。如果您正苦于以下问题:PHP AZLib类的具体用法?PHP AZLib怎么用?PHP AZLib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AZLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Run
static function Run()
{
AZLib::CheckDir(PAGE_CACHE_DIR);
if (isset($_REQUEST['page'])) {
if ($_REQUEST['page'] == "home") {
Url::redirect_url(WEB_DIR, 301);
}
$page_name = strtolower($_REQUEST['page']);
} else {
$page_name = 'home';
}
AZNet::$page_cache_file = PAGE_CACHE_DIR . $page_name . '.php';
if (Url::get('refresh_page') == 1) {
self::del_page_cache($page_name);
}
if (Url::get('refresh_page') != 1 && PAGE_CACHE_ON && file_exists(AZNet::$page_cache_file)) {
require_once AZNet::$page_cache_file;
} else {
$re = DB::query('SELECT id, name, title, layout FROM page WHERE name="' . addslashes($page_name) . '"', __LINE__ . __FILE__);
if ($re) {
AZNet::$page = mysql_fetch_assoc($re);
}
if (!AZNet::$page) {
Url::redirect_url(WEB_DIR, 301);
}
AZGen::PageGenerate();
}
}
示例2: on_submit
function on_submit()
{
$user_name = AZLib::getParam('user_name');
$content = AZLib::getParam('content');
$active = (int) Url::get('active');
$expire = (int) Url::get('expire', 7);
$id = (int) Url::get('id');
$cmd = Url::get('cmd');
$sql = "SELECT id FROM user WHERE user_name='{$user_name}'";
$row = DB::fetch($sql);
$user_id = (int) $row["id"];
if (!$user_id) {
$this->setFormError('user_name', 'Không tồn tại thành viên này!');
} elseif (!$user_name || !$content) {
$this->setFormError('content', 'Dữ liệu không hợp lệ!');
} else {
if ($cmd == "add") {
$item_array = array('content' => $content, 'user_name' => $user_name, 'user_id' => $user_id, 'admin_add' => User::user_name(), 'active' => $active, 'time_add' => TIME_NOW, 'expire_date' => TIME_NOW + 86400 * $expire);
DB::insert('admin_notice_user', $item_array);
} elseif ($cmd == "edit" && $id) {
$item_array = array('content' => $content, 'user_name' => $user_name, 'user_id' => $user_id, 'admin_edit' => User::user_name(), 'active' => $active, 'time_edit' => TIME_NOW, 'expire_date' => TIME_NOW + 86400 * $expire);
DB::update_id('admin_notice_user', $item_array, $id);
}
User::getAdminNoticeUser($user_id, 0, 1);
Url::redirect_current(array('act'));
}
}
示例3: on_submit
function on_submit()
{
$og_name = Url::get('og_name');
$u_name = Url::get('u_name');
$u_yahoo = Url::get('u_yahoo');
$u_skype = Url::get('u_skype');
$OnlineSupport = array();
if ($og_name) {
foreach ($og_name as $gid => $g_name) {
if ($g_name != '' && isset($u_name[$gid], $u_yahoo[$gid], $u_skype[$gid])) {
$garray = array('name' => $g_name, 'users' => array());
foreach ($u_name[$gid] as $uid => $name) {
if ($name != '' && isset($u_yahoo[$gid][$uid], $u_skype[$gid][$uid]) && ($u_yahoo[$gid][$uid] != '' || $u_skype[$gid][$uid] != '')) {
$garray['users'][$uid] = array('name' => $name, 'yahoo' => $u_yahoo[$gid][$uid], 'skype' => $u_skype[$gid][$uid]);
}
}
if ($garray['users']) {
$OnlineSupport[$gid] = $garray;
}
}
}
}
if (isset(CGlobal::$configs['OnlineSupport'])) {
DB::update('configs', array("conf_val" => addslashes(serialize($OnlineSupport))), "conf_key='OnlineSupport'", __FILE__ . " Dòng:" . __LINE__);
} else {
DB::insert('configs', array("conf_key" => 'OnlineSupport', "conf_val" => addslashes(serialize($OnlineSupport))), __FILE__ . " Dòng:" . __LINE__);
}
AZLib::get_config(0, 1);
AZLib::refreshParent();
}
示例4: draw
function draw()
{
global $display;
$this->beginForm();
$display->add('url_admin', Url::build_current());
$display->add('msg', $this->showFormErrorMessages(1));
if ($this->contact['name']) {
$email = stripslashes($this->contact['name']) . " ";
}
if ($this->contact['address']) {
$email .= "( " . stripslashes($this->contact['address']) . ") ";
}
$email .= '<a href="mailto:' . $this->contact['email'] . '"><font color=blue>' . $this->contact['email'] . "</font></a>";
$display->add('email', $email);
$display->add('date', date('H:i:s d/m/Y', $this->contact['time']));
$display->add('date2', AZLib::duration_time($this->contact['time']));
$display->add('content', stripslashes($this->contact['content']));
$display->add('reply_content', stripslashes(Url::get('reply_content')));
$display->add('subject', stripslashes(Url::get('subject')));
if ($this->contact['reply_content']) {
$display->add('replied_content', stripslashes($this->contact['reply_content']));
} else {
$display->add('replied_content', "Chưa có");
}
$display->output('FeedbackReply');
$this->endForm();
}
示例5: 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");
}
示例6: draw
function draw()
{
global $display;
$this->beginForm(false, "post", false, Url::build_current());
$item_per_page = 30;
$total_row = DB::fetch('SELECT count(*) AS total_row FROM `province` limit 0,1', 'total_row', 0);
$paging = '';
$items = array();
if ($total_row) {
$limit = '';
$paging = AZPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
$sql = "SELECT * FROM province ORDER BY id " . $limit;
$re = DB::query($sql);
if ($re) {
while ($row = mysql_fetch_assoc($re)) {
$area = array(1 => 'Bắc', 2 => 'Trung', 3 => 'Nam');
$status = array('SHOW' => 'Hiện', 'HIDE' => '<font color=red>Ẩn</font>', 'HOME' => 'HOME');
$row['area'] = $area[$row['area']];
$row['status'] = $status[$row['status']];
$items[$row['id']] = $row;
$items[$row['id']] = $row;
}
}
}
$display->add('hover', AZLib::mouse_hover('#F7F7F7', true));
$display->add('items', $items);
$display->add('paging', $paging);
$display->add('total_row', $total_row);
$display->output('list');
$this->endForm();
}
示例7: piclens_gallery
function piclens_gallery()
{
$item_id = AZLib::getParam('item_id');
$entry = '';
if ($item_id) {
$sql = 'select id, img_url, title, position from item_image where item_id = ' . intval($item_id) . ' ORDER BY position ';
DB::query($sql);
if (DB::num_rows()) {
$entry = '';
while ($rows = DB::fetch_row()) {
$rows['title'] = $rows['title'] ? $rows['title'] : "Image {$rows['position']}";
$rows['title'] = trim(XMLLib::_xml_encode_attribute($rows['title']));
if (ereg('/', $rows['img_url'])) {
$url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "{$rows['img_url']}"));
} else {
$url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "uploaded/items/{$rows['img_url']}"));
}
$entry .= "\r\n\t\t \t \t<item>\r\n\t\t \t \t\t\t<title>" . stripslashes($rows['title']) . "</title>\r\n\t\t\t\t\t\t<link>{$url}</link>\r\n\t\t\t\t\t\t<guid>Image {$rows['position']}</guid>\r\n\t\t\t\t\t\t<media:thumbnail url=\"{$url}\" />\r\n\t\t\t\t\t\t<media:content url=\"{$url}\" />\r\n\t\t\t\t</item>\r\n\t\t \t \t";
}
@header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n\t\t\t <rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss\">\r\n\t\t\t <channel>\t\t\t\r\n\t\t\t <title>Enbac.com</title>\r\n\t\t\t <link>http://www.enbac.com/</link>\r\n\t\t\t <description>Enbac.com - </description>\r\n\t\t\t <logo url=\"style/images/logo.piclens.png\" />\r\n\t\t\t";
echo $entry;
echo "\r\n\t\t \t </channel>\r\n\t\t\t </rss>\r\n\t\t\t";
} else {
die("no_info");
}
} else {
die("no_info");
}
}
示例8: 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");
}
示例9: ListItem
function ListItem($row)
{
Module::Module($row);
CGlobal::$website_title = AZLib::titlePath(CGlobal::$curCategory);
require_once 'forms/ListItem.php';
$this->add_form(new ListItemForm());
}
示例10: ImportExcel
function ImportExcel($row)
{
if (User::have_permit(array(ADMIN_ITEM))) {
Module::Module($row);
$cmd = Url::get('cmd');
switch ($cmd) {
case 'download':
$file_src = DATA_PATH . "AzNet.xls";
if (file_exists(ROOT_PATH . $file_src)) {
$ext = AZLib::getExtension($file_src);
if ($ext && strlen($ext) <= 5) {
$ext_app = substr($ext, 1);
header("Content-type: application/{$ext_app}");
header("Content-Disposition: attachment; filename=" . date("Y.m.d-H\\hi", TIME_NOW) . "_ANS_Products{$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;
break;
default:
require_once 'forms/ImportExcel.php';
$this->add_form(new ImportExcelForm());
break;
}
} else {
Url::access_denied();
}
}
示例11: FilterMenuSearch
function FilterMenuSearch($row)
{
Module::Module($row);
AZLib::getFilters();
require_once 'forms/FilterMenuSearch.php';
$this->add_form(new FilterMenuSearchForm());
}
示例12: draw
function draw()
{
$this->beginForm();
if (Url::get('cmd') == 'edit' && ($row = DB::select('bad_words', 'id=' . intval(AZLib::getParam('id'))))) {
$contents = $row['contents'];
$reason = $row['reason'];
$exact = $row['exact'];
if ($row['is_phone'] == 1) {
$contents = BadWord::filter_badword_show($contents);
}
$is_phone = $row['is_phone'];
} else {
$contents = '';
$exact = '';
$is_phone = '';
$reason = '';
}
global $display;
$display->add('msg', $this->showFormErrorMessages());
$display->add('contents', $contents);
$display->add('reason', $reason);
$display->add('exact', $exact);
$display->add('is_phone', $is_phone);
$display->add('cmd', Url::get('cmd'));
$display->output('edit');
$this->endForm();
}
示例13: PostItem
function PostItem($row)
{
Module::Module($row);
if (User::is_login()) {
if (!User::have_permit(ADMIN_ITEM) || User::is_block()) {
Url::access_denied();
} else {
if (Url::get('cmd') == 'edit') {
if (Url::get('id')) {
require_once 'forms/EditItemForm.php';
$this->add_form(new EditItemForm());
return;
}
}
if (Url::get('cmd') != '') {
Url::redirect_current();
}
require_once 'forms/PostItemForm.php';
$this->add_form(new PostItemForm());
}
} else {
AZLib::check_uri();
Url::redirect_url('?page=sign_in&href=' . base64_encode(CGlobal::$query_string));
}
}
示例14: check_login
function check_login()
{
if (!User::is_login()) {
AZLib::check_uri();
Url::redirect_url('?page=sign_in&href=' . base64_encode(CGlobal::$query_string));
}
}
示例15: draw
function draw()
{
global $display;
$cmd = Url::get('cmd');
if ($cmd == 'update') {
AZMemcache::do_put("prhot_ver:", 0);
Url::redirect_current();
}
$this->beginForm();
$list_cat = array(999999999 => 'Mặc định', 0 => 'Trang chủ');
$list_cat += AZLib::getTopCats();
$item = DB::fetch_all('SELECT item_id,status,product_hot_cat_id,end_time,start_time FROM product_hot');
$items_tmp = array();
foreach ($item as $values) {
if (isset($list_cat[$values['product_hot_cat_id']])) {
$items_tmp[$values['product_hot_cat_id']]['cat_name'] = $list_cat[$values['product_hot_cat_id']];
if ($values['status'] == 1) {
$items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['cat_id'] = $values['product_hot_cat_id'];
$items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['start_time'] = date("d/m/Y", $values['start_time']);
$items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['end_time'] = date("d/m/Y", $values['end_time']);
} else {
$items_tmp[$values['product_hot_cat_id']]['item'][$values['item_id']] = $values['product_hot_cat_id'];
}
}
}
$items = array();
foreach ($list_cat as $key => $values) {
if (isset($items_tmp[$key])) {
$items[$key] = $items_tmp[$key];
}
}
$display->add('items', $items);
$display->output('ManageProductHot');
$this->endForm();
}