コード例 #1
0
ファイル: Skins.php プロジェクト: djqhuan/CSCMS-v4.0-UTF8
 public function cscms_common($str, $skins = '')
 {
     //解析头部、底部、左右分栏
     $str = $this->topandend($str, $skins);
     $str = str_replace("{cscms:webname}", Web_Name, $str);
     $str = str_replace("{cscms:weburl}", Web_Url, $str);
     $str = str_replace("{cscms:webpath}", Web_Path, $str);
     $str = str_replace("{cscms:path}", "http://" . Web_Url . Web_Path, $str);
     $str = str_replace("{cscms:indextempurl}", Skins_Dir('index', $skins), $str);
     $dir = !defined('PLUBPATH') ? '' : PLUBPATH;
     $str = str_replace("{cscms:tempurl}", Skins_Dir($dir, $skins), $str);
     $str = str_replace("{cscms:stat}", str_decode(Web_Count), $str);
     $str = str_replace("{cscms:notice}", str_decode(Web_Notice), $str);
     $str = str_replace("{cscms:regxy}", str_decode(User_Regxy), $str);
     //SEO代码
     $seo = defined('PLUBPATH') ? config('Seo') : '';
     $title = !empty($seo['title']) ? $seo['title'] : str_decode(Web_Title);
     $str = str_replace("{cscms:title}", $title, $str);
     $keywords = !empty($seo['keywords']) ? $seo['keywords'] : str_decode(Web_Keywords);
     $str = str_replace("{cscms:keywords}", $keywords, $str);
     $description = !empty($seo['description']) ? $seo['description'] : str_decode(Web_Description);
     $str = str_replace("{cscms:description}", $description, $str);
     $str = str_replace("{cscms:mail}", Admin_Mail, $str);
     $str = str_replace("{cscms:qq}", Admin_QQ, $str);
     $str = str_replace("{cscms:tel}", Admin_Tel, $str);
     $str = str_replace("{cscms:icp}", Web_Icp, $str);
     //判断登录状态
     if (isset($_SESSION['cscms__id']) && isset($_SESSION['cscms__login'])) {
         $str = str_replace("{cscms:login}", "ok", $str);
         $str = str_replace("{cscms:uid}", $_SESSION['cscms__id'], $str);
     } else {
         $str = str_replace("{cscms:login}", "no", $str);
         $str = str_replace("{cscms:uid}", 0, $str);
     }
     //网站部分链接
     if (Web_Mode == 2) {
         $str = str_replace('{cscms:gbooklink}', 'http://' . Web_Url . Web_Path . 'gbook.html', $str);
     } else {
         $str = str_replace('{cscms:gbooklink}', site_url('gbook'), $str);
     }
     //搜索链接
     $solink = '';
     if ($dir != '') {
         $Ym_Mode = config('Ym_Mode', $dir);
         //二级域名状态
         $Ym_Url = config('Ym_Url', $dir);
         //二级域名地址
         if ($Ym_Mode == 1) {
             $solink = 'http://' . $Ym_Url . Web_Path . 'index.php/search';
         } else {
             $solink = Web_Path . 'index.php/' . $dir . '/search';
         }
     }
     $str = str_replace('{cscms:solink}', $solink, $str);
     $str = str_replace('{cscms:codes}', site_url('api/codes'), $str);
     $str = str_replace('{cscms:userlink}', site_url('user'), $str);
     $str = str_replace('{cscms:loginlink}', site_url('user/login'), $str);
     $str = str_replace('{cscms:reglink}', site_url('user/reg'), $str);
     $str = str_replace('{cscms:passlink}', site_url('user/pass'), $str);
     $str = str_replace('{cscms:qqlink}', site_url('user/open/login/qq'), $str);
     $str = str_replace('{cscms:weibolink}', site_url('user/open/login/weibo'), $str);
     $str = str_replace('{cscms:kaixinlink}', site_url('user/open/login/kaixin'), $str);
     $str = str_replace('{cscms:baidulink}', site_url('user/open/login/baidu'), $str);
     $str = str_replace('{cscms:doubanlink}', site_url('user/open/login/douban'), $str);
     $str = str_replace('{cscms:sohulink}', site_url('user/open/login/sohu'), $str);
     $str = str_replace('{cscms:wangyilink}', site_url('user/open/login/netease'), $str);
     $str = str_replace('{cscms:renrenlink}', site_url('user/open/login/renren'), $str);
     $str = userurl($str);
     return $str;
 }
コード例 #2
0
ファイル: csdjtpl.php プロジェクト: djqhuan/CSCMS-v4.0-UTF8
 public function page($row, $return = FALSE)
 {
     $cache_id = "page_" . $row['name'];
     if (!$this->cache->start($cache_id)) {
         $Mark_Text = str_decode($row['html']);
         $Mark_Text = $this->skins->template_parse($Mark_Text, true);
         if ($return == FALSE) {
             echo $Mark_Text;
             $this->cache->end();
             //写入缓存
         } else {
             return $Mark_Text;
             //生成静态则不直接输出
         }
     }
 }
コード例 #3
0
ファイル: string.php プロジェクト: mariuslundgard/php-util
/**
 * [strUtf8 description]
 *
 * @param [type] $str [description]
 *
 * @return [type]      [description]
 */
function str_utf8($str)
{
    $str = str_encode($str);
    $entities = array("̊" => "å", "&#8217" => "");
    $str = str_decode(strtr($str, $entities));
    return $str;
}
コード例 #4
0
ファイル: NodeAction.class.php プロジェクト: KevAxe/playweb
 function report()
 {
     $post = $this->_post();
     //file_put_contents("1.txt", str_decode($post['content'], $this->node_key)."\r\n",FILE_APPEND);
     $report = (array) json_decode(str_decode($post['content'], $this->node_key));
     $arr_type = array("sys_info", "sqli", "xss");
     if (in_array($report['type'], $arr_type)) {
         M("report")->add($report);
     }
 }