Remository Plugin for Google Sitemap Generator Component
Marc
So after I completely relaunched icq-4u.com recently I was worried about google's ability of finding all my new pages on its own. Luckily there is a Mambo component called GSG (Google Sitemap Generator) which generates a google xml sitemap from all of the basic content. And because GSG allows enhancement with plugins, it is possible to add content from non-basic components such as Remository to the sitemap.
Note: Installation of GSG in Mambo seemed somewhat tricky at first. I had to copy the folders includes/domit and includes/patTemplate from a Joomla to my Mambo installation, but after that it worked fine!
I couldn't find a ready-to-download Remository plugin, so I made one myself. Please keep in mind that I do not have secret or non public folders in my Remository, so I do not check for these aspects when generating the links.
The following file should be called remository_map.class.php and copied to administrator/components/com_gsg/plugins/.
PHP:
-
/**
-
* Google Sitemap Generator.
-
* @version SVN $Id$
-
* @package gsg.org
-
* @author Todd Nine*
-
* @license Released under the terms of the GNU General Public License
-
* @abstract This class represends the required methods of a 3PC Implementations.
-
* Extend this class and override the method below.
-
**/
-
class remository_map extends GSGExtension{
-
-
/**
-
* Get the URLS from the 3PC.
-
* @return An array of URLResource objects.
-
*/
-
function getURLResources() {
-
global $database,
-
$mosConfig_live_site,
-
$mosConfig_absolute_path,
-
$gsg_url_changefreq,
-
$gsg_url_priority;
-
-
$database->setQuery("SELECT id FROM mos_menu WHERE link = 'index.php?option=com_remository'");
-
$Itemid = $database->loadResult();
-
-
$query = "SELECT f.* FROM mos_downloads_files AS f WHERE f.published=1 ORDER BY filetitle LIMIT 10";
-
-
$database->setQuery($query);
-
$rows = $database->loadObjectList();
-
-
$row = & $rows[$i];
-
$urlResource = new URLResource();
-
$urlResource->title = 'Download Files: '. $row->filetitle;
-
$urlResource->link = 'index.php?option=com_remository&Itemid='. $Itemid .'&func=fileinfo&id='. $row->id;
-
$urlResource->date = gsg :: showdate(0, 0, 1);
-
$urlResource->changeFreq = $gsg_url_changefreq;
-
$urlResource->priority = $gsg_url_priority;
-
$results[] = $urlResource;
-
-
}
-
-
// Getting the containers
-
$query2 = "SELECT * FROM mos_downloads_containers ORDER BY sequence, name";
-
-
$database->setQuery($query2);
-
$content_rows = $database->loadObjectList();
-
-
$row = & $content_rows[$i];
-
$urlResource = new URLResource();
-
$urlResource->title = 'Browse Files: '. $row->name;
-
$urlResource->link = 'index.php?option=com_remository&Itemid='. $Itemid .'&func=select&id='. $row->id;
-
$urlResource->date = gsg :: showdate(0, 0, 1);
-
$urlResource->changeFreq = $gsg_url_changefreq;
-
$urlResource->priority = $gsg_url_priority;
-
$results[] = $urlResource;
-
}
-
return $results;
-
}
-
-
/**
-
* @return The string description
-
*/
-
function getDescription() {
-
return "Creates Remository sitemap.";
-
}
-
-
}
-
?>
This will include nice Remository links in your GSG sitemaps it has been tested with Mambo 4.5.1 and Remository 3.41.
This will not make sef_ext-style links unless you modify certain GSG files. However, a workaround is possible which I could post if someone is interested.
Have fun!
