<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Message extends CI_Controller {

	public function addmessage($view, $text, $username) 
	{
		$text = urldecode($text);
		$this->message_model->addmessage($view,$text,$username);
	}

	public function delmessage($id = 0)
	{
		if($this->message_model->is_have($id))
		{
			$this->message_model->delete($id);
		}
	}

	public function find_name($str) 
	{
		$name_list = array();
		$count = substr_count($str,'@');
		for ($i=0; $i < $count; $i++) { 
			$domain = strstr($str, '@');
			$len    = strpos($domain," ");
			$name   = substr($domain, 1, $len);
			$str    = substr($domain, 1);
			array_push($name_list,$name);
		}
		return $name_list;
	}
}

/* End of file xixi.php */
/* Location: ./application/controllers/xixi.php */