演示截图:
评分插件.zip (13.34 KB)
10、标题后面的“?”如何删除? 解决:
1.
2. {str_cut($v['title'],28)}修改为{str_cut($v['title'],28,\
复制代码
11、摘要空格变字符的问题 解决:
1.
2. {str_cut(strip_tags($v['content']), 38)}这样写就不会有 了
复制代码
12、v9_sso_session数据表自动删除 解决:
v9后台的phpsso管理出问题了,不能登录了
MySQL Query :
MySQL Error : Table 'jinhua_liuying.v9_sso_session' doesn't exist MySQL Errno : 1146
Message : Table 'jinhua_liuying.v9_sso_session' doesn't exist
把以前备份过的sql数据打开,凡是前缀为v9_sso_的数据全部拷贝到当前数据 即可解决此问题
13、v9采集规则一例 解决:
采集自新浪国内新闻.经过测试,可以正常采集.特分享一下.需要了解规则的也可以导入后查看
pc_collection_1.zip (1.13 KB)
2010年11月12日20:51:24最新更新: 分页采集方法:
pc_collection_2.zip (894 Bytes)
可以正常采集分页,测试通过.
有些同志不能采集的,建议分析下这个规则里的 过滤选项 .
过滤选项不要限制过死,过小.不建议直接过滤任何标签,否则如果目标站嵌套了你就啥也采集不到了. 比如:
]*)>[|] [|]
这是标准的过滤a标签的,系统自带的过滤a标签: ]*)>(.*)[|] 会把a中间的内容也过滤掉.这是不好的.
内容匹配规则,不可指定常用标签比如div,p等.而应该宽泛点,如: 标签结束,是不对的.限制太大 14、如何调用出会员自定义模型的字段 解决:
如果只输出值
1.
2. {pc:get sql=\
dbsource=\3. 4. 5.
6. {loop $data $key $val} 7.
8. {$val[username]}
9.
10. {/loop} 11. 12. 13.
14. {$pages} 15. 16. {/pc}
复制代码
如果要输出联动菜单、box、日期字段、等特殊字段,需要做一下处理。
1.直接输出参见:phpcms/modules/member/index.php中的account_manage方法 2.带编辑框输出参见:phpcms/modules/member/index.php中的 account_manage_info方法
15、实现v9内容页url规则增加汉字拼音功能 解决:
效果如下:
当你的内容标题为 绿色软件 时,链接地址里将带上 lvseruanjian .
实现过程:
修改 modules/content/classes/url.class.php 文件的 public function show() 函数为如下代码:
1. public function show($id, $page = 0, $catid = 0, $time = 0, $prefix = '',$data
= '',$action = 'edit') { 2. $page = max($page,1); 3. $urls = $catdir = '';
4. $category = $this->categorys[$catid];
5. $setting = string2array($category['setting']); 6. $content_ishtml = $setting['content_ishtml']; 7. $show_ruleid = $setting['show_ruleid']; 8. $urlrules = $this->urlrules[$show_ruleid]; 9. if(!$time) $time = SYS_TIME;
10. $urlrules_arr = explode('|',$urlrules); 11. if($page==1) {
12. $urlrule = $urlrules_arr[0]; 13. } else {
14. $urlrule = $urlrules_arr[1]; 15. }
16. if (strpos($category['url'], '://')!==false && strpos($category['url'],
'?')===false) {
17. if (preg_match('/^((http|https):\\/\\/)?([^\\/]+)/i', $category['url'],
$matches)) {
18. $url = $matches[0].'/'; 19. }
20. $db = pc_base::load_model('category_model'); 21. $r = $db->get_one(array('url'=>$url), '`catid`'); 22. $domain_dir =
$this->get_categorydir($r['catid']).$this->categorys[$r['catid']]['catdir'].'/'; 23. }
24. $categorydir = $this->get_categorydir($catid); 25. $catdir = $category['catdir']; 26. $year = date('Y',$time); 27. $month = date('m',$time); 28. $day = date('d',$time);
29. //add 2010年10月29日23:49:06 化蝶自在飞 标题转化为拼音 感谢
http://www.k686.com站长支持. 30. pc_base::load_sys_func('iconv'); 31. $modelid = $category['modelid']; 32. if(!$modelid) return '';
33. $db = pc_base::load_model('content_model'); 34. $db->set_model($modelid);
35. $r = $db->get_one(array('id'=>$id), '`title`'); 36. $pinyin = gbk_to_pinyin($r['title']); 37. if(is_array($pinyin)) {
38. $pinyin = implode('', $pinyin); 39. } 40. //end 41. $urls =
str_replace(array('{$categorydir}','{$catdir}','{$year}','{$month}','{$