Martes, 30 Septiembre 2014 15:50
beggarly

Modification date always "now"

Report Xmap bugs on this forum.

Modification date always "now"

Postby lwillis » Mon Apr 28, 2008 8:33 pm

I don't really use content categories etc. on my site and my menus just contain links to individual content items. When I look at my sitemap, the modification dates always say the date and time that you request the sitemap. Eg. If I load my sitemap now (The XML version), then all of my content items are listed with a modification date of

Code: Select all
<lastmod>2008-04-28T20:30:47Z</lastmod>


Do I have to change a setting somewhere? Or is this a bug?
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm

Re:Modification date always "now"

Postby lwillis » Mon Apr 28, 2008 9:01 pm

I've done some digging, and the following changes seem to make it work for me.

In administrator/components/com_xmap/extensions/com_content.php, line 102:
Add an extra case statement for "content_item_link", e.g.

Code: Select all

         break;
         case 'content_typed':
         case 'content_item_link':
            global $database;
            $database->setQuery("SELECT modified, created FROM #__content WHERE id=". $id);
            $database->loadObject( $item );
            if( $item->modified == '0000-00-00 00:00:00' )
               $item->modified = $item->created;
            $parent->modified = xmap_com_content::toTimestamp( $item->modified );
         break;


Then, in components/com_xmap/xmap.php, around line 263, change the last chunk of the forach statement as follows:

Code: Select all

XmapPlugins::printTree( $this, $item, $cache, $plugins );       // Determine the menu entry's type and call it's handler
                        if (isset($item->modified))
                                $node->modified         = $item->modified;
                        $this->printNode($node);
                        $this->printMenuTree($node,$cache,$plugins);



I wasn't sure exactly what this code was doing - but it seemed to "print" the node before it had gone off and got the modification date, so I've re-ordered it a bit and it seems to work :)
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm


Return to Bugs



Who is online

Users browsing this forum: Bing [Bot] and 3 guests