Community Add-Ons
Dynamic SiteMap V 1.0
for osCommerce Online Merchant v2.2
This is based on the excellent SiteMap MS2 contriubtion.
It finds and builds links for all pages and infoboxes dynamically.
This is the same as below but I have added ssl linking to the main xml sitemap.
Some pages you always want to be linked via SSL, like Account information,Order History, etc. Determine if the resulting page link should be linked via SSL or not. This looks into each page only as far as the doctype tag and see if the breadcrumb link is SSL, if it reaches the doctype tag it exits and assumes nonssl.
NOT A FULL PACKAGE
To add Enable/Disable categories contribution compatibility
so dynamic Site Map does not show disabled categories... This should not have a negative effect on store without Enable/Disable categories contribution. Instructions for version 3 and version 2 of the contrib.
I do not like to do major upgrades and overwrites without knowing what I may be overwritting, the readme is accurate for installing, but here are the changes. pretty straightforward.
The Dynamic SiteMap version 3.2 uses PHP to write a short javascript that opens three small new browser windows pointed to the notification URLs of three different search engines: Google, Yahoo and Ask. I would have added MSN but they don't seem to support sitemap submission at this time. The search engines will display in these windows a notice of whether or not the new sitemap notification was successful. The script is activated when you click anywhere on the sitemap creation page. Therefore clicking any link on the sitemap creation page to return to other osCommerce activities will result in the sitemap submission notification windows being opened unless you have javascript turned off in your browser.
For those who are already using Dynamic SiteMap version 3.0 or 3.1 the only file that has changed is /catalog/admin/create_xml_sitemaps.php and therefore to upgrade the only thing you will need to do is replace this one file. The complete install is included here for new users.
I made a mistake earlier. Here is the proper code. Just overwrite the old code I wrote,
or place this where ever you want the articles to appear.
<?php
//ARTICLE MANAGER START
echo '<ul class="sitemap">';
echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, '',
'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a></li>' . "";
$topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " .
TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)
$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)
$languages_id . "' order by sort_order, td.topics_name");
if (tep_db_num_rows($topics_query) > 0) {
$row = 0;
while ($topics = tep_db_fetch_array($topics_query)) {
$row++;
echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $topics['topics_id'])
. '">' . $topics['topics_name'] . '</a></li>' . "";
}
}
echo '</ul>';
//ARTICLE MANAGER END
?>
The Dynamic SiteMap version 3.0 has been well received but we've had problems with the function that was supposed to automatically notify Google. The PHP file open of a web URL didn't seem to work on our server and we've found that other servers don't even permit this behavior.
This revised version fixes the problem by using PHP to write a short javascript that opens a small new browser window pointed to the correct Google notification URL. Google itself will display in this window a notice of whether or not the new sitemap notification was successful. The script is activated when you click anywhere on the sitemap creation page. Therefore clicking any link on the sitemap creation page to return to other osCommerce activities will result in the Google notification window being opened unless you have javascript turned off in your browser.
For those who are already using Dynamic SiteMap version 3.0 the only file that has changed is /catalog/admin/create_xml_sitemaps.php and therefore to upgrade the only thing you will need to do is replace this one file. The complete install is included here for new users.
We've used the Dynamic SiteMap 2.0 for a while and liked the map it provided for users of our web site but needed something that would generate XML sitemaps for the search engines. I had also noticed that the category paths generated by Dynamic SiteMap weren't complete. Unfortunately I couldn't seem to find a contribution that provided both a user sitemap and a complete XML sitemap.
This version corrects the user sitemap with completely nested category links that will show the complete path in the navigation bar. Some extraneous code was removed from the file and all code for the catalog side dynamic sitemap has been condensed into one file rather than being spread among four files.
The ability to create XML sitemaps has been added to the admin side using the sitemap maintenance module provided by the dynamic sitemaps contribution as a starting point. Creating a new set of XML sitemaps is as simple as choosing file change frequencies and your time zone (or accepting the defaults) and clicking a button. Files excluded from the dynamic sitemap will also be excluded from the XML sitemap.
Many of the XML sitemap contributions I looked at create only partial sitemaps. One only listed products and left out the critical time zone information from the sitemap. Others I've seen only listed categories. This contribution creates a complete set of site maps that cover every possible page of your web site with a site map index to point search engines to the other site map files.
Every main page in your web site will be listed in the XML map except for those that you specifically mark as excluded in site map maintenance. Every in stock product will be listed in the XML maps as will every page of specials, categories and manufacturers. Note that means EVERY page of every category, special and manufacturer is listed. It doesn't point search engines to the first page and hope that they find the following pages themselves, it shows them where EVERYTHING is located. Since each type of sitemap is created in its own file only the largest of stores should have to worry about the site map files exceeding the 50,000 listing limit.
Simply add this to catalog/dynamic_sitemap.php where ever you want it to appear.
<?php
//ARTICLE MANAGER START
echo '<ul class="sitemap">';
echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, '',
'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a></li>' . "";
$topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " .
TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)
$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)
$languages_id . "' order by sort_order, td.topics_name");
if (tep_db_num_rows($topics_query) > 0) {
$row = 0;
while ($topics = tep_db_fetch_array($topics_query)) {
$row++;
echo '<li><a href="' . tep_href_link(FILENAME_ARTICLES, 'topics_id=' . $topics
['topics_id']) . '">' . $topics['topics_name'] . '</a></li>' . "";
}
}
echo '</ul>';
//ARTICLE MANAGER END
?>
If you want to have category links to be suitable and compatible with breadcrumb and other contribs (like some categories box enhancments and similar), which means to have complete links including the parent categories, you just need to make these few minor changes included below.
AUTHORS: wizaard (if) and funous (the others) ;)
-------------------------------------------------------------
HOW TO?
CHANGES TO catalog/includes/classes/category_tree.php
-------------------------------------------------------------
REPLACE:
function buildBranch($parent_id, $level = 0) {
WITH:
function buildBranch($parent_id, $level = 0, $p_category_link = false) {
ADD BELOW FOREACH FUNCTION (around line 23):
if ($parent_id == '0') {
$category_link = $category_id;
} else {
$category_link = $p_category_link . '_' . $category_id;
}
REPLACE:
$result .= $this->buildBranch($category_id, $level+1);}
WITH:
$result .= $this->buildBranch($category_id, $level+1, $category_link);}
---------------------------------------------------------------
THE END, ENJOY
MANUFACTURERS LIST FOR ANY VERSION OF DYNAMIC SITEMAP
---------------------------------------------------------
This is a very simple contribution but I hope it's gonna be
useful or interesting for many of you. It just adds the
list of product manufacturers to the Dynamic Sitemap
contribution. It uses only osCommerce MS2 standard functions,
so no other changes are needed. Just add the code below
(almost) anywhere to the dynamic_sitemap.php file and the
manufacturers list will be shown there.
For example I placed it into the left column under the
categories tree and it works and looks (I think) quite well.
But be aware - I'm no PHP coder, I'm very rookie boy, so if
anything doesn't work, don't be angry, but the probability
that something's gonna be wrong is (in my point of view) very
small.
So good luck and enjoy this simple contrib.
* AUTHOR: wizaard
* NATIONALITY: Czech
* E-MAIL: matej(dot)gottwald(at)tiscali(dot)cz
* HOMEPAGE: http://www.sweb.cz/M.Gottwald
---------------------------------------------------------
CODE TO ADD TO catalog/dynamic_sitemap.php:
---------------------------------------------------------
<?php
// MANUFACTURERS LIST START
echo '<ul class="sitemap">';
$manufacturers_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m order by m.manufacturers_name");
if (tep_db_num_rows($manufacturers_query) > 0) {
$row = 0;
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$row++;
echo '<li><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers['manufacturers_name'] . '</a></li>' . "n";
}
}
echo '</ul>';
// MANUFACTURERS LIST END
?>
---------------------------------------------------------
THE END, BYE BYE!
Revised install instructions as last set of instructions given were wrong.
hope this helps the noobs like myself
To add Enable/Disable categories contribution compatibility so dynamic Site Map does not show disabled categories...
in catalog/includes/classes/category_tree.php
change:
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.parent_id, c.sort_order, cd.categories_name");
to:
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.categories_status = '1' and cd.language_id = '" . (int)$languages_id . "' order by c.parent_id, c.sort_order, cd.categories_name");
if you want a right colum you will have to copy and paste the second coding into your catolog/dynamic_sitemap.php file.
I have a included only the file in this folder.
######NOT FULL PACKAGE#######
Thanks for a great contribution,
I download it today, and everything is work fine.
However I Site Map I need to be link to products, NOT to a
categories.
I made a minor changes, instead of links to categories ==> links to
products.
HOW TO INSTALL:
1. backup only one file: includesclassescategory_tree.php
2. DOWNLOAD THIS FILE.
3. overwrite /includes/classes/category_tree.php
USE IT ON YOUR OWN RISK.
ALWAYS BACKUP.
THIS IS NOT A FULL VERSION, PLEASE INSTALL PREVIOUS EDITION.
Paquete completo.
Arreglado error en admin/includes/boxes/tools.php
gracias a NELSON
----------------------------------------------------
Full pack
fixed bug (tnx NELSON).
Paquete original v 2.0
arreglado dos bug
aņadido idioma espanol
pack completo.
Sallen
In the readme -file has a typo:
"6) In admin/includes/boxes/tools.php..."
It should be:
admin/includes/languages/english.php (and in every other language file too)
[only fixed readme in this contribution]
This is the ungraded version of the dynamic sitemap. Fixed bugs with bad links and susbtitution symbols (%s) in names. Added admin interface for excluded files control. Exclude can be performed for all or for unregistered users only. Full package, english only.
This is a replacement for the /catalog/includes/classes/category_tree.php
With the old one it incorrectly generated the nested list for the categories so the html wasn't vaild.
This is only 1 file, for the full contribution please download v1.6 below.
if you are using"information pages unlimited" contribution and would like to have your pages listed in this great Dynamic site map.
Just replace catalog/dynamic_sitemap
with the one found in this zip.
Note that files will only be listed when status is set to active.
Fixed a few problems with display of the links and how the displayed links matched the actual pages (see suport thread for details).
This is a full package but all that was changed was the includes/modules/dynamic_sitemap.php file if you are looking to upgrade.
- Changed code to list filenames in the current language olf the shop.
-Added code to prevent false errors
Support Thread:
http://forums.oscommerce.com/index.php?showtopic=157547&st=0
Added compatibility with the "Enable/Disable Categories" module, so that disabled categories won't show on the site map.
This is a full package.
Added code to only look at files ending in .php.
This is a full package.
I forgot to actually add the changed file to V 1.1. This is a full package and contains the fix for invalid infoboxes.
Added code to indicate which infobox is causing a failure.
Support thread is at
http://forums.oscommerce.com/index.php?showtopic=157547&st=0&p=644909&#entry644909
This is based on the excellent SiteMap MS2 contriubtion.
It finds and builds links for all pages and infoboxes dynamically.
