<?php

class text2html
{
	var $change_text 	= array();
	var $ini_array 		= array();

    function apply($text){
	
	//$text2html_url と　$text2html_dir_pathは必ず設定してください。
	//このディレクトリまでの絶対パスとURL
	
	$text2html_url 		= "";
	
	$text2html_dir_path = "";
	
		include_once(CORE_ROOT."/plugins/text2html/scripts/trans.php");

		$this->change_text = file(CORE_ROOT."/plugins/text2html/data/change.txt");
		
		foreach($this->change_text as $loop){
		
			if(strpos($loop,'#')){
				list($before,$after) = explode('#',$loop);
				
				$a[] = trim($after);
				$b[] = $before;
			}
			
		}
		
		$text = str_replace($b,$a,$text);


		$ini_array	= parse_ini_file(CORE_ROOT."/plugins/text2html/scripts/html.ini", true);
		$benchmark	= false;
		$obj		= new trans($text);
		$documents	= $obj->text2html();
		
		return $documents;

    }
}

?>