Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Sitemap for YaBB forum (Read 23820 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 34
Sitemap for YaBB forum
06.11.07 at 14:30:08
 
Sitemap for YaBB forum
 
I have been looking around to find a tool to create a site map for a YaBB (www.yabbforum.com) forum. I did not manage to find something out of the box I could use so I have written something myself. I have used the following techniques:
 
Techniques used:
1. Sitemap generator that Google recommends: sitemap_gen
    See https://www.google.com/webmasters/tools/docs/en/sitemap-generator.html
2. Created a perl script to generate a list of YaBB topics
3. Configures the sitemap_gen to add the list of YaBB topics
 
Setup:
1. Follow the directions at https://www.google.com/webmasters/tools/docs/en/sitemap-generator.html to install the sitemap_gen tool. This entails a simpel download. The editing of a small xml file to make it specific to your own site.
2. I wrote a small perl script to create a file listing:
Code:
$strPath = "/var/user/cgi-bin/yabb2/Messages";
opendir( $ptrDir, $strPath);

while  ($strFile = readdir($ptrDir)) 
{
  if ($strFile =~ m/\.txt/)
  {
    $strTopic = $strFile;
    $strTopic =~ s/\.txt//;
    print 'http://www.oraxcel.com/cgi-bin/yabb2/YaBB.pl?num=' 
	  . $strTopic . "\n";
  }
}
closedir($ptrDir);
 


 
This code is based on a small test program I wrote to make a file listing.  
See: http://www.oraxcel.com/cgi-bin/yabb2/YaBB.pl?num=1194354889
 
Save the above code in a .pl file e.g. forumtopics.pl.  
A small ksh script can be made to dump the output into a text file:
perl forumtopics.pl > forumtopics.txt
Back to top
 
« Last Edit: 06.11.07 at 14:37:08 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 34
Re: Sitemap for YaBB forum
Reply #1 - 07.11.07 at 22:38:39
 
To show the resulting sitemap.xml (www.oraxcel.com/sitemap.xml) in a decent way an XSLT can be done. This is easily achieved by adding a style sheet to the XML file. To automate it I changed the sitemap_gen program to add the stylesheet. Open the sitemap_gen.py file in notepad. Find the following code:
 
Code:
SITEMAP_HEADER     = \
  '<?xml version="1.0" encoding="UTF-8"?>\n' \
  '<urlset\n' \
 


 
Change this to:
 
Code:
SITEMAP_HEADER     = \
  '<?xml version="1.0" encoding="UTF-8"?>\n' \
  '<?xml-stylesheet type="text/xsl" href="gss.xsl"?>\n' \
  '<urlset\n' \
 


 
Then add the style sheet file in the same directory as the sitemap.xm file and all is done.
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1