本文整理汇总了PHP中CGlobal::keywords方法的典型用法代码示例。如果您正苦于以下问题:PHP CGlobal::keywords方法的具体用法?PHP CGlobal::keywords怎么用?PHP CGlobal::keywords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGlobal
的用法示例。
在下文中一共展示了CGlobal::keywords方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct()
{
Form::Form('NewsDetailForm');
$id = Url::get('news_id', 0);
if ($id) {
if (!CGlobal::$news_details) {
CGlobal::$news_details = DB::select("news", "id={$id}");
}
if (CGlobal::$news_details && (CGlobal::$news_details['status'] == 1 || CGlobal::$news_details['status'] == 0 && User::have_permit(ADMIN_NEWS))) {
$this->news = CGlobal::$news_details;
}
}
if (!$this->news) {
Url::redirect('news_list', array('news_catid', 'azname'));
} else {
DB::query("UPDATE news SET view_num=view_num+1 WHERE id =" . $this->news['id']);
}
$news_title = $this->news['title'];
$catid = $this->news['news_catid'];
$str_keywords = '';
$str_catSub = '';
$meta_keywords = '';
$meta_desc = '';
if (isset(CGlobal::$allNewsCategories[$catid])) {
$news_title .= " - " . CGlobal::$allNewsCategories[$catid]['name'];
$curMainCat = CGlobal::$allNewsCategories[$catid];
$str_catSub = $curMainCat['name'];
if ($curMainCat['keywords']) {
$meta_keywords .= ($meta_keywords ? ', ' : '') . $curMainCat['keywords'];
}
if ($curMainCat['description']) {
$meta_desc .= ($meta_desc ? ', ' : '') . $curMainCat['description'];
}
}
if ($this->news['brief']) {
CGlobal::$meta_desc = AZLib::cleanHtml($this->news['brief']);
} elseif ($meta_desc != '') {
CGlobal::$meta_desc = $meta_desc;
}
if ($meta_keywords != '') {
CGlobal::$keywords = $meta_keywords;
} elseif ($str_catSub != '') {
CGlobal::$keywords = $str_catSub;
}
CGlobal::$website_title = stripslashes($news_title) . ' - Tin tức';
//CGlobal::$website_title = AznetLib::subString($news_title,0,100,true);
// $this->link_css('style/aznet/jquery.lightbox.css');
// $this->link_js('javascript/jquery/lightbox/jquery.lightbox.js');
}
示例2:
function __construct($row){
Module::Module($row);
require_once 'forms/header.php';
$str_keywords = '';
$str_catSub = '';
$meta_desc = '';
//limit character description and keyword
CGlobal::$keywords = EClassApi::word_limit(CGlobal::$keywords,20,'');
CGlobal::$meta_desc = EClassApi::word_limit(CGlobal::$meta_desc,250,'');
//Gán title cho các trang trong!
if(isset($page_title_arr[EClass::$page['name']])){
CGlobal::$website_title = $page_title_arr[EClass::$page['name']].' | '.CGlobal::$website_title;
}
$this->add_form(new HeaderForm);
}
示例3:
function __construct()
{
$this->link_css('style/listItem.css');
$this->link_js('javascript/default/list.js');
$this->link_css('style/home/list-supplier.css');
$this->link_css('style/home/nav-filter.css');
// Start Import Autocomplete
$this->link_js('javascript/autocomplete/jquery.autocomplete.min.js');
$this->link_css('javascript/autocomplete/jquery.autocomplete.css');
// End Import Autocomplete
$slug = Url::get('slug');
$sql = 'SELECT * FROM seo_keywords WHERE safe_key="' . $slug . '"';
$keyword = mysql_fetch_assoc(DB::query($sql));
$district_id = $keyword['did'];
if (is_numeric($district_id) && $district_id > 0) {
$sql = 'SELECT * FROM district WHERE id=' . $district_id;
$district = mysql_fetch_assoc(DB::query($sql));
}
CGlobal::$website_title = " Danh sách nhà cung cấp với từ khóa " . $keyword['keyword'];
CGlobal::$meta_desc = $keyword['description'];
CGlobal::$keywords = $keyword['meta_keyword'];
}
示例4: elseif
function __construct()
{
Form::Form('NewsListForm');
$news_cat_id = Url::get('news_catid', 'id', 0);
AZLib::getNewsCats();
if ($news_cat_id && isset(CGlobal::$allNewsCategories[$news_cat_id]) && (CGlobal::$allNewsCategories[$news_cat_id]['public'] || User::have_permit(ADMIN_NEWS))) {
$this->news_cat = CGlobal::$allNewsCategories[$news_cat_id];
} else {
Url::redirect('news');
}
$news_title = '';
$catid = $news_cat_id;
$str_keywords = '';
$str_catSub = '';
$meta_keywords = '';
$meta_desc = '';
if (isset(CGlobal::$allNewsCategories[$catid])) {
$news_title .= CGlobal::$allNewsCategories[$catid]['name'];
$curMainCat = CGlobal::$allNewsCategories[$catid];
$str_catSub .= $curMainCat['name'];
if ($curMainCat['keywords']) {
$meta_keywords .= ($meta_keywords ? ', ' : '') . $curMainCat['keywords'];
}
if ($curMainCat['description']) {
$meta_desc .= ($meta_desc ? ', ' : '') . $curMainCat['description'];
}
}
if ($meta_desc != '') {
CGlobal::$meta_desc = $meta_desc;
}
if ($meta_keywords != '') {
CGlobal::$keywords = $meta_keywords;
} elseif ($str_catSub != '') {
CGlobal::$keywords = $str_catSub;
}
CGlobal::$website_title = stripslashes($news_title) . " - Tin tức";
}
示例5: array
}
} else {
if (isset($_GET['login_as']) || isset($_GET['login_as_id'])) {
if (User::is_admin()) {
$user_id = (int) Url::get('login_as_id', 0);
$user = array();
if ($user_id) {
$user = User::getUser($user_id);
} else {
$user_name = Url::get('login_as');
if ($user_name != '') {
$user = User::getByUserName($user_name);
}
}
if ($user) {
if (User::is_root() || !$user['gids'] || $user['gids'] && !preg_match("/([\\D])9([\\D])/i", "|{$user['gids']}|")) {
User::LogIn($user);
}
}
}
Url::redirect_url(Url::build_all(array('login_as', 'login_as_id')));
}
}
}
//Title mac dinh cho website
CGlobal::$website_title = "Big School";
CGlobal::$keywords = 'Big School, Study, Học hành, Giáo viên, Học sinh, Thi cử';
CGlobal::$meta_desc = 'Big School';
register_shutdown_function(array("DB", "close"));
register_shutdown_function(array("EClassApi", "ftp_image_close"));
$display = new EBDisplay();
示例6: foreach
function __construct($row)
{
Module::Module($row);
require_once 'forms/header.php';
if (AZNet::$page['name'] == 'zone') {
$zone_id = (int) Url::get("zone_id");
if (!$zone_id || $zone_id && !isset(CGlobal::$allZones[$zone_id])) {
//Url::access_denied();
Url::redirect('home');
}
}
if (AZNet::$page['name'] == 'item_detail') {
$item_id = (int) Url::get('id', 0);
if (Item::$id == -1) {
Item::$id = $item_id;
Item::$item = Item::get_item($item_id);
AZLib::checkItem();
if (Item::$item && Item::$item['display']) {
CGlobal::$curCategory = Item::$item['category_id'];
}
}
}
$curCategory = false;
if (CGlobal::$curCategory && isset(CGlobal::$allCategories[CGlobal::$curCategory])) {
$curCategory = CGlobal::$allCategories[CGlobal::$curCategory];
}
$str_keywords = '';
$str_catSub = '';
$meta_desc = '';
if ($curCategory) {
if ($curCategory['parent_id'] && isset(CGlobal::$allCategories[$curCategory['parent_id']])) {
$parent_cat = CGlobal::$allCategories[$curCategory['parent_id']];
CGlobal::$curMainCat = CGlobal::$allCategories[$curCategory['parent_id']];
CGlobal::$curLevel2Cat = $curCategory;
} else {
CGlobal::$curMainCat = $curCategory;
}
}
if (CGlobal::$curMainCat && isset(CGlobal::$curMainCat['zones'])) {
foreach (CGlobal::$curMainCat['zones'] as $zid) {
if ($zid && isset(CGlobal::$allZones[$zid])) {
CGlobal::$curZone = CGlobal::$allZones[$zid];
if (CGlobal::$curMainCat['id'] != 100) {
break;
}
}
}
}
if (!CGlobal::$curZone) {
$zid = (int) Url::get("zone_id", 0);
if ($zid && isset(CGlobal::$allZones[$zid])) {
CGlobal::$curZone = CGlobal::$allZones[$zid];
}
}
if (AZNet::$page['name'] == 'zone') {
if (REWRITE_ON) {
//tuannk add 2010.07.28 fix redirect 301 với các url link sai
$ebname = CGlobal::$curZone['ebname'];
$eburl = WEB_DIR . "z" . CGlobal::$curZone['id'] . "/{$ebname}.html";
if ($ebname != '' && strpos($_SERVER['REQUEST_URI'], $eburl) !== 0) {
Url::redirect_url($eburl, 301);
}
}
##########################################
#For SEO
if (isset(CGlobal::$curZone['cats'])) {
foreach (CGlobal::$curZone['cats'] as $catid) {
if (isset(CGlobal::$allCategories[$catid])) {
$str_catSub .= ($str_catSub ? ', ' : '') . CGlobal::$allCategories[$catid]['name'];
if (CGlobal::$allCategories[$catid]['keywords']) {
$str_keywords .= ($str_keywords ? ', ' : '') . CGlobal::$allCategories[$catid]['keywords'];
}
if (CGlobal::$allCategories[$catid]['description']) {
$meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$allCategories[$catid]['description'];
}
}
}
}
if (!$str_keywords) {
if ($str_catSub) {
$str_keywords = $str_catSub;
} else {
$str_keywords = CGlobal::$curZone['name'];
}
}
if (!$meta_desc) {
if ($str_catSub) {
$meta_desc = $str_catSub;
} else {
$meta_desc = CGlobal::$curZone['name'];
}
}
CGlobal::$keywords = $str_keywords;
CGlobal::$meta_desc = $meta_desc;
CGlobal::$website_title = CGlobal::$curZone['name'];
#For SEO
##########################################
} else {
$catid = CGlobal::$curCategory;
if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['ref_id']) {
//.........这里部分代码省略.........
示例7: array
$user_id = (int) Url::get('login_as_id', 0);
$user = array();
if ($user_id) {
$user = User::getUser($user_id);
} else {
$user_name = Url::get('login_as');
if ($user_name != '') {
$user = User::getByUserName($user_name);
}
}
if ($user) {
if (User::is_root() || !$user['gids'] || $user['gids'] && !preg_match("/([\\D])9([\\D])/i", "|{$user['gids']}|")) {
User::LogIn($user);
}
}
}
Url::redirect_url(Url::build_all(array('login_as', 'login_as_id')));
}
}
}
//Title mac dinh cho website
CGlobal::$website_title = WEB_TITLE;
CGlobal::$keywords = META_KEYWORDS;
CGlobal::$meta_desc = META_DESCRIPTION;
//Tiền tệ:
CGlobal::$currency = array('1' => 'VNĐ', '2' => '$');
//CGlobal::$currency = array('1'=>'VNĐ','2'=>'$','3'=>'€');//'3'=>'€');
register_shutdown_function(array("DB", "close"));
register_shutdown_function(array("AZLib", "ftp_image_close"));
global $display;
$display = new AZDisplay();