联系我们

  • 联系电话:13637710550
  • QQ 咨询QQ 467225336

当前位置: 首页 > ECshop经验共享 > ecshop内页关键词的实现

ecshop内页关键词的实现
复制代码
  1.  /**      
  2.      * @authorHPCQ.COM PHP博客|PHP技术站      
  3.      */      
  4.  ecshop内页关键词的实现如:search.php?intro=best,flow.php,message.php的改进      
  5.  打开includes/lib_main.php    
  6.  找到函数:function assign_ur_here($cat = 0, $str = '')    
  7.  elseif ('exchange' == $filename)    
  8.              {    
  9.                  $page_title = $GLOBALS['_LANG']['exchange'] . '_' . $page_title;    
  10.                  $args       = array('wsid' => '0');    
  11.                  $ur_here   .= ' <code>></code> <a href="exchange.php">' .    
  12.                                  $GLOBALS['_LANG']['exchange'] . '</a>';    
  13.              }    
  14.        /* 其他的在这里补充 */   
  15.        /*下面就是我自己补充的*/   
  16.        elseif ('search' == $filename)//获取当前页的地址参数...如:search.php?intro=best  得到search    
  17.              {    
  18.              $action = unserialize(base64_decode(trim($_GET['encode'])));//对search.php产生的随机编码URL进行固定解码...    
  19.              $action = $action['intro'];    
  20.                  if($action == 'best[L]'){//热卖类内页 如:search.php?intro=best  得到best    
  21.                      $keywords = " ";//这里就是您的关键词    
  22.                      $description = " ";//这里是您的描述         
  23.                  }             
  24.              }         
  25.          elseif ('flow' == $filename)//获取当前页的地址参数...如:flow.php 得到flow    
  26.              {    
  27.                      $keywords = "flow";//这里就是您的关键词    
  28.                      $description = "flow";//这里是您的描述               
  29.              }    
  30.          elseif ('message' == $filename)//获取当前页的地址参数...如:message.php 得到message    
  31.              {    
  32.                      $keywords = "message";//这里就是您的关键词    
  33.                      $description = "message";//这里是您的描述               
  34.              }             
  35.                  
  36.      /* 返回值    注意这句代码也要加以修改*/   
  37.      return array('title' => $page_title'ur_here' => $ur_here,    
  38.      'keywords'=> $keywords,'description' => $description);    
  39.           
  40.           
  41. 基本上的功能已经实现,你可以在需要参数的代码中增加:    
  42. $smarty->assign('keywords',$position['keywords']);      //页面关键词    
  43. $smarty->assign('description',$position['description']);  // 页面描述