Exemplo n.º 1
0
				}
				$fileName= $tpl['user']["user_id"].".$fileType";
				//require("../advertise/resizeImageAndSave.php");
				//resizeImageAndSave("tmp/", "collector/images/", $fileName, 200, 200);
				$res = imageMini::SaveSmallImage($path_on_server."tmp/", $path_on_server."images/",$fileName, 200, 200,false);	
				//var_dump($res );
				$data_update = array();
				$tpl['user']['data']['photo']=$data_update['photo'] = $fileName;
				//var_dump($fileName);	
				$user_class->updateUser($data_update);
			}					
		}		
	}

	require_once($cfg['path'].'/models/collector.php');
	$collectors_class = new model_collectors($db_class);
	$tpl['user']["collectors"]['interests'] = array();
	$collector_info = array();
	$collector_info['user'] = $tpl['user']['user_id'];
	for ($i=1; $i<=sizeof($interests); $i++){
		if(isset($_REQUEST['interest'.$i])&&$_REQUEST['interest'.$i]){
			$collector_info['interest'.$i] = 1;
			$tpl['user']["collectors"]['interests'][] = $i;
		} else 	$collector_info['interest'.$i] = 0;		
	}
	if(!$tpl['user']["collectors"]['id'] ){
		//add
		$collector_info['date'] = time();
		$tpl['user']["collectors"] = $collectors_class->addCollector($collector_info);
	} else {
		//edit
Exemplo n.º 2
0
<? 

$user_to = (int) request('user_to');
$collectors_message = (int) request('collectors_message');
$topic  = request('topic');
$details = request('details'); 
//$user_to = '352480';
require_once($cfg['path'].'/models/collector.php');
require_once($cfg['path'].'/models/mails.php');

$mail_class = new Mails();

$collectors_class = new model_collectors($db_class);

$tpl['collector']['errors'] = array();

$error = false;

if (!$tpl['user']['user_id']){
	$tpl['collector']['no_auth'] = true;
	$error = true;
}

if(!$error&&$collectors_message){
	//получаем автора
	$message_data = $user_class->Message_show($collectors_message);
	if(!$message_data){
		$tpl['collector']['mess_error'] = "Сообщения не существует";
		$error = true;
	} else if($message_data["user_to"]!=$tpl['user']['user_id']){
		$tpl['collector']['mess_error'] = "Вы пытаетесь ответить на сообщение, адресованное другому пользователю";