php中的方法,从网上下载了一个网站程序,这个步骤没看懂是干嘛的,求指教
程序员文章站
2024-01-07 16:43:16
...
php中的方法,从网上下载了一个网站程序,这个方法没看懂是干嘛的,求指教
function seo($ident)
{
include APP_PATH."/plus/seo.cache.php";
$seo=$seo[$ident];
if(is_array($seo)){
foreach($seo as $k=>$v){
if($v[affiliation]!=""){
[email protected](",",$v['affiliation']);
if($_SESSION[did]!="" && in_array($_SESSION['did'],$did)){
$seo=$v;
}elseif(in_array("0",$did)){
$seo=$v;
}
}else{
$seo=$v;
}
}
}
$data=$this->data;
if(is_array($seo))
{
$cityname = $_SESSION['cityname']?$_SESSION['cityname']:$this->config["sy_indexcity"];
foreach($seo as $key=>$value)
{
$seo[$key] = str_replace("{webname}",$this->config['sy_webname'],$seo[$key]);
$seo[$key] = str_replace("{webkeyword}",$this->config['sy_webkeyword'],$seo[$key]);
$seo[$key] = str_replace("{webdesc}",$this->config['sy_webmeta'],$seo[$key]);
$seo[$key] = str_replace("{weburl}",$this->config['sy_weburl'],$seo[$key]);
$seo[$key] = str_replace("{city}",$cityname,$seo[$key]);
if(is_array($data)){
foreach($data as $k=>$v){
$seo[$key] = str_replace("{".$k."}",$v,$seo[$key]);
}
}
if([email protected]('{seacrh_class}',$seo[$key])){
$rdata=$this->get_search_class($ident,$key);
$seo[$key] = str_replace("{seacrh_class}",$rdata,$seo[$key]);
}
$seo[$key]=str_replace(' ',' ',$seo[$key]);
$seo[$key]=str_replace(array("- -","- -"),'-',$seo[$key]);
$seo[$key]=str_replace(array("- -","- -"),'-',$seo[$key]);
}
}
$this->yunset("title",$seo['title']);
$this->yunset("keywords",$seo['keywords']);
$this->yunset("description",$seo['description']);
}
function yunset($name,$value){
$this->tpl->assign($name,$value);
}
------解决方案--------------------
优化地址栏链接
------解决方案--------------------
你说下哪句不懂,可以给你解释。
function seo($ident)
{
include APP_PATH."/plus/seo.cache.php";
$seo=$seo[$ident];
if(is_array($seo)){
foreach($seo as $k=>$v){
if($v[affiliation]!=""){
[email protected](",",$v['affiliation']);
if($_SESSION[did]!="" && in_array($_SESSION['did'],$did)){
$seo=$v;
}elseif(in_array("0",$did)){
$seo=$v;
}
}else{
$seo=$v;
}
}
}
$data=$this->data;
if(is_array($seo))
{
$cityname = $_SESSION['cityname']?$_SESSION['cityname']:$this->config["sy_indexcity"];
foreach($seo as $key=>$value)
{
$seo[$key] = str_replace("{webname}",$this->config['sy_webname'],$seo[$key]);
$seo[$key] = str_replace("{webkeyword}",$this->config['sy_webkeyword'],$seo[$key]);
$seo[$key] = str_replace("{webdesc}",$this->config['sy_webmeta'],$seo[$key]);
$seo[$key] = str_replace("{weburl}",$this->config['sy_weburl'],$seo[$key]);
$seo[$key] = str_replace("{city}",$cityname,$seo[$key]);
if(is_array($data)){
foreach($data as $k=>$v){
$seo[$key] = str_replace("{".$k."}",$v,$seo[$key]);
}
}
if([email protected]('{seacrh_class}',$seo[$key])){
$rdata=$this->get_search_class($ident,$key);
$seo[$key] = str_replace("{seacrh_class}",$rdata,$seo[$key]);
}
$seo[$key]=str_replace(' ',' ',$seo[$key]);
$seo[$key]=str_replace(array("- -","- -"),'-',$seo[$key]);
$seo[$key]=str_replace(array("- -","- -"),'-',$seo[$key]);
}
}
$this->yunset("title",$seo['title']);
$this->yunset("keywords",$seo['keywords']);
$this->yunset("description",$seo['description']);
}
function yunset($name,$value){
$this->tpl->assign($name,$value);
}
------解决方案--------------------
优化地址栏链接
------解决方案--------------------
你说下哪句不懂,可以给你解释。
相关文章
相关视频