Sitemap Generator in Yii


(foe#1) #1

I have created a simple and basic XML sitemap generator.

Check it out at http://gemisoft.com/tools/index.html

I would like to make changes as per your feedback

Thanks :)


(Darknsf) #2

Nice work, I submitted a test request.


(Darknsf) #3

a few suggestions:

other than that, looks pretty solid.


(foe#1) #4

Both of your suggestions will be incorporated. Thank you.


(foe#1) #5

I have about 100,000 URLs from one website.

My problem is, it takes couple of minutes to get the data. I think it is taking longer at pagination. All indexes added. However, the first page loads fast. Any idea how I can make this efficient. I am using InnoDB




	public function actionSitemapLinks()

	{   

		$condition = 'off=0';

		$this->getHulkLinks($condition, $redir='SitemapLinks');

	}


	private function getHulkLinks($condition, $redir)

	{

		$HR = $this->getValidHR();

		$name = $HR->name;

		

		$criteria=new CDbCriteria;

	    $criteria->condition = $condition.' AND rid='.$HR->id;;

		$criteria->order     = 'h_level, url, h_order, pid';


		$pages=new CPagination(hulk_links::model()->count($criteria));

		$pages->pageSize=self::PAGE_SIZE;

		if ($_GET['cp']) $pages->currentPage=$_GET['cp'];

		$pages->applyLimit($criteria);

		

		$sort=new CSort('hulk_links');

		$sort->applyOrder($criteria);

		

		$models=hulk_links::model()->findAll($criteria);

        

		if ($redir==ErrorLinks)

			$this->render('validated_errors',array('models'=>$models,'pages'=>$pages,'sort'=>$sort,'name'=>$name,'redir'=>$redir));

		else

			$this->render('validated',array('models'=>$models,'pages'=>$pages,'sort'=>$sort,'name'=>$name,'redir'=>$redir));

	}





(foe#1) #6

Thanks for testing this tools. I had tested with small site only. The two huge request submits gave me opportunity to sort out some bugs. The pagination is now faster after dropping the order clause.

  • Fixed with a quick patch

(Logity) #7

Got this error

Alias "application.components.email_template.Email_template" is invalid. Make sure it points to an existing PHP file.