コード例 #1
0
ファイル: im.php プロジェクト: 221V/fastchat_kphp
		exit;
	break;

	default:

	$st_files = array('nano.js', 'nano.css', 'im.css', 'im.js', 'jquery.autosize.min.js');

	$msg_list = $im->get("topmsglist{$uid}#-1,-15");
	$exp = explode(',', $msg_list);

	if($exp[0] > 0){

		$res = $peers = array();

		$counts = get_new_counts($uid);
		$site_title = $counts['unicue'] > 0 ? gram($counts['unicue'], 'новое сообщение', 'новых сообщения', 'новых сообщений') : 'FastChat';

		for($i = 1; $i < count($exp); $i += 2){
			$msg_id = $exp[$i];
			$msg = $im->get("message{$uid}_{$msg_id}");
			$msg = explode("\t", $msg);

			$msg_data = explode(',', $msg[0]);

			if(count($msg) == 3) $msg_txt = $msg[2];
			else $msg_txt = $msg[1];

			$new_cnt = $counts['peers'][$msg_data[2]];
			
			$res[] = array(
				'ts' => $msg_data[1],
コード例 #2
0
ファイル: friends.php プロジェクト: 221V/fastchat_kphp
			$sql_ = mysql_query("SELECT uid, name, lname, last_update FROM `users` WHERE uid IN ({$ids})", 1);
			$ids = false;

			foreach($sql_ as $row){
				tpl_set(array(
					'{name}' => $row['name'].' '.$row['lname'],
					'{online}' => $row['last_update'] > $online_time ? 'online' : '',
					'{id}' => $row['uid']
				));
				tpl_make('res');
			}
		}else $tpl_res['res'] = '<div class="info_center" style="padding: 100px 0;">У вас нет друзей</div>';

		tpl_load('friends/head');
		tpl_set(array(
			'{res}' => $tpl_res['res'],
			'{cnt}' => $cnt > 0 ? gram($cnt, 'друг', 'друга', 'друзей') : 'нет друзей',
			'{load_but}' => $cnt > 15 ? '' : ' no_display',
			'{req_cnt}' => $uinfo['friends_request'] > 0 ? '+'.$uinfo['friends_request'] : ''
		));
		tpl_make('cont');

		$initJS = 'friends.uid = '.$get_id.';
friends.tpl = \''.$friends_tpl.'\';
friends.loadFriends();
friends.req_tpl = \'<div class="one_request" id="req{id}"><img src="/img/camera_100.gif" class="fl_l"><div class="cont fl_l"><div class="name"><a href="/">{name}</a></div><div class="online">{online}</div><div class="buttons"><button class="button fl_l" onClick="friends.accept({id});">Принять</button><button class="button inline fl_l" onClick="friends.reject({id});">Откланить</button><div class="clear"></div></div></div><div class="clear"></div></div>\'';
	}
}else{
	tpl_load('nolog_err');
	tpl_make('cont');
}