mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-22 21:40:28 +03:00
fixed online/offline image for groups
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@523 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
84ef59b133
commit
54afb72e12
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
require_once('libs/common.php');
|
require_once('libs/common.php');
|
||||||
require_once('libs/operator.php');
|
require_once('libs/operator.php');
|
||||||
|
require_once('libs/groups.php');
|
||||||
|
|
||||||
$image = verifyparam("image","/^\w+$/", "webim");
|
$image = verifyparam("image","/^\w+$/", "webim");
|
||||||
$lang = verifyparam(isset($_GET['language']) ? "language" : "lang", "/^[\w-]{2,5}$/", "");
|
$lang = verifyparam(isset($_GET['language']) ? "language" : "lang", "/^[\w-]{2,5}$/", "");
|
||||||
@ -21,7 +22,20 @@ if(!$lang || !locale_exists($lang)) {
|
|||||||
$lang = $current_locale;
|
$lang = $current_locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
$image_postfix = has_online_operators() ? "on" : "off";
|
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
||||||
|
if($groupid) {
|
||||||
|
loadsettings();
|
||||||
|
if($settings['enablegroups'] == '1') {
|
||||||
|
$group = group_by_id($groupid);
|
||||||
|
if(!$group) {
|
||||||
|
$groupid = "";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$groupid = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$image_postfix = has_online_operators($groupid) ? "on" : "off";
|
||||||
$filename = "locales/${lang}/button/${image}_${image_postfix}.gif";
|
$filename = "locales/${lang}/button/${image}_${image_postfix}.gif";
|
||||||
|
|
||||||
$fp = fopen($filename, 'rb') or die("no image");
|
$fp = fopen($filename, 'rb') or die("no image");
|
||||||
|
@ -43,16 +43,6 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !$thread ) {
|
if( !$thread ) {
|
||||||
if(!has_online_operators()) {
|
|
||||||
$page = array();
|
|
||||||
setup_logo();
|
|
||||||
$page['formname'] = topage(getgetparam('name'));
|
|
||||||
$page['formemail'] = topage($email);
|
|
||||||
$page['info'] = topage($info);
|
|
||||||
expand("styles", getchatstyle(), "leavemessage.tpl");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$groupid = "";
|
$groupid = "";
|
||||||
if($settings['enablegroups'] == '1') {
|
if($settings['enablegroups'] == '1') {
|
||||||
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
||||||
@ -64,6 +54,16 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!has_online_operators($groupid)) {
|
||||||
|
$page = array();
|
||||||
|
setup_logo();
|
||||||
|
$page['formname'] = topage(getgetparam('name'));
|
||||||
|
$page['formemail'] = topage($email);
|
||||||
|
$page['info'] = topage($info);
|
||||||
|
expand("styles", getchatstyle(), "leavemessage.tpl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$visitor = visitor_from_request();
|
$visitor = visitor_from_request();
|
||||||
$referer = isset($_GET['url']) ? $_GET['url'] :
|
$referer = isset($_GET['url']) ? $_GET['url'] :
|
||||||
(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "");
|
(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "");
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
[+] new permission: "Ability to modify profile"
|
[+] new permission: "Ability to modify profile"
|
||||||
[+] new project name: Mibew Messenger
|
[+] new project name: Mibew Messenger
|
||||||
[!] fixed localization of dates for all languages
|
[!] fixed localization of dates for all languages
|
||||||
|
[!] fixed online/offline image for groups
|
||||||
|
|
||||||
1.6.0
|
1.6.0
|
||||||
-----
|
-----
|
||||||
|
@ -110,11 +110,15 @@ function notify_operator_alive($operatorid) {
|
|||||||
mysql_close($link);
|
mysql_close($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function has_online_operators() {
|
function has_online_operators($groupid="") {
|
||||||
global $settings;
|
global $settings;
|
||||||
loadsettings();
|
loadsettings();
|
||||||
$link = connect();
|
$link = connect();
|
||||||
$row = select_one_row("select min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from chatoperator",$link);
|
$query = "select min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from chatoperator";
|
||||||
|
if($groupid) {
|
||||||
|
$query .= ", chatgroupoperator where groupid = $groupid and chatoperator.operatorid = chatgroupoperator.operatorid";
|
||||||
|
}
|
||||||
|
$row = select_one_row($query,$link);
|
||||||
mysql_close($link);
|
mysql_close($link);
|
||||||
return $row['time'] < $settings['online_timeout'];
|
return $row['time'] < $settings['online_timeout'];
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,11 @@ if( !$lang || !in_array($lang,$image_locales) )
|
|||||||
$file = "../locales/${lang}/button/${image}_on.gif";
|
$file = "../locales/${lang}/button/${image}_on.gif";
|
||||||
$size = get_gifimage_size($file);
|
$size = get_gifimage_size($file);
|
||||||
|
|
||||||
$message = get_image(get_app_location($showhost,$forcesecure)."/button.php?image=$image&lang=$lang",$size[0],$size[1]);
|
$imagehref = get_app_location($showhost,$forcesecure)."/button.php?image=$image&lang=$lang";
|
||||||
|
if($groupid) {
|
||||||
|
$imagehref .= "&group=$groupid";
|
||||||
|
}
|
||||||
|
$message = get_image($imagehref,$size[0],$size[1]);
|
||||||
|
|
||||||
$page = array();
|
$page = array();
|
||||||
$page['buttonCode'] = generate_button("",$lang,$style,$groupid,$message,$showhost,$forcesecure);
|
$page['buttonCode'] = generate_button("",$lang,$style,$groupid,$message,$showhost,$forcesecure);
|
||||||
|
Loading…
Reference in New Issue
Block a user