本文整理汇总了PHP中seo函数的典型用法代码示例。如果您正苦于以下问题:PHP seo函数的具体用法?PHP seo怎么用?PHP seo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了seo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _list
function _list()
{
global $_G;
$url = 'm=shop&a=list';
$and = '';
$size = 10;
seo('品牌店铺 - 合作商家');
if ($_GET['cate']) {
$cateid = intval($_GET[cate]);
$cate = $_G['shop_cate'][$cateid];
$and .= " AND cate = " . $cateid;
$url .= "&cate=" . $cateid;
if ($cate['page'] > 0) {
$size = intval($cate['page']);
}
if ($cate['title']) {
seo($cate[title], $cate[keywords], $cate[description]);
} else {
seo($cate['name'] . ' - 品牌店铺', $cate[keywords], $cate[description]);
}
}
if (isset($_GET['shop_type'])) {
$shop_type = intval($_GET[shop_type]);
$and .= " AND shop_type = " . $shop_type;
$url .= "&shop_type=" . $shop_type;
}
$and .= " AND start_time < " . TIMESTAMP;
$and .= " AND ( end_time = 0 or end_time > " . TIMESTAMP . ")";
$rs = D(array('table' => 'shop', 'and' => $and . ' AND `hide` = 0', 'order' => ' `sort` DESC,id DESC ', 'key' => ''), array('size' => $size, 'url' => $url));
$this->add($rs);
$this->show();
}
示例2: register
/**
* 申请友情链接
*/
public function register() {
$siteid = SITEID;
if(isset($_POST['dosubmit'])){
if($_POST['name']==""){
showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");
}
if($_POST['url']==""){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
}
if(!in_array($_POST['linktype'],array('0','1'))){
$_POST['linktype'] = '0';
}
$link_db = pc_base::load_model(link_model);
$_POST['logo'] =new_html_special_chars($_POST['logo']);
if($_POST['linktype']=='0'){
$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']);
}else{
$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']);
}
$link_db->insert($sql);
showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");
} else {
$setting = getcache('link', 'commons');
$setting = $setting[$siteid];
if($setting['is_post']=='0'){
showmessage(L('suspend_application'), HTTP_REFERER);
}
$this->type = pc_base::load_model('type_model');
$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类
pc_base::load_sys_class('form', '', 0);
$SEO = seo(SITEID, '', L('application_links'), '', '');
include template('link', 'register');
}
}
示例3: _list
function _list()
{
global $_G;
$id = intval($_GET['id']);
$and = '';
$url = URL . "m=article&a=list";
if ($id > 0) {
foreach ($_G[setting][article_tag] as $k => $v) {
if ($k == $id) {
$tag = $v;
}
}
if (!$tag) {
showmessage('未找到分类');
return false;
}
$and .= " AND tag = " . $id;
$url .= "&id=" . $id;
}
$rs = D(array('and' => $and . ' AND `hide` = 0 ', 'table' => 'article', 'order' => '`sort` DESC,`id` DESC'), array('size' => 10, 'url' => $url));
foreach ($rs[goods] as $k => $v) {
$rs[goods][$k][message] = trim_html($v[message], 1);
}
$this->add(array('tag' => $tag));
$this->add($rs);
seo('文章列表' . ' - ' . $_G['setting'][title]);
$this->show();
}
示例4: register
/**
* 申请友情链接
*/
public function register()
{
if (isset($_POST['dosubmit'])) {
if ($_POST['name'] == "") {
showmessage(L('sitename_noempty'), U('link/index/register'));
}
if ($_POST['url'] == "") {
showmessage(L('siteurl_not_empty'), U('link/index/register'));
}
if (!in_array($_POST['linktype'], array('0', '1'))) {
$_POST['linktype'] = '0';
}
$link_db = Loader::model('link_model');
$_POST['logo'] = String::htmlspecialchars($_POST['logo']);
if ($_POST['linktype'] == '0') {
$sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url']);
} else {
$sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'logo' => $_POST['logo']);
}
$link_db->insert($sql);
showmessage(L('add_success'), U('link/index'));
} else {
$setting = S('common/link');
if (isset($setting['is_post']) && $setting['is_post'] == '0') {
showmessage(L('suspend_application'), HTTP_REFERER);
}
$this->type = Loader::model('type_model');
$types = $this->type->get_types();
// 获取站点下所有友情链接分类
$SEO = seo('', L('application_links'), '', '');
include template('link', 'register');
}
}
示例5: lists
/**
* 按照模型搜索
*/
public function lists()
{
$tag = safe_replace(addslashes($_GET['tag']));
$keyword_data_db = pc_base::load_model('keyword_data_model');
//获取标签id
$r = $this->keyword_db->get_one(array('keyword' => $tag, 'siteid' => $this->siteid), 'id');
if (!$r['id']) {
showmessage('不存在此关键字!');
}
$tagid = intval($r['id']);
$page = max($_GET['page'], 1);
$pagesize = 20;
$where = '`tagid`=\'' . $tagid . '\' AND `siteid`=' . $this->siteid;
$infos = $keyword_data_db->listinfo($where, '`id` DESC', $page, $pagesize);
$pages = $keyword_data_db->pages;
$total = $keyword_data_db->number;
if (is_array($infos)) {
$datas = array();
foreach ($infos as $info) {
list($contentid, $modelid) = explode('-', $info['contentid']);
$this->db->set_model($modelid);
$res = $this->db->get_one(array('id' => $contentid), 'title, description, url, inputtime, style');
$res['title'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['title']);
$res['description'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['description']);
$datas[] = $res;
}
}
$SEO = seo($siteid, '', $tag);
include template('content', 'tag_list');
}
示例6: __construct
public function __construct()
{
if (is_mobile_request()) {
$params = $_GET;
$this->redirect('Mobile/' . CONTROLLER_NAME . '/' . ACTION_NAME, $params);
}
parent::__construct();
$this->assign('controller', CONTROLLER_NAME);
//读取配置信息
$web_stting = F('setting');
if ($web_stting === false) {
$params = array();
$list = M('Setting')->getField('name,value');
foreach ($list as $key => $val) {
$params[$key] = unserialize($val) ? unserialize($val) : $val;
}
F('setting', $params);
$web_stting = F('setting');
}
$this->assign('web_stting', $web_stting);
//站点状态判断
if ($web_stting['site_status'] != 1) {
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo $web_stting['closed_reason'];
exit;
} else {
$link = M('Link')->where(array('status' => 1))->order('sort desc')->select();
$this->assign('seo', seo());
$this->assign('link', $link);
}
}
示例7: __construct
public function __construct()
{
parent::__construct();
//读取配置信息
$web_stting = F('setting');
if ($web_stting === false) {
$params = array();
$list = M('Setting')->getField('name,value');
foreach ($list as $key => $val) {
$params[$key] = unserialize($val) ? unserialize($val) : $val;
}
F('setting', $params);
$web_stting = F('setting');
}
$this->assign('web_stting', $web_stting);
//站点状态判断
if ($web_stting['site_status'] != 1) {
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo $web_stting['closed_reason'];
exit;
} else {
$this->check_login();
$link = M('Link')->where(array('status' => 1))->order('sort DESC')->select();
$this->assign('link', $link);
$this->assign('seo', seo());
}
}
示例8: index
public function index()
{
//URL规则
$urlrules = F('urlrules');
$where = array();
if (isset($_GET['tagid'])) {
$where['tagid'] = array("EQ", (int) $this->_get("tagid"));
$r = M("Tags")->where($where)->find();
$where['tag'] = $r['tag'];
unset($where['tagid']);
} else {
$where['tag'] = array("EQ", $this->_get("tag"));
}
$data = M("Tags")->where($where)->find();
if (!$data) {
$this->error("该Tag不存在!");
}
$this->assign($data);
M("Tags")->where($where)->setInc("hits");
M("Tags")->where($where)->save(array("lasthittime" => time()));
$page = $this->_get(C("VAR_PAGE"));
$this->assign("page", $page);
$urlrules = $urlrules[CONFIG_TAGURL];
define('URLRULE', str_replace('|', '~', str_replace(array('{$tag}', '{$tagid}'), array($this->_get('tag'), (int) $this->_get("tagid")), $urlrules)));
$SEO = seo();
//seo分配到模板
$this->assign("SEO", $SEO);
//把分页分配到模板
$this->assign(C("VAR_PAGE"), $page);
$this->display("Tags:tag");
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->assign('controller', CONTROLLER_NAME);
//读取配置信息
$web_stting = F('setting');
if ($web_stting === false) {
$params = array();
$list = M('Setting')->getField('name,value');
foreach ($list as $key => $val) {
$params[$key] = unserialize($val) ? unserialize($val) : $val;
}
F('setting', $params);
$web_stting = F('setting');
}
$this->web_stting = $web_stting;
//站点状态判断
if ($this->web_stting['site_status'] != 1) {
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo $this->web_stting['closed_reason'];
exit;
} else {
$this->assign('seo', seo());
}
//检查登录
/* session('member_id',null);
if(!session('member_id'))
{
$this->wx_auto_login(); //自动登录
}
$this->mid = session('member_id'); */
$this->mid = 10;
$this->m_info = M('Member')->where('member_id=' . $this->mid)->find();
}
示例10: index
public function index()
{
//编号,也就是下载第几个链接,有的是多文件下载用的!
$k = I('get.k', 0, 'intval');
//字段名称
$f = I('get.f', '');
if (empty($this->id) || empty($this->catid) || empty($f)) {
$this->error("参数有误!");
}
//模型ID
$modelid = getCategory($this->catid, 'modelid');
$ModelField = cache('ModelField');
$Model_field = $ModelField[$modelid];
//判断字段类型
if (!in_array($Model_field[$f]['formtype'], array('downfiles', 'downfile'))) {
$this->error('下载地址错误!');
}
$this->db = \Content\Model\ContentModel::getInstance($modelid);
$data = $this->db->relation(true)->where(array("id" => $this->id, 'status' => 99))->find();
if (empty($data)) {
$this->error("该信息不存在!");
}
$this->db->dataMerger($data);
if (!empty($data)) {
//取得下载字段信息
$downfiles = $data[$f];
$dowUnserialize = unserialize($downfiles);
if ($dowUnserialize) {
$info = $dowUnserialize[$k];
if (empty($info)) {
$this->error("该下载地址已经失效!");
}
} else {
$info = array();
$info['filename'] = basename($downfiles);
$info['point'] = 0;
$info['groupid'] = 0;
}
//当前客户端标识
$aut = md5($this->userid . $this->groupid . substr($_SERVER['HTTP_USER_AGENT'], 0, 254));
//加密
//格式:aut|栏目ID|信息id|下载编号|字段
$key = \Libs\Util\Encrypt::authcode(implode('|', array($aut, $this->catid, $this->id, $k, $f)), '', '', 3600);
$this->assign("info", $data);
$this->assign("fileurl", U("Download/d", array('key' => urlencode($key))));
$this->assign("filename", $info['filename']);
$this->assign("point", $info['point']);
$this->assign("groupid", $info['groupid']);
$this->assign("Member_group", cache("Member_group"));
$this->assign("SEO", seo($this->catid, urldecode($info['filename']), '', ''));
$this->display("Public:download");
} else {
$this->error("该信息不存在!");
}
}
示例11: index
public function index()
{
$where = array();
$catid = I('get.catid', 0, 'intval');
$rssid = I('get.rssid', 0, 'intval');
if ($rssid) {
header("Content-Type: text/xml; charset=" . C("DEFAULT_CHARSET"));
//检测缓存
$data = S("Rss_{$rssid}");
if ($data) {
echo $data;
exit;
}
$Cat = getCategory($rssid);
//检查栏目是否存在
if (empty($Cat)) {
$this->error('该栏目不存在!');
}
//检查栏目类型
if ($Cat['type'] != 0) {
$this->error('栏目类型不正确!');
}
$where['status'] = array("EQ", 99);
//判断是否有子栏目
if (getCategory($rssid, 'child')) {
$where['catid'] = array("IN", getCategory($rssid, 'arrchildid'));
} else {
$where['catid'] = array("EQ", $rssid);
}
//模型ID
$modelid = getCategory($rssid, 'modelid');
//获取表名
$tablename = ucwords(getModel($modelid, 'tablename'));
if (empty($tablename)) {
$this->error('出现错误!');
}
//栏目配置
$setting = getCategory($rssid, 'setting');
$data = M($tablename)->where($where)->order(array("updatetime" => "DESC", "id" => "DESC"))->limit(50)->select();
import('@.ORG.Rss');
$Rss = new Rss($this->XMLstr(getCategory($rssid, 'catname') . ' - ' . CONFIG_SITENAME), $this->XMLstr(getCategory($rssid, 'url')), $this->XMLstr(getCategory($rssid, 'description')), $this->XMLstr(getCategory($rssid, 'image')));
foreach ($data as $k => $v) {
$v = $this->XMLstr($v);
$Rss->AddItem($v['title'], $v['url'], $v['description'], date("Y-m-d H:i:s A", $v['updatetime']));
}
//进行缓存
S("Rss_{$rssid}", $Rss->Fetch(), 900);
$Rss->Display();
}
$this->assign('catid', $catid);
$this->assign('rssid', $rssid);
$this->assign("SEO", seo(0, 'Rss订阅中心'));
$this->display();
}
示例12: main
function main()
{
global $_G;
$title = $_G[setting][seo_title];
$and = '';
$url = URL . 'm=list';
$rs = array('showpage' => '', 'count' => 0, 'goods' => array());
$size = $channel['page'] > 0 ? intval($channel['page']) : $_G['setting'][cate_page];
$this->add($rs);
$this->add(array('channel' => $channel));
seo($channel['title'], $channel['keywords'], $channel['description']);
$this->show();
}
示例13: init
public function init()
{
$catid = intval($_GET['catid']);
$id = intval($_GET['id']);
if (!$catid || !$id) {
showmessage(L('information_does_not_exist'), 'blank');
}
$_userid = $this->_userid;
$_username = $this->_username;
$_groupid = $this->_groupid;
$page = intval($_GET['page']);
$page = max($page, 1);
$siteids = getcache('category_content', 'commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_' . $siteid, 'commons');
if (!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type'] != 0) {
showmessage(L('information_does_not_exist'), 'blank');
}
$this->category = $CAT = $CATEGORYS[$catid];
$this->category_setting = $CAT['setting'] = string2array($this->category['setting']);
$siteid = $GLOBALS['siteid'] = $CAT['siteid'];
$MODEL = getcache('model', 'commons');
$modelid = $CAT['modelid'];
$tablename = $this->db->table_name = $this->db->db_tablepre . $MODEL[$modelid]['tablename'];
$r = $this->db->get_one(array('id' => $id));
if (!$r || $r['status'] != 99) {
showmessage(L('info_does_not_exists'), 'blank');
}
$this->db->table_name = $tablename . '_data';
$r2 = $this->db->get_one(array('id' => $id));
$rs = $r2 ? array_merge($r, $r2) : $r;
//再次重新赋值,以数据库为准
$catid = $CATEGORYS[$r['catid']]['catid'];
$modelid = $CATEGORYS[$catid]['modelid'];
require_once CACHE_MODEL_PATH . 'content_output.class.php';
$content_output = new content_output($modelid, $catid, $CATEGORYS);
$data = $content_output->get($rs);
extract($data);
//最顶级栏目ID
$arrparentid = explode(',', $CAT['arrparentid']);
$top_parentid = $arrparentid[1] ? $arrparentid[1] : $catid;
$template = 'demo';
//SEO
$seo_keywords = '';
if (!empty($keywords)) {
$seo_keywords = implode(',', $keywords);
}
$SEO = seo($siteid, $catid, $title, $description, $seo_keywords);
include template('content', $template);
}
示例14: index
/**
* 显示下载页面
*/
public function index()
{
//栏目ID
$catid = (int) $this->_get('catid');
//信息ID
$id = (int) $this->_get('id');
//编号
$k = (int) $this->_get('k');
//字段名称
$f = $this->_get('f');
if (!$catid || !$id || !$f) {
$this->error("参数有误!");
}
$Category = F('Category');
$Model = F('Model');
//模型ID
$modelid = $Category[$catid]['modelid'];
$Model_field = F("Model_field_" . $modelid);
//主表名称
if ((int) $Model_field[$f]['issystem'] == 1) {
$tablename = ucwords($Model[$modelid]['tablename']);
} else {
$tablename = ucwords($Model[$modelid]['tablename']) . "_data";
}
//字段配置
$setting = unserialize($Model_field[$f]['setting']);
if ($setting) {
//字段信息
$downfiles = M($tablename)->where(array("id" => $id))->getField($f);
$downfiles = unserialize($downfiles);
$info = $downfiles[$k];
if (!$info) {
$this->error("该下载地址已经失效!");
}
//加验证码
$aut = md5(get_client_ip() . substr($_SERVER['HTTP_USER_AGENT'], 0, 254));
//加密
//格式:aut|栏目ID|信息id|下载编号|字段
$key = authcode($aut . "|" . $catid . "|" . $id . "|" . $k . "|" . $f, "", '', 3600);
$this->assign("fileurl", U("Download/d", "key=" . str_replace("%2F", "%*2F", urlencode($key))));
$this->assign("filename", $info['filename']);
$this->assign("point", $info['point']);
$this->assign("groupid", $info['groupid']);
$this->assign("Member_group", F("Member_group"));
$this->assign("SEO", seo($catid, urldecode($info['filename']), '', ''));
$this->display("Public:download");
} else {
$this->error("出现错误,请联系管理员更新缓存!");
}
}
示例15: index
public function index()
{
$search = $_GET;
$gc = array();
if (intval($search['cate'])) {
$array = M('GoodsClass')->order('gc_sort desc')->select();
$ids = getChildsId($array, intval($search['cate']), 'gc_id', 'gc_parent_id');
$ids[] = intval($search['cate']);
$where['gc_id'] = array('IN', $ids);
$gc = M('GoodsClass')->where($where)->find();
if ($gc['gc_parent_id']) {
$pcate = $gc['gc_parent_id'];
} else {
$pcate = intval($search['cate']);
}
$search['cateName'] = $gc['gc_name'];
$param['title'] = $gc['gc_title'];
$param['keywords'] = $gc['gc_key'];
$param['description'] = $gc['gc_desc'];
$this->seo = seo($param);
}
if (trim($search['tag'])) {
$tag = explode(',', trim($search['tag']));
$where['_string'] = '';
if (is_array($tag)) {
foreach ($tag as $key => $val) {
$where['_string'] .= '(tag like "%|' . $val . '|%") AND ';
}
$where['_string'] = substr($where['_string'], 0, -5);
}
}
$order = 'goods_sort desc';
$where['goods_status'] = 1;
$count = D('Goods')->where($where)->count();
$page = new Page($count, 8);
$list = D('Goods')->where($where)->limit($page->firstRow . ',' . $page->listRows)->order($order)->select();
$tc_ids = $gc['tc_id'];
if (!empty($tc_ids)) {
$tag_class = D('TagClass')->relation(true)->where(array('tc_id' => array('IN', $tc_ids)))->order('tc_sort desc')->select();
$this->assign('tag_class', $tag_class);
}
$this->assign('pcate', $pcate);
$this->assign('list', $list);
$this->assign('page', $page->show());
$this->assign('search', $search);
$this->display();
}