教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 资格考试 >

V9使用技巧合集(4)

来源:网络收集 时间:2026-08-27
导读: day}','{$catid}','{$id}','{$page}','{$pinyin}'),array($categorydir,$catdir,$year,$month,$day,$catid,$id,$page,$pinyin),$urlrule); 42. $create_to_html_root = $category['create_to_html_root']; 43. if(p

day}','{$catid}','{$id}','{$page}','{$pinyin}'),array($categorydir,$catdir,$year,$month,$day,$catid,$id,$page,$pinyin),$urlrule); 42. $create_to_html_root = $category['create_to_html_root'];

43. if(preg_match(\44. if($category['parentid'] && $_match[0]) { 45. foreach ($this->categorys as $_key=>$_value) {

46. if($_value['create_to_html_root'] && $_value['url']==$_match[0].'/')

$create_to_html_root = 1; 47. } 48. } 49. } 50.

51. if($create_to_html_root) { 52. $html_root = ''; 53. } else {

54. $html_root = $this->html_root; 55. } 56.

57. if($content_ishtml && $url) {

58. if (strpos($urls, $domain_dir)!==false) { 59. $url_arr[1] = $html_root.'/'.$urls;

60. $url_arr[0] = str_replace($domain_dir, $url, $urls); 61. } else {

62. $url_arr[1] = $html_root.'/'.$domain_dir.$urls; 63. $url_arr[0] = WEB_PATH == '/' ? $url.$urls :

substr(WEB_PATH,0,-1).$url.$urls; 64. }

65. } elseif($content_ishtml) {

66. $url_arr[0] = WEB_PATH == '/' ? $html_root.'/'.$urls :

substr(WEB_PATH,0,-1).$html_root.'/'.$urls; 67. $url_arr[1] = $html_root.'/'.$urls; 68. } else {

69. $url_arr[0] = $url_arr[1] = APP_PATH.$urls; 70. }

71. //生成静态 ,在添加文章的时候,同时生成静态,不在批量更新URL处调用 72. if($content_ishtml && $data) {

73. $html = pc_base::load_app_class('html', 'content'); 74. $data['id'] = $id;

75. $html->show($url_arr[1],$data); 76. //在添加和修改内容处定义了 INDEX_HTML

77. if(defined('INDEX_HTML')) $html->index();

78. if(defined('RELATION_HTML')) $html->create_relation_html($catid); 79. } 80.

81. return $url_arr; 82. } 复制代码

注意是整个函数替换掉.这个函数是昨天的最新版本.不想替换的可以自己对比和原来函数,只是增加了一段代码.

然后就可以在url规则里使用 {$pinyin} 这个url标志了.注意是内容规则(show),不适用栏目url

16、shtml设置如何设置 解决:

1.

2. 修改url规则的.html变成.shtml

3. 如果你是为静态的就要修改 .htaccess 文件 4. RewriteRule ^index.shtml index.php

5. RewriteRule ^content-([0-9]+)-([0-9]+)-([0-9]+).shtml

index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3

6.

7. RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+).shtml

index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 8. RewriteRule ^pic-([0-9]+)-([0-9]+)-([0-9]+).shtml

index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 9.

10. RewriteRule ^down-([0-9]+)-([0-9]+)-([0-9]+).shtml

index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 11.

12. RewriteRule ^list-([0-9]+)-([0-9]+).shtml

index.php?m=content&c=index&a=lists&catid=$1&page=$2

复制代码

17、内容页的标签调用 解决:

1. 2.

3. 直接用字段变量解决 4. 如 : 5. 字段 test

6. 模板中用{$test}即可

复制代码

18、文章评论页调用会员头像 解决:

1. 2. /**

3. * 获取用户头像,建议传入phpssouid

4. * @param $uid 默认为phpssouid

5. * @param $is_userid $uid是否为v9 userid,如果为真,执行sql查询此用户的phpssouid 6. * @param $size 头像大小 有四种[30x30 45x45 90x90 180x180] 默认30 7. */

8. function get_memberavatar($uid, $is_userid='', $size='30'); 复制代码

…… 此处隐藏:453字,全部文档内容请下载后查看。喜欢就下载吧 ……
V9使用技巧合集(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/413699.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)