ecshop内页关键词改进

 /**  
    * @author:PHPCQ.COM PHP博客|PHP技术站  
    */ 
ecshop内页关键词的实现如:search.php?intro=best,flow.php,message.php的改进 
打开includes/lib_main.php
找到函数:function assign_ur_here($cat = 0, $str = '')
 elseif ('exchange' == $filename)
            {
                $page_title = $GLOBALS['_LANG']['exchange'] . '_' . $page_title;
                $args       = array('wsid' => '0');
                $ur_here   .= ' <code>&gt;</code> <a href="exchange.php">' .
                                $GLOBALS['_LANG']['exchange'] . '</a>';
            }
      /* 其他的在这里补充 */
      /*下面就是我自己补充的*/
      elseif ('search' == $filename)//获取当前页的地址参数...如:search.php?intro=best  得到search
            {
            $action = unserialize(base64_decode(trim($_GET['encode'])));//对search.php产生的随机编码URL进行固定解码...
            $action = $action['intro'];
                if($action == 'best[L]'){//热卖类内页 如:search.php?intro=best  得到best
                    $keywords = " ";//这里就是您的关键词
                    $description = " ";//这里是您的描述    
                }        
            }    
        elseif ('flow' == $filename)//获取当前页的地址参数...如:flow.php 得到flow
            {
                    $keywords = "flow";//这里就是您的关键词
                    $description = "flow";//这里是您的描述          
            }
        elseif ('message' == $filename)//获取当前页的地址参数...如:message.php 得到message
            {
                    $keywords = "message";//这里就是您的关键词
                    $description = "message";//这里是您的描述          
            }        
            
    /* 返回值    注意这句代码也要加以修改*/
    return array('title' => $page_title, 'ur_here' => $ur_here,
    'keywords'=> $keywords,'description' => $description);
    
    
    基本上的功能已经实现,你可以在需要参数的代码中增加:
    $smarty->assign('keywords', $position['keywords']);      //页面关键词
    $smarty->assign('description',$position['description']);  // 页面描述        

上一篇文章: ecshop比较强大 下一篇文章: 有时间的话一定做SEO

关于PHP博客

PHP blogger

博客-致力于分享PHP技术的开发心得, 记录站长生活的点点滴滴,PHP博客采用PHP 面向对象编程+Smarty模板引擎+Mysql数据库 开发(全站纯静态化与伪静态化)
QQ:334192009
电邮:admin@PHPdesigner.org

本站搜索

本站最新文章

博客最近档案

友情链接