How to use: Save the following code as rss.asp (remember to save in UTF-8 format) and upload to the site root directory, the rest of the work is to find the RSS feed to submit the portal to submit your feed address http://your domain name/rss.asp
Demo: http://www.366mv.cn
Code as follows, please modify the appropriate information according to the comments, copyright information also hope you can retain ^_^
Copy Code code as follows:
<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<%
session.codepage=65001
response.charset= "UTF-8"
'========================================================================
' Copyright (c) 2005-2007, sour film ([Url]www.366mv.cn[/url]) All rights reserved.
'========================================================================
' Name: rss.asp
' Description: Generate RSS feeds dynamically.
'========================================================================
%>
<!--#include file=inc/conn.asp--><?xml version= "1.0" encoding= "Utf-8"?>
<rss version= "2.0" xmlns:atom= "Http://www.w3.org/2005/Atom" >
<%
title= "Sour film" ' changed to your own name
Response.Write "<channel>" &CHR (13)
Response.Write "<atom:link href=" "http://" &maxz_2& "/xml.asp" "rel=" "Self" "type=" "Application/rss+xml" " /> "&CHR (13)
Response.Write "<title> recently updated film-" &title& "</title>" &CHR (13)
Response.Write "<link>http://" &maxz_2& "</link>" &CHR (13)
Response.Write "<description>" &title& "-million movie online watch. Free movies, online movies, TVB, VCDs, Korean dramas, anime, sci-fi, horror, romance, serials, blockbusters, surreal ......</description> "&CHR (13)
Response.Write Get_left (15,0) ' shows top 15 movies, sorted by update date
Response.Write "</channel>" &CHR (13)
Function Re (str)
If not IsNull (str) Then
Re=replace (str, "&", "&")
Re=replace (Re, "<", "<")
Re=replace (Re, ">", ">")
Re=replace (Re, "'", "" ")
Re=replace (Re, "" "", "" ")
End If
End Function
Function Get_left (n,m)
N=cint (N): M=cint (m)
If M=1 Then
mm= "ORDER BY zt_hits Desc" ' Sort by clicks
Else
mm= "ORDER BY zt_date Desc" ' Sorted by Update date
End If
Set Rs1=conn.execute (' Select top ' &n& ' zt_id,zt_name,zt_zy,zt_dy,zt_type,zt_date,zt_hits,zt_content from Zt_ Data "&mm)
Get_left_i=0
Do as not rs1.eof
Get_left_i=get_left_i+1
get_left=get_left& "<item>" &CHR (13)
get_left=get_left& "<title>" &re (rs1 ("Zt_name")) & "</title>" &CHR (13)
get_left=get_left& "<link>http://" &maxz_2& "/" &get_classenname (Rs1 ("Zt_type")) & "/" &rs1 ("zt_id") & "</link>" &CHR (13)
get_left=get_left& "<description><! [cdata[<p> Category: <a href= "" http://"&maxz_2&"/"&get_classenname (Rs1 (" Zt_type ")) &" ">" &get_classname (Rs1 ("Zt_type")) & "</a></p><p> Starring:" &rs1 ("Zt_zy") & "</p>< P> plot: "&re (Rs1 (" Zt_content ")) &" </p>]]></description> "&CHR (13)
get_left=get_left& "<guid>http://" &maxz_2& "/" &get_classenname (Rs1 ("Zt_type")) & "/" &rs1 ("zt_id") & "</guid>" &CHR (13)
get_left=get_left& "<category><! [cdata["&get_classname" (Rs1 ("Zt_type")) & "]]></category>" &CHR (13)
get_left=get_left& "<pubDate>" &datetorfc822 (rs1 ("Zt_date")) & "</pubDate>" &CHR (13)
get_left=get_left& "</item>" &CHR (13)
If get_left_i>=n Then Exit do
Rs1.movenext
Loop
Rs1.close
End Function
Function DateToRFC822 (ByVal dtaval)
Dim Strcurlocale:strcurlocale = GetLocale ()
SetLocale ("EN-GB")
Dtaval = CDate (dtaval)
DateToRFC822 = WeekdayName (Weekday (dtaval), True) & "," & _
Right ("0" &day (dtaval), 2) & "" & _
MonthName (Month (dtaval), True) & "" & _
Year (Dtaval) & "" & _
Right ("0" &hour (dtaval), 2) & ":" & _
Right ("0" &minute (dtaval), 2) & ":" & _
Right ("0" &second (dtaval), 2) & "" & _
Www~chinaz~com
"+0800"
SetLocale (Strcurlocale)
End Function
%></rss>