Print Page | Close Window

[MOD] Google Sitemap for SQL v8.04

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21317
Printed Date: 28 March 2026 at 2:24am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: [MOD] Google Sitemap for SQL v8.04
Posted By: superlative
Subject: [MOD] Google Sitemap for SQL v8.04
Date Posted: 16 September 2006 at 3:41pm
Hi All;
 
Here is the my dynamic google sitemap script. If you want to more indexed pages for google read this :
 
https://www.google.com/webmasters/sitemaps/docs/en/protocol.html - https://www.google.com/webmasters/sitemaps/docs/en/protocol.html
 
[QUOTE]
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
'************************************************
'****** Dynamic Google SiteMap for WWF v8.04 SQL*******
'******* written by Kaan DOGAN (aka Superlative)********
'**************** http://www.knowhow.gen.tr - www.knowhow.gen.tr **************
'************************************************
'Dimension variables
Dim intRecordPositionPageNum
Dim intTotalRecordsPages 'Holds the total number of pages
Dim intStartPosition  'Holds the start poition for records to be shown
Dim intEndPosition  'Holds the end poition for records to be shown
Dim sarryForums   'Holds the recordset array for all the categories and forums
Dim sarryTopics   'Holds the topics to display
Dim saryMemebrStats  'Holds the member stats
Dim intForumID   'Holds the forum ID number
Dim strCategory   'Holds the category name
Dim intCatID   'Holds the id for the category
Dim strForumName  'Holds the forum name
Dim strForumDiscription  'Holds the forum description
Dim strForumPassword  'Holds the forum password if there is one
Dim lngNumberOfTopics  'Holds the number of topics in a forum
Dim lngNumberOfPosts  'Holds the number of Posts in the forum
Dim lngTotalNumberOfTopics 'Holds the total number of topics in a forum
Dim lngTotalNumberOfPosts 'Holds the total number of Posts in the forum
Dim intNumberofForums  'Holds the number of forums
Dim lngLastEntryMeassgeID 'Holds the message ID of the last entry
Dim dtmLastEntryDate  'Holds the date of the last entry to the forum
Dim strLastEntryUser  'Holds the the username of the user who made the last entry
Dim lngLastEntryUserID  'Holds the ID number of the last user to make and entry
Dim dtmLastEntryDateAllForums 'Holds the date of the last entry to all fourms
Dim strLastEntryUserAllForums 'Holds the the username of the user who made the last entry to all forums
Dim lngLastEntryUserIDAllForums 'Holds the ID number of the last user to make and entry to all forums
Dim blnForumLocked  'Set to true if the forum is locked
Dim intForumColourNumber 'Holds the number to calculate the table row colour
Dim blnHideForum  'Set to true if this is a hidden forum
Dim intCatShow   'Holds the ID number of the category to show if only showing one category
Dim intActiveUsers  'Holds the number of active users
Dim intActiveGuests  'Holds the number of active guests
Dim intActiveMembers  'Holds the number of logged in active members
Dim strMembersOnline  'Holds the names of the members online
Dim intSubForumID  'Holds the sub forum ID number
Dim strSubForumName  'Holds the sub forum name
Dim strSubForums  'Holds if there are sub forums
Dim dtmLastSubEntryDate  'Holds the date of the last entry to the forum
Dim strLastSubEntryUser  'Holds the the username of the user who made the last entry
Dim lngLastSubEntryUserID 'Holds the ID number of the last user to make and entry
Dim lngSubForumNumberOfPosts 'Holds the number of posts in the subforum
Dim lngSubForumNumberOfTopics 'Holds the number of topics in the subforum
Dim intTotalRecords  'Holds the number of records
Dim intCurrentRecord  'Holds the current record position
Dim intTempRecord  'Holds a temporary record position for looping through records for any checks
Dim blnSubRead   'Holds if the user has entry to the sub forum
Dim lngNoOfMembers  'Holds the number of forum members
Dim intArrayPass  'Active users array counter
Dim strBirthdays  'String containing all those with birtdays today
Dim dtmNow   'Now date with off-set
Dim intBirtdayLoopCounter 'Holds the bitrhday loop counter
Dim intLastForumEntryID  'Holds the last forum ID for the last entry for link in forum stats
Dim intTotalViewingForum 'Holds the number of people viewing the forum, including sub forums
Dim z
'Initialise variables
lngTotalNumberOfTopics = 0
lngTotalNumberOfPosts = 0
intNumberofForums = 0
intForumColourNumber = 0
intActiveMembers = 0
intActiveGuests = 0
intActiveUsers = 0
intTotalRecords = 0
lngNoOfMembers = 0
intBirtdayLoopCounter = 0
z= 0
'Set the content type for feed
Response.ContentType = "application/xml"
%><?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns=" http:// - http://www.google.com/schemas/sitemap/0.84"><%
'Read the various categories, forums, and permissions from the database in one hit for extra performance
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "" & _
"SELECT " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Forum_description, " & strDbTable & "Forum.No_of_topics, " & strDbTable & "Forum.No_of_posts, " & strDbTable & "Author.Username, " & strDbTable & "Forum.Last_post_author_ID, " & strDbTable & "Forum.Last_post_date, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Locked, " & strDbTable & "Forum.Hide, " & strDbTable & "Permissions.View_Forum " & _
"FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Permissions" & strDBNoLock & ", " & strDbTable & "Author" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Category.Cat_ID = " & strDbTable & "Forum.Cat_ID " & _
 "AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Permissions.Forum_ID " & _
 "AND " & strDbTable & "Forum.Last_post_author_ID = " & strDbTable & "Author.Author_ID " & _
 "AND (" & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & " OR " & strDbTable & "Permissions.Group_ID = " & intGroupID & ") " & _
"ORDER BY " & strDbTable & "Category.Cat_order, " & strDbTable & "Forum.Forum_Order, " & strDbTable & "Permissions.Author_ID DESC;"
'Set error trapping
On Error Resume Next
 
'Query the database
rsCommon.Open strSQL, adoCon
'If an error has occured write an error to the page
If Err.Number <> 0 Then Call errorMsg("An error has occured while executing SQL query on database.", "get_forum_data", "default.asp")
   
'Disable error trapping
On Error goto 0

'Place the recordset into an array
If NOT rsCommon.EOF Then
 sarryForums = rsCommon.GetRows()
 intTotalRecords = Ubound(sarryForums,2) + 1
End If
'Close the

-------------
http://www.knowhow.gen.tr" rel="nofollow">



Replies:
Posted By: Ali Bilgrami
Date Posted: 19 September 2006 at 3:34pm

Microsoft VBScript runtime error '800a0009'

Subscript out of range: '27'

/forum/sitemap_forum.asp, line 246



-------------
Lets!


Posted By: superlative
Date Posted: 19 September 2006 at 5:20pm
Can you sent to here line 246 ? In my script line 246 is blank
 
Line 245     Do While CInt(sarryForums(3,intCurrentRecord)) > 0
Line 246      
Line 247     'Go to next record


-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: superlative
Date Posted: 19 September 2006 at 11:06pm
Ali, i corrected to code, when i use CODE forum tags and then who copy code from this forum, my code didnt work. I change the CODE tags to QUOTE problem is resolved. Please copy above code then change red lines and try. Please inform to me.

-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: Ali Bilgrami
Date Posted: 20 September 2006 at 12:03pm
Yes, that was the problem :) thanks superlative...it works like a charm. Great Job...(Y)

-------------
Lets!


Posted By: superlative
Date Posted: 21 September 2006 at 9:18am
Thanks Ali, Enjoy :)

-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: gölge
Date Posted: 08 November 2006 at 2:14am
exellent code!
thanks superlative


Posted By: GopCa
Date Posted: 13 November 2006 at 4:54pm
bende hata verdi.
 
'Do....While Loop to loop through the recorset to display the forum topics
 For k=1 to sayikayit
z= z + 1
 %>
 
bu ksıımdan tür uyuşmazlığı verdi...


-------------
Türkçe Web Wiz Forum Desteğine http://Gopca.Net - http://Gopca.Net adresinden ulaşabilirsiniz...


Posted By: wwcn
Date Posted: 15 November 2006 at 1:07pm
it can be used for access too. 


Posted By: jmdennis999
Date Posted: 30 January 2007 at 4:53pm
Thanks for this script, it was a big help.  i use it with access and it works great.  If you would like to take an extra step and add the <lastmod> tag to your sitemap for Google, you can insert this script above the <changefreq>:

  <lastmod><%
if(Month(Date)<10 and Day(Date)<10) then
 Response.Write(Year(Date) & "-0" & Month(Date) & "-0" & Day(Date))
else
 if(Month(Date)<10) then
  Response.Write(Year(Date) & "-0" & Month(Date) & "-" & Day(Date))
 else
  if(Day(Date)<10) then
   Response.Write(Year(Date) & "-" & Month(Date) & "-0" & Day(Date))
  else
   Response.Write(Year(Date) & "-" & Month(Date) & "-" & Day(Date))
  end if
 end if
end if
%></lastmod>

enjoy!


Posted By: superlative
Date Posted: 30 January 2007 at 10:50pm
You`re welcome. Enjoy :)

-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: khaled66
Date Posted: 31 January 2007 at 10:40am

Thanks for the code but and it gives me the following errors:

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the javascript:location.reload%28%29 - Refresh button, or try again later.


A string literal was expected, but no opening quote character was found. Error processing resource

 </url> <font face="Arial" size=2>
--------------------------------^



Posted By: khaled66
Date Posted: 01 February 2007 at 12:21pm
the error is now fixed


Posted By: kkimber
Date Posted: 05 February 2007 at 11:00am
member_profile.asp?PF=18438&FID=19 - superlative süpersin. v8.05 çalışmakta...



Posted By: superlative
Date Posted: 06 February 2007 at 1:57am
enjoy it, kkimber Tongue

-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: kpdillon
Date Posted: 06 February 2007 at 5:34pm
I am getting the same error... How did you fix this?
 
Originally posted by khaled66 khaled66 wrote:

Thanks for the code but and it gives me the following errors:

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the javascript:location.reload%28%29 - Refresh button, or try again later.


A string literal was expected, but no opening quote character was found. Error processing resource

 </url> <font face="Arial" size=2>
--------------------------------^



Posted By: superlative
Date Posted: 06 February 2007 at 7:55pm
Hi khaled66, I think this problem related wrong html code of your database. Your DB contain this line
 
<font face="Arial" size=2>

But correct tag is here :

<font face="Arial" size="2">
 
I dont know why your database include wrong syntax. You must replace all incorrect tags. I think somebody copy paste some text to your forum. And you recieve this error. XML syntax is most important.



-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: kpdillon
Date Posted: 06 February 2007 at 8:35pm
Any idea what table I would look in to check for this?  All the RSS stuff seems to be working OK.


Posted By: kpdillon
Date Posted: 06 February 2007 at 10:08pm
This appears to be a generic error that IE is throwing, I don' have anything in the database or the files that have the string, but from what I read IE is throwing it because of some missing charachter somewhere..  How do we track this down?
 
<font face="Arial" size=2>
 


Posted By: khaled66
Date Posted: 07 February 2007 at 1:38am
Hi  i fixed  it by  replacing   (line 293) 
 
sayikayit = rsCommon("toplam")
 
with
 
sayikayit = Clng(rsCommon("toplam"))
 
 
Originally posted by kpdillon kpdillon wrote:

I am getting the same error... How did you fix this?
 
Originally posted by khaled66 khaled66 wrote:

Thanks for the code but and it gives me the following errors:

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the javascript:location.reload%28%29 - Refresh button, or try again later.


A string literal was expected, but no opening quote character was found. Error processing resource

 </url> <font face="Arial" size=2>
--------------------------------^



Posted By: kkimber
Date Posted: 07 February 2007 at 4:01pm
sitemap version 0.9 içinde bir update yapmayı düşünüyormusun?


Posted By: kpdillon
Date Posted: 11 February 2007 at 4:02am
Originally posted by khaled66 khaled66 wrote:

Hi  i fixed  it by  replacing   (line 293) 
 
sayikayit = rsCommon("toplam")
 
with
 
sayikayit = Clng(rsCommon("toplam"))
 
 
Thanks that fixed it for me!


Posted By: PrivateEye
Date Posted: 27 February 2007 at 12:29pm
I have created sitemap_forum.asp file and is working correctly. I have also read contents on https://www.google.com/webmasters/tools/docs/en/protocol.html

I am confused about how to use sitemap_forum.asp file to produce sitemap for Google as Google says the sitemap file may be like sitemap.xml but my file is sitemap_forum.asp
Can anyone help me out that how can I use sitemap_forum.asp to produce sitemap for Google. Thank you.


-------------
The Judgement Day


Posted By: kkimber
Date Posted: 19 April 2007 at 9:28am
Originally posted by PrivateEye PrivateEye wrote:

I have created sitemap_forum.asp file and is working correctly. I have also read contents on https://www.google.com/webmasters/tools/docs/en/protocol.html

I am confused about how to use sitemap_forum.asp file to produce sitemap for Google as Google says the sitemap file may be like sitemap.xml but my file is sitemap_forum.asp
Can anyone help me out that how can I use sitemap_forum.asp to produce sitemap for Google. Thank you.


run the sitemap.asp on must "ie" exam; www.xxxxx.com/forum/sitemap.asp and copy the output paste it notepad and edit the follow...

original;
-------------------------------------
  <?xml version="1.0" encoding="UTF-8" ?>
- <urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
- <url>
  <loc>http://xxxxxxxxxxx.com/forum/default.asp?C=12</loc>
  <lastmod>2007-04-19</lastmod>
  <changefreq>daily</changefreq>
  <priority>0.5</priority>
  </url>
- <url>
-------------------------------------


change the;
-------------------------------------
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>http://xxxxxx.com/</loc></url>
- <url>
  <loc>http://xxxx.com</loc>
  <lastmod>2007-04-11</lastmod>
  <changefreq>daily</changefreq>
  <priority>1.0</priority>
  </url>
- <url>
  <loc>http://xxxxx
-------------------------------------

save as the file "utf-8" format, "unimportant file name.xml" and upload it.
then go to google account page and link the filename, exam; www.xxxxx.com/hedehodo.xml
that's all. if successfully the change file, google bot visiting the forum or google account screen error appear.


Posted By: MortiOli
Date Posted: 19 April 2007 at 3:54pm
I'm sure you don't have to copy and paste the output.
 
Just save the file as sitemap.asp and add that to Google as the sitemap.  That's exactly what I've done, and Google didn't complain.


Posted By: kkimber
Date Posted: 20 April 2007 at 7:13am
i use the copy/paste and change the xml.. and google np.

Originally posted by MortiOli MortiOli wrote:

I'm sure you don't have to copy and paste the output.
 
Just save the file as sitemap.asp and add that to Google as the sitemap.  That's exactly what I've done, and Google didn't complain.


Posted By: cathal
Date Posted: 07 May 2007 at 2:46pm
I submitted my sitemap.asp file to google webmaster and it reported an error, it said the file wasnt of a supported format. I then submitted my .xml file and it accepted it with no problems, the URLs were added within very quickly.
 
Do i have to update my .xml myself on a regular basis, or is there some sort of auto update utility i can use.


Posted By: cathal
Date Posted: 07 May 2007 at 3:37pm

No wait, now its saying the .asp file is OK, make your mind up Google



Posted By: superlative
Date Posted: 11 May 2007 at 5:19am
http://www.knowhow.gen.tr/forum/sitemap_forum.asp - http://www.knowhow.gen.tr/forum/sitemap_forum.asp

-------------
http://www.knowhow.gen.tr" rel="nofollow">


Posted By: cathal
Date Posted: 11 May 2007 at 11:50am
Will changing the priority change the speed at which google searches the site, I changed it to 1.0, will this affect the MOD's operation?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net