Hi I have been trying to integrate my module pages into the gsitemap.php Just been running into some problems.
I was trying to include class.module.inc.php but this creates a conflict trying to redefine cmsobject.
To make this work i need to use these two functions:
GetPreference
CreateLink
Any ideas on how to get this to work.
Gsitemap with my module
Re: Gsitemap with my module
I think there is not a standard way to fix it, but:
You can check is the object is defined in the core files that instantiate this object, use something like
You can check is the object is defined in the core files that instantiate this object, use something like
Code: Select all
if (!is_object($obj)
{
$obj - new Obj()
}
Re: Gsitemap with my module
Ok that is a pain in the butt. Maybe this is something that can or should be added to the CMS, it would open up modules to be added to the google site map.
I am pretty sure this would help users sites rankings especially if news could be added to this.
I am pretty sure this would help users sites rankings especially if news could be added to this.
Re: Gsitemap with my module
Hi,
(I will assume your gsitemap.php is the Google Sitemap Plugin by Noll & co., and I will also assume that I understand what you mean)
The php file loads the basic include file, which also means $gCms, so you can access any module using :
or (not tested for error notices, but should be ok)
Where "your code" could be a call to an action if your module has, like mines, an action to output a sitemap :
or otherwise acces the tables manually :
Pierre-Luc
(I will assume your gsitemap.php is the Google Sitemap Plugin by Noll & co., and I will also assume that I understand what you mean)
The php file loads the basic include file, which also means $gCms, so you can access any module using :
Code: Select all
if( isset($gCms->modules[$modulename])
&& $gCms->modules[$modulename]["active"]
&& $themodule = $gCms->modules[$modulename]["object"]
){
// your code
}
Code: Select all
if( $themodule = $gCms->GetModuleInstance[$modulename] ){
// your code
}
Code: Select all
$themodule->DoAction("sitemap", "", $params);
Code: Select all
$db = $gCms->GetDb();
$query = "SELECT news_id, news_title FROM ".cms_db_prefix()."module_news"; // just an example...
$dbresult = $db->Execute($query);
while ($dbresult && $row = $dbresult->FetchRow()){
// print out your <url> tag
}';