织梦 convertstringtobstr 函数式什么意思

当前位置: >
dedecms 织梦配置 手机 wap 站点,并绑定二级域名
主站& 手机站
1.安装手机wap浏览 模块
2.根目录创建 wap文件夹 ,将 templets\wap 文件移入 根目录下的 wap, 如图:
3.将根目录下的 wap.php 移入 wap文件夹,如图:
4.修改wap.php
& a.&& 第一行require_once (dirname(__FILE__) . &/include/common.inc.php&); 修改成require_once (dirname(__FILE__) . &/../include/common.inc.php&);
& b.& 第四行require_once(dirname(__FILE__).&/include/wap.inc.php&);修改成require_once(dirname(__FILE__).&/../include/wap.inc.php&);
&c.& 第六行 $cfg_templets_dir = $cfg_basedir.$cfg_templets_修改成 $cfg_templets_dir = $cfg_basedir.&/wap/&.$cfg_templets_
&d.& 找 到require_once(dirname(__FILE__).&/include/datalistcp.class.php&); 修改成require_once(dirname(__FILE__).&/../include/datalistcp.class.php&);
5.文章带有图片处理,找到include/wap.inc.php
& 第54行 $content = str_replace(&WAP-IMG::{$k}&, $attstr, $content); 修改成 $content = str_replace(&WAP-IMG::{$k}&, &&, $content);
如果希望让图片显示,您可以修改这个图片路径
&a . 下的 wap 文件夹 做重定向
&b.&创建新站点
绑定文件夹 wap
7. 手机访问& 直接跳转
&& 模板index.htm 添加js
& &script src=&/tz.php& type=&text/javascript&&&/script&
&tz.php& 代码:
if(isset($_SERVER['HTTP_USER_AGENT']))
$clientkeywords = array('nokia','sony','ericsson','mot','samsung','htc','sgh','lg','sharp','sie-','philips','panasonic','alcatel','lenovo','iphone','ipod','blackberry','meizu','android','netfront',
'symbian','ucweb','windowsce','palm','operamini','operamobi','openwave','nexusone','cldc','midp','wap','mobile');
// 从HTTP_USER_AGENT中查找手机浏览器的关键字
if (preg_match(&/(&.implode('|',$clientkeywords).&)/i&,strtolower($_SERVER['HTTP_USER_AGENT']))){
if(isset($_SERVER['HTTP_USER_AGENT']))
$clientkeywords = array('nokia','sony','ericsson','mot','samsung','htc','sgh','lg','sharp','sie-','philips','panasonic','alcatel','lenovo','iphone','ipod','blackberry','meizu','android','netfront',
'symbian','ucweb','windowsce','palm','operamini','operamobi','openwave','nexusone','cldc','midp','wap','mobile');
// 从HTTP_USER_AGENT中查找手机浏览器的关键字
if (preg_match(&/(&.implode('|',$clientkeywords).&)/i&,strtolower($_SERVER['HTTP_USER_AGENT']))){
window.location.href='';
8.wap站添加 搜索
修改 wap.php
else if($action=='search')
$needCode = 'UTF-8';
if(empty($keyword)) exit('Error!');
require_once(dirname(__FILE__).&/../include/datalistcp.class.php&);
$varlist = &cfg_webname,cfg_templeturl&;
ConvertCharset($varlist);
$dlist = new DataListCP();
$dlist-&SetTemplet($cfg_templets_dir.&/wap/search.wml&);
$dlist-&pageSize = 10;
$dlist-&SetParameter(&action&,&search&);
$dlist-&SetParameter(&keyword&,$keyword);
$dlist-&SetSource(&Select id,title,pubdate,click From `idea_archives` where title like '%&. iconv(&UTF-8&, &GB2312&,$keyword).&%' And arcrank=0 order by id desc&);
$dlist-&Display();
(责任编辑:free100.org)
请在这里输入您的评论
版权所有:飞龙工作室
京ICP备号-4当前位置: >
发布时间: 10:45 类别:
在中字符串内容截取函数比较常用的有两个。 源码分享网
Html2text() 函数是去掉html标签代码。
cn_substr(str,80) 函数是截取字符串长度。
当然,他们也可以合并起来使用: 励志
[field:title function=&cn_substr(@me,30)&/] & & &
[field:body function=&cn_substr(Html2text(@me),80)&/] 织梦文章内容截取去掉文本标签 520分享
更多函数总结:
& 内容来自
基本语法: 520分享
函数一:function=cn_substr(@me,200)(功能:获取指定数值的字符串) 源码分享网
函数二:function=html2text(@me)(功能:去掉html样式,转换为纯文本字符) 源码分享网
函数三:function=GetDateTimeMk(&@me&)(功能:根据秒数返回时间) 励志
函数四: function=&GetDateMK(@me) (功能:根据秒数返回日期) 520分享
函数五: function=&strftime(&%m-%d&,@me)&(功能:根据秒数返回格式化的日期或者时间,php自带的函数) 520分享
时间日期截取 源码分享网
首页: 源码分享网
&08 & & & & & & & & & & & & & & & & &[field:pubdate function=strftime('%d',@me)/] 励志
&08 日 & & & & & & & & & & & & & & [field:pubdate function=strftime('%d日',@me)/]
&06-08 & & & & & & & & & & & & & &[field:pubdate function=strftime('%m-%d',@me)/]
&06月08日 & & & & & & & & & & [field:pubdate function=strftime('%m月%d日',@me)/] 内容来自
&09-06-08 & & & & & & & & & & &[field:pubdate function=strftime('%y-%m-%d',@me)/] 520分享
& & & & & & & & & [field:pubdate function=strftime('%Y-%m-%d',@me)/]
&09年06月08日 & & & & & &[field:pubdate function=strftime('%y年%m月%d日',@me)/] 源码分享网
&日 & & & [field:pubdate function=strftime('%Y年%m月%d日',@me)/]
& &13:28 & &[field:pubdate function=strftime('%Y-%m-%d %H:%M',@me)/]
&[field:pubdate function=&GetDateTimeMK(@me)&/]== 18:30:02 源码分享网
&[field:pubdate function=&GetDateMK(@me)&/]== 内容来自
&函数六: function=&str_replace(&lit_&,&&,@me) (功能:替换字符串) 内容来自
&函数七: function=MyDate(&m-d&,@me) (功能:返回格林威治标准时间) 源码分享网
&组合函数:function=&html2text(cn_substr('@me',200))&(功能:提取指定个数的字符串并去掉html样式,转换为纯文本字符) 励志
举例: 520分享
&{:field.content function=&Html2Text(cn_substr('@me',110))& /} 520分享
功能:获取栏目信息摘要信息(提取110个字符[55个汉字]),删除hml标签元素,转为纯文本! 励志
(责任编辑:520share)
下一篇:没有了 上一篇:
猜你会喜欢....

我要回帖

更多关于 db2 convert函数 的文章

 

随机推荐