ecshop自动内链插件seo优化插件
2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家
ecshop自动内链插件seo优化插件安装教程: 1.打开admin\includes里面的inc_menu.php文件: 添加: $modules['11_system']['auto_neilian'] = 'auto_neilian.php?act=list_edit'; // ecshop自动内链插件 如图: 2.languages\zh_cn\admin\common.php 增加语言项 /* 系统设置 */ $_LANG['01_shop_config'] = '商店设置'; $_LANG['auto_neilian'] = '自动添加内链设置'; 3 修改跟目录article.php 搜索: ./* 获得文章的信息 * 找到:$row['author'] = $GLOBALS['_CFG']['shop_name']; 在: { $row['author'] = $GLOBALS['_CFG']['shop_name']; } 下方增加: //seo内链插件 start function str_replace_once($needle, $replace, $haystack) { //函数作用,只替换一次字符 //$needle --- 需要替换的字符 //$replace --- 替换成什么字符 //$haystack --- 需要操作的字符串 $pos = strpos($haystack, $needle); if ($pos === false) { return $haystack; } return substr_replace($haystack, $replace, $pos, strlen($needle)); } $content = file_get_contents("data/auto_neilian.php"); $array = explode("\r\n",$content); foreach ($array AS $value){ $tmp = explode("---",$value); if ($tmp !== false){ if($tmp[1]){ $str = "".$tmp[0].""; } else{ $str = "".$tmp[0].""; } $str_1 = $tmp[0]; $str_2 = $str; $tmp1 = explode("<",$row['content']); foreach ($tmp1 as $key=>$item){ $tmp2 = explode(">",$item); if (sizeof($tmp2)>1) { if(substr($tmp2[0],0,1)!="a" && substr($tmp2[0],0,1)!="A"){ if(strpos($tmp2[1],$str_1)!==false){ $tmp2[1] = str_replace_once($str_1,$str_2,$tmp2[1]); $tmp1[$key] = implode(">",$tmp2); break; } } } } $row['content'] = implode("<",$tmp1); } } //seo内链插件 end 4. 修改跟目录goods.php /* 如果没有找到任何记录则跳回到首页 */ ecs_header("Location: ./\n"); exit; } else { 下方增加: //seo内链插件 start //$content = iconv("GB2312","UTF-8",file_get_contents("data/auto_neilian.php")); function str_replace_once($needle, $replace, $haystack) { //函数作用,只替换一次字符 //$needle --- 需要替换的字符 //$replace --- 替换成什么字符 //$haystack --- 需要操作的字符串 $pos = strpos($haystack, $needle); if ($pos === false) { return $haystack; } return substr_replace($haystack, $replace, $pos, strlen($needle)); } $content = file_get_contents("data/auto_neilian.php"); $array = explode("\r\n",$content); foreach ($array AS $value){ $tmp = explode("---",$value); if ($tmp !== false){ if($tmp[1]){ $str = "".$tmp[0].""; } else{ $str = "".$tmp[0].""; } $str_1 = $tmp[0]; $str_2 = $str; $tmp1 = explode("<",$goods['goods_desc']); foreach ($tmp1 as $key=>$item){ $tmp2 = explode(">",$item); if (sizeof($tmp2)>1) { if(substr($tmp2[0],0,1)!="a" && substr($tmp2[0],0,1)!="A"){ if(strpos($tmp2[1],$str_1)!==false){ $tmp2[1] = str_replace_once($str_1,$str_2,$tmp2[1]); $tmp1[$key] = implode(">",$tmp2); break; } } } } $goods['goods_desc'] = implode("<",$tmp1); } } //seo内链插件 end 5. 剩下全部覆盖就可以了 !
最近更新
常用插件
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...