<?php

	class ArticleURL {
		public static function renderURLFromArticleName( $name , $langcode = 0 ) {
			if (!$langcode) $langcode = $GLOBALS["langcode"];

			$query = sprintf( "select larticle_url from larticles where
				article_id in (select article_id from articles where article_name='%s') and
				site_language_id = %d",
				FNTH_db_addslashes( $name ),
				$langcode );
			$row = FNTH_db_get_row( $query );
			if (!$row) {
				// FIXME fallback to normal url
				return false;
			}
			return $row["larticle_url"];
		}
	}


?>
