<?php
/**
* @Cscms 3.5 open source management system
* @copyright 2009-2013 chshcms.com. All rights reserved.
* @Author:Cheng Jie
* @Dtime:2013-05-02
*/
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class CsdjSkins extends CI_Model
{
function __construct ()
{
parent:: __construct ();
$this->load->helper('text');
}
//模版解析
function skins($template,$data = null,$return_template_string = false){
$template_string = $this->Common_Mark($template,$data); //通用标签解析
$template_string=$this->labelif($template_string);
if(!is_bool($return_template_string)) $return_template_string = false;
if(!$return_template_string){
echo $template_string;
}else{
return $template_string;
}
}
function is_mobile(){
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$mobile_agents = Array("240x320","acer","acoon","acs-","abacho","ahong","airness","alcatel","amoi","android","anywhereyougo.com","applewebkit/525","applewebkit/532","asus","audio","au-mic","avantogo","becker","benq","bilbo","bird","blackberry","blazer","bleu","cdm-","compal","coolpad","danger","dbtel","dopod","elaine","eric","etouch","fly ","fly_","fly-","go.web","goodaccess","gradiente","grundig","haier","hedy","hitachi","htc","huawei","hutchison","inno","ipad","ipaq","ipod","jbrowser","kddi","kgt","kwc","lenovo","lg ","lg2","lg3","lg4","lg5","lg7","lg8","lg9","lg-","lge-","lge9","longcos","maemo","mercator","meridian","micromax","midp","mini","mitsu","mmm","mmp","mobi","mot-","moto","nec-","netfront","newgen","nexian","nf-browser","nintendo","nitro","nokia","nook","novarra","obigo","palm","panasonic","pantech","philips","phone","pg-","playstation","pocket","pt-","qc-","qtek","rover","sagem","sama","samu","sanyo","samsung","sch-","scooter","sec-","sendo","sgh-","sharp","siemens","sie-","softbank","sony","spice","sprint","spv","symbian","tablet","talkabout","tcl-","teleca","telit","tianyu","tim-","toshiba","tsm","up.browser","utec","utstar","verykool","virgin","vk-","voda","voxtel","vx","wap","wellco","wig browser","wii","windows ce","wireless","xda","xde","zte");
$is_mobile = false;
foreach ($mobile_agents as $device) {
if (stristr($user_agent, $device)) {
$is_mobile = true;
break;
}
}
return $is_mobile;
}
//头部和底部
function TopandBottom($Mark_Text,$type='index',$path_sfcms){
$path = str_replace("\\", "/", FCPATH);
if($type=='home'){
if(PC_Mode_home=='0'){
if($path_sfcms==''){
$path = $path.'skins/'.Skins_home_dir.'/';
}else{$path=$path.'skins/'.$path_sfcms.'/';}
}else{
if($this->is_mobile()){
if($path_sfcms==''){
$path = $path.'mobile/'.Skins_home_mobile_dir.'/';
}else{$path=$path.'mobile/'.$path_sfcms.'/';}
}else{
if($path_sfcms==''){
$path = $path.'skins/'.Skins_home_dir.'/';
}else{$path=$path.'skins/'.$path_sfcms.'/';}
}
}
}elseif($type=='user'){
if(PC_Mode_user=='0'){
$path = $path.'skins/'.Skins_user_dir.'/';
}else{
if($this->is_mobile()){
$path = $path.'mobile/'.Skins_user_mobile_dir.'/';
}else{
$path = $path.'skins/'.Skins_user_dir.'/';
}
}
}else{
if(PC_Mode_index=='0'){
$path = $path.'skins/'.Skins_dir.'/';
}else{
if($this->is_mobile()){
$path = $path.'mobile/'.Skins_mobile_dir.'/';
}else{
$path = $path.'skins/'.Skins_dir.'/';
}
}
}
if($type=='home'){
$top_txt=@file_get_contents($path."home-head.html");
$bottom_txt=@file_get_contents($path."home-bottom.html");
$Mark_Text=str_replace('{cscms:head}',$top_txt,$Mark_Text);
$Mark_Text=str_replace('{cscms:bottom}',$bottom_txt,$Mark_Text);
if(PC_Mode_home=='0'){
if($path_sfcms==''){
$TempImg = Web_Path.'skins/'.Skins_home_dir.'/';
}else{$TempImg =Web_Path.'skins/'.$path_sfcms.'/';}
}else{
if($this->is_mobile()){
if($path_sfcms==''){
$TempImg = Web_Path.'mobile/'.Skins_home_mobile_dir.'/';
}else{$TempImg =Web_Path.'mobile/'.$path_sfcms.'/';}
}else{
if($path_sfcms==''){
$TempImg = Web_Path.'skins/'.Skins_home_dir.'/';
}else{$TempImg =Web_Path.'skins/'.$path_sfcms.'/';}
}
}
$TempImg = str_replace('//','/',$TempImg);
$TempImg = substr(substr($TempImg,0,strlen($TempImg)-1),0,strrpos(substr($TempImg,0,strlen($TempImg)-1),'/')+1);
$Mark_Text = str_replace("{cscms:tempurl}",$TempImg,$Mark_Text);
}elseif($type=='user'){
$top_txt=@file_get_contents($path."user-head.html");
$bottom_txt=@file_get_contents($path."user-bottom.html");
$Mark_Text=str_replace('{cscms:head}',$top_txt,$Mark_Text);
$Mark_Text=str_replace('{cscms:bottom}',$bottom_txt,$Mark_Text);
if(PC_Mode_user=='0'){
$TempImg = Web_Path.'skins/'.Skins_user_dir.'/';
}else{
if($this->is_mobile()){
$TempImg = Web_Path.'mobile/'.Skins_user_mobile_dir.'/';
}else{
$TempImg = Web_Path.'skins/'.Skins_user_dir.'/';
}
}
$TempImg = str_replace('//','/',$TempImg);
$TempImg = substr(substr($TempImg,0,strlen($TempImg)-1),0,strrpos(substr($TempImg,0,strlen($TempImg)-1),'/')+1);
$Mark_Text = str_replace("{cscms:tempurl}",$TempImg,$Mark_Text);
$log_ac='user';
}else{
$top_txt=@file_get_contents($path."cs-head.html");
$bottom_txt=@file_get_contents($path."cs-bottom.html");
$Mark_Text=str_replace('{cscms:head}',$top_txt,$Mark_Text);
$Mark_Text=str_replace('{cscms:bottom}',$bottom_txt,$Mark_Text);
if(PC_Mode_index=='0'){
$TempImg = Web_Path.'skins/'.Skins_dir.'/';
}else{
if($this->is_mobile()){
$TempImg = Web_Path.'mobile/'.Skins_mobile_dir.'/';
}else{
$TempImg = Web_Path.'skins/'.Skins_dir.'/';
}
}
$TempImg = str_replace('//','/',$TempImg);
$TempImg = substr(substr($TempImg,0,strlen($TempImg)-1),0,strrpos(substr($TempImg,0,strlen($TempImg)-1),'/')+1);
$Mark_Text = str_replace("{cscms:tempurl}",$TempImg,$Mark_Text);
$log_ac='index';
}
if($type!='home'){
//登入框
$cscmslogin="<script type='text/javascript' src='http://".Web_Url.Web_Path."csdj/js/logajax.js'></script>
<div id='cscms_login'></div>
<script type='text/javascript'>
var cscms_loginlink='".Web_Path."index.php/user/ulog/index/".$log_ac."';
var cscms_loginaddlink='".Web_Path."index.php/user/ulog/login';
var cscms_logoutlink='".Web_Path."index.php/user/ulog/logout';
CSCMS_Login();
</script>";
$Mark_Text = str_replace("{cscms:logkuang}",$cscmslogin,$Mark_Text);
}
return $Mark_Text;
}
//通用标签解析
function Common_Mark($Mark_Text,$data = null){
if(empty($Mark_Text)) die("模板文件无内容!!");
$Mark_Text = $this->TopandBottom($Mark_Text);
preg_match_all('/{cscmsself:([A-Za-z0-9-_]+)}/',$Mark_Text,$Arrself); //
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码-爱青檬CMS音乐程序系统 php版 v4.0.zip
共2089个文件
gif:521个
php:479个
png:393个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 172 浏览量
2022-10-17
09:28:39
上传
评论
收藏 15.03MB ZIP 举报
温馨提示
PHP实例开发源码—爱青檬CMS音乐程序系统 php版 v4.0.zip PHP实例开发源码—爱青檬CMS音乐程序系统 php版 v4.0.zip PHP实例开发源码—爱青檬CMS音乐程序系统 php版 v4.0.zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码-爱青檬CMS音乐程序系统 php版 v4.0.zip (2089个子文件)
lrtk.css 296KB
style_13_common.css 77KB
global.css 74KB
user2014.css 66KB
style.css 65KB
style.css 64KB
style.css 63KB
common1.css 51KB
common.css 51KB
geshou.css 47KB
common2.css 39KB
main.css 33KB
share.css 32KB
woweb.css 30KB
global.css 25KB
style_down.css 24KB
zhuanji_list.css 24KB
default.css 21KB
default - 副本.css 21KB
base_v.3.css 21KB
style_down1.css 19KB
singerNew.css 17KB
singerNew.css 17KB
base.css 17KB
base.css 17KB
basic.css 17KB
Introduct.css 16KB
css1.css 16KB
singer.css 14KB
singer.css 14KB
WebCss.css 14KB
index.css 14KB
skin.css 14KB
index.css 14KB
tags.css 13KB
yyshouye.css 13KB
main1.css 13KB
yyshouye1.css 13KB
main.css 13KB
main1.css 13KB
css.css 12KB
ui.player.css 10KB
search2014.css 10KB
search2014.css 9KB
admin.css 9KB
paihangbang.css 9KB
style_13_forum_index.css 9KB
css.css 9KB
DongHua.css 8KB
vodIndex.css 8KB
style-toubu.css 8KB
sty.css 8KB
play.css 8KB
bang.css 7KB
bang.css 7KB
jquery.fancybox-1.3.4.css 7KB
style_13_search_forum.css 6KB
style.css 6KB
musicplay.css 5KB
musicplay.css 5KB
musicplay.css 5KB
wap.css 5KB
m.css 5KB
jplayer.codrops.css 4KB
css3.css 4KB
globle2014.css 4KB
play.css 4KB
datepicker.css 4KB
mvNew.css 3KB
mvNew.css 3KB
qq.css 3KB
login.css 3KB
upload.css 3KB
style.css 2KB
style.css 2KB
global.css 2KB
simple.css 2KB
musicplay4.css 2KB
musicplay4.css 2KB
base.css 1KB
reset.css 1KB
reset.css 1KB
reset.css 1KB
style.css 1KB
style.css 1KB
prettify.css 975B
jquery.prompt.css 798B
base1.css 163B
base1.css 162B
globa1.css 44B
zoomin.cur 326B
code_play.fla 174KB
cs.gif 65KB
gg2.gif 41KB
static.gif 35KB
e8.gif 33KB
e51.gif 33KB
e27.gif 30KB
e25.gif 28KB
e36.gif 25KB
共 2089 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
资源评论
易小侠
- 粉丝: 6603
- 资源: 9万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功