I thought ManualSitemap was great but it had some flaws. I don't want do update it manualy. I want it to update itself. I did some haxing and now my Mediawiki sitemap works like a charm.
This is what i did:
I rewrote the wfExtensionSpecialManualSitemap-function in ManualSitemap.php to:
function wfExtensionSpecialManualSitemap() {
global $wgMessageCache,$IP,$wgGroupPermissions;
$wgMessageCache->addMessages(array('manualsitemap' => 'Manual Sitemap'));
//$wgAvailableRights[] = 'manualsitemap';
//$wgGroupPermissions['bureaucrat']['manualsitemap'] = true;
//$wgGroupPermissions['*']['manualsitemap'] = true;
SpecialPage::addPage( new SpecialPage( 'ManualSitemap' , '',true,false,$IP.'/extensions
/ManualSitemap/SpecialManualSitemap.php') );
}
Then i put a "This IP only filter" in SpecialManualSitemap.php,
function ManualSitemapPage() {
//added the following to lines in ManualSitemapPage-function
if($_SERVER["REMOTE_ADDR"]!="AA.BB.CC.DD"){//Replace AA.BB.CC.DD with your IP
header("Location: /wiki/Main_Page");
}
In the initialize-function is the form written out. Comment out the two lines below. When you do this, you dont have to post the form. The sitemap is created with the default values.
//if(!($request->getText( 'wpSortCriterion' )))
//return;
If you want to, you can change de default values. Locate the following lines in the beginning of SpecialManualSitemap.php and change them as you please.
var $DEFAULT_PRIORITY = 0.5;
var $DEFAULT_CHANGE_FREQ = "daily";
var $file_handle;
var $file_exists;
var $count, $cursor_pos = 0;
var $form_action;
var $article_priorities = "linear";
var $estimate_change_freq = false;
var $sorting_criterion = "POP";
If you now setup a cronjob to load the /wiki/Special:ManualSitemap the sitemap will be updated. Remember that the IP you specified must be the same IP as the computer with the cronjob. Now is your mediawiki

Post new comment