/**
 * 应用 >> 安米手机客户端 >> 下载页面
 *
 * @author 谢建平 <*****@*****.**>
 * @copyright 2012-2014 Appbyme
 * @license http://opensource.org/licenses/LGPL-3.0
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
require_once dirname(__FILE__) . '/appbyme.class.php';
Appbyme::init();
global $_G;
$_G['disabledwidthauto'] = 1;
$appInfo = Appbyme::getAppbymeConfig('app_download_options');
!empty($appInfo['cvalue']) && ($appInfo = unserialize($appInfo['cvalue']));
$appName = $appInfo['appName'];
$appImage = $appInfo['appImage'];
$appIcon = $appInfo['appIcon'];
$appDescribe = $appInfo['appDescribe'];
$androidDownloadUrl = $appInfo['appDownloadUrl']['android'];
$appleDownloadUrl = $appInfo['appDownloadUrl']['apple'];
$appleMobileDownloadUrl = $appInfo['appDownloadUrl']['appleMobile'];
$androidQRCode = $appInfo['appQRCode']['android'];
$appleQRCode = $appInfo['appQRCode']['apple'];
$assetsBaseUrlPath = $_G['siteurl'] . '/source/plugin/' . Appbyme::PLUGIN_ID . '/template';
list($navtitle, $metadescription, $metakeywords) = Appbyme::getSeoSetting('download');
if (!$navtitle) {
    $navtitle = Appbyme::lang('appbyme_seo_title_download');
    $nobbname = false;
Beispiel #2
0
 * @author 谢建平 <*****@*****.**>
 * @copyright 2012-2014 Appbyme
 * @license http://opensource.org/licenses/LGPL-3.0
 */
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
require_once dirname(__FILE__) . '/appbyme.class.php';
Appbyme::init();
$baseUrl = rawurldecode(cpurl());
if (!submitcheck('seo_submit')) {
    $formUrl = ltrim($baseUrl, 'action=');
    $setting = array();
    $seoConfigs = array('seotitle', 'seokeywords', 'seodescription');
    foreach ($seoConfigs as $key) {
        $config = Appbyme::getAppbymeConfig($key);
        $setting[$key] = unserialize($config['cvalue']);
    }
    showtagheader('div', 'seo_setting', true);
    showformheader($formUrl);
    showtableheader();
    showtitle('<em class="right">' . cplang('setting_seo_robots_output') . '</em>' . cplang('setting_seo'));
    showtablerow('', array('class="vtop tips2" colspan="4" style="padding-left:20px;"'), array('<ul><li>' . cplang('setting_seo_seotitle_comment') . '</li><li>' . cplang('setting_seo_seodescription_comment') . '</li><li>' . cplang('setting_seo_seokeywords_comment') . '</li></ul>'));
    showtitle(Appbyme::lang('appbyme_seo_title_download'));
    showtablerow('', array('width="80"', ''), array(cplang('setting_seo_seotitle'), '<input type="text" name="settingnew[seotitle][download]" value="' . htmlspecialchars($setting['seotitle']['download']) . '" class="txt" style="width:280px;" />'));
    showtablerow('', array('width="80"', ''), array(cplang('setting_seo_seokeywords'), '<input type="text" name="settingnew[seokeywords][download]" value="' . htmlspecialchars($setting['seokeywords']['download']) . '" class="txt" style="width:280px;" />'));
    showtablerow('', array('width="80"', ''), array(cplang('setting_seo_seodescription'), '<input type="text" name="settingnew[seodescription][download]" value="' . htmlspecialchars($setting['seodescription']['download']) . '" class="txt" style="width:280px;" />'));
    showtablefooter();
    // showtableheader();
    // showsetting('setting_seo_seohead', 'settingnew[seohead]', $setting['seohead'], 'textarea');
    // showtablefooter();
 public static function getSeoSetting($page, $data = array(), $defset = array())
 {
     global $_G;
     $searchs = array('{bbname}');
     $replaces = array($_G['setting']['bbname']);
     $setting = array();
     $seoConfigs = array('seotitle', 'seokeywords', 'seodescription');
     foreach ($seoConfigs as $key) {
         $config = Appbyme::getAppbymeConfig($key);
         $setting[$key] = unserialize($config['cvalue']);
     }
     $_G['setting'] = array_merge($_G['setting'], $setting);
     $seotitle = $seodescription = $seokeywords = '';
     $titletext = $defset['seotitle'] ? $defset['seotitle'] : $_G['setting']['seotitle'][$page];
     $descriptiontext = $defset['seodescription'] ? $defset['seodescription'] : $_G['setting']['seodescription'][$page];
     $keywordstext = $defset['seokeywords'] ? $defset['seokeywords'] : $_G['setting']['seokeywords'][$page];
     preg_match_all("/\\{([a-z0-9_-]+?)\\}/", $titletext . $descriptiontext . $keywordstext, $pageparams);
     if ($pageparams) {
         foreach ($pageparams[1] as $var) {
             $searchs[] = '{' . $var . '}';
             if ($var == 'page') {
                 $data['page'] = $data['page'] > 1 ? lang('core', 'page', array('page' => $data['page'])) : '';
             }
             $replaces[] = $data[$var] ? strip_tags($data[$var]) : '';
         }
         if ($titletext) {
             $seotitle = helper_seo::strreplace_strip_split($searchs, $replaces, $titletext);
         }
         if ($descriptiontext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
             $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
         }
         if ($keywordstext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
             $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
         }
     }
     return array($seotitle, $seodescription, $seokeywords);
 }