mirror of
				https://github.com/Mibew/java.git
				synced 2025-10-31 10:31:07 +03:00 
			
		
		
		
	extract update intervals into settings array
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@550 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
		
							parent
							
								
									79df1b80f1
								
							
						
					
					
						commit
						1c4d739f75
					
				| @ -142,7 +142,7 @@ function get_messages($threadid,$meth,$isuser,&$lastid) { | ||||
| } | ||||
| 
 | ||||
| function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agentid=null) { | ||||
| 	global $webim_encoding, $webimroot, $connection_timeout; | ||||
| 	global $webim_encoding, $webimroot, $connection_timeout, $settings; | ||||
| 	$threadid = $thread['threadid']; | ||||
| 	$istyping = abs($thread['current']-$thread[$isuser ? "lpagent" : "lpuser"]) < $connection_timeout | ||||
| 				&& $thread[$isuser?"agentTyping":"userTyping"] == "1" ? "1" : "0"; | ||||
| @ -157,6 +157,7 @@ function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agen | ||||
| 		} | ||||
| 		print("</thread>"); | ||||
| 	} else if( $format == "html" ) { | ||||
| 		loadsettings(); | ||||
| 		$output = get_messages($threadid,"html",$isuser,$lastid); | ||||
| 
 | ||||
| 		start_html_output(); | ||||
| @ -166,7 +167,7 @@ function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agen | ||||
| 			"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">". | ||||
| 			"<html>\n<head>\n". | ||||
| 			"<link href=\"$webimroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n". | ||||
| 			"<meta http-equiv=\"Refresh\" content=\"7; URL=$url&sn=11\">\n". | ||||
| 			"<meta http-equiv=\"Refresh\" content=\"".$settings['updatefrequency_oldchat']."; URL=$url&sn=11\">\n". | ||||
| 			"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n". | ||||
| 			"<title>chat</title>\n". | ||||
| 			"</head>\n". | ||||
| @ -330,6 +331,7 @@ function setup_chatview_for_user($thread,$level) { | ||||
| 	$page['isOpera95'] = is_agent_opera95(); | ||||
| 	$page['neediframesrc'] = needsFramesrc(); | ||||
| 
 | ||||
| 	$page['frequency'] = $settings['updatefrequency_chat']; | ||||
| } | ||||
| 
 | ||||
| function load_canned_messages($locale, $groupid) { | ||||
| @ -393,6 +395,7 @@ function setup_chatview_for_operator($thread,$operator) { | ||||
| 	$page['redirectLink'] = "$webimroot/operator/agent.php?".$params."&act=redirect"; | ||||
| 
 | ||||
| 	$page['namePostfix'] = ""; | ||||
| 	$page['frequency'] = $settings['updatefrequency_chat']; | ||||
| } | ||||
| 
 | ||||
| function update_thread_access($threadid, $params, $link) { | ||||
|  | ||||
| @ -553,7 +553,6 @@ $settings = array( | ||||
| 	'chattitle' => 'Live Support', | ||||
| 	'geolink' => 'http://api.hostip.info/get_html.php?ip={ip}', | ||||
| 	'geolinkparams' => 'width=440,height=100,toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1', | ||||
| 	'online_timeout' => 30,		/* Timeout (in seconds) when online operator becomes offline */ | ||||
| 	'max_uploaded_file_size' => 100000, | ||||
| 	'max_connections_from_one_host' => 10, | ||||
| 
 | ||||
| @ -572,6 +571,11 @@ $settings = array( | ||||
| 		'surveyaskgroup' => '1', | ||||
| 		'surveyaskmessage' => '0', | ||||
| 	'enablepopupnotification' => '0', | ||||
| 
 | ||||
| 	'online_timeout' => 30,		/* Timeout (in seconds) when online operator becomes offline */ | ||||
| 	'updatefrequency_operator' => 2, | ||||
| 	'updatefrequency_chat' => 2, | ||||
| 	'updatefrequency_oldchat' => 7, | ||||
| ); | ||||
| $settingsloaded = false; | ||||
| $settings_in_db = array(); | ||||
|  | ||||
| @ -22,7 +22,8 @@ function demo_print_message($msg,$format) { | ||||
| } | ||||
| 
 | ||||
| function demo_process_thread($act,$outformat,$lastid,$isuser,$canpost,$istyping,$postmessage) { | ||||
| 	global $kind_for_agent, $kind_info, $kind_events, $kind_user, $kind_agent, $webimroot; | ||||
| 	global $kind_for_agent, $kind_info, $kind_events, $kind_user, $kind_agent, $webimroot, $settings; | ||||
| 	loadsettings(); | ||||
| 	if( $act == "refresh" || $act == "post" ) { | ||||
| 		$lastid++; | ||||
| 		if($outformat == "xml") { | ||||
| @ -36,7 +37,7 @@ function demo_process_thread($act,$outformat,$lastid,$isuser,$canpost,$istyping, | ||||
| 				"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">". | ||||
| 				"<html>\n<head>\n". | ||||
| 				"<link href=\"$webimroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n". | ||||
| 				"<meta http-equiv=\"Refresh\" content=\"7; URL=$url&sn=11\">\n". | ||||
| 				"<meta http-equiv=\"Refresh\" content=\"".$settings['updatefrequency_oldchat']."; URL=$url&sn=11\">\n". | ||||
| 				"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n". | ||||
| 				"<title>chat</title>\n". | ||||
| 				"</head>\n". | ||||
|  | ||||
| @ -36,6 +36,7 @@ if($settings['enablegroups'] == '1') { | ||||
| $page = array(); | ||||
| $page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1"; | ||||
| $page['showpopup'] = $settings['enablepopupnotification'] == '1' ? "1" : "0"; | ||||
| $page['frequency'] = $settings['updatefrequency_operator']; | ||||
| 
 | ||||
| prepare_menu($operator); | ||||
| start_html_output(); | ||||
|  | ||||
| @ -7,7 +7,7 @@ | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/common.js?v=161"></script> | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/brws.js?v=161"></script> | ||||
| <script type="text/javascript" language="javascript"><!-- | ||||
| var threadParams = { servl:"${webimroot}/thread.php",wroot:"${webimroot}",frequency:2,${if:user}user:"true",${endif:user}threadid:${page:ct.chatThreadId},token:${page:ct.token},cssfile:"${tplroot}/chat.css",ignorectrl:${page:ignorectrl} }; | ||||
| var threadParams = { servl:"${webimroot}/thread.php",wroot:"${webimroot}",frequency:${page:frequency},${if:user}user:"true",${endif:user}threadid:${page:ct.chatThreadId},token:${page:ct.token},cssfile:"${tplroot}/chat.css",ignorectrl:${page:ignorectrl} }; | ||||
| //--> | ||||
| </script> | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/chat.js?v=161"></script> | ||||
|  | ||||
| @ -7,7 +7,7 @@ | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/common.js?v=161"></script> | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/brws.js?v=161"></script> | ||||
| <script type="text/javascript" language="javascript"><!-- | ||||
| var threadParams = { servl:"${webimroot}/thread.php",wroot:"${webimroot}",frequency:2,${if:user}user:"true",${endif:user}threadid:${page:ct.chatThreadId},token:${page:ct.token},cssfile:"${tplroot}/chat.css",ignorectrl:${page:ignorectrl} }; | ||||
| var threadParams = { servl:"${webimroot}/thread.php",wroot:"${webimroot}",frequency:${page:frequency},${if:user}user:"true",${endif:user}threadid:${page:ct.chatThreadId},token:${page:ct.token},cssfile:"${tplroot}/chat.css",ignorectrl:${page:ignorectrl} }; | ||||
| //--> | ||||
| </script> | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/chat.js?v=161"></script> | ||||
|  | ||||
| @ -7,7 +7,7 @@ | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/common.js?v=161"></script> | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/brws.js?v=161"></script> | ||||
| <script type="text/javascript" language="javascript"><!-- | ||||
| var threadParams = { servl:"${webimroot}/thread.php",wroot:"${webimroot}",frequency:2,${if:user}user:"true",${endif:user}threadid:${page:ct.chatThreadId},token:${page:ct.token},cssfile:"${tplroot}/chat.css",ignorectrl:${page:ignorectrl} }; | ||||
| var threadParams = { servl:"${webimroot}/thread.php",wroot:"${webimroot}",frequency:${page:frequency},${if:user}user:"true",${endif:user}threadid:${page:ct.chatThreadId},token:${page:ct.token},cssfile:"${tplroot}/chat.css",ignorectrl:${page:ignorectrl} }; | ||||
| //--> | ||||
| </script> | ||||
| <script type="text/javascript" language="javascript" src="${webimroot}/js/chat.js?v=161"></script> | ||||
|  | ||||
| @ -31,7 +31,7 @@ var localized = new Array( | ||||
| ); | ||||
| var updaterOptions = { | ||||
| 	url:"<?php echo $webimroot ?>/operator/update.php",wroot:"<?php echo $webimroot ?>", | ||||
| 	agentservl:"<?php echo $webimroot ?>/operator/agent.php", | ||||
| 	agentservl:"<?php echo $webimroot ?>/operator/agent.php", frequency:<?php echo $page['frequency'] ?>,
 | ||||
| 	noclients:"<?php echo getlocal("clients.no_clients") ?>", havemenu: <?php echo $page['havemenu'] ?>, showpopup: <?php echo $page['showpopup'] ?> };
 | ||||
| //--></script>
 | ||||
| <script type="text/javascript" language="javascript" src="<?php echo $webimroot ?>/js/users.js?v=161"></script> | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user