Exemple #1
0
/**
 * @param string $_page 当前页面信息(list,view)
 * @param string $_definedSeo 自定义SEO配置信息
 * @param string $_fname 板块名称
 * @param string $_types 分类信息
 * @param string $_subject 帖子名称
 * @param string $_tags 标签
 * @param string $_summary 摘要
 */
function cmsSeoSettings($_page = 'index', $_definedSeo = '', $_column = '', $_subject = '', $_tags = '', $_summary = '')
{
    global $cms_sitename, $cms_seoset;
    /* 网站名称,栏目名称,文章名称,标签名称,文章概要  */
    $_targets = array('{wzmc}', '{lmmc}', '{armc}', '{tmc}', '{wzgy}');
    $_replace = array($cms_sitename, $_column, $_subject, $_tags, $_summary);
    /*获取SEO配置信息  自定义->后台定义->默认*/
    empty($_definedSeo['title']) && ($_definedSeo['title'] = $cms_seoset['title'][$_page]);
    empty($_definedSeo['metaDescription']) && ($_definedSeo['metaDescription'] = $cms_seoset['metaDescription'][$_page]);
    empty($_definedSeo['metaKeywords']) && ($_definedSeo['metaKeywords'] = $cms_seoset['metaKeywords'][$_page]);
    /*如果以上设置为空则采用默认配置*/
    $_default = array('title' => '{armc} | {lmmc} - {wzmc}', 'descp' => '{wzgy} | {armc}', 'keywords' => '{tmc} , {armc} | {lmmc} - {wzmc}');
    return seoSettings($_definedSeo, $_replace, $_default, $_targets);
}
Exemple #2
0
}
!$channelInfo && Showmsg('频道不存在');
/*SEO*/
$_seo = array('title' => $channelInfo['metatitle'], 'metaDescription' => $channelInfo['metadescrip'], 'metaKeywords' => $channelInfo['metakeywords']);
if (empty($channelInfo['metatitle'])) {
    $_seo['title'] = $area_seoset['title']['index'];
}
if (empty($channelInfo['metadescrip'])) {
    $_seo['metaDescription'] = $area_seoset['metaDescription']['index'];
}
if (empty($channelInfo['metakeywords'])) {
    $_seo['metaKeywords'] = $area_seoset['metaKeywords']['index'];
}
$_replace = array($area_sitename, $_fname, $_types, $_subject, $_tags, $_summary);
$area_sitename = $area_sitename ? $area_sitename : $db_bbsname;
seoSettings($_seo, array($area_sitename, $channelInfo['name'], '', '', '', '', $channelInfo['name']));
/*SEO*/
$channelImagePath = $db_htmdir . '/channel/' . $alias . '/images';
if (defined('HTML_CHANNEL')) {
    $htmlFile = S::escapePath(AREA_PATH . $alias . '/index.html');
    if (!file_exists($htmlFile)) {
        Showmsg('channel_html_have_not_create');
    }
    readfile($htmlFile);
    exit;
}
if (!defined('AREA_STATIC')) {
    $ifactive = 1;
}
$channelid = $channelInfo['id'];
$areaLevelService = L::loadClass('arealevel', 'area');
Exemple #3
0
/**
 * @param string $_page 当前页面信息
 * @param string $_definedSeo 自定义SEO配置信息
 * @param string $_fname 板块名称
 * @param string $_types 分类信息
 * @param string $_subject 帖子名称
 * @param string $_tags 标签
 * @param string $_summary 摘要
 */
function bbsSeoSettings($_page = 'index', $_definedSeo = array(), $_fname = '', $_types = '', $_subject = '', $_tags = '', $_summary = '')
{
    global $db_bbsname, $db_seoset;
    /* 网站名称,板块名称,分类名称,帖子名称,标签名称,文章概要  */
    $_tags = substr($_tags, 0, strpos($_tags, "\t"));
    $_types = isset($_types) && is_array($_types) ? $_types['name'] : '';
    $_replace = array($db_bbsname, $_fname, $_types, $_subject, $_tags, $_summary);
    /*获取SEO配置信息  自定义->后台定义->默认*/
    empty($_definedSeo['title']) && ($_definedSeo['title'] = $db_seoset['title'][$_page]);
    empty($_definedSeo['metaDescription']) && ($_definedSeo['metaDescription'] = $db_seoset['metaDescription'][$_page]);
    empty($_definedSeo['metaKeywords']) && ($_definedSeo['metaKeywords'] = $db_seoset['metaKeywords'][$_page]);
    return seoSettings($_definedSeo, $_replace, $_default, $_targets);
}