作者:monface
发布时间:May 27, 2009
分类:帝国ecms
帝国cms在12月8号发布5.1正式版了,而且开源了,这对所有帝国cms用户甚至国内所有开源项目爱好者都是一个值得期待的开始。此前做英文站都是用wp,drupal,虽然很不错,但是模板真的很难搞,很浪费时间,其他程序也没那么多精力一个个去研究,还是用最容易上手而且效率高的帝国了,这次花点时间,把ExpressionEngine的title自动转换url title的功能移植过来了,让帝国也有类似wp的自动添加Permalink功能,更适合英文站。
演示图片:

第一步
1,打开 e/admin/AddNews.php 找到 <script src=”editor/setday.js”></script>
2,在下面添加 <script src=”editor/url.js” type=”text/javascript”></script>
3,然后下载url.js 放到e/admin/editor/下.
第二步
1,帝国后台设置 系统设置 > 管理系统数据标 > 管理字段 (选择你要使用的系统,例如新闻系统数据表)
2,找到
<input type=text name=title value=”<?=htmlspecialchars(stripSlashes($r[title]))?>” size=”60″>
换成
<input type=text name=title value=”<?=htmlspecialchars(stripSlashes($r[title]))?>” size=”60″ id=”title” onkeyup=”liveUrlTitle();”>
第三步
1,在 e/admin/AddNews.php 中找到下面这段代码
<tr>
<td height=”25″ bgcolor=”#FFFFFF”><span id=”diy_filename1″ style=”display:”>文件前缀: <input name=”filenameqz” type=”text” value=”<?=stripSlashes($r[filenameqz])?>”></span>
<span id=”diy_filename2″ style=”display:none”>文件名 : <input name=”filename” type=”text” value=”<?=$r[filename]?>”></span>
<input name=”diyfilename” type=”checkbox” id=”diyfilename” value=”1″ onClick=”if(this.checked){diy_filename1.style.display=’none’;diy_filename2.style.display='’;}else{diy_filename2.style.display=’none’;diy_filename1.style.display='’;}”>
自定义文件名 ,
<input type=checkbox name=closepl value=1<?=$r[closepl]==1?” checked”:”"?>>关闭评论</td>
</tr>
2,如果你打算将 标题URL 显示在默认的地方(特殊属性)里,你可以直接添用最下面给出的内容,替换上面的内容。如果你打算 标题URL 显示在 标题 上面(演示图那样),那么在 e/admin/AddNews.php 里找下面这一段,并且删除上面的一段
</table>
<?
@include($modfile);
?>
在这段的上面添加如下内容。
<tr>
<td height=”25″ bgcolor=”#FFFFFF”>标题url</td>
<td bgcolor=”#FFFFFF”>
<span id=”diy_filename1″ style=”display:none”>文件前缀: <input name=”filenameqz” type=”text” value=”<?=stripSlashes($r[filenameqz])?>” size=”40″></span>
<span id=”diy_filename2″ style=”display:”>文件名 : <input name=”filename” type=”text” id=”url_title” value=”<?=$r[filename]?>” size=”40″>.html</span>
<input name=”diyfilename” type=”checkbox” id=”diyfilename” value=”1″ onClick=”if(this.checked){diy_filename1.style.display=’none’;diy_filename2.style.display='’;}else{diy_filename2.style.display=’none’;diy_filename1.style.display='’;}” checked>
自定义文件名 ,
<input type=checkbox name=closepl value=1<?=$r[closepl]==1?” checked”:”"?>>关闭评论</td>
</tr>
OK,完成了!测试一下效果吧! 效果会是 http://***.com/classname/what_about_your_think.html
如果要以目录的形式( http://***.com/what_about_your_think/ )其实也很容易,在栏目生成选项中,设置内容存放目录在根目录,内容页文件命名形式选择“目录”就可以了。这个完全看个人习惯了!
作者:monface
发布时间:May 27, 2009
分类:Google
Google SiteMap Protocol是Google自己推出的一种站点地图协议,此协议文件基于早期的robots.txt文件协议,并有所升级。在Google官方指南中指出加入了Google SiteMap文件的网站将更有利于Google网页爬行机器人的爬行索引,这样将提高索引网站内容的效率和准确度。文件协议应用了简单的XML格式,一共用到6个标签,其中关键标签包括链接地址、更新时间、更新频率和索引优先权。
Google SiteMap文件生成后格式如下:
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>http://www.xx.com<;/loc>
<lastmod>2005-06-03T04:20-08:00</lastmod>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.xx.com/300687.html<;/loc>
<lastmod>2005-06-02T20:20:36Z</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</urlset>
XML标签
changefreq:页面内容更新频率。
lastmod:页面最后修改时间
loc:页面永久链接地址
priority:相对于其他页面的优先权
url:相对于前4个标签的父标签
urlset:相对于前5个标签的父标签
我将一句一句分解讲解这个xml文件的每一个标签:
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
这一行定义了此xml文件的命名空间,相当于网页文件中的<html>标签一样的作用。
<url>
这是具体某一个链接的定义入口,你所希望展示在SiteMap文件中的每一个链接都要用<url>和</url>包含在里面,这是必须的。
<loc>http://www.xx.com<;/loc>
用<loc>描述出具体的链接地址,这里需要注意的是链接地址中的一些特殊字符必须转换为XML(HTML)定义的转义字符,如下表:字符 转义后的字符
HTML字符 字符编码
and(和) & & &
单引号 ' ' '
双引号 " " "
大于号 > > >
小于号 < < <
<lastmod>2005-06-03T04:20:32-08:00</lastmod>
<lastmod>是用来指定该链接的最后更新时间,这个很重要。Google的机器人会在索引此链接前先和上次索引记录的最后更新时间进行比较,如果时间一样就会跳过不再索引。所以如果你的链接内容基于上次Google索引时的内容有所改变,应该更新该时间,让Google下次索引时会重新对该链接内容进行分析和提取关键字。这里必须用ISO 8601中指定的时间格式进行描述,格式化的时间格式如下:
年:YYYY(2005)
年和月:YYYY-MM(2005-06)
年月日:YYYY-MM-DD(2005-06-04)
年月日小时分钟:YYYY-MM-DDThh:mmTZD(2005-06-04T10:37+08:00)
年月日小时分钟秒:YYYY-MM-DDThh:mmTZD(2005-06-04T10:37:30+08:00)
这里需注意的是TZD,TZD指定就是本地时间区域标记,像中国就是+08:00了
<changefreq>always</changefreq>
用这个标签告诉Google此链接可能会出现的更新频率,比如首页肯定就要用always(经常),而对于很久前的链接或者不再更新内容的链接就可以用yearly(每年)。这里可以用来描述的单词共这几个:"always", "hourly", "daily", "weekly", "monthly", "yearly",具体含义我就不用解释了吧,光看单词的意思就明白了。
<priority>1.0</priority>
<priority>是用来指定此链接相对于其他链接的优先权比值,此值定于0.0 - 1.0之间
还有</url>和</urlset>,这两个就是来关闭xml标签的,这和HTML中的</body>和</html>是一个道理
另外需要注意的是,这个xml文件必须是utf-8的编码格式,不管你是手动生成还是通过代码生成,建议最好检查一下xml文件是否是utf-8编码,最简单的方法就是用记事本打开xml然后另存为时选择编码(或转换器)为UTF-8。
登陆Google提交你的SiteMap文件,让Google开始爬行吧打开
https://www.google.com/webmasters/sitemaps/链接,如果还没有注册或者登陆Google,就先用自己的帐号登陆Google,登陆后转到Your Sitemaps状态页面,可以点击那个Add a Sitemap + 跳转到提交页面进行Sitemap文件的提交。建议文件放在你的站点根目录下。给Google提交你的Sitemap URL后可以看见在列表里已存在,不过这时候还没有生效,必须过几个小时后Status栏变成OK表示正式生效,如果不是OK,可以查看Google给出的状态标示解释看看是什么原因。
附录:Google Sitemap Protocol 英文教程
网址:https://www.google.com/webmasters/sitemaps/docs/en/protocol.html
Google Sitemap Generator 英文教程
网址:https://www.google.com/webmasters/sitemaps/docs/en/sitemap-generator.html
From : 落伍论坛 2005-6-7
原文地址:http://www.im286.com/viewthread.php?tid=943337&extra=page%3D1
直接生成XML的Google SiteMap代码[ASP版本]
根据森林提供的代码修改完成
在GG已经通过
ASP版本,需要空间的FSO支持
<%
Server.ScriptTimeout=50000
' sitemap_gen.asp
' A simple script to automatically produce sitemaps for a webserver, in the Google Sitemap Protocol (GSP)
' by Francesco Passantino
' www.iteam5.net/francesco/sitemap
' v0.2 released 5 june 2005 (Listing a directory tree recursively improvement)
'
' BSD 2.0 license,
' http://www.opensource.org/licenses/bsd-license.php
' 收集整理: 重庆森林@im286.com
session("server")="http://192.168.0.111" '你的域名
vDir = "/" '制作SiteMap的目录,相对目录(相对于根目录而言)
set objfso = CreateObject("Scripting.FileSystemObject")
root = Server.MapPath(vDir)
'response.ContentType = "text/xml"
'response.write "<?xml version='1.0' encoding='UTF-8'?>"
'response.write "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>;"
str = "<?xml version='1.0' encoding='UTF-8'?>" & vbcrlf
str = str & "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>;" & vbcrlf
Set objFolder = objFSO.GetFolder(root)
'response.write getfilelink(objFolder.Path,objFolder.dateLastModified)
Set colFiles = objFolder.Files
For Each objFile In colFiles
'response.write getfilelink(objFile.Path,objfile.dateLastModified)
str = str & getfilelink(objFile.Path,objfile.dateLastModified) & vbcrlf
Next
ShowSubFolders(objFolder)
'response.write "</urlset>"
str = str & "</urlset>" & vbcrlf
set fso = nothing
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
'.Type = adTypeText
'.Mode = adModeReadWrite
.Open
.Charset = "utf-8"
.Position = objStream.Size
.WriteText=str
.SaveToFile server.mappath("/sitemap.xml"),2 '生成的XML文件名
.Close
End With
Set objStream = Nothing
If Not Err Then
Response.Write("<script>alert('成功生成站点地图!');history.back();</script>")
Response.End
End If
Sub ShowSubFolders(objFolder)
Set colFolders = objFolder.SubFolders
For Each objSubFolder In colFolders
if folderpermission(objSubFolder.Path) then
'response.write getfilelink(objSubFolder.Path,objSubFolder.dateLastModified)
str = str & getfilelink(objSubFolder.Path,objSubFolder.dateLastModified) & vbcrlf
Set colFiles = objSubFolder.Files
For Each objFile In colFiles
'response.write getfilelink(objFile.Path,objFile.dateLastModified)
str = str & getfilelink(objFile.Path,objFile.dateLastModified) & vbcrlf
Next
ShowSubFolders(objSubFolder)
end if
Next
End Sub
Function getfilelink(file,datafile)
file=replace(file,root,"")
file=replace(file,"\","/")
If FileExtensionIsBad(file) then Exit Function
if month(datafile)<10 then filedatem="0"
if day(datafile)<10 then filedated="0"
filedate=year(datafile)&"-"&filedatem&month(datafile)&"-"&filedated&day(datafile)
getfilelink = "<url><loc>"&server.htmlencode(session("server")&vDir&file)&"</loc><lastmod>"&filedate&"</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url>"
Response.Flush
End Function
Function Folderpermission(pathName)
'需要过滤的目录(不列在SiteMap里面)
PathExclusion=Array("\temp","\_vti_cnf","_vti_pvt","_vti_log","cgi-bin","\admin","\edu")
Folderpermission =True
for each PathExcluded in PathExclusion
if instr(ucase(pathName),ucase(PathExcluded))>0 then
Folderpermission = False
exit for
end if
next
End Function
Function FileExtensionIsBad(sFileName)
Dim sFileExtension, bFileExtensionIsValid, sFileExt
'modify for your file extension (http://www.googleguide.com/file_type.html)
Extensions = Array("png","gif","jpg","jpeg","zip","pdf","ps","html","htm","php","wk1","wk2","wk3","wk4","wk5","wki","wks","wku","lwp","mw","xls","ppt","doc","swf","wks","wps","wdb","wri","rtf","ans","txt")
'设置列表的文件名,扩展名不在其中的话SiteMap则不会收录该扩展名的文件
if len(trim(sFileName)) = 0 then
FileExtensionIsBad = true
Exit Function
end if
sFileExtension = right(sFileName, len(sFileName) - instrrev(sFileName, "."))
bFileExtensionIsValid = false 'assume extension is bad
for each sFileExt in extensions
if ucase(sFileExt) = ucase(sFileExtension) then
bFileExtensionIsValid = True
exit for
end if
next
FileExtensionIsBad = not bFileExtensionIsValid
End Function
%>
作者:yale 文章来源:落伍者 2005-6-13
附录:
1、Google SiteMap官方生成器(Python 脚本)
https://www.google.com/webmasters/sitemaps/docs/zh_CN/sitemap-generator.html
2、Google Sitemap生成器(ASP.NET版本)
下载地址:http://sitemap.chinookwebs.com/
3、Google Sitemap生成器(phpBB 2.0.x版本)
国外发布了专门用于PHPBB 2.0.x 的 Google Sitemaps 生成器,他可以列出论坛的基本URLs, 单个论坛的URLs, 以及论坛主题的URLs等。如果你使用PHPBB, 这个很值得一试。
PHPBB SItemaps 生成器地址:http://www.phpbb.com/phpBB/viewtopic.php?t=295493
4、Google Sitemap生成器(php版本)
国外不少人已经做出了PHP版的 Google Sitemaps 生成器,这里介绍两个。
第一个是 phpSitemap 1.1, 上传版本。功能能上目前只能列出目录一级,还不能列出数据库产生的动态网页链接。像本站只能列出大概20个主要页面。下载后上传到网站根目录,运行phpsitemap.php即可。
下载地址:http://enarion.net/google/
作者:monface
发布时间:May 27, 2009
分类:帝国ecms
新建一个自定义页面.定义路径为: /sitemap.xml
自定义页面内容为:
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<priority>1.000</priority>
</url>
[e:loop={"select * from [!db.pre!]enewsclass where checked=1 order by classid",0,24,0}]
<url>
<loc><?=$public_r[newsurl]?><?=$bqr[classpath]?>/</loc>
<priority>0.5000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]enewszt order by ztid",0,24,0}]
<url>
<loc><?=$public_r[newsurl]?><?=$bqr[ztpath]?>/</loc>
<priority>0.5000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_news where checked=1 order by newstime",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<priority>0.5000</priority>
</url>
[/e:loop]
</urlset>
如果有多个表,则继续,把[!db.pre!]ecms_news,改成相应的表名.
[e:loop={"select * from [!db.pre!]ecms_表名 where checked=1 order by newstime",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<priority>0.5000</priority>
</url>
[/e:loop]
-----------------------------
以下是另外一个的修正版本
页面内容如下:
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>[!--news.url--]</loc>
<priority>1.000</priority>
</url>
[e:loop={"select * from [!db.pre!]enewsclass order by classid limit 1000",1000,24,0}]
<url>
<loc><?=$public_r[newsurl]?><?=$bqr[classpath]?>/</loc>
<changefreq>daily</changefreq>
<priority>0.8000</priority>
</url>
[/e:loop]
[e:loop={"select * from [!db.pre!]ecms_news order by newstime desc limit 50000",0,24,0}]
<url>
<loc><?=$bqsr[titleurl]?></loc>
<lastmod><?=format_datetime($bqr[newstime],'Y-m-d')?></lastmod>
<priority>0.5000</priority>
</url>
[/e:loop]
</urlset>
作者:monface
发布时间:May 25, 2009
分类:游戏
按照佣兵的技能类型,游戏中一共有12种佣兵,分别是:
ACT1的冰箭MM
ACT1的火箭MM
ACT2的祈祷光环枪兵
ACT2的瞄准光环枪兵
ACT2的防御光环枪兵
ACT2的荆棘光环枪兵
ACT2的力量光环枪兵
ACT2的冰冻光环枪兵
ACT3的电法师
ACT3的冰法师
ACT3的火法师
ACT5的野蛮人
雇佣ACT2枪兵的时候要注意不是所有难度的游戏都能雇到所有类型枪兵的,其中:
噩梦难度雇不到,只能在普通和地狱难度雇的有:祈祷(战斗型)、瞄准(进攻型)和防御(防御型)三种枪兵
普通和地狱难度雇不到,只能在噩梦难度雇的有:荆棘(战斗型)、力量(进攻型)和冰冻(防御型)三种枪兵
光环的作用:
祈祷:给自己和队友缓慢加血
防御:增加自己和队友的防御值
瞄准:增加自己和队友的攻击命中率
荆棘:当敌人击中自己或队友时受到反伤害
力量:增加自己和队友的伤害力
冰冻:冰冻并减慢敌人
同一种类型的佣兵,在普通难度雇佣的要好于噩梦难度雇佣的,噩梦难度好于地狱难度,虽然区别不是很大。前提是佣兵练到相同级别时比较。(只能在噩梦难度雇佣的三种枪兵就不用考虑这一点了)
同一种类型的佣兵,而且是在相同难度游戏里雇佣的,不管雇佣的时候级别是多少,只要练到同一级别,都是完全一样的。也就是说在游戏难度和类型一定的前提下,初始等级越高越好
关于适用的角色职业真的是各有所好,无法一概而论,只是列一些佣兵之所以受欢迎的原因吧:
ACT2的长枪佣兵一般来说是首选,因为他们带着光环,能帮助自己和队友更快更安全的杀怪。
冰冻光环最受女巫的欢迎,因为在瞬移传送时更加安全,不小心传到怪物堆里,可以让怪物进攻速度迟缓,正好逃掉。
瞄准光环和力量光环受死灵的欢迎,骷髅和复活的怪物们变得更强大了。
ACT1的冰箭MM也有不少人喜欢,男女搭配,干活不累,漂亮MM谁不喜欢?肉搏型角色喜欢弓箭MM还因为她能用“内视”技能,降低怪物的防御(能让怪物亮晶晶的闪光),这样怪物就容易打了。
ACT3的法师和ACT5的野蛮人用的人就少多了,这不是说他们完全没用,之不过多数人不能抵御上面那些更好佣兵的诱惑。
至于你说的那把武器个人认为在普通的还算可以,像你这样刚进噩梦应该换把攻击至少上百的长枪.出处么你可以经常打第一幕的安姐,也可以打第三幕的劳模,他们都出几把比较好的暗金矛,比如荣耀尖塔,破骨这种,如果你现在手上的那把矛是暗金的话也可以用方块升一下级
公式: 1 Ral(8#) + 1 Sol(12#) + 1 完美绿宝石 + 普通暗金武器 = 该武器扩展版 ,也就是8号付文拉尔加上12号付文索尔加一个完美绿宝石.
至于ACT的意思就是关卡的意思,呵呵~我也是刚刚打暴地狱的一个骑士,给你点资料了,呵呵