为什么80%的码农都做不了架构师?>>>
if($page != 0){//首先判断是否为节点单页而非文章列表页;$keys = $info= NULL;$info = substr(filter_xss($node->content['body']['#value'], array()), 0, 240);$info = preg_replace('([\r\n])', '', $info);//过滤节点内容部分的特殊字符并截取前 240 个字符做为摘要部分;foreach($node->taxonomy as $term){ $keys .= $term->name.','; }//遍历节点的术语标签并存入数组备用;drupal_set_html_head('<meta content="'.$keys.''.variable_get('site_name', 'drupal').'" name="keywords" />');drupal_set_html_head('<meta content="'.$info.'" name="description" />');//利用 Drupal 函数将 html 代码加入页面 head 标签;}