12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- //判断tid
- /*
- * T:职称论文模板_(抓取文章标题)
- K:抓取文章标题,职称论文
- D:抓取文章摘要的前70个字符
- */
- function strip_tags_and_substr($string, $length = 70) {
- // 去除HTML标签
- $withoutTags = strip_tags($string);
- // 截取指定长度的字符串
- $result = mb_substr($withoutTags, 0, $length);
- return $result;
- }
-
- //默认值
- $seo_title = $eyou['field']['seo_title'];
- $key_keywords = $eyou['field']['seo_keywords'];
- $desc_ription = $eyou['field']['seo_description'];
-
- //var_dump($eyou['field']['typeid']);
- //var_dump($eyou["field"]["seo_title"]);
- //var_dump($eyou["field"]["aid"]);
- ?>
-
- {eyou:if condition='((int)$eyou.field.typeid === 127 && empty($eyou["field"]["seo_title"]))'}
- <?php
- //如果是职称论文参考
- $seo_title = '职称论文模板_'.$eyou['field']['title'];
- $key_keywords = $eyou['field']['title'].",职称论文";
- $content_sql = $eyou['field']['content_5'];
- //处理字符串
- $processedString = strip_tags_and_substr($content_sql, 70);
- $desc_ription = $processedString;
- ?>
- {eyou:else /}
- {eyou:if condition='(empty($eyou["field"]["seo_title"]))'}
- <?php
- //如果是其他栏目文章 且 默认seo为空
- //评审攻略 //职称答辩 //职称补贴 //职称评审常见问题 //职称评审政策资讯
- $seo_title = $eyou['field']['title'];
- $key_keywords = $eyou['field']['title'];
- $content_sql = $eyou['field']['content_5'];
- //处理字符串
- $processedString = strip_tags_and_substr($content_sql, 70);
- $desc_ription = $processedString;
- ?>
- {/eyou:if}
- {/eyou:if}
|