Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Forum Site Map for Search Engines Details »»
Forum Site Map for Search Engines
Version: 1.00, by Webdork Webdork is offline
Developer Last Online: Nov 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-03-2002 Last Update: Never Installs: 8
Is in Beta Stage  
No support by the author.

Just a very quick hack that will print a static php page listing your categories and topics.

Search engines like Google wont index a dynamic URL off a dynamic URL so by providing a static page listing your topics dynamic URL's you will get a deeper crawl. I know there are different approaches on this board to optimizing for Google, but try this as well. It works

I then just create a link from the home page to the this file (you should try and name it sitemap.php or something similar.

Please note that I have deliberately not used any vbulletin templates etc... the goal of this page is to be as simple and clean as possible for crawlers like Google and AlltheWeb to index as much as possible.

Example of output here: http://www.sizematters.com.au/forums/sitemap.php

Just cut and paste the code and play. In another version I made it so the first 100 characters of the first post in each topic was created, but I dont think it helps much.

PHP Code:

<?php require('./global.php');

// This file can be saved as any name, but upload to your forum dir.

// Only real variables for you to change. Include the trailing /

$siteurl "http://www.sizematters.com.au/forums";
$sitename "SizeMatters";

// You can safely edit the header and footer as well.

?>

<html>

<head>
<title>SizeMatters Forum Site Map</title>
<meta name="description" content="">
<meta name="keywords" content="">

<style>
<!--
h1           { font-family: Verdana; font-size: 14pt; color: #666666 }
h2           { font-family: Verdana; font-size: 12pt; color: #666666 }
body         { font-family: Verdana; font-size: 8pt; color: #666666 }
p            { font-family: Verdana; font-size: 8pt; color: #666666 }
-->
</style>

</head>

<body>

<?php

echo "\r\n<h1>$sitename Forum Site Map</h1>\r\n";

echo 
"\r\n<p>Click here to return to <a href='$siteurl/'>$sitename</a></p>\r\n";

echo 
"\r\n<h2>$sitename Forum Categories</h2>\r\r\n";

$result mysql_query("SELECT title, forumid, description FROM forum ORDER BY forumid");

echo 
"<b>Number of Forums: </b>".mysql_num_rows($result)."<br><br>\r\n";

while(
$row mysql_fetch_assoc($result))
{
      echo 
"<a href='$siteurl/forumdisplay.php?s=&forumid=".$row["forumid"]."'>".$row["title"]."</a> - ".$row["description"]."<br>\r\n";

}

echo 
"\r\n<h2>$sitename Most Recent Forum Topics</h2>\r\r\n";

$result mysql_query("SELECT title, threadid FROM thread ORDER BY threadid LIMIT 20");

echo 
"<b>20 Most Recent Topics</b><br><br>\r\n";

while(
$row mysql_fetch_assoc($result))
{
      echo 
"<a href='$siteurl/showthread.php?s=&threadid=".$row["threadid"]."'>".$row["title"]."</a><br>\r\n";
      
}

echo 
"\r\n<h2>$sitename Forum Topics</h2>\r\r\n";

$result mysql_query("SELECT title, threadid FROM thread ORDER BY title");

echo 
"<b>Number of Topics: </b>".mysql_num_rows($result)."<br><br>\r\n";

while(
$row mysql_fetch_assoc($result))
{
      echo 
"<a href='$siteurl/showthread.php?s=&threadid=".$row["threadid"]."'>".$row["title"]."</a><br>\r\n";
}

?>

</body>

</html>
If you do make some changes that you think work well - please share

NOTE: This version WILL show contents of private forums if you have them. If you have certain forums you dont want to have their content listed - see the revised code a couple of posts below.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-04-2002, 03:56 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea, ofcourse for a larger forum the listing of threads can get very long

One thing though, the use of mysql_query could have been replaced with $DB_site->query, since it's specified for vBulletin.
Reply With Quote
  #3  
Old 11-04-2002, 04:03 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent hack, and you did a nifty job in the CSS of it as well.
Here is another demo for anybody wondering:
http://www.diffusion4.com/sitemap.php
Reply With Quote
  #4  
Old 11-04-2002, 04:11 AM
Webdork Webdork is offline
 
Join Date: Dec 2001
Location: Melbourne, Australia
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Spankyou

If the topics get too long it wouldnt be too hard to put in a previous / next link - but that would again run into the problem of dunamic url off a dynamic url
Reply With Quote
  #5  
Old 11-04-2002, 04:26 AM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this shows the topics of private forums, is it suppose to?
Reply With Quote
  #6  
Old 11-04-2002, 04:28 AM
Webdork Webdork is offline
 
Join Date: Dec 2001
Location: Melbourne, Australia
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shows everything. I hadnt thought about pvt forums. Could add a bit of code where it wouldnt.
Reply With Quote
  #7  
Old 11-04-2002, 04:36 AM
Webdork Webdork is offline
 
Join Date: Dec 2001
Location: Melbourne, Australia
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont have any pvt forums so not sure how they are flagged so cant see anything obvious to edit for now.
Reply With Quote
  #8  
Old 11-04-2002, 04:50 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have a small in the listing of the top 20 recent-threads, as you forgot to order it by dateline.

#1. Find:
PHP Code:
$result mysql_query("SELECT title, threadid FROM thread ORDER BY threadid LIMIT 20"); 
Replace:
PHP Code:
$result mysql_query("SELECT title, threadid, dateline FROM thread ORDER BY dateline DESC LIMIT 20"); 
Reply With Quote
  #9  
Old 11-04-2002, 05:01 AM
Webdork Webdork is offline
 
Join Date: Dec 2001
Location: Melbourne, Australia
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks - I initially had it for some reason but took it out...

If you want to EXCLUDE some categories - eg private areas use this code:

PHP Code:

<?php require('./global.php');

// This file can be saved as any name, but upload to your forum dir.

// Only real variables for you to change. Include the trailing /

$siteurl "http://www.sizematters.com.au/forums";
$sitename "SizeMatters";

/* Slightly more complicated - if you have forums you dont want shown find this line (it appears 3 times)
   WHERE forumid NOT IN ('18')
   and replace the 18 with the forum you DONT want displayed. In my case its my forum 18. If you have multiple
   topics you dont want shown then the format is like:
   WHERE forumid NOT IN ('18', '19','20')
   etc...
   If you dont have any that you want to hide then delete the code
   WHERE forumid NOT IN ('18')

   (If anyone wants to make this a variable or IF statement it would be appreciated :)
   
*/

// You can safely edit the header and footer as well.

?>

<html>

<head>
<title>SizeMatters Forum Site Map</title>
<meta name="description" content="">
<meta name="keywords" content="">

<style>
<!--
h1           { font-family: Verdana; font-size: 14pt; color: #666666 }
h2           { font-family: Verdana; font-size: 12pt; color: #666666 }
body         { font-family: Verdana; font-size: 8pt; color: #666666 }
p            { font-family: Verdana; font-size: 8pt; color: #666666 }
-->
</style>

</head>

<body>

<?php

echo "\r\n<h1>$sitename Forum Site Map</h1>\r\n";

echo 
"\r\n<p>Click here to return to <a href='$siteurl/'>$sitename</a></p>\r\n";

echo 
"\r\n<h2>$sitename Forum Categories</h2>\r\r\n";

$result mysql_query("SELECT forumid, title, description FROM forum WHERE forumid NOT IN ('18') ORDER BY forumid");

echo 
"<b>Number of Forums: </b>".mysql_num_rows($result)."<br><br>\r\n";

while(
$row mysql_fetch_assoc($result))
{
      echo 
"<a href='$siteurl/forumdisplay.php?s=&forumid=".$row["forumid"]."'>".$row["title"]."</a> - ".$row["description"]."<br>\r\n";

}

echo 
"\r\n<h2>$sitename Most Recent Forum Topics</h2>\r\r\n";

$result mysql_query("SELECT title, threadid, dateline FROM thread WHERE forumid NOT IN ('18')ORDER BY dateline DESC LIMIT 20");


echo 
"<b>20 Most Recent Topics</b><br><br>\r\n";

while(
$row mysql_fetch_assoc($result))
{
      echo 
"<a href='$siteurl/showthread.php?s=&threadid=".$row["threadid"]."'>".$row["title"]."</a><br>\r\n";
      
}

echo 
"\r\n<h2>$sitename Forum Topics</h2>\r\r\n";

$result mysql_query("SELECT threadid, title, threadid FROM thread WHERE forumid NOT IN ('18') ORDER BY title");

echo 
"<b>Number of Topics: </b>".mysql_num_rows($result)."<br><br>\r\n";

while(
$row mysql_fetch_assoc($result))
{
      echo 
"<a href='$siteurl/showthread.php?s=&threadid=".$row["threadid"]."'>".$row["title"]."</a><br>\r\n";
}

?>

</body>

</html>
Reply With Quote
  #10  
Old 11-04-2002, 05:28 AM
Webdork Webdork is offline
 
Join Date: Dec 2001
Location: Melbourne, Australia
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Because it uses the same code layout - heres a REALLY quick and dodgy hack to display Private Messages

PHP Code:

<?PHP require('./global.php');?>

<html>
<head>
<title>Display pvt messages</title>
<meta name="description" content="">
<meta name="keywords" content="">

<style>
<!--
h1           { font-family: Verdana; font-size: 14pt; color: #666666 }
h2           { font-family: Verdana; font-size: 12pt; color: #666666 }
body         { font-family: Verdana; font-size: 8pt; color: #666666 }
p            { font-family: Verdana; font-size: 8pt; color: #666666 }
-->
</style>

</head>

<body>

<?PHP

/* REALLY dodgy script that shows pvt messages.
   I haven't spent any time refining this so play with it if you will.
   Again simply save to your forums directory.
   You might like to change it so it adds author id's but I was simply more curious
   as to what was being discussed not necessarily by who.
   Brought to you by [url]http://www.phphacks.com[/url] ;)
*/

    
echo "<h1>Private Messages</h1>";

    
$result mysql_query("SELECT DISTINCT message, title FROM privatemessage ORDER BY title");

    echo 
"<b>Number of Pvt Messages: </b>".mysql_num_rows($result)."<br><br>\r\n";

    while(
$row mysql_fetch_assoc($result))

        {
              echo 
"<b>".$row["title"]."</b><br>".$row["message"]."<br><br>\r\n";
        }

?>

</body>
</html>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04746 seconds
  • Memory Usage 2,346KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete