Welcome Guest, Not a member yet? Register   Sign In
Sitemap generator
#1

[eluser]cmarra[/eluser]
Hello everyone, I'm trying to use Sitemap Generator http://codeigniter.com/wiki/Google% 20Sitemaps /
everything works but I want to ensure that when the system enters a data in the database then I should rebuild the sitemap ...

I would like to make this controller without cron script ...

any ideas?
#2

[eluser]wingdspur[/eluser]
Make sure that the page db table you are using has a last_modified field and when ever a user adds a new page or updates a page, have it call the sitemap controller method to generate a new sitemap.xml in the background. So inside the controller method for adding/updating pages, just call the sitemap controller method that generates the new XML every time there is a new page added or an update to an existing page and make sure you are updating the last_modified timestamp field as well so that the sitemap that gets generated has an updated last_modified tag in the xml file.
#3

[eluser]cmarra[/eluser]
ok but you can call a controller in another controller? if you like?
#4

[eluser]wingdspur[/eluser]
Well you could just move the sitemap controller method into the same controller as your page controller and then do $this->sitemap();
#5

[eluser]cmarra[/eluser]
ok tnx 1000 Wink
#6

[eluser]InsiteFX[/eluser]
Create a MY_Controller

Then extend your controllers from the MY_Controller
this way you can add your site_map code to the MY_Controller
and it will be avaible to all your controllers and the whole
application.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB