TSYS2.0修正文章跳链接生成错误 :: 人民需要艺术,艺术需要交流!
artscn · 13zhang · 2006-03-10
人民需要艺术,艺术需要交流!
开始记录我的思想,不能因为它们与众不同而感到羞耻!
<< 用asp水印图片代码和方法
|
首页
|
2006-03-10
TSYS2.0修正文章跳链接生成错误
TSYS 2.0 beta1中,写新文章的时候,如果填写了“跳链接”这一项,即无法生成文章,点击文章标题的时候也不会跳转到指定的地址。之前有个做修改了
修改文件:/tsys/manage/inc/ResCreator.class.asp
'具有跳链接的资源无需生成
If RsInfo("go_url") <> "" Then
Sql = "update resource_list SET created=1 where id=" & RsInfo("id")
Db.ExeCute(Sql)
createRes = 1
Exit Function
End If
红色部分
为添加部分
但是这样做的实质并没有真正的生成,只是将生成标示强加给了这个资源,点击文章标题的时候出现判断是visit_url是否为空,为空则提示错误,不为空则跳转到visit_url,
CODE:
[Copy to clipboard]
Function ShowTitle(Rs)
If Rs("visit_url")<>"" Then
ShowTitle = "<a href=""javascript:window.open('" & Rs("visit_url") & "');void(0);"" title=""资源编号:" & Rs("id") &""">" & Rs("title") & "</a>"
Else
ShowTitle = "<a href=""javascript:Uncreated();void(0);"" title=""资源编号:" & Rs("id") &""">" & Rs("title") & "</a>"
End If
End Function
查看代码不难发现
CODE:
[Copy to clipboard]
If go_url <> "" Then
file_path = go_url
Else
file_path = ""
End If
也就是把go_url的值给了file_path,资源地址,而visit_url在写入时为
Rs("visit_url") = ""
所以就无法达到跳转了。。。
以上是原理部分。。。下面为修正方法:
修改/tsys/manage/Resource_Process.asp文件
将
CODE:
[Copy to clipboard]
If go_url <> "" Then
file_path = go_url
Else
file_path = ""
End If
替换为:
CODE:
[Copy to clipboard]
If go_url <> "" Then
visit_url = go_url
file_path = ""
Else
visit_url = ""
End If
注意添加一个定义visit_url,
修改文件:/tsys/manage/inc/ResCreator.class.asp
将
CODE:
[Copy to clipboard]
'具有跳链接的资源无需生成
If RsInfo("go_url") <> "" Then
createRes = 1
Exit Function
End If
替换为:
CODE:
[Copy to clipboard]
'具有跳链接的资源无需生成
If RsInfo("go_url") <> "" Then
Sql = "update resource_list SET created=1 where id=" & RsInfo("id")
Db.ExeCute(Sql)
createRes = 1
Exit Function
End If
转载请注明出处:
http://www.31u.net/blog/blogview.asp?logID=210
13zhang
引用Trackback(0)
|
编辑
评论
最后更新
发表评论
原始快照:web.archive.org