phpfreechat-svn Mailing List for phpFreeChat (Page 11)
Status: Beta
Brought to you by:
kerphi
You can subscribe to this list here.
2006 |
Jan
|
Feb
(2) |
Mar
|
Apr
(61) |
May
(56) |
Jun
(96) |
Jul
(23) |
Aug
(62) |
Sep
(76) |
Oct
(48) |
Nov
(28) |
Dec
(28) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(31) |
Feb
(40) |
Mar
(29) |
Apr
(11) |
May
(6) |
Jun
(18) |
Jul
(18) |
Aug
(108) |
Sep
(24) |
Oct
(6) |
Nov
(21) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(16) |
Apr
|
May
(3) |
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(3) |
Dec
(2) |
2009 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ke...@us...> - 2007-06-07 09:50:35
|
Revision: 1029 http://svn.sourceforge.net/phpfreechat/?rev=1029&view=rev Author: kerphi Date: 2007-06-07 02:50:35 -0700 (Thu, 07 Jun 2007) Log Message: ----------- [en] Bug fix: workaround for Firefox when 'HTTP only' cookies are in use like in IPB (thanks to Karl Buckland) [fr] Bug fix : contournement d'un probl?\195?\168me dans Firefox avec les 'HTTP only cookies' qui sont utilis?\195?\169s dans IPB (merci ?\195?\160 Karl Buckland) Modified Paths: -------------- trunk/data/public/js/compat.js Modified: trunk/data/public/js/compat.js =================================================================== --- trunk/data/public/js/compat.js 2007-05-20 19:58:45 UTC (rev 1028) +++ trunk/data/public/js/compat.js 2007-06-07 09:50:35 UTC (rev 1029) @@ -3,6 +3,9 @@ { read: function (name) { + // Work around for Firefox when 'HTTP only' cookies are in use + if (typeof(document.cookie) != "string" && navigator.product == "Gecko") delete HTMLDocument.prototype.cookie; + var arrCookies = document.cookie.split ('; '); for (var i=0; i<arrCookies.length; i++) { @@ -18,6 +21,9 @@ write: function (name, value, expires, path) { + // Work around for Firefox when 'HTTP only' cookies are in use + if (typeof(document.cookie) != "string" && navigator.product == "Gecko") delete HTMLDocument.prototype.cookie; + if (expires) { var date = new Date (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-05-20 19:58:47
|
Revision: 1028 http://svn.sourceforge.net/phpfreechat/?rev=1028&view=rev Author: kerphi Date: 2007-05-20 12:58:45 -0700 (Sun, 20 May 2007) Log Message: ----------- [en] Remove xajax dependencies, pfc only uses prototype js library. [6h45] [fr] Retire les d?\195?\169pendances avec la lib xajax, pfc n'utilise plus que la lib prototype. [6h45] [en] Bug fix: CSS selectors separated with comma didn't worked on IE6 [fr] Bug fix : les selecteurs CSS s?\195?\169par?\195?\169s par des virgules ne fonctionnaient pas sous IE6 Modified Paths: -------------- trunk/data/public/js/createstylerule.js trunk/data/public/js/myprototype.js trunk/data/public/js/pfcclient.js trunk/data/public/js/pfcgui.js trunk/demo/demo2_simple_with_params.php trunk/src/commands/redirect.class.php trunk/src/pfcglobalconfig.class.php trunk/src/phpfreechat.class.php trunk/src/proxies/lock.class.php trunk/themes/default/chat.js.tpl.php trunk/themes/default/style.css.php Added Paths: ----------- trunk/data/public/js/prototype.js trunk/src/pfcresponse.class.php Removed Paths: ------------- trunk/lib/xajax_0.5_beta1/ Modified: trunk/data/public/js/createstylerule.js =================================================================== --- trunk/data/public/js/createstylerule.js 2007-05-20 10:21:38 UTC (rev 1027) +++ trunk/data/public/js/createstylerule.js 2007-05-20 19:58:45 UTC (rev 1028) @@ -24,12 +24,16 @@ applyRule: function(selector, declaration) { - if (!this.is_iewin) { - var styleRule = document.createTextNode(selector + " {" + declaration + "}"); - this.style.appendChild(styleRule); // bugs in IE/Win + selector = selector.split(','); + for ( var i = 0; i < selector.length; i++) + { + if (!this.is_iewin) { + var styleRule = document.createTextNode(selector[i] + " {" + declaration + "}"); + this.style.appendChild(styleRule); // bugs in IE/Win + } + if (this.is_iewin && document.styleSheets && document.styleSheets.length > 0) { + this.lastStyle.addRule(selector[i], declaration); + } } - if (this.is_iewin && document.styleSheets && document.styleSheets.length > 0) { - this.lastStyle.addRule(selector, declaration); - } } } \ No newline at end of file Modified: trunk/data/public/js/myprototype.js =================================================================== --- trunk/data/public/js/myprototype.js 2007-05-20 10:21:38 UTC (rev 1027) +++ trunk/data/public/js/myprototype.js 2007-05-20 19:58:45 UTC (rev 1028) @@ -1,1502 +1,5 @@ -// modified prototype library -var Prototype = { - Version: '1.4.0', - ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', - emptyFunction: function() {}, - K: function(x) {return x} -} - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - } - } -} - -var Abstract = new Object(); - -Object.extend = function(destination, source) { - for (property in source) { - destination[property] = source[property]; - } - return destination; -} - -Object.inspect = function(object) { - try { - if (object == undefined) return 'undefined'; - if (object == null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } -} - -Function.prototype.bind = function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } -} - -Function.prototype.bindAsEventListener = function(object) { - var __method = this; - return function(event) { - return __method.call(object, event || window.event); - } -} - -Object.extend(Number.prototype, { - toColorPart: function() { - var digits = this.toString(16); - if (this < 16) return '0' + digits; - return digits; - }, - - succ: function() { - return this + 1; - }, - - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; - } -}); - -var Try = { - these: function() { - var returnValue; - - for (var i = 0; i < arguments.length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) {} - } - - return returnValue; - } -} - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create(); -PeriodicalExecuter.prototype = { - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.callback(); - } finally { - this.currentlyExecuting = false; - } - } - } -} - -/*--------------------------------------------------------------------------*/ - -function $() { - var elements = new Array(); - - for (var i = 0; i < arguments.length; i++) { - var element = arguments[i]; - if (typeof element == 'string') - element = document.getElementById(element); - - if (arguments.length == 1) - return element; - - elements.push(element); - } - - return elements; -} -Object.extend(String.prototype, { - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, - - stripScripts: function() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, - - extractScripts: function() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - }, - - evalScripts: function() { - return this.extractScripts().map(eval); - }, - - escapeHTML: function() { - var div = document.createElement('div'); - var text = document.createTextNode(this); - div.appendChild(text); - return div.innerHTML; - }, - - unescapeHTML: function() { - var div = document.createElement('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; - }, - - toQueryParams: function() { - var pairs = this.match(/^\??(.*)$/)[1].split('&'); - return pairs.inject({}, function(params, pairString) { - var pair = pairString.split('='); - params[pair[0]] = pair[1]; - return params; - }); - }, - - toArray: function() { - return this.split(''); - }, - - camelize: function() { - var oStringList = this.split('-'); - if (oStringList.length == 1) return oStringList[0]; - - var camelizedString = this.indexOf('-') == 0 - ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) - : oStringList[0]; - - for (var i = 1, len = oStringList.length; i < len; i++) { - var s = oStringList[i]; - camelizedString += s.charAt(0).toUpperCase() + s.substring(1); - } - - return camelizedString; - }, - - inspect: function() { - return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'"; - } -}); - -String.prototype.parseQuery = String.prototype.toQueryParams; - -var $break = new Object(); -var $continue = new Object(); - -var Enumerable = { - each: function(iterator) { - var index = 0; - try { - this._each(function(value) { - try { - iterator(value, index++); - } catch (e) { - if (e != $continue) throw e; - } - }); - } catch (e) { - if (e != $break) throw e; - } - }, - - all: function(iterator) { - var result = true; - this.each(function(value, index) { - result = result && !!(iterator || Prototype.K)(value, index); - if (!result) throw $break; - }); - return result; - }, - - any: function(iterator) { - var result = true; - this.each(function(value, index) { - if (result = !!(iterator || Prototype.K)(value, index)) - throw $break; - }); - return result; - }, - - collect: function(iterator) { - var results = []; - this.each(function(value, index) { - results.push(iterator(value, index)); - }); - return results; - }, - - detect: function (iterator) { - var result; - this.each(function(value, index) { - if (iterator(value, index)) { - result = value; - throw $break; - } - }); - return result; - }, - - findAll: function(iterator) { - var results = []; - this.each(function(value, index) { - if (iterator(value, index)) - results.push(value); - }); - return results; - }, - - grep: function(pattern, iterator) { - var results = []; - this.each(function(value, index) { - var stringValue = value.toString(); - if (stringValue.match(pattern)) - results.push((iterator || Prototype.K)(value, index)); - }) - return results; - }, - - include: function(object) { - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - }, - - inject: function(memo, iterator) { - this.each(function(value, index) { - memo = iterator(memo, value, index); - }); - return memo; - }, - - invoke: function(method) { - var args = $A(arguments).slice(1); - return this.collect(function(value) { - return value[method].apply(value, args); - }); - }, - - max: function(iterator) { - var result; - this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (value >= (result || value)) - result = value; - }); - return result; - }, - - min: function(iterator) { - var result; - this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (value <= (result || value)) - result = value; - }); - return result; - }, - - partition: function(iterator) { - var trues = [], falses = []; - this.each(function(value, index) { - ((iterator || Prototype.K)(value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - }, - - pluck: function(property) { - var results = []; - this.each(function(value, index) { - results.push(value[property]); - }); - return results; - }, - - reject: function(iterator) { - var results = []; - this.each(function(value, index) { - if (!iterator(value, index)) - results.push(value); - }); - return results; - }, - - sortBy: function(iterator) { - return this.collect(function(value, index) { - return {value: value, criteria: iterator(value, index)}; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - }, - - toArray: function() { - return this.collect(Prototype.K); - }, - - zip: function() { - var iterator = Prototype.K, args = $A(arguments); - if (typeof args.last() == 'function') - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - iterator(value = collections.pluck(index)); - return value; - }); - }, - - inspect: function() { - return '#<Enumerable:' + this.toArray().inspect() + '>'; - } -} - -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray - }); - -var $A = Array.from = function(iterable) { - if (!iterable) return []; - if (iterable.toArray) { - return iterable.toArray(); - } else { - var results = []; - for (var i = 0; i < iterable.length; i++) - results.push(iterable[i]); - return results; - } -} - -//Array.prototype._reverse = Array.prototype.reverse; - -//Object.extend(Array.prototype, Enumerable); -/* -Array.prototype._reverse = Array.prototype.reverse; - - -Object.extend(Array.prototype, { - _each: function(iterator) { - for (var i = 0; i < this.length; i++) - iterator(this[i]); - }, - - clear: function() { - this.length = 0; - return this; - }, - - first: function() { - return this[0]; - }, - - last: function() { - return this[this.length - 1]; - }, - - compact: function() { - return this.select(function(value) { - return value != undefined || value != null; - }); - }, - - flatten: function() { - return this.inject([], function(array, value) { - return array.concat(value.constructor == Array ? - value.flatten() : [value]); - }); - }, - - without: function() { - var values = $A(arguments); - return this.select(function(value) { - return !values.include(value); - }); - }, - - indexOf: function(object) { - for (var i = 0; i < this.length; i++) - if (this[i] == object) return i; - return -1; - }, - - reverse: function(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - }, - - shift: function() { - var result = this[0]; - for (var i = 0; i < this.length - 1; i++) - this[i] = this[i + 1]; - this.length--; - return result; - }, - - inspect: function() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - } -}); -*/ - - -var Hash = { - _each: function(iterator) { - for (key in this) { - var value = this[key]; - if (typeof value == 'function') continue; - - var pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - }, - - keys: function() { - return this.pluck('key'); - }, - - values: function() { - return this.pluck('value'); - }, - - merge: function(hash) { - return $H(hash).inject($H(this), function(mergedHash, pair) { - mergedHash[pair.key] = pair.value; - return mergedHash; - }); - }, - - toQueryString: function() { - return this.map(function(pair) { - return pair.map(encodeURIComponent).join('='); - }).join('&'); - }, - - inspect: function() { - return '#<Hash:{' + this.map(function(pair) { - return pair.map(Object.inspect).join(': '); - }).join(', ') + '}>'; - } -} - -function $H(object) { - var hash = Object.extend({}, object || {}); - Object.extend(hash, Enumerable); - Object.extend(hash, Hash); - return hash; -} -ObjectRange = Class.create(); -Object.extend(ObjectRange.prototype, Enumerable); -Object.extend(ObjectRange.prototype, { - initialize: function(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - }, - - _each: function(iterator) { - var value = this.start; - do { - iterator(value); - value = value.succ(); - } while (this.include(value)); - }, - - include: function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } -}); - -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -} - -document.getElementsByClassName = function(className, parentElement) { - var children = ($(parentElement) || document.body).getElementsByTagName('*'); - return $A(children).inject([], function(elements, child) { - if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) - elements.push(child); - return elements; - }); -} - -/*--------------------------------------------------------------------------*/ - -if (!window.Element) { - var Element = new Object(); -} - -Object.extend(Element, { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function() { - for (var i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); - Element[Element.visible(element) ? 'hide' : 'show'](element); - } - }, - - hide: function() { - for (var i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); - element.style.display = 'none'; - } - }, - - show: function() { - for (var i = 0; i < arguments.length; i++) { - var element = $(arguments[i]); - element.style.display = ''; - } - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - }, - - update: function(element, html) { - $(element).innerHTML = html.stripScripts(); - setTimeout(function() {html.evalScripts()}, 10); - }, - - getHeight: function(element) { - element = $(element); - return element.offsetHeight; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - return Element.classNames(element).include(className); - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - return Element.classNames(element).add(className); - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - return Element.classNames(element).remove(className); - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - for (var i = 0; i < element.childNodes.length; i++) { - var node = element.childNodes[i]; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - Element.remove(node); - } - }, - - empty: function(element) { - return $(element).innerHTML.match(/^\s*$/); - }, - - scrollTo: function(element) { - element = $(element); - var x = element.x ? element.x : element.offsetLeft, - y = element.y ? element.y : element.offsetTop; - window.scrollTo(x, y); - }, - - getStyle: function(element, style) { - element = $(element); - var value = element.style[style.camelize()]; - if (!value) { - if (document.defaultView && document.defaultView.getComputedStyle) { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css.getPropertyValue(style) : null; - } else if (element.currentStyle) { - value = element.currentStyle[style.camelize()]; - } - } - - if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) - if (Element.getStyle(element, 'position') == 'static') value = 'auto'; - - return value == 'auto' ? null : value; - }, - - setStyle: function(element, style) { - element = $(element); - for (name in style) - element.style[name.camelize()] = style[name]; - }, - - getDimensions: function(element) { - element = $(element); - if (Element.getStyle(element, 'display') != 'none') - return {width: element.offsetWidth, height: element.offsetHeight}; - - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - els.visibility = 'hidden'; - els.position = 'absolute'; - els.display = ''; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = 'none'; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) { - element.style.top = 0; - element.style.left = 0; - } - } - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return; - element._overflow = element.style.overflow; - if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') - element.style.overflow = 'hidden'; - }, - - undoClipping: function(element) { - element = $(element); - if (element._overflow) return; - element.style.overflow = element._overflow; - element._overflow = undefined; - } -}); - -var Toggle = new Object(); -Toggle.display = Element.toggle; - -/*--------------------------------------------------------------------------*/ - -Abstract.Insertion = function(adjacency) { - this.adjacency = adjacency; -} - -Abstract.Insertion.prototype = { - initialize: function(element, content) { - this.element = $(element); - this.content = content.stripScripts(); - - if (this.adjacency && this.element.insertAdjacentHTML) { - try { - this.element.insertAdjacentHTML(this.adjacency, this.content); - } catch (e) { - if (this.element.tagName.toLowerCase() == 'tbody') { - this.insertContent(this.contentFromAnonymousTable()); - } else { - throw e; - } - } - } else { - this.range = this.element.ownerDocument.createRange(); - if (this.initializeRange) this.initializeRange(); - this.insertContent([this.range.createContextualFragment(this.content)]); - } - - setTimeout(function() {content.evalScripts()}, 10); - }, - - contentFromAnonymousTable: function() { - var div = document.createElement('div'); - div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>'; - return $A(div.childNodes[0].childNodes[0].childNodes); - } -} - -var Insertion = new Object(); - -Insertion.Before = Class.create(); -Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { - initializeRange: function() { - this.range.setStartBefore(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.parentNode.insertBefore(fragment, this.element); - }).bind(this)); - } -}); - -Insertion.Top = Class.create(); -Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { - initializeRange: function() { - this.range.selectNodeContents(this.element); - this.range.collapse(true); - }, - - insertContent: function(fragments) { - fragments.reverse(false).each((function(fragment) { - this.element.insertBefore(fragment, this.element.firstChild); - }).bind(this)); - } -}); - -Insertion.Bottom = Class.create(); -Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { - initializeRange: function() { - this.range.selectNodeContents(this.element); - this.range.collapse(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.appendChild(fragment); - }).bind(this)); - } -}); - -Insertion.After = Class.create(); -Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { - initializeRange: function() { - this.range.setStartAfter(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.parentNode.insertBefore(fragment, - this.element.nextSibling); - }).bind(this)); - } -}); - -/*--------------------------------------------------------------------------*/ - -Element.ClassNames = Class.create(); -Element.ClassNames.prototype = { - initialize: function(element) { - this.element = $(element); - }, - - _each: function(iterator) { - this.element.className.split(/\s+/).select(function(name) { - return name.length > 0; - })._each(iterator); - }, - - set: function(className) { - this.element.className = className; - }, - - add: function(classNameToAdd) { - if (this.include(classNameToAdd)) return; - this.set(this.toArray().concat(classNameToAdd).join(' ')); - }, - - remove: function(classNameToRemove) { - if (!this.include(classNameToRemove)) return; - this.set(this.select(function(className) { - return className != classNameToRemove; - }).join(' ')); - }, - - toString: function() { - return this.toArray().join(' '); - } -} - -Object.extend(Element.ClassNames.prototype, Enumerable); -var Field = { - clear: function() { - for (var i = 0; i < arguments.length; i++) - $(arguments[i]).value = ''; - }, - - focus: function(element) { - $(element).focus(); - }, - - present: function() { - for (var i = 0; i < arguments.length; i++) - if ($(arguments[i]).value == '') return false; - return true; - }, - - select: function(element) { - $(element).select(); - }, - - activate: function(element) { - element = $(element); - element.focus(); - if (element.select) - element.select(); - } -} - -/*--------------------------------------------------------------------------*/ - -var Form = { - serialize: function(form) { - var elements = Form.getElements($(form)); - var queryComponents = new Array(); - - for (var i = 0; i < elements.length; i++) { - var queryComponent = Form.Element.serialize(elements[i]); - if (queryComponent) - queryComponents.push(queryComponent); - } - - return queryComponents.join('&'); - }, - - getElements: function(form) { - form = $(form); - var elements = new Array(); - - for (tagName in Form.Element.Serializers) { - var tagElements = form.getElementsByTagName(tagName); - for (var j = 0; j < tagElements.length; j++) - elements.push(tagElements[j]); - } - return elements; - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) - return inputs; - - var matchingInputs = new Array(); - for (var i = 0; i < inputs.length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || - (name && input.name != name)) - continue; - matchingInputs.push(input); - } - - return matchingInputs; - }, - - disable: function(form) { - var elements = Form.getElements(form); - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - element.blur(); - element.disabled = 'true'; - } - }, - - enable: function(form) { - var elements = Form.getElements(form); - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - element.disabled = ''; - } - }, - - findFirstElement: function(form) { - return Form.getElements(form).find(function(element) { - return element.type != 'hidden' && !element.disabled && - ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); - }); - }, - - focusFirstElement: function(form) { - Field.activate(Form.findFirstElement(form)); - }, - - reset: function(form) { - $(form).reset(); - } -} - -Form.Element = { - serialize: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - var parameter = Form.Element.Serializers[method](element); - - if (parameter) { - var key = encodeURIComponent(parameter[0]); - if (key.length == 0) return; - - if (parameter[1].constructor != Array) - parameter[1] = [parameter[1]]; - - return parameter[1].map(function(value) { - return key + '=' + encodeURIComponent(value); - }).join('&'); - } - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - var parameter = Form.Element.Serializers[method](element); - - if (parameter) - return parameter[1]; - } -} - -Form.Element.Serializers = { - input: function(element) { - switch (element.type.toLowerCase()) { - case 'submit': - case 'hidden': - case 'password': - case 'text': - return Form.Element.Serializers.textarea(element); - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element); - } - return false; - }, - - inputSelector: function(element) { - if (element.checked) - return [element.name, element.value]; - }, - - textarea: function(element) { - return [element.name, element.value]; - }, - - select: function(element) { - return Form.Element.Serializers[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - }, - - selectOne: function(element) { - var value = '', opt, index = element.selectedIndex; - if (index >= 0) { - opt = element.options[index]; - value = opt.value; - if (!value && !('value' in opt)) - value = opt.text; - } - return [element.name, value]; - }, - - selectMany: function(element) { - var value = new Array(); - for (var i = 0; i < element.length; i++) { - var opt = element.options[i]; - if (opt.selected) { - var optValue = opt.value; - if (!optValue && !('value' in opt)) - optValue = opt.text; - value.push(optValue); - } - } - return [element.name, value]; - } -} - -/*--------------------------------------------------------------------------*/ - -var $F = Form.Element.getValue; - -/*--------------------------------------------------------------------------*/ - -Abstract.TimedObserver = function() {} -Abstract.TimedObserver.prototype = { - initialize: function(element, frequency, callback) { - this.frequency = frequency; - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - this.registerCallback(); - }, - - registerCallback: function() { - setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - onTimerEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - } -} - -Form.Element.Observer = Class.create(); -Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(); -Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = function() {} -Abstract.EventObserver.prototype = { - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - var elements = Form.getElements(this.element); - for (var i = 0; i < elements.length; i++) - this.registerCallback(elements[i]); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - case 'password': - case 'text': - case 'textarea': - case 'select-one': - case 'select-multiple': - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -} - -Form.Element.EventObserver = Class.create(); -Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(); -Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { - getValue: function() { - return Form.serialize(this.element); - } -}); -if (!window.Event) { - var Event = new Object(); -} - -Object.extend(Event, { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - - element: function(event) { - return event.target || event.srcElement; - }, - - isLeftClick: function(event) { - return (((event.which) && (event.which == 1)) || - ((event.button) && (event.button == 1))); - }, - - pointerX: function(event) { - return event.pageX || (event.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft)); - }, - - pointerY: function(event) { - return event.pageY || (event.clientY + - (document.documentElement.scrollTop || document.body.scrollTop)); - }, - - stop: function(event) { - if (event.preventDefault) { - event.preventDefault(); - event.stopPropagation(); - } else { - event.returnValue = false; - event.cancelBubble = true; - } - }, - - // find the first node with the given tagName, starting from the - // node the event was triggered on; traverses the DOM upwards - findElement: function(event, tagName) { - var element = Event.element(event); - while (element.parentNode && (!element.tagName || - (element.tagName.toUpperCase() != tagName.toUpperCase()))) - element = element.parentNode; - return element; - }, - - observers: false, - - _observeAndCache: function(element, name, observer, useCapture) { - if (!this.observers) this.observers = []; - if (element.addEventListener) { - this.observers.push([element, name, observer, useCapture]); - element.addEventListener(name, observer, useCapture); - } else if (element.attachEvent) { - this.observers.push([element, name, observer, useCapture]); - element.attachEvent('on' + name, observer); - } - }, - - unloadCache: function() { - if (!Event.observers) return; - for (var i = 0; i < Event.observers.length; i++) { - Event.stopObserving.apply(this, Event.observers[i]); - Event.observers[i][0] = null; - } - Event.observers = false; - }, - - observe: function(element, name, observer, useCapture) { - var element = $(element); - useCapture = useCapture || false; - - if (name == 'keypress' && - (navigator.appVersion.match(/Konqueror|Safari|KHTML/) - || element.attachEvent)) - name = 'keydown'; - - this._observeAndCache(element, name, observer, useCapture); - }, - - stopObserving: function(element, name, observer, useCapture) { - var element = $(element); - useCapture = useCapture || false; - - if (name == 'keypress' && - (navigator.appVersion.match(/Konqueror|Safari|KHTML/) - || element.detachEvent)) - name = 'keydown'; - - if (element.removeEventListener) { - element.removeEventListener(name, observer, useCapture); - } else if (element.detachEvent) { - element.detachEvent('on' + name, observer); - } - } -}); - -/* prevent memory leaks in IE */ -Event.observe(window, 'unload', Event.unloadCache, false); -var Position = { - // set to true if needed, warning: firefox performance problems - // NOT neeeded for page scrolling, only if draggable contained in - // scrollable elements - includeScrollOffsets: false, - - // must be called before calling withinIncludingScrolloffset, every time the - // page is scrolled - prepare: function() { - this.deltaX = window.pageXOffset - || document.documentElement.scrollLeft - || document.body.scrollLeft - || 0; - this.deltaY = window.pageYOffset - || document.documentElement.scrollTop - || document.body.scrollTop - || 0; - }, - - realOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return [valueL, valueT]; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return [valueL, valueT]; - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; - } - } while (element); - return [valueL, valueT]; - }, - - offsetParent: function(element) { - if (element.offsetParent) return element.offsetParent; - if (element == document.body) return element; - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return element; - - return document.body; - }, - - // caches x/y coordinate pair to use with overlap - within: function(element, x, y) { - if (this.includeScrollOffsets) - return this.withinIncludingScrolloffsets(element, x, y); - this.xcomp = x; - this.ycomp = y; - this.offset = this.cumulativeOffset(element); - - return (y >= this.offset[1] && - y < this.offset[1] + element.offsetHeight && - x >= this.offset[0] && - x < this.offset[0] + element.offsetWidth); - }, - - withinIncludingScrolloffsets: function(element, x, y) { - var offsetcache = this.realOffset(element); - - this.xcomp = x + offsetcache[0] - this.deltaX; - this.ycomp = y + offsetcache[1] - this.deltaY; - this.offset = this.cumulativeOffset(element); - - return (this.ycomp >= this.offset[1] && - this.ycomp < this.offset[1] + element.offsetHeight && - this.xcomp >= this.offset[0] && - this.xcomp < this.offset[0] + element.offsetWidth); - }, - - // within must be called directly before - overlap: function(mode, element) { - if (!mode) return 0; - if (mode == 'vertical') - return ((this.offset[1] + element.offsetHeight) - this.ycomp) / - element.offsetHeight; - if (mode == 'horizontal') - return ((this.offset[0] + element.offsetWidth) - this.xcomp) / - element.offsetWidth; - }, - - clone: function(source, target) { - source = $(source); - target = $(target); - target.style.position = 'absolute'; - var offsets = this.cumulativeOffset(source); - target.style.top = offsets[1] + 'px'; - target.style.left = offsets[0] + 'px'; - target.style.width = source.offsetWidth + 'px'; - target.style.height = source.offsetHeight + 'px'; - }, - - page: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - // Safari fix - if (element.offsetParent==document.body) - if (Element.getStyle(element,'position')=='absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } while (element = element.parentNode); - - return [valueL, valueT]; - }, - - clone: function(source, target) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || {}) - - // find page position of source - source = $(source); - var p = Position.page(source); - - // find coordinate system to use - target = $(target); - var delta = [0, 0]; - var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas - if (Element.getStyle(target,'position') == 'absolute') { - parent = Position.offsetParent(target); - delta = Position.page(parent); - } - - // correct by body offsets (fixes Safari) - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - // set position - if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if(options.setWidth) target.style.width = source.offsetWidth + 'px'; - if(options.setHeight) target.style.height = source.offsetHeight + 'px'; - }, - - absolutize: function(element) { - element = $(element); - if (element.style.position == 'absolute') return; - Position.prepare(); - - var offsets = Position.positionedOffset(element); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px';; - element.style.left = left + 'px';; - element.style.width = width + 'px';; - element.style.height = height + 'px';; - }, - - relativize: function(element) { - element = $(element); - if (element.style.position == 'relative') return; - Position.prepare(); - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - } -} - -// Safari returns margins on body which is incorrect if the child is absolutely -// positioned. For performance reasons, redefine Position.cumulativeOffset for -// KHTML/WebKit only. -if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { - Position.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return [valueL, valueT]; - } -} - - function indexOf(array, object) { for (var i = 0; i < array.length; i++) Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-05-20 10:21:38 UTC (rev 1027) +++ trunk/data/public/js/pfcclient.js 2007-05-20 19:58:45 UTC (rev 1028) @@ -159,9 +159,35 @@ */ handleResponse: function(cmd, resp, param) { + // display some debug messages if (pfc_debug) - if (cmd != "update") trace('handleResponse: '+cmd + "-"+resp+"-"+param); + if (cmd != "update") + { + var param2 = param; + if (cmd == "who" || cmd == "who2") + { + param2 = $H(param2); + param2['meta'] = $H(param2['meta']); + param2['meta']['users'] = $H(param2['meta']['users']); + trace('handleResponse: '+cmd + "-"+resp+"-"+param2.inspect()); + } + else + if (cmd == "whois" || cmd == "whois2") + { + param2 = $H(param2); + trace('handleResponse: '+cmd + "-"+resp+"-"+param2.inspect()); + } + else + if (cmd == "getnewmsg" || cmd == "join") + { + param2 = $A(param2); + trace('handleResponse: '+cmd + "-"+resp+"-"+param2.inspect()); + } + else + trace('handleResponse: '+cmd + "-"+resp+"-"+param); + } + // store the new refresh time this.last_response_time = new Date().getTime(); @@ -174,8 +200,6 @@ if (resp == "ok") { this.nickname = param[0]; - this.sendRequest('/nick "'+this.nickname+'"'); - this.isconnected = true; // start the polling system @@ -216,7 +240,6 @@ } else if (cmd == "leave") { - //alert(cmd + "-"+resp+"-"+param); if (resp =="ok") { // remove the channel @@ -282,7 +305,7 @@ { this.el_handle.innerHTML = param; this.nickname = param; - this.usermeta[this.nickid]['nick'] = param; + this.setUserMeta(this.nickid, 'nick', param); this.updateNickBox(this.nickid); // clear the possible error box generated by the bellow displayMsg(...) function @@ -396,7 +419,7 @@ var nickid = param['nickid']; if (resp == "ok") { - this.usermeta[nickid] = $H(param); + this.setUserMeta(nickid, param); this.updateNickBox(nickid); this.updateNickWhoisBox(nickid); } @@ -426,10 +449,10 @@ var chan = param['chan']; var chanid = param['chanid']; var meta = $H(param['meta']); + meta['users'] = $H(meta['users']); if (resp == "ok") { - this.chanmeta[chanid] = meta; - + this.setChanMeta(chanid,meta); // send /whois commands for unknown users for (var i=0; i<meta['users']['nickid'].length; i++) { @@ -490,6 +513,18 @@ return ''; }, + setUserMeta: function(nickid, key, value) + { + if (nickid && key) + { + if (!this.usermeta[nickid]) this.usermeta[nickid] = $H(); + if (value) + this.usermeta[nickid][key] = value; + else + this.usermeta[nickid] = $H(key); + } + }, + getAllChanMeta: function(chanid) { if (chanid && this.chanmeta[chanid]) @@ -506,6 +541,18 @@ return ''; }, + setChanMeta: function(chanid, key, value) + { + if (chanid && key) + { + if (!this.chanmeta[chanid]) this.chanmeta[chanid] = $H(); + if (value) + this.chanmeta[chanid][key] = value; + else + this.chanmeta[chanid] = $H(key); + } + }, + doSendMessage: function() { var w = this.el_words; @@ -557,7 +604,7 @@ if (nick_src != '') { var tabid = this.gui.getTabId(); - var n_list = this.chanmeta[tabid]['users']['nick']; + var n_list = this.getChanMeta(tabid,'users')['nick']; for (var i=0; i<n_list.length; i++) { var nick = n_list[i]; @@ -921,7 +968,7 @@ */ updateNickListBox: function(chanid) { - var nickidlst = this.chanmeta[chanid]['users']['nickid']; + var nickidlst = this.getChanMeta(chanid,'users')['nickid']; var nickdiv = this.gui.getOnlineContentFromTabId(chanid); var ul = document.createElement('ul'); ul.setAttribute('class', 'pfc_nicklist'); @@ -1757,4 +1804,4 @@ this.pfc = new pfcPrompt($('pfc_container')); return this.pfc; } -}; +}; \ No newline at end of file Modified: trunk/data/public/js/pfcgui.js =================================================================== --- trunk/data/public/js/pfcgui.js 2007-05-20 10:21:38 UTC (rev 1027) +++ trunk/data/public/js/pfcgui.js 2007-05-20 19:58:45 UTC (rev 1028) @@ -174,7 +174,7 @@ // empty the chat div content var div_chat = this.getChatContentFromTabId(tabid); - div_chat.innerHTML = ''; + div_chat.update(''); // remove the tab from the list var tabpos = indexOf(this.tabids, tabid); @@ -184,7 +184,8 @@ this.tabtypes = without(this.tabtypes, this.tabtypes[tabpos]); tabpos = indexOf(this.tabids, this.getTabId()); if (tabpos<0) tabpos = 0; - this.setTabById(this.tabids[tabpos]); + if (this.tabids[tabpos]) + this.setTabById(this.tabids[tabpos]); return name; }, Added: trunk/data/public/js/prototype.js =================================================================== --- trunk/data/public/js/prototype.js (rev 0) +++ trunk/data/public/js/prototype.js 2007-05-20 19:58:45 UTC (rev 1028) @@ -0,0 +1,3271 @@ +/* Prototype JavaScript framework, version 1.5.1 + * (c) 2005-2007 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.5.1', + + Browser: { + IE: !!(window.attachEvent && !window.opera), + Opera: !!window.opera, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1 + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + (document.createElement('div').__proto__ !== + document.createElement('form').__proto__) + }, + + ScriptFragment: '<script[^>]*>([\u0001-\uFFFF]*?)</script>', + JSONFilter: /^\/\*-secure-\s*(.*)\s*\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +} + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function(destination, source) { + for (var property in source) { + destination[property] = source[property]; + } + return destination; +} + +Object.extend(Object, { + inspect: function(object) { + try { + if (object === undefined) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + toJSON: function(object) { + var type = typeof object; + switch(type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } + if (object === null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (object.ownerDocument === document) return; + var results = []; + for (var property in object) { + var value = Object.toJSON(object[property]); + if (value !== undefined) + results.push(property.toJSON() + ': ' + value); + } + return '{' + results.join(', ') + '}'; + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({}, object); + } +}); + +Function.prototype.bind = function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } +} + +Function.prototype.bindAsEventListener = function(object) { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } +} + +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + }, + + toPaddedString: function(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; + }, + + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); + +Date.prototype.toJSON = function() { + return '"' + this.getFullYear() + '-' + + (this.getMonth() + 1).toPaddedString(2) + '-' + + this.getDate().toPaddedString(2) + 'T' + + this.getHours().toPaddedString(2) + ':' + + this.getMinutes().toPaddedString(2) + ':' + + this.getSeconds().toPaddedString(2) + '"'; +}; + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(this); + } finally { + this.currentlyExecuting = false; + } + } + } +} +Object.extend(String, { + interpret: function(value) { + return value == null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return this; + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : this; + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var self = arguments.callee; + self.text.data = this; + return self.div.innerHTML; + }, + + unescapeHTML: function() { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return {}; + + return match[1].split(separator || '&').inject({}, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var key = decodeURIComponent(pair.shift()); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + if (value != undefined) value = decodeURIComponent(value); + + if (key in hash) { + if (hash[key].constructor != Array) hash[key] = [hash[key]]; + hash[key].push(value); + } + else hash[key] = value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + var result = ''; + for (var i = 0; i < count; i++) result += this; + return result; + }, + + camelize: function() { + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; + + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); + + return camelized; + }, + + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { + var character = String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + evalJSON: function(sanitize) { + var json = this.unfilterJSON(); + try { + if (!sanitize || (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json))) + return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) === 0; + }, + + endsWith: function(pattern) { + var d = this.length - pattern.length; + return d >= 0 && this.lastIndexOf(pattern) === d; + }, + + empty: function() { + return this == ''; + }, + + blank: function() { + return /^\s*$/.test(this); + } +}); + +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + }, + unescapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (typeof replacement == 'function') return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +} + +String.prototype.parseQuery = String.prototype.toQueryParams; + +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); + +with (String.prototype.escapeHTML) div.appendChild(text); + +var Template = Class.create(); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; +Template.proto... [truncated message content] |
From: <ke...@us...> - 2007-05-20 10:21:39
|
Revision: 1027 http://svn.sourceforge.net/phpfreechat/?rev=1027&view=rev Author: kerphi Date: 2007-05-20 03:21:38 -0700 (Sun, 20 May 2007) Log Message: ----------- Swedish translation update (thanks to zilveer) Modified Paths: -------------- trunk/i18n/sv_SE/main.php Added Paths: ----------- trunk/i18n/sv_SE/admin.php Added: trunk/i18n/sv_SE/admin.php =================================================================== --- trunk/i18n/sv_SE/admin.php (rev 0) +++ trunk/i18n/sv_SE/admin.php 2007-05-20 10:21:38 UTC (rev 1027) @@ -0,0 +1,72 @@ +<?php +/** + * i18n/sv_SE/main.php + * + * Copyright © 2006 Stephane Gully <ste...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +/** + * Swedish translation of the messages (utf8 encoded!) + * + * @author Isa Acar <zi...@gm...> + */ + +$GLOBALS["i18n"]["lang"] = "English"; + +// admin/index.php +$GLOBALS["i18n"]["Administration"] = "Administration"; +$GLOBALS["i18n"]["Available Languages"] = "Tillgängliga språk"; +$GLOBALS["i18n"]["PFC version verification"] = "PFC version verifikation"; +$GLOBALS["i18n"]["Internet connection is not possible"] = "Internet uppkoppling är inte möjlig "; +$GLOBALS["i18n"]["PFC is update"] = "PFC is uppdaterad"; +$GLOBALS["i18n"]["PFC version"] = "PFC version"; +$GLOBALS["i18n"]["The last official version"] = "Senaste oficiella versionen"; +$GLOBALS["i18n"]["PFC is not update"] = "PFC is not update"; +$GLOBALS["i18n"]["Your version"] = "Din version"; +$GLOBALS["i18n"]["Download the last version %s here %s."] = "Ladda ner den senaste versionen %s här %s."; + + +// admin/user.php +$GLOBALS["i18n"]["Users management"] = "Användarhantering"; +$GLOBALS["i18n"]["At least one user must be declare to activate authentication."] = "Minst en person måste deklarera för att aktivera autentiseringen."; +$GLOBALS["i18n"]["It is not possible to delete the last user."] = "Det är inte möjligt att radera den sista användaren."; + +$GLOBALS["i18n"]["User %s deleted."] = "Användare %s raderades."; +$GLOBALS["i18n"]["User %s added."] = "Användare %s lades till."; +$GLOBALS["i18n"]["User %s edited."] = "Användare %s redigerades."; + +$GLOBALS["i18n"]["Authentication disable"] = "Autentisering inaktiverad"; +$GLOBALS["i18n"]["Enable here"] = "Aktivera här"; +$GLOBALS["i18n"]["Authentication enable"] = "Autentisering aktiverad"; +$GLOBALS["i18n"]["Disable here"] = "Inaktivera här"; + +$GLOBALS["i18n"]["Username"] = "Användarnamn"; +$GLOBALS["i18n"]["Password"] = "Lösenord"; +$GLOBALS["i18n"]["Group"] = "Grupp"; + +$GLOBALS["i18n"]["Do you really want to delete %s ?"] = "Vill du verkligen radera %s?"; +$GLOBALS["i18n"]["Add a new user"] = "Lägg till ny användare"; + +$GLOBALS["i18n"]["Edit"] = "Redigera"; +$GLOBALS["i18n"]["Delete"] = "Radera"; + +// admin/themes.php +$GLOBALS["i18n"]["Available themes"] = "Tillgängliga teman"; +$GLOBALS["i18n"]["Screenshot"] = "Screenshot"; + +?> Modified: trunk/i18n/sv_SE/main.php =================================================================== --- trunk/i18n/sv_SE/main.php 2007-05-19 09:24:10 UTC (rev 1026) +++ trunk/i18n/sv_SE/main.php 2007-05-20 10:21:38 UTC (rev 1027) @@ -31,7 +31,7 @@ $GLOBALS["i18n"]["My Chat"] = "Min chat"; // line 201 in phpfreechatconfig.class.php -$GLOBALS["i18n"]["%s not found, %s library can't be found."] = "%s finns inte, %s biblioteksfilen kan inte hittas."; +$GLOBALS["i18n"]["%s not found, %s library can't be found."] = "%s hittades inte, %s biblioteket kunde inte hittas."; // line 355 in phpfreechat.class.php $GLOBALS["i18n"]["Please enter your nickname"] = "Ange alias: "; @@ -61,7 +61,7 @@ $GLOBALS["i18n"]["You need %s"] = "Du måste %s"; // line 241 in phpfreechatconfig.class.php -$GLOBALS["i18n"]["%s doesn't exist, %s library can't be found"] = "%s finns inte, %s biblioteksfilen kan inte hittas"; +$GLOBALS["i18n"]["%s doesn't exist, %s library can't be found"] = "%s finns inte, %s biblioteket kunde inte hittas"; // line 280 in phpfreechatconfig.class.php $GLOBALS["i18n"]["%s doesn't exist"] = "%s finns inte"; @@ -125,10 +125,10 @@ // line 48 in phpfreechattemplate.class.php -$GLOBALS["i18n"]["%s template could not be found"] = ""; +$GLOBALS["i18n"]["%s template could not be found"] = "%s temat kunde inte hittas"; // line 324 in phpfreechatconfig.class.php -$GLOBALS["i18n"]["'serverid' parameter is mandatory by default use 'md5(__FILE__)' value"] = ""; +$GLOBALS["i18n"]["'serverid' parameter is mandatory by default use 'md5(__FILE__)' value"] = "'serverid' parametern är obligatorisk, använd 'md5(__FILE__)' värdet i vanliga fall"; // line 512 in phpfreechatconfig.class.php $GLOBALS["i18n"]["Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct"] = "Var vänlig och kontrollera sökvägen till temat."; @@ -146,7 +146,7 @@ $GLOBALS["i18n"]["Delete"] = "Radera"; // line 37 in chat.html.tpl.php -$GLOBALS["i18n"]["Pre"] = ""; +$GLOBALS["i18n"]["Pre"] = "Pre"; // line 38 in chat.html.tpl.php $GLOBALS["i18n"]["Mail"] = "Maila"; @@ -170,7 +170,7 @@ $GLOBALS["i18n"]["%s must be implemented"] = "Du måste implementera %s."; // line 343 in phpfreechatconfig.class.php -$GLOBALS["i18n"]["'%s' parameter is mandatory by default use '%s' value"] = ""; +$GLOBALS["i18n"]["'%s' parameter is mandatory by default use '%s' value"] = "'%s' parametern är obligatorisk, använd '%s' värdet i vanliga fall"; // line 378 in phpfreechatconfig.class.php $GLOBALS["i18n"]["'%s' parameter must be a positive number"] = "%s måste ha ett positivt värde"; @@ -179,7 +179,7 @@ $GLOBALS["i18n"]["'%s' parameter is not valid. Available values are : '%s'"] = "Parametern '%s' finns inte. Följande värden finns: '%s'"; // line 186 in pfcglobalconfig.class.php -$GLOBALS["i18n"]["My room"] = ""; +$GLOBALS["i18n"]["My room"] = "Mitt rum"; // line 19 in unban.class.php $GLOBALS["i18n"]["Missing parameter"] = "Parameter fattas."; @@ -188,7 +188,7 @@ $GLOBALS["i18n"]["banished from %s by %s"] = "Bannad från %s av %s"; // line 23 in banlist.class.php -$GLOBALS["i18n"]["The banished user's id list is:"] = "Bannade användarid-listan är:"; +$GLOBALS["i18n"]["The banished user's id list is:"] = "Bannade användalistan är:"; // line 32 in banlist.class.php $GLOBALS["i18n"]["Empty"] = "Här var det tomt!"; @@ -224,7 +224,7 @@ $GLOBALS["i18n"]["You are not allowed to run '%s' command"] = "Du får inte köra kommandot '%s'"; // line 66 in auth.class.php -$GLOBALS["i18n"]["Can't join %s because you are banished"] = "Ajaj..kan inte logga in.!"; +$GLOBALS["i18n"]["Can't join %s because you are banished"] = "Ajaj..du är bannad, du kan inte logga in.!"; // line 76 in auth.class.php $GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Kan inte logga in i %s, rummet är privat."; @@ -272,7 +272,7 @@ $GLOBALS["i18n"]["Error: the chat cannot be loaded! two possibilities: your browser doesn't support javascript or you didn't setup correctly the server directories rights - don't hesitate to ask some help on the forum"] = "Error: chatten kan inte laddas, detta antingen p.g.a att din webbläsare inte stödjer javascript eller för att inställningarna inte är korrekta. Var vänlig och kontakta admin."; // line 31 in help.class.php -$GLOBALS["i18n"]["Here is the command list:"] = "Här följer kommando-listan:"; +$GLOBALS["i18n"]["Here is the command list:"] = "Här följer kommandolistan:"; // line 63 in identify.class.php $GLOBALS["i18n"]["Succesfully identified"] = "Identifieringen lyckades"; @@ -312,81 +312,81 @@ // line 302 in pfcglobalconfig.class.php -$GLOBALS["i18n"]["'%s' parameter must be a charatere string"] = ""; +$GLOBALS["i18n"]["'%s' parameter must be a charatere string"] = "'%s' parametern måste vara en karakteristisk sträng"; // line 86 in mysql.class.php $GLOBALS["i18n"]["Mysql container: connect error"] = ""; // line 101 in mysql.class.php -$GLOBALS["i18n"]["Mysql container: create database error '%s'"] = ""; +$GLOBALS["i18n"]["Mysql container: create database error '%s'"] = "Mysql container: databasen kunde ej skapas '%s'"; // line 112 in mysql.class.php -$GLOBALS["i18n"]["Mysql container: create table error '%s'"] = ""; +$GLOBALS["i18n"]["Mysql container: create table error '%s'"] = "Mysql container: tabellen kunde ej skapas '%s'"; // line 80 in chat.js.tpl.php -$GLOBALS["i18n"]["You are not allowed to speak to yourself"] = ""; +$GLOBALS["i18n"]["You are not allowed to speak to yourself"] = "Ehmm.. Du kan inte prata med dig själv"; // line 82 in chat.js.tpl.php -$GLOBALS["i18n"]["Choosen nickname is not allowed"] = ""; +$GLOBALS["i18n"]["Choosen nickname is not allowed"] = "Vald alias är inte tillåten"; // line 83 in chat.js.tpl.php -$GLOBALS["i18n"]["Enable sound notifications"] = ""; +$GLOBALS["i18n"]["Enable sound notifications"] = "Tillåt ljud"; // line 84 in chat.js.tpl.php -$GLOBALS["i18n"]["Disable sound notifications"] = ""; +$GLOBALS["i18n"]["Disable sound notifications"] = "Inaktivera ljud"; // line 23 in kick.class.php -$GLOBALS["i18n"]["no reason"] = ""; +$GLOBALS["i18n"]["no reason"] = "Ingen anledning"; // line 24 in banlist.class.php -$GLOBALS["i18n"]["The banished user list is:"] = ""; +$GLOBALS["i18n"]["The banished user list is:"] = "Bannade användarlistan är:"; // line 39 in banlist.class.php -$GLOBALS["i18n"]["'/unban {nickname}' will unban the user identified by {nickname}"] = ""; +$GLOBALS["i18n"]["'/unban {nickname}' will unban the user identified by {nickname}"] = "'/unban {nickname}' kommer att unbanna användaren med alias {nickname}"; // line 43 in kick.class.php -$GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = ""; +$GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = "Kickas från %s av %s - anledning: %s"; // line 20 in quit.class.php -$GLOBALS["i18n"]["%s quit (%s)"] = ""; +$GLOBALS["i18n"]["%s quit (%s)"] = "%s quit (%s)"; // line 124 in chat.js.tpl.php -$GLOBALS["i18n"]["Chat loading ..."] = ""; +$GLOBALS["i18n"]["Chat loading ..."] = "Chatt v0.5 laddas"; // line 124 in chat.js.tpl.php -$GLOBALS["i18n"]["Please wait"] = ""; +$GLOBALS["i18n"]["Please wait"] = "Var god och vänta.."; // line 139 in chat.js.tpl.php -$GLOBALS["i18n"]["%s appears to be either disabled or unsupported by your browser."] = ""; +$GLOBALS["i18n"]["%s appears to be either disabled or unsupported by your browser."] = "%s verkar vara inaktiverad eller så stödjer inte din webbläsaren detta."; // line 139 in chat.js.tpl.php -$GLOBALS["i18n"]["This web application requires %s to work properly."] = ""; +$GLOBALS["i18n"]["This web application requires %s to work properly."] = "Denna webapplikation kräver %s för att fungera utan problem."; // line 135 in chat.js.tpl.php -$GLOBALS["i18n"]["Please enable %s in your browser settings, or upgrade to a browser with %s support and try again."] = ""; +$GLOBALS["i18n"]["Please enable %s in your browser settings, or upgrade to a browser with %s support and try again."] = "Var god och aktivera %s i webbläsarens inställlningar, eller uppgradera till en webbläsare som stödjer %s."; // line 137 in chat.js.tpl.php -$GLOBALS["i18n"]["Please upgrade to a browser with %s support and try again."] = ""; +$GLOBALS["i18n"]["Please upgrade to a browser with %s support and try again."] = "Var god och uppgradera till en webbläsare som stödjer %s."; // line 139 in chat.js.tpl.php -$GLOBALS["i18n"]["In Internet Explorer versions earlier than 7.0, Ajax is implemented using ActiveX. Please enable ActiveX in your browser security settings or upgrade to a browser with Ajax support and try again."] = ""; +$GLOBALS["i18n"]["In Internet Explorer versions earlier than 7.0, Ajax is implemented using ActiveX. Please enable ActiveX in your browser security settings or upgrade to a browser with Ajax support and try again."] = "I versioner av Internet Explorer tidigare än 7.0 är Ajax implementerad av ActiveX. Var god och aktivera ActiveX in din webbläsare säkerhetsinställningar eller uppgradera till en webbläsare som stödjer Ajax."; // line 359 in pfcglobalconfig.class.php -$GLOBALS["i18n"]["%s doesn't exist, data_public_path cannot be installed"] = ""; +$GLOBALS["i18n"]["%s doesn't exist, data_public_path cannot be installed"] = "%s existerar inte, data_public_path kunde inte installeras"; // line 73 in invite.class.php -$GLOBALS["i18n"]["You must join %s to invite users in this channel"] = ""; +$GLOBALS["i18n"]["You must join %s to invite users in this channel"] = "Du måste joina %s för att kunna bjuda in användare till den kanalen"; // line 47 in chat.html.tpl.php -$GLOBALS["i18n"]["Ping"] = ""; +$GLOBALS["i18n"]["Ping"] = "Ping"; // line 477 in phpfreechat.class.php -$GLOBALS["i18n"]["Input Required"] = ""; +$GLOBALS["i18n"]["Input Required"] = "Inmatning krävs"; // line 478 in phpfreechat.class.php -$GLOBALS["i18n"]["OK"] = ""; +$GLOBALS["i18n"]["OK"] = "OK"; // line 479 in phpfreechat.class.php -$GLOBALS["i18n"]["Cancel"] = ""; +$GLOBALS["i18n"]["Cancel"] = "Avbryt"; -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-05-19 09:24:11
|
Revision: 1026 http://svn.sourceforge.net/phpfreechat/?rev=1026&view=rev Author: kerphi Date: 2007-05-19 02:24:10 -0700 (Sat, 19 May 2007) Log Message: ----------- Hungarian translation update (thanks to GaLa) Modified Paths: -------------- trunk/i18n/hu_HU/main.php Modified: trunk/i18n/hu_HU/main.php =================================================================== --- trunk/i18n/hu_HU/main.php 2007-05-11 09:40:49 UTC (rev 1025) +++ trunk/i18n/hu_HU/main.php 2007-05-19 09:24:10 UTC (rev 1026) @@ -312,7 +312,7 @@ $GLOBALS["i18n"]["Mysql container: connect error"] = "Mysql tároló: kapcsolódási hiba"; // line 101 in mysql.class.php -$GLOBALS["i18n"]["Mysql container: create database error '%s'"] = "Mysql tároló: adtbázis létrehozási hiba '%s'"; +$GLOBALS["i18n"]["Mysql container: create database error '%s'"] = "Mysql tároló: adatbázis létrehozási hiba '%s'"; // line 112 in mysql.class.php $GLOBALS["i18n"]["Mysql container: create table error '%s'"] = "Mysql tároló: tábla létrehozási hiba '%s'"; @@ -340,46 +340,47 @@ // line 43 in kick.class.php $GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = "kirúgva %s szobából %s által - oka: %s"; -// line 359 in pfcglobalconfig.class.php -$GLOBALS["i18n"]["%s doesn't exist, data_public_path cannot be installed"] = ""; // line 20 in quit.class.php -$GLOBALS["i18n"]["%s quit (%s)"] = ""; +$GLOBALS["i18n"]["%s quit (%s)"] = "%s kilép (%s)"; // line 124 in chat.js.tpl.php -$GLOBALS["i18n"]["Chat loading ..."] = ""; +$GLOBALS["i18n"]["Chat loading ..."] = "A Chat töltődik ..."; // line 124 in chat.js.tpl.php -$GLOBALS["i18n"]["Please wait"] = ""; +$GLOBALS["i18n"]["Please wait"] = "Kérlek várj!"; // line 139 in chat.js.tpl.php -$GLOBALS["i18n"]["%s appears to be either disabled or unsupported by your browser."] = ""; +$GLOBALS["i18n"]["%s appears to be either disabled or unsupported by your browser."] = "%s nem működik, mert vagy le van tiltva vagy a böngésző nem támogatja."; // line 139 in chat.js.tpl.php -$GLOBALS["i18n"]["This web application requires %s to work properly."] = ""; +$GLOBALS["i18n"]["This web application requires %s to work properly."] = "A(z) %s szükséges ahhoz, hogy ez a web alkalmazás megfelelően dolgozzon."; // line 135 in chat.js.tpl.php -$GLOBALS["i18n"]["Please enable %s in your browser settings, or upgrade to a browser with %s support and try again."] = ""; +$GLOBALS["i18n"]["Please enable %s in your browser settings, or upgrade to a browser with %s support and try again."] = "Engedélyezd a(z) %s -t a böngésző beállításainál, vagy használj olyan böngészőt, mely támogatja a(z) %s -t, majd próbáld újra."; // line 137 in chat.js.tpl.php -$GLOBALS["i18n"]["Please upgrade to a browser with %s support and try again."] = ""; +$GLOBALS["i18n"]["Please upgrade to a browser with %s support and try again."] = " %s támogatásához frissítsd a böngésződ, majd próbáld újra."; // line 139 in chat.js.tpl.php -$GLOBALS["i18n"]["In Internet Explorer versions earlier than 7.0, Ajax is implemented using ActiveX. Please enable ActiveX in your browser security settings or upgrade to a browser with Ajax support and try again."] = ""; +$GLOBALS["i18n"]["In Internet Explorer versions earlier than 7.0, Ajax is implemented using ActiveX. Please enable ActiveX in your browser security settings or upgrade to a browser with Ajax support and try again."] = "Az Internet Explorer 7.0 előtti verzióiban az Ajax végrehajtáshoz az ActivX -t használja. Engedélyezd az ActivX-t a böngésződ biztonsági beállításainál, vagy használj olyan böngészőt, mely támogatja az Ajax technológiát, majd próbáld újra."; +// line 359 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["%s doesn't exist, data_public_path cannot be installed"] = "%s nem létezik, a data_public_path nem telepíthető"; + // line 73 in invite.class.php -$GLOBALS["i18n"]["You must join %s to invite users in this channel"] = ""; +$GLOBALS["i18n"]["You must join %s to invite users in this channel"] = "Csatlakozni kell ide: %s, hogy felhasználót lehessen hívni ebbe a csatornába"; // line 47 in chat.html.tpl.php -$GLOBALS["i18n"]["Ping"] = ""; +$GLOBALS["i18n"]["Ping"] = "Ping"; // line 477 in phpfreechat.class.php -$GLOBALS["i18n"]["Input Required"] = ""; +$GLOBALS["i18n"]["Input Required"] = "Adat szükséges"; // line 478 in phpfreechat.class.php -$GLOBALS["i18n"]["OK"] = ""; +$GLOBALS["i18n"]["OK"] = "OK"; // line 479 in phpfreechat.class.php -$GLOBALS["i18n"]["Cancel"] = ""; +$GLOBALS["i18n"]["Cancel"] = "Mégse"; -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-05-11 09:40:49
|
Revision: 1025 http://svn.sourceforge.net/phpfreechat/?rev=1025&view=rev Author: kerphi Date: 2007-05-11 02:40:49 -0700 (Fri, 11 May 2007) Log Message: ----------- [en] Integrate the user time zone contribution http://www.phpfreechat.net/forum/viewtopic.php?id=1508 (thanks to Peter's great work) [1h] [fr] Int?\195?\169gration de la contribution sur le param?\195?\169trage des fuseaux horaires utilisateurs http://www.phpfreechat.net/forum/viewtopic.php?id=1508 (merci ?\195?\160 Peter pour son tr?\195?\168s bon travail) [1h] Modified Paths: -------------- trunk/src/commands/getnewmsg.class.php trunk/src/pfccontainer.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/commands/getnewmsg.class.php =================================================================== --- trunk/src/commands/getnewmsg.class.php 2007-05-11 09:34:07 UTC (rev 1024) +++ trunk/src/commands/getnewmsg.class.php 2007-05-11 09:40:49 UTC (rev 1025) @@ -79,8 +79,8 @@ foreach ($data as $d) { $m_id = $d["id"]; - $m_date = $d["date"]; - $m_time = $d["time"]; + $m_date = gmdate($c->date_format, $d["timestamp"] + $c->time_offset); + $m_time = gmdate($c->time_format, $d["timestamp"] + $c->time_offset); $m_sender = $d["sender"]; $m_recipientid = $recipientid; $m_cmd = $d["cmd"]; @@ -92,8 +92,8 @@ $m_recipientid, $m_cmd, $m_param, - date("d/m/Y") == $m_date ? 1 : 0, - $oldmsg ? 1 : 0); + gmdate($c->date_format, time() + $c->time_offset) == $m_date ? 1 : 0, // posted today ? + $oldmsg ? 1 : 0); // is it a new message in the current session or is it a part of the history $data_sent = true; } if (count($js) != 0) Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2007-05-11 09:34:07 UTC (rev 1024) +++ trunk/src/pfccontainer.class.php 2007-05-11 09:40:49 UTC (rev 1025) @@ -352,6 +352,7 @@ */ function isNickOnline($chan, $nickid) { + if (!$nickid) return false; if ($chan == NULL) $chan = 'SERVER'; $ret = $this->getMeta("channelid-to-nickid", @@ -380,8 +381,7 @@ // format message $data = "\n"; $data .= $msgid."\t"; - $data .= date("d/m/Y")."\t"; - $data .= date("H:i:s")."\t"; + $data .= time()."\t"; $data .= $nick."\t"; $data .= $cmd."\t"; $data .= $param; @@ -434,12 +434,11 @@ { $formated_line = explode( "\t", $line ); $data = array(); - $data["id"] = trim($formated_line[0]); - $data["date"] = $formated_line[1]; - $data["time"] = $formated_line[2]; - $data["sender"]= $formated_line[3]; - $data["cmd"] = $formated_line[4]; - $data["param"] = $formated_line[5]; + $data["id"] = trim($formated_line[0]); + $data["timestamp"] = $formated_line[1]; + $data["sender"] = $formated_line[2]; + $data["cmd"] = $formated_line[3]; + $data["param"] = $formated_line[4]; $datalist[$data["id"]] = $data; } } Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-05-11 09:34:07 UTC (rev 1024) +++ trunk/src/pfcglobalconfig.class.php 2007-05-11 09:40:49 UTC (rev 1025) @@ -133,6 +133,20 @@ var $debugxajax = false; /** + * This is the user time zone + * it is the difference in seconds between user clock and server clock + */ + var $time_offset = 0; + /** + * How to display the dates in the chat + */ + var $date_format = "d/m/Y"; + /** + * How to display the time in the chat + */ + var $time_format = "H:i:s"; + + /** * This parameter is useful when your chat server is behind a reverse proxy that * forward client ip address in HTTP_X_FORWARDED_FOR http header. * see : http://www.phpfreechat.net/forum/viewtopic.php?id=1344 @@ -142,7 +156,7 @@ // private parameters var $_sys_proxies = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); - var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels", "channels", "privmsg", "nickmeta","baseurl"); + var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels", "channels", "privmsg", "nickmeta","baseurl","time_offset","date_format","time_format"); var $_params_type = array(); var $_query_string = ''; @@ -266,7 +280,7 @@ if (is_string($v)) $this->_params_type["string"][] = $k; else if (is_bool($v)) $this->_params_type["bool"][] = $k; else if (is_array($v)) $this->_params_type["array"][] = $k; - else if (is_int($v) && $v>=0) $this->_params_type["positivenumeric"][] = $k; + else if (is_int($v) && $v>0) $this->_params_type["positivenumeric"][] = $k; else $this->_params_type["misc"][] = $k; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-05-11 09:34:21
|
Revision: 1024 http://svn.sourceforge.net/phpfreechat/?rev=1024&view=rev Author: kerphi Date: 2007-05-11 02:34:07 -0700 (Fri, 11 May 2007) Log Message: ----------- Fixes about the last pfcContainer interfaces changes Modified Paths: -------------- trunk/testcase/container_generic.php Modified: trunk/testcase/container_generic.php =================================================================== --- trunk/testcase/container_generic.php 2007-05-04 15:31:35 UTC (rev 1023) +++ trunk/testcase/container_generic.php 2007-05-11 09:34:07 UTC (rev 1024) @@ -56,16 +56,11 @@ $nickid = $prefix . '_' . $this->nickid; $chan = $prefix . '_' . $this->chan; - // create on the channel - $this->ct->createNick($chan, $nick, $nickid); - $isonline = ($this->ct->isNickOnline($chan, $nickid) >= 0); - $this->assertTrue($isonline, "nickname should be online on the channel"); - - // create on the server - $chan = NULL; - $this->ct->createNick($chan, $nick, $nickid); - $isonline = ($this->ct->isNickOnline($chan, $nickid) >= 0); - $this->assertTrue($isonline, "nickname should be online on the server"); + $this->ct->createNick($nickid, $nick); + $nick2 = $this->ct->getNickname($nickid); + $nickid2 = $this->ct->getNickId($nick); + $this->assertEquals($nick, $nick2, "nicknames should be the same"); + $this->assertEquals($nickid, $nickid2, "nickids should be the same"); } function test_removeNick_Generic() @@ -78,49 +73,22 @@ $chan = $prefix . '_' . $this->chan; // on the channel - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, $chan); + $this->ct->joinChan($nickid, NULL); - $this->ct->removeNick($chan, $nickid); - $isonline = ($this->ct->isNickOnline($chan, $nickid) >= 0); - $this->assertFalse($isonline, "nickname shouldn't be online on the channel"); - $isonline2 = ($this->ct->isNickOnline(NULL, $nickid) >= 0); - $this->assertTrue($isonline2, "nickname should be online on the server"); + $this->assertTrue($this->ct->isNickOnline($chan,$nickid),"should be online"); + $this->assertTrue($this->ct->isNickOnline(NULL,$nickid),"should be online"); + + $this->ct->removeNick($chan, $nickid); + $this->assertFalse($this->ct->isNickOnline($chan,$nickid),"should not be online"); + $this->assertTrue($this->ct->isNickOnline(NULL,$nickid),"should be online"); $this->ct->removeNick(NULL, $nickid); - $isonline = ($this->ct->isNickOnline(NULL, $nickid) >= 0); - $this->assertFalse($isonline, "nickname shouldn't be online on the server"); + $this->assertFalse($this->ct->isNickOnline($chan,$nickid),"should not be online"); + $this->assertFalse($this->ct->isNickOnline(NULL,$nickid),"should not be online"); } - - function test_getNickId_Generic() - { - $c =& $this->c; - $ct =& $this->ct; - $prefix = __FUNCTION__; - $nick = $prefix . '_' . $this->nick; - $nickid = $prefix . '_' . $this->nickid; - $chan = $prefix . '_' . $this->chan; - - $this->ct->createNick(NULL, $nick, $nickid); - $ret = $this->ct->getNickId($nick); - $this->assertEquals($nickid, $ret, "created nickname doesn't have a correct nickid"); - } - function test_getNickname_Generic() - { - $c =& $this->c; - $ct =& $this->ct; - $prefix = __FUNCTION__; - $nick = $prefix . '_' . $this->nick; - $nickid = $prefix . '_' . $this->nickid; - $chan = $prefix . '_' . $this->chan; - - // on the channel - $this->ct->createNick($chan, $nick, $nickid); - - $ret = $this->ct->getNickname($nickid); - $this->assertEquals($nick, $ret, "nickname value is wrong"); - } - function test_getOnlineNick_Generic() { $c =& $this->c; @@ -130,8 +98,10 @@ $nickid = $prefix . '_' . $this->nickid; $chan = $prefix . '_' . $this->chan; - // on the channel - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); + $time = time(); $ret = $this->ct->getOnlineNick($chan); $this->assertEquals(1, count($ret["nickid"]), "1 nickname should be online"); @@ -153,12 +123,16 @@ $nickid = $prefix . '_' . $this->nickid; $chan = $prefix . '_' . $this->chan; - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); + sleep(2); + $ret = $this->ct->removeObsoleteNick(1000); $this->assertEquals(1, count($ret["nickid"]), "1 nickname should be obsolete"); $this->assertEquals(2, count($ret["channels"][0]), "nickname should be disconnected from two channels"); - $isonline = ($this->ct->isNickOnline($chan, $nickid) >= 0); + $isonline = $this->ct->isNickOnline($chan, $nickid); $this->assertFalse($isonline, "nickname shouldn't be online anymore"); } @@ -171,14 +145,18 @@ $nickid = $prefix . '_' . $this->nickid; $chan = $prefix . '_' . $this->chan; - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); + sleep(2); + $ret = $this->ct->updateNick($nickid); $this->assertTrue($ret, "nickname should be correctly updated"); $ret = $this->ct->removeObsoleteNick(1000); $this->assertFalse(in_array($nick, $ret['nick']), "nickname shouldn't be removed because it has been updated"); - $isonline = ($this->ct->isNickOnline($chan, $nickid) >= 0); + $isonline = $this->ct->isNickOnline($chan, $nickid); $this->assertTrue($isonline, "nickname should be online"); } @@ -194,11 +172,14 @@ $chan = $prefix . '_' . $this->chan; // create a nick on a channel and change it - $this->ct->createNick($chan, $nick1, $nickid); + $this->ct->createNick($nickid, $nick1); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); + $ret = $this->ct->changeNick($nick2, $nick1); $this->assertTrue($ret, "nickname change function should returns true (success)"); - $isonline1 = ($this->ct->isNickOnline($chan, $this->ct->getNickId($nick1)) >= 0); - $isonline2 = ($this->ct->isNickOnline($chan, $this->ct->getNickId($nick2)) >= 0); + $isonline1 = $this->ct->isNickOnline($chan, $this->ct->getNickId($nick1)); + $isonline2 = $this->ct->isNickOnline($chan, $this->ct->getNickId($nick2)); $this->assertFalse($isonline1, "nickname shouldn't be online"); $this->assertTrue($isonline2, "nickname shouldn't be online"); } @@ -215,7 +196,9 @@ $msg = "my test message"; // on the channel - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); for($i = 0; $i < 10; $i++) { $msgid = $this->ct->write($chan, $nick, $cmd ,$msg . $i); @@ -237,7 +220,9 @@ $msg = "my test message"; // create message on the channel - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); $msgid = $this->ct->write($chan, $nick, $cmd, $msg); $this->assertEquals(1, $msgid,"generated msg_id is not correct"); $res = $this->ct->read($chan, 0); @@ -258,7 +243,9 @@ $msg = "my test message"; // create on the channel - $this->ct->createNick($chan, $nick, $nickid); + $this->ct->createNick($nickid, $nick); + $this->ct->joinChan($nickid, NULL); + $this->ct->joinChan($nickid, $chan); for($i = 0; $i < 10; $i++) { $msgid = $this->ct->write($chan, $nick, $cmd ,$msg . $i); @@ -403,8 +390,6 @@ $ret = $ct->getMeta($group,$subgroup1,$leaf1); $this->assertEquals(0, count($ret["value"]), "leaf should not exists"); } - - } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-05-04 15:31:42
|
Revision: 1023 http://svn.sourceforge.net/phpfreechat/?rev=1023&view=rev Author: kerphi Date: 2007-05-04 08:31:35 -0700 (Fri, 04 May 2007) Log Message: ----------- Bug fix : make possible to have '@' characteres in urls Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-04-25 07:42:44 UTC (rev 1022) +++ trunk/data/public/js/pfcclient.js 2007-05-04 15:31:35 UTC (rev 1023) @@ -1114,9 +1114,9 @@ parseMessage: function(msg) { var rx = null; - + // parse urls - var rx_url = new RegExp('(^|[^\\"])([a-z]+\:\/\/[a-z0-9.\\~\\/\\?\\=\\&\\-\\_\\#:;%,]*[a-z0-9\\/\\?\\=\\&\\-\\_\\#])([^\\"]|$)','ig'); + var rx_url = new RegExp('(^|[^\\"])([a-z]+\:\/\/[a-z0-9.\\~\\/\\?\\=\\&\\-\\_\\#:;%,@]*[a-z0-9\\/\\?\\=\\&\\-\\_\\#])([^\\"]|$)','ig'); var ttt = msg.split(rx_url); if (ttt.length > 1 && !navigator.appName.match("Explorer|Konqueror") && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-25 07:42:53
|
Revision: 1022 http://svn.sourceforge.net/phpfreechat/?rev=1022&view=rev Author: kerphi Date: 2007-04-25 00:42:44 -0700 (Wed, 25 Apr 2007) Log Message: ----------- try to fix http://www.phpfreechat.net/forum/viewtopic.php?pid=5844#p5844 Modified Paths: -------------- trunk/src/pfctools.php Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2007-04-18 15:30:04 UTC (rev 1021) +++ trunk/src/pfctools.php 2007-04-25 07:42:44 UTC (rev 1022) @@ -430,13 +430,15 @@ function flock_put_contents($filename, $data, $mode = "wb") { $fp = fopen( $filename, $mode ); - if( $fp && flock( $fp, LOCK_EX ) ) + if( $fp ) { - fwrite( $fp, $data ); - // flock($fp, LOCK_UN); // will be done by fclose + if ( flock( $fp, LOCK_EX ) ) + { + fwrite( $fp, $data ); + // flock($fp, LOCK_UN); // will be done by fclose + } + fclose( $fp ); } - fclose( $fp ); } - -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-18 15:30:07
|
Revision: 1021 http://svn.sourceforge.net/phpfreechat/?rev=1021&view=rev Author: kerphi Date: 2007-04-18 08:30:04 -0700 (Wed, 18 Apr 2007) Log Message: ----------- change the version filename Modified Paths: -------------- trunk/misc/sendSource Modified: trunk/misc/sendSource =================================================================== --- trunk/misc/sendSource 2007-04-18 15:25:30 UTC (rev 1020) +++ trunk/misc/sendSource 2007-04-18 15:30:04 UTC (rev 1021) @@ -1,8 +1,8 @@ #!/bin/sh -NAME_TGZ=phpfreechat-`cat ../version`.tar.gz -NAME_ZIP=phpfreechat-`cat ../version`.zip -NAME_SETUP=phpfreechat-`cat ../version`-setup.php +NAME_TGZ=phpfreechat-`cat ../version.txt`.tar.gz +NAME_ZIP=phpfreechat-`cat ../version.txt`.zip +NAME_SETUP=phpfreechat-`cat ../version.txt`-setup.php #scp ./$NAME_ZIP ./$NAME_TGZ mic...@ph...:/home/micropolia/svn/phpfreechat/prod/www/download/ lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $NAME_TGZ" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-18 15:25:30
|
Revision: 1020 http://svn.sourceforge.net/phpfreechat/?rev=1020&view=rev Author: kerphi Date: 2007-04-18 08:25:30 -0700 (Wed, 18 Apr 2007) Log Message: ----------- [en] Bug fix: $GLOBALS['i18n'] array could overlap with external codes, now pfc uses $GLOBALS[$serverid]['i18n'], I think it's more secure. [1h30] [fr] Bug fix : le tableau $GLOBALS['i18n'] pouvait entrer en collision avec des programmes externes, maintenant pfc utilise le tableau $GLOBALS[$serverid]['i18n'] qui permettra d'?\195?\169viter ces situations. [1h30] Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php trunk/src/pfci18n.class.php trunk/src/phpfreechat.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-04-18 13:59:38 UTC (rev 1019) +++ trunk/src/pfcglobalconfig.class.php 2007-04-18 15:25:30 UTC (rev 1020) @@ -147,10 +147,12 @@ var $_query_string = ''; function pfcGlobalConfig( $params = array() ) - { - // setup the local for translated messages - pfcI18N::Init(isset($params["language"]) ? $params["language"] : ""); - + { + // @todo find a cleaner way to forward serverid to i18n functions + $GLOBALS['serverid'] = isset($params['serverid']) ? $params['serverid'] : '_serverid_'; + // setup the locales for the translated messages + pfcI18N::Init(isset($params['language']) ? $params['language'] : ''); + // check the serverid is really defined if (!isset($params["serverid"])) $this->errors[] = _pfc("'%s' parameter is mandatory by default use '%s' value", "serverid", "md5(__FILE__)"); Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-04-18 13:59:38 UTC (rev 1019) +++ trunk/src/pfci18n.class.php 2007-04-18 15:25:30 UTC (rev 1020) @@ -25,10 +25,11 @@ function _pfc() { $args = func_get_args(); - $args[0] = isset($GLOBALS["i18n"][$args[0]]) && $GLOBALS["i18n"][$args[0]] != "" ? + $serverid = $GLOBALS['serverid']; // serverid is used to avoid conflicts with external code using same 'i18n' key + $args[0] = isset($GLOBALS[$serverid]["i18n"][$args[0]]) && $GLOBALS[$serverid]["i18n"][$args[0]] != "" ? ($GLOBALS["output_encoding"] == "UTF-8" ? - $GLOBALS["i18n"][$args[0]] : - iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]])) : + $GLOBALS[$serverid]["i18n"][$args[0]] : + iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS[$serverid]["i18n"][$args[0]])) : "_".$args[0]."_"; return call_user_func_array('sprintf', $args); } @@ -39,10 +40,11 @@ function _pfc2() { $args = func_get_args(); - $args[0] = isset($GLOBALS["i18n"][$args[0]]) && $GLOBALS["i18n"][$args[0]] != "" ? + $serverid = $GLOBALS['serverid']; // serverid is used to avoid conflicts with external code using same 'i18n' key + $args[0] = isset($GLOBALS[$serverid]["i18n"][$args[0]]) && $GLOBALS[$serverid]["i18n"][$args[0]] != "" ? ($GLOBALS["output_encoding"] == "UTF-8" ? - $GLOBALS["i18n"][$args[0]] : - iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]])) : + $GLOBALS[$serverid]["i18n"][$args[0]] : + iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS[$serverid]["i18n"][$args[0]])) : "_".$args[0]."_"; return $args[0]; } @@ -61,6 +63,10 @@ require_once(dirname(__FILE__)."/../i18n/".$language."/admin.php"); else require_once(dirname(__FILE__)."/../i18n/".$language."/main.php"); + + $serverid = $GLOBALS['serverid']; // serverid is used to avoid conflicts with external code using same 'i18n' key + $GLOBALS[$serverid]['i18n'] = $GLOBALS['i18n']; // do not pass by reference because $GLOBALS['i18n'] is maybe used by unknown external code + $GLOBALS["output_encoding"] = "UTF-8"; // by default client/server communication is utf8 encoded } Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2007-04-18 13:59:38 UTC (rev 1019) +++ trunk/src/phpfreechat.class.php 2007-04-18 15:25:30 UTC (rev 1020) @@ -38,19 +38,14 @@ function phpFreeChat( &$params ) { - if (!is_object($params) && - isset($params["debug"]) && - $params["debug"]) + if (!is_array($params)) + die('phpFreeChat parameters must be an array'); + + if ( isset($params["debug"]) && $params["debug"] ) require_once dirname(__FILE__)."/../debug/log.php"; - // check if the given parameters is a simple array - // or a allready created phpfreechat object - $c = NULL; - if (is_object($params) && - get_class($params) == "pfcglobalconfig") - $c =& $params; - else - $c =& pfcGlobalConfig::Instance( $params ); + // initialize the global config object + $c =& pfcGlobalConfig::Instance( $params ); // need to initiate the user config object here because it uses sessions $u =& pfcUserConfig::Instance(); @@ -76,19 +71,11 @@ } /** - * printJavaScript must be called into html header - * usage: - * <code> - * <?php $chat->printJavascript(); ?> - * </code> + * depreciated */ function printJavaScript( $return = false ) { $output = ''; - $c =& pfcGlobalConfig::Instance(); - $u =& pfcUserConfig::Instance(); - - // display output if ($return) return $output; else @@ -96,19 +83,11 @@ } /** - * printStyle must be called in the header - * it inserts CSS in order to style the chat - * usage: - * <code> - * <?php $chat->printStyle(); ?> - * </code> + * depreciated */ function printStyle( $return = false ) { - $c =& pfcGlobalConfig::Instance(); - $output = ''; - if($return) return $output; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-18 13:59:37
|
Revision: 1019 http://svn.sourceforge.net/phpfreechat/?rev=1019&view=rev Author: kerphi Date: 2007-04-18 06:59:38 -0700 (Wed, 18 Apr 2007) Log Message: ----------- [en] Bug fix: themes resources (images/sound) were hidden if pfc sources were located in a private (for the web browsers) path. [1h45] [fr] Bug fix : les ressources des th?\195?\168mes (images et son) ne s'affichaient pas lorsque le code source de pfc ?\195?\169tait plac?\195?\169 dans un chemin priv?\195?\169 (non accessible par les navigateurs web). [1h45] Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-04-18 12:17:25 UTC (rev 1018) +++ trunk/src/pfcglobalconfig.class.php 2007-04-18 13:59:38 UTC (rev 1019) @@ -405,18 +405,35 @@ $this->errors[] = _pfc("%s doesn't exist", $filetotest); $this->server_script_url = relativePath($this->client_script_path, $this->server_script_path).'/'.basename($filetotest).$this->_query_string; } - + + // If the user didn't give any theme_default_url value, + // copy the default theme resources in a public directory + if ($this->theme_default_url == '') + { + mkdir_r($this->data_public_path.'/themes/default'); + if (!is_dir($this->data_public_path.'/themes/default')) + $this->errors[] = _pfc("cannot create %s", $this->data_public_path.'/themes/default'); + else + { + $ret = copy_r( dirname(__FILE__).'/../themes/default', + $this->data_public_path.'/themes/default' ); + if (!$ret) + $this->errors[] = _pfc("cannot copy %s in %s", + dirname(__FILE__).'/../themes/default', + $this->data_public_path.'/themes/default'); + } + } + // check if the theme_path parameter are correctly setup - if ($this->theme_default_path == "" || !is_dir($this->theme_default_path)) - $this->theme_default_path = realpath(dirname(__FILE__)."/../themes"); - if ($this->theme_path == "" || !is_dir($this->theme_path)) + if ($this->theme_default_path == '' || !is_dir($this->theme_default_path)) + $this->theme_default_path = dirname(__FILE__).'/../themes'; + if ($this->theme_path == '' || !is_dir($this->theme_path)) $this->theme_path = $this->theme_default_path; // calculate theme url if ($this->theme_default_url == '') - $this->theme_default_url = relativePath($this->client_script_path, $this->theme_default_path); + $this->theme_default_url = $this->data_public_url.'/themes'; if ($this->theme_url == '') - $this->theme_url = relativePath($this->client_script_path, $this->theme_path); - + $this->theme_url = $this->theme_default_url; // --- // run specific container initialisation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-18 12:17:28
|
Revision: 1018 http://svn.sourceforge.net/phpfreechat/?rev=1018&view=rev Author: kerphi Date: 2007-04-18 05:17:25 -0700 (Wed, 18 Apr 2007) Log Message: ----------- [en] New Vietnamese vi_VN translation (thanks to lvt) [fr] Nouvelle traduction Vietnamienne (merci ?\195?\160 lvt) Modified Paths: -------------- trunk/demo/index.php trunk/src/pfci18n.class.php Added Paths: ----------- trunk/demo/demo60_in_vietnamese.php trunk/i18n/vi_VN/ trunk/i18n/vi_VN/main.php Added: trunk/demo/demo60_in_vietnamese.php =================================================================== --- trunk/demo/demo60_in_vietnamese.php (rev 0) +++ trunk/demo/demo60_in_vietnamese.php 2007-04-18 12:17:25 UTC (rev 1018) @@ -0,0 +1,36 @@ +<?php + +require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; + +$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat +$params["language"] = "vi_VN"; +$chat = new phpFreeChat( $params ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat demo</title> + + <?php $chat->printJavascript(); ?> + <?php $chat->printStyle(); ?> + + </head> + + <body> + <?php $chat->printChat(); ?> + +<?php + // print the current file + echo "<h2>The source code</h2>"; + $filename = __FILE__; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + + </body> +</html> Modified: trunk/demo/index.php =================================================================== --- trunk/demo/index.php 2007-04-17 20:19:40 UTC (rev 1017) +++ trunk/demo/index.php 2007-04-18 12:17:25 UTC (rev 1018) @@ -124,7 +124,8 @@ <li><a href="demo56_in_romanian.php">demo56 - Romanian translation of the chat</a></li> <li><a href="demo57_in_korean.php">demo57 - Korean translation of the chat</a></li> <li><a href="demo58_in_danish.php">demo58 - Danish translation of the chat</a></li> - <li><a href="demo59_in_norwegian_nynorsk.php">demo58 - Norwegian Nynorsk translation of the chat</a></li> + <li><a href="demo59_in_norwegian_nynorsk.php">demo59 - Norwegian Nynorsk translation of the chat</a></li> + <li><a href="demo60_in_vietnamese.php">demo60 - Vietnamese translation of the chat</a></li> </ul> </div> Added: trunk/i18n/vi_VN/main.php =================================================================== --- trunk/i18n/vi_VN/main.php (rev 0) +++ trunk/i18n/vi_VN/main.php 2007-04-18 12:17:25 UTC (rev 1018) @@ -0,0 +1,384 @@ +<?php +/** + * i18n/vi_VN/main.php + * + * Copyright © 2006 Stephane Gully <ste...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +/** + * Vietnamese translation of the messages (utf8 encoded!) + * + * @author Jet <mir...@ya...> + */ + +// line 45 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["My Chat"] = "Chat room"; + +// line 201 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s not found, %s library can't be found."] = "Không tìm thấy %s, không tìm thấy tệp tin %s."; + +// line 355 in phpfreechat.class.php +$GLOBALS["i18n"]["Please enter your nickname"] = "Hãy nhập tên truy cập của bạn vào đây"; + +// line 565 in phpfreechat.class.php +$GLOBALS["i18n"]["Text cannot be empty"] = "Tin nhắn không thể bị để trống"; + +// line 392 in phpfreechat.class.php +$GLOBALS["i18n"]["%s changes his nickname to %s"] = "%s đã đổi sang tên mới là %s"; + +// line 398 in phpfreechat.class.php +$GLOBALS["i18n"]["%s is connected"] = "%s đang vào phòng chat"; + +// line 452 in phpfreechat.class.php +$GLOBALS["i18n"]["%s quit"] = "%s ra khỏi phòng chat"; + +// line 468 in phpfreechat.class.php +$GLOBALS["i18n"]["%s disconnected (timeout)"] = "%s đã ra khỏi phòng chat (hết thời gian chờ)"; + +// line 262 in phpfreechat.class.php +$GLOBALS["i18n"]["Unknown command [%s]"] = "Câu lệnh không phù hợp [%s]"; + +// line 149 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s doesn't exist: %s"] = "Không tìm thấy %s: %s"; + +// line 180 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["You need %s"] = "Bạn cần có %s"; + +// line 241 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s doesn't exist, %s library can't be found"] = "Không tìm thấy %s, không tìm thấy thư viện %s"; + +// line 280 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s doesn't exist"] = "Không tìm thấy %s"; + +// line 433 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s directory must be specified"] = "thư mục %s phải được chỉ định"; + +// line 439 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s must be a directory"] = "%s phải là một thư mục"; + +// line 446 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s can't be created"] = "Không tạo được %s"; + +// line 451 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s is not writeable"] = "Không ghi được %s"; + +// line 496 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s is not readable"] = "Không đọc được %s"; + +// line 469 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s is not a file"] = "%s không phải là tệp tin"; + +// line 491 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["%s is not a directory"] = "%s không phải là thư mục"; + +// line 23 in chat.html.tpl.php +$GLOBALS["i18n"]["PHP FREE CHAT [powered by phpFreeChat-%s]"] = "PHP FREE CHAT [powered by phpFreeChat-%s]"; + +// line 296 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Hide nickname marker"] = "Ẩn mầu sắc của tên truy cập"; + +// line 304 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Show nickname marker"] = "Hiện mầu sắc của tên truy cập"; + +// line 389 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Disconnect"] = "Thoát ra"; + +// line 395 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Connect"] = "Đăng nhập"; + +// line 427 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Magnify"] = "Phóng to"; + +// line 434 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Cut down"] = "Cắt"; + +// line 345 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Hide dates and hours"] = "Ẩn ngày tháng và thời gian"; + +// line 353 in javascript1.js.tpl.php +$GLOBALS["i18n"]["Show dates and hours"] = "Hiện ngày tháng và thời gian"; + +// line 21 in chat.html.tpl.php +$GLOBALS["i18n"]["Enter your message here"] = "Nhập tin nhắn của bạn vào đây"; + +// line 24 in chat.html.tpl.php +$GLOBALS["i18n"]["Enter your nickname here"] = "Nhập tên truy cập của bạn vào đây"; + +// line 93 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["Error: undefined or obsolete parameter '%s', please correct or remove this parameter"] = "Có lỗi: tham số không xác định hay không cần thiết '%s', hãy chỉnh lại hay lược bỏ tham số này"; + +// line 86 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Hide smiley box"] = "Ẩn mặt cười"; + +// line 87 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Show smiley box"] = "Hiện mặt cười"; + +// line 88 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Hide online users box"] = "Ẩn danh sách người đang chat"; + +// line 89 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Show online users box"] = "Hiện danh sách người đang chat"; + +// line 33 in chat.html.tpl.php +$GLOBALS["i18n"]["Bold"] = "Đậm"; + +// line 34 in chat.html.tpl.php +$GLOBALS["i18n"]["Italics"] = "Nghiêng"; + +// line 35 in chat.html.tpl.php +$GLOBALS["i18n"]["Underline"] = "Gạch chân"; + +// line 36 in chat.html.tpl.php +$GLOBALS["i18n"]["Delete"] = "Xóa"; + +// line 37 in chat.html.tpl.php +$GLOBALS["i18n"]["Pre"] = "Pre"; + +// line 38 in chat.html.tpl.php +$GLOBALS["i18n"]["Mail"] = "Mail"; + +// line 39 in chat.html.tpl.php +$GLOBALS["i18n"]["Color"] = "Mầu sắc"; + +// line 48 in phpfreechattemplate.class.php +$GLOBALS["i18n"]["%s template could not be found"] = "Không tìm thấy tệp tin template sau : %s"; + +// line 512 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct"] = "Có lỗi: không tìm thấy '%s', hãy kiểm tra lại đường dẫn cho '%s' và '%s'"; + +// line 75 in pfccommand.class.php +$GLOBALS["i18n"]["%s must be implemented"] = "%s phải được khởi tạo"; + + +// line 343 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["'%s' parameter is mandatory by default use '%s' value"] = "'%s' là bắt buộc, tham số mặc định là '%s'"; + +// line 378 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["'%s' parameter must be a positive number"] = "'%s' phải là một số thực"; + +// line 386 in phpfreechatconfig.class.php +$GLOBALS["i18n"]["'%s' parameter is not valid. Available values are : '%s'"] = "Giá trị của '%s' không hợp lệ. Những giá trị có thể dùng là: '%s'"; + +// line 185 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["My room"] = "Chat Room"; + +// line 109 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Private message"] = "Tin nhắn cá nhân"; + +// line 110 in pfcclient.js.tpl.php +$GLOBALS["i18n"]["Close this tab"] = "Đóng thẻ này lại"; + +// line 225 in pfcgui.js.tpl.php +$GLOBALS["i18n"]["Do you really want to leave this room ?"] = "Bạn thực sự muốn rời khỏi phòng chat ?"; + +// line 19 in unban.class.php +$GLOBALS["i18n"]["Missing parameter"] = "Thiếu tham số"; + +// line 38 in ban.class.php +$GLOBALS["i18n"]["banished from %s by %s"] = "bị cấm vào %s bởi %s"; + +// line 23 in banlist.class.php +$GLOBALS["i18n"]["The banished user's id list is:"] = "Danh sách những người bị cấm:"; + +// line 32 in banlist.class.php +$GLOBALS["i18n"]["Empty"] = "Trống"; + +// line 34 in banlist.class.php +$GLOBALS["i18n"]["'/unban {id}' will unban the user identified by {id}"] = "'/unban {id}' sẽ xóa lệnh cấm cho {id}"; + +// line 35 in banlist.class.php +$GLOBALS["i18n"]["'/unban all' will unban all the users on this channel"] = "'/unban all' sẽ xóa lệnh cấm cho tất những người đang ở trong phòng chat này"; + +// line 24 in update.class.php +$GLOBALS["i18n"]["%s quit (timeout)"] = "%s rời khỏi phòng (hết thời gian chờ)"; + +// line 46 in join.class.php +$GLOBALS["i18n"]["%s joins %s"] = "%s đang vào %s"; + +// line 31 in kick.class.php +$GLOBALS["i18n"]["kicked from %s by %s"] = "bị đuổi ra khỏi %s bởi %s"; + +// line 38 in send.class.php +$GLOBALS["i18n"]["Can't send the message, %s is offline"] = "Không gửi được tin nhắn, %s hiện không có mặt trong phòng chat"; + +// line 27 in unban.class.php +$GLOBALS["i18n"]["Nobody has been unbanished"] = "Không có ai được bỏ lệnh cấm cả"; + +// line 42 in unban.class.php +$GLOBALS["i18n"]["%s has been unbanished"] = "%s đã được bỏ lệnh cấm"; + +// line 49 in unban.class.php +$GLOBALS["i18n"]["%s users have been unbanished"] = "%s người đã được xóa lệnh cấm"; + +// line 47 in auth.class.php +$GLOBALS["i18n"]["You are not allowed to run '%s' command"] = "Bạn không có quyền sử dụng lệnh '%s'"; + +// line 67 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because you are banished"] = "Bạn không vào được %s vì bạn đang bị cấm vận"; + +// line 79 in auth.class.php +$GLOBALS["i18n"]["You are not allowed to change your nickname"] = "Bạn không có quyền thay tên truy cập"; + +// line 76 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Không vào được %s vì phòng này nằm trong danh sách bị hạn chế"; + +// line 56 in noflood.class.php +$GLOBALS["i18n"]["Please don't post so many message, flood is not tolerated"] = "Xin đừng gửi nhiều tin nhắn một lúc như vậy, mọi hành động bị coi là spam sẽ bị xử lý"; + +// line 169 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["Error: '%s' is a private parameter, you are not allowed to change it"] = "Có lỗi: '%s' là một tham số cố định, bạn không thể thay đổi nó"; + +// line 253 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["'%s' parameter must be an array"] = "'%s' phải là tham số có dạng xâu (Array)"; + +// line 265 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["'%s' parameter must be a boolean"] = "'%s' phải là tham số dạng Boolean"; + +// line 271 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["'%s' parameter must be a charatere string"] = "'%s' phải là tham số dạng chuỗi ký tự"; + +// line 395 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["'%s' must be writable"] = "'%s' phải cho phép ghi"; + +// line 425 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["'%s' directory doesn't exist"] = "Không tìm được thư mục '%s'"; + +// line 544 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["Please correct these errors"] = "Hãy kiểm tra lại những lỗi trên"; + +// line 21 in pfcinfo.class.php +$GLOBALS["i18n"]["Error: the cached config file doesn't exists"] = "Có lỗi: không tìm thấy tệp đệm của tệp tin điều khiển"; + +// line 190 in phpfreechat.class.php +$GLOBALS["i18n"]["Error: the chat cannot be loaded! two possibilities: your browser doesn't support javascript or you didn't setup correctly the server directories rights - don't hesitate to ask some help on the forum"] = "Có lỗi: không khởi động được chức năng chat! Có hai khả năng sau: trình duyệt của bạn không hỗ trợ JavaScript hay bạn chưa set quyền hợp lý cho các thư mục - Xin đừng ngại, bạn có thể đặt câu hỏi trên forum của chúng tôi"; + +// line 31 in help.class.php +$GLOBALS["i18n"]["Here is the command list:"] = "Danh sách các lệnh:"; + +// line 63 in identify.class.php +$GLOBALS["i18n"]["Succesfully identified"] = "Đăng nhập thành công"; + +// line 68 in identify.class.php +$GLOBALS["i18n"]["Identification failure"] = "Không đăng nhập được"; + +// line 25 in send.class.php +$GLOBALS["i18n"]["Your must be connected to send a message"] = "Bạn phải đăng nhập để có thể gửi tin nhắn"; + +// line 87 in chat.js.tpl.php +$GLOBALS["i18n"]["Click here to send your message"] = "Nhấn vào đây để gửi tin nhắn"; + +// line 80 in chat.js.tpl.php +$GLOBALS["i18n"]["Enter the text to format"] = "Nhập văn bản cần định dạng"; + +// line 81 in chat.js.tpl.php +$GLOBALS["i18n"]["Configuration has been rehashed"] = "Các thay đổi đã được cập nhật"; + +// line 82 in chat.js.tpl.php +$GLOBALS["i18n"]["A problem occurs during rehash"] = "Không cập nhật được các thay đổi"; + +// line 83 in chat.js.tpl.php +$GLOBALS["i18n"]["Choosen nickname is allready used"] = "Tên truy cập này đã được sử dụng"; + +// line 84 in chat.js.tpl.php +$GLOBALS["i18n"]["phpfreechat current version is %s"] = "Phiên bản hiện thời của PFC là %s"; + +// line 85 in chat.js.tpl.php +$GLOBALS["i18n"]["Maximum number of joined channels has been reached"] = "Số lượng phòng chat bạn truy cập vào đã đạt mức tối đa"; + +// line 86 in chat.js.tpl.php +$GLOBALS["i18n"]["Maximum number of private chat has been reached"] = "Số lượng tin nhắn riêng tư đã đạt tới mức tối đa"; + +// line 88 in chat.js.tpl.php +$GLOBALS["i18n"]["Send"] = "Gửi đi"; + +// line 86 in mysql.class.php +$GLOBALS["i18n"]["Mysql container: connect error"] = "Lỗi Mysql: không kết nối được với cơ sở dữ liệu"; + +// line 101 in mysql.class.php +$GLOBALS["i18n"]["Mysql container: create database error '%s'"] = "Lỗi Mysql: không tạo được cơ sở dữ liệu '%s'"; + +// line 112 in mysql.class.php +$GLOBALS["i18n"]["Mysql container: create table error '%s'"] = "Lỗi Mysql: không tạo được bảng '%s'"; + +// line 80 in chat.js.tpl.php +$GLOBALS["i18n"]["You are not allowed to speak to yourself"] = "Bạn không được phép tự chat một mình"; + +// line 82 in chat.js.tpl.php +$GLOBALS["i18n"]["Choosen nickname is not allowed"] = "Tên truy cập không được chấp nhận"; + +// line 83 in chat.js.tpl.php +$GLOBALS["i18n"]["Enable sound notifications"] = "Bật chức năng thông báo bằng âm thanh"; + +// line 84 in chat.js.tpl.php +$GLOBALS["i18n"]["Disable sound notifications"] = "Tắt chức năng thông báo bằng âm thanh"; + +// line 23 in kick.class.php +$GLOBALS["i18n"]["no reason"] = "không có lý do"; + +// line 24 in banlist.class.php +$GLOBALS["i18n"]["The banished user list is:"] = "Danh sách những người bị cấm:"; + +// line 39 in banlist.class.php +$GLOBALS["i18n"]["'/unban {nickname}' will unban the user identified by {nickname}"] = "'/unban {nickname}' sẽ bỏ lệnh cấm đối với người có tên truy cập {nickname}"; + +// line 43 in kick.class.php +$GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = "bị đuổi khỏi %s bởi %s - Lý do: %s"; + +// line 20 in quit.class.php +$GLOBALS["i18n"]["%s quit (%s)"] = "%s rời khỏi (%s)"; + +// line 124 in chat.js.tpl.php +$GLOBALS["i18n"]["Chat loading ..."] = "Đang nạp thông tin ..."; + +// line 124 in chat.js.tpl.php +$GLOBALS["i18n"]["Please wait"] = "Xin chờ một chút"; + +// line 139 in chat.js.tpl.php +$GLOBALS["i18n"]["%s appears to be either disabled or unsupported by your browser."] = "%s có thể bị tắt hoặc trình duyệt của bạn không hỗ trợ tính năng này."; + +// line 139 in chat.js.tpl.php +$GLOBALS["i18n"]["This web application requires %s to work properly."] = "Ứng dụng này cần có %s để có thể chạy được."; + +// line 135 in chat.js.tpl.php +$GLOBALS["i18n"]["Please enable %s in your browser settings, or upgrade to a browser with %s support and try again."] = "Bạn phải bật tính năng hỗ trợ %s cho trình duyệt hoặc cập nhật trình duyệt lên phiên bản có hỗ trợ %s và thử lại."; + +// line 137 in chat.js.tpl.php +$GLOBALS["i18n"]["Please upgrade to a browser with %s support and try again."] = "Bạn phải cập nhật trình duyệt lên phiên bản mới nhất có hỗ trợ %s và thử lại."; + +// line 139 in chat.js.tpl.php +$GLOBALS["i18n"]["In Internet Explorer versions earlier than 7.0, Ajax is implemented using ActiveX. Please enable ActiveX in your browser security settings or upgrade to a browser with Ajax support and try again."] = "Trình duyệt Internet Explorer cũ hơn 7.0 dùng ActiveX để hỗ trợ Ajax, bạn phải bật ActiveX hay cập nhật lên phiên bản mới nhất"; + +// line 359 in pfcglobalconfig.class.php +$GLOBALS["i18n"]["%s doesn't exist, data_public_path cannot be installed"] = "Không tìm thấy %s, không cài đặt được data_public_path"; + +// line 73 in invite.class.php +$GLOBALS["i18n"]["You must join %s to invite users in this channel"] = "Bạn phải vào %s để mời người chat trong phòng"; + +// line 47 in chat.html.tpl.php +$GLOBALS["i18n"]["Ping"] = "Ping"; + +// line 477 in phpfreechat.class.php +$GLOBALS["i18n"]["Input Required"] = "Bạn chưa nhập thông tin"; + +// line 478 in phpfreechat.class.php +$GLOBALS["i18n"]["OK"] = "OK"; + +// line 479 in phpfreechat.class.php +$GLOBALS["i18n"]["Cancel"] = "Thôi"; + +?> Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2007-04-17 20:19:40 UTC (rev 1017) +++ trunk/src/pfci18n.class.php 2007-04-18 12:17:25 UTC (rev 1018) @@ -97,7 +97,7 @@ */ function GetAcceptedLanguage($type="main") { - return /*<GetAcceptedLanguage>*/array('ar_LB','sv_SE','ja_JP','ba_BA','pt_PT','el_GR','tr_TR','hy_AM','nb_NO','zh_TW','ru_RU','fr_FR','es_ES','bg_BG','zh_CN','nl_NL','de_DE-informal','pl_PL','pt_BR','it_IT','id_ID','hu_HU','en_US','sr_CS','de_DE-formal','eo','bn_BD','uk_UA','uk_RO','ko_KR','da_DK','nn_NO');/*</GetAcceptedLanguage>*/ + return /*<GetAcceptedLanguage>*/array('ar_LB','sv_SE','ja_JP','ba_BA','pt_PT','el_GR','tr_TR','hy_AM','nb_NO','zh_TW','ru_RU','fr_FR','es_ES','bg_BG','zh_CN','nl_NL','de_DE-informal','pl_PL','pt_BR','it_IT','id_ID','hu_HU','en_US','sr_CS','de_DE-formal','eo','bn_BD','uk_UA','uk_RO','ko_KR','da_DK','nn_NO','vi_VN');/*</GetAcceptedLanguage>*/ } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-17 20:19:40
|
Revision: 1017 http://svn.sourceforge.net/phpfreechat/?rev=1017&view=rev Author: kerphi Date: 2007-04-17 13:19:40 -0700 (Tue, 17 Apr 2007) Log Message: ----------- [en] Bug fix: private message tabs were lost when reloading the chat page [0h10] [fr] Bug fix : les onglets des messages priv?\195?\169s ?\195?\169taient perdus lorsque l'on rechargait le chat [0h10] Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-04-16 17:00:15 UTC (rev 1016) +++ trunk/src/commands/connect.class.php 2007-04-17 20:19:40 UTC (rev 1017) @@ -75,7 +75,7 @@ { $cmdp = array(); $cmdp["param"] = $pvlist[$i]; - $cmd =& pfcCommand::Factory( $i < count($pvlist)-1 || !$joinoldchan ? 'join2' : 'join' ); + $cmd =& pfcCommand::Factory( $i < count($pvlist)-1 || !$joinoldchan ? 'privmsg2' : 'privmsg' ); $cmd->run($xml_reponse, $cmdp); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-16 17:00:18
|
Revision: 1016 http://svn.sourceforge.net/phpfreechat/?rev=1016&view=rev Author: kerphi Date: 2007-04-16 10:00:15 -0700 (Mon, 16 Apr 2007) Log Message: ----------- [en] Bug fix: nicknames with spaces at first connection were broken [fr] Bug fix : les pseudonymes avec des espaces entr?\195?\169s lors de la premi?\195?\168re connexion ne fonctionnaient pas Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-04-13 11:42:00 UTC (rev 1015) +++ trunk/data/public/js/pfcclient.js 2007-04-16 17:00:15 UTC (rev 1016) @@ -150,7 +150,7 @@ if (this.isconnected) this.sendRequest('/nick "'+newnick+'"'); else - this.sendRequest('/connect '+newnick); + this.sendRequest('/connect "'+newnick+'"'); } }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-13 11:52:03
|
Revision: 1015 http://svn.sourceforge.net/phpfreechat/?rev=1015&view=rev Author: kerphi Date: 2007-04-13 04:42:00 -0700 (Fri, 13 Apr 2007) Log Message: ----------- [en] Bug fix: the demo50 (usermeta / avatar) was broken [0h25] [fr] Bug fix?\194?\160: la demo50 (usermeta / avatar) ne fonctionnait pas corretement [0h25] Modified Paths: -------------- trunk/demo/demo50_customized_usermetadata.php trunk/demo/demo50_data/mytheme/customize.js.php trunk/themes/default/style.css.php Modified: trunk/demo/demo50_customized_usermetadata.php =================================================================== --- trunk/demo/demo50_customized_usermetadata.php 2007-04-01 13:10:16 UTC (rev 1014) +++ trunk/demo/demo50_customized_usermetadata.php 2007-04-13 11:42:00 UTC (rev 1015) @@ -5,7 +5,7 @@ $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat $params["title"] = "A chat which shows how to use user metadata : add avatar (images) to each connected users"; $params["nick"] = "guest".rand(1,1000); -$params["nickmeta"] = array("avatar" => "demo50_data/avatar".rand(1,10).".jpg"); +$params["nickmeta"] = array("avatar" => "demo50_data/avatar".rand(1,9).".jpg"); $params["theme_path"] = dirname(__FILE__)."/demo50_data"; $params["theme"] = "mytheme"; $chat = new phpFreeChat( $params ); Modified: trunk/demo/demo50_data/mytheme/customize.js.php =================================================================== --- trunk/demo/demo50_data/mytheme/customize.js.php 2007-04-01 13:10:16 UTC (rev 1014) +++ trunk/demo/demo50_data/mytheme/customize.js.php 2007-04-13 11:42:00 UTC (rev 1015) @@ -1,71 +1,43 @@ pfcClient.prototype.updateNickWhoisBox = function(nickid) - { +{ + var usermeta = this.getAllUserMeta(nickid); + var div = document.createElement('div'); div.setAttribute('class', 'pfc_nickwhois'); div.setAttribute('className', 'pfc_nickwhois'); // for IE6 - var ul = document.createElement('ul'); - div.appendChild(ul); + var p = document.createElement('p'); + p.setAttribute('class', 'pfc_nickwhois_header'); + p.setAttribute('className', 'pfc_nickwhois_header'); // for IE6 + div.appendChild(p); // add the close button - var li = document.createElement('li'); - li.setAttribute('class', 'pfc_nickwhois_close'); - li.setAttribute('className', 'pfc_nickwhois_close'); // for IE6 - ul.appendChild(li); - var a = document.createElement('a'); - a.setAttribute('href', ''); - a.pfc_parent = div; - a.onclick = function(evt){ + var img = document.createElement('img'); + img.setAttribute('class', 'pfc_nickwhois_close'); + img.setAttribute('className', 'pfc_nickwhois_close'); // for IE6 + img.pfc_parent = div; + img.onclick = function(evt){ this.pfc_parent.style.display = 'none'; return false; } - var img = document.createElement('img'); img.setAttribute('src', this.res.getFileUrl('images/close-whoisbox.gif')); - img.alt = document.createTextNode(this.res.getLabel('Close')); - a.appendChild(img); - li.appendChild(a); + img.alt = this.res.getLabel('Close'); + p.appendChild(img); + p.appendChild(document.createTextNode(usermeta['nick'])); // append the nickname text in the title - // add the privmsg link (do not add it if this button is yourself) - if (pfc.getUserMeta(nickid,'nick') != this.nickname) - { - var li = document.createElement('li'); - li.setAttribute('class', 'pfc_nickwhois_pv'); - li.setAttribute('className', 'pfc_nickwhois_pv'); // for IE6 - ul.appendChild(li); - var a = document.createElement('a'); - a.setAttribute('href', ''); - a.pfc_nickid = nickid; - a.pfc_parent = div; - a.onclick = function(evt){ - var nick = pfc.getUserMeta(this.pfc_nickid,'nick'); - pfc.sendRequest('/privmsg "'+nick+'"'); - this.pfc_parent.style.display = 'none'; - return false; - } - var img = document.createElement('img'); - img.setAttribute('src', this.res.getFileUrl('images/openpv.gif')); - img.alt = document.createTextNode(this.res.getLabel('Private message')); - a.appendChild(img); - a.appendChild(document.createTextNode(this.res.getLabel('Private message'))); - li.appendChild(a); - } - - // add the whois information table var table = document.createElement('table'); -// table.setAttribute('cellspacing',0); -// table.setAttribute('cellpadding',0); -// table.setAttribute('border',0); var tbody = document.createElement('tbody'); table.appendChild(tbody); - var um = this.getAllUserMeta(nickid); - var um_keys = um.keys(); + var um_keys = usermeta.keys(); var msg = ''; for (var i=0; i<um_keys.length; i++) { var k = um_keys[i]; - var v = um[k]; + var v = usermeta[k]; if (v && k != 'nickid' + && k != 'nick' // useless because it is displayed in the box title + && k != 'isadmin' // useless because of the gold shield icon && k != 'floodtime' && k != 'flood_nbmsg' && k != 'flood_nbchar' @@ -89,11 +61,39 @@ div.appendChild(table); // append the avatar image - var img = document.createElement('img'); - img.setAttribute('src',this.getUserMeta(nickid,'avatar')); - img.setAttribute('class', 'pfc_nickwhois_avatar'); - img.setAttribute('className', 'pfc_nickwhois_avatar'); // for IE6 - div.appendChild(img); + if (this.getUserMeta(nickid,'avatar')) + { + var img = document.createElement('img'); + img.setAttribute('src',this.getUserMeta(nickid,'avatar')); + img.setAttribute('class', 'pfc_nickwhois_avatar'); + img.setAttribute('className', 'pfc_nickwhois_avatar'); // for IE6 + div.appendChild(img); + } + + // add the privmsg link (do not add it if this button is yourself) + if (pfc.getUserMeta(nickid,'nick') != this.nickname) + { + var p = document.createElement('p'); + p.setAttribute('class', 'pfc_nickwhois_pv'); + p.setAttribute('className', 'pfc_nickwhois_pv'); // for IE6 + var a = document.createElement('a'); + a.setAttribute('href', ''); + a.pfc_nickid = nickid; + a.pfc_parent = div; + a.onclick = function(evt){ + var nick = pfc.getUserMeta(this.pfc_nickid,'nick'); + pfc.sendRequest('/privmsg "'+nick+'"'); + this.pfc_parent.style.display = 'none'; + return false; + } + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/openpv.gif')); + img.alt = document.createTextNode(this.res.getLabel('Private message')); + a.appendChild(img); + a.appendChild(document.createTextNode(this.res.getLabel('Private message'))); + p.appendChild(a); + div.appendChild(p); + } - this.nickwhoisbox[nickid] = div; - } + this.nickwhoisbox[nickid] = div; +} Modified: trunk/themes/default/style.css.php =================================================================== --- trunk/themes/default/style.css.php 2007-04-01 13:10:16 UTC (rev 1014) +++ trunk/themes/default/style.css.php 2007-04-13 11:42:00 UTC (rev 1015) @@ -359,6 +359,7 @@ font-size: 75%; } .pfc_nickwhois_header { + margin: 0; padding: 0; background-color: #EEE; border-bottom: 1px solid #444; text-align: center; @@ -379,6 +380,10 @@ } td.pfc_nickwhois_c2 { } +.pfc_nickwhois_pv { + margin:0; padding: 0; + text-align: center; +} .pfc_nickwhois_pv a { text-decoration: none; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-01 13:10:17
|
Revision: 1014 http://svn.sourceforge.net/phpfreechat/?rev=1014&view=rev Author: kerphi Date: 2007-04-01 06:10:16 -0700 (Sun, 01 Apr 2007) Log Message: ----------- simplify the lock process Modified Paths: -------------- trunk/src/pfctools.php Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2007-04-01 13:06:42 UTC (rev 1013) +++ trunk/src/pfctools.php 2007-04-01 13:10:16 UTC (rev 1014) @@ -418,7 +418,7 @@ if( $fp && flock( $fp, LOCK_SH ) ) { $data = fread( $fp, $size ); - flock($fp, LOCK_UN); + // flock($fp, LOCK_UN); // will be done by fclose } fclose( $fp ); return $data; @@ -433,7 +433,7 @@ if( $fp && flock( $fp, LOCK_EX ) ) { fwrite( $fp, $data ); - flock($fp, LOCK_UN); + // flock($fp, LOCK_UN); // will be done by fclose } fclose( $fp ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-01 13:06:42
|
Revision: 1013 http://svn.sourceforge.net/phpfreechat/?rev=1013&view=rev Author: kerphi Date: 2007-04-01 06:06:42 -0700 (Sun, 01 Apr 2007) Log Message: ----------- [en] Bug fix: use flock() to lock the read and write access in the file container [1h10] [fr] Bug fix : utilise la fonction flock() pour les acc?\195?\168s en lecture et ?\195?\169criture du conteneur "file" [1h10] Modified Paths: -------------- trunk/src/containers/file.class.php trunk/src/pfctools.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2007-04-01 11:01:46 UTC (rev 1012) +++ trunk/src/containers/file.class.php 2007-04-01 13:06:42 UTC (rev 1013) @@ -91,7 +91,7 @@ } else { - file_put_contents($leaffilename, $leafvalue); + flock_put_contents($leaffilename, $leafvalue); } // store the value in the memory cache @@ -157,7 +157,7 @@ if (!file_exists($leaffilename)) return $ret; if ($withleafvalue) - $ret["value"][] = file_get_contents($leaffilename); + $ret["value"][] = flock_get_contents($leaffilename); else $ret["value"][] = NULL; $ret["timestamp"][] = filemtime($leaffilename); Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2007-04-01 11:01:46 UTC (rev 1012) +++ trunk/src/pfctools.php 2007-04-01 13:06:42 UTC (rev 1013) @@ -403,4 +403,40 @@ } } +/** + * Almost the Same as file_get_contents except that it uses flock() to lock the file + */ +function flock_get_contents($filename, $mode = "rb") +{ + $data = ''; + if (!file_exists($filename)) return $data; + + $size = filesize($filename); + if ($size == 0) return $data; + + $fp = fopen( $filename, $mode ); + if( $fp && flock( $fp, LOCK_SH ) ) + { + $data = fread( $fp, $size ); + flock($fp, LOCK_UN); + } + fclose( $fp ); + return $data; +} + +/** + * Almost the Same as file_put_contents except that it uses flock() to lock the file + */ +function flock_put_contents($filename, $data, $mode = "wb") +{ + $fp = fopen( $filename, $mode ); + if( $fp && flock( $fp, LOCK_EX ) ) + { + fwrite( $fp, $data ); + flock($fp, LOCK_UN); + } + fclose( $fp ); +} + + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-04-01 11:01:51
|
Revision: 1012 http://svn.sourceforge.net/phpfreechat/?rev=1012&view=rev Author: kerphi Date: 2007-04-01 04:01:46 -0700 (Sun, 01 Apr 2007) Log Message: ----------- [en] Bug fix: add get_ip_from_xforwardedfor parameter which can be used to get ip from HTTP_X_FORWARDED_FOR when the chat is behind a reverse proxy (thanks to datacompboy) [0h15] [fr] Bug fix : ajout du parametre get_ip_from_xforwardedfor qui peut ?\195?\170tre utilis?\195?\169 pour r?\195?\169cup?\195?\169rer l'ip des client depuis l'ent?\195?\170te http HTTP_X_FORWARDED_FOR lorsque le chat est derri?\195?\168re un reverse proxy (merci ?\195?\160 datacompboy) [0h15] Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-03-29 08:29:05 UTC (rev 1011) +++ trunk/src/commands/connect.class.php 2007-04-01 11:01:46 UTC (rev 1012) @@ -43,7 +43,9 @@ $nickid = $u->nickid; $ct->joinChan($nickid, NULL); // join the server // store the user ip - $ip = isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"]; + $ip = ( $c->get_ip_from_xforwardedfor && isset($_SERVER["HTTP_X_FORWARDED_FOR"])) ? + $_SERVER["HTTP_X_FORWARDED_FOR"] : + $_SERVER["REMOTE_ADDR"]; if ($ip == "::1") $ip = "127.0.0.1"; // fix for konqueror & localhost $ct->setUserMeta($nickid, 'ip', $ip); // store the admin flag Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-03-29 08:29:05 UTC (rev 1011) +++ trunk/src/pfcglobalconfig.class.php 2007-04-01 11:01:46 UTC (rev 1012) @@ -131,6 +131,14 @@ var $debugurl = ""; var $debug = false; var $debugxajax = false; + + /** + * This parameter is useful when your chat server is behind a reverse proxy that + * forward client ip address in HTTP_X_FORWARDED_FOR http header. + * see : http://www.phpfreechat.net/forum/viewtopic.php?id=1344 + */ + var $get_ip_from_xforwardedfor = false; + // private parameters var $_sys_proxies = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-29 08:29:04
|
Revision: 1011 http://svn.sourceforge.net/phpfreechat/?rev=1011&view=rev Author: kerphi Date: 2007-03-29 01:29:05 -0700 (Thu, 29 Mar 2007) Log Message: ----------- 1.0-beta10 Added Paths: ----------- tags/1.0-beta10/ Copied: tags/1.0-beta10 (from rev 1010, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-28 11:57:20
|
Revision: 1010 http://svn.sourceforge.net/phpfreechat/?rev=1010&view=rev Author: kerphi Date: 2007-03-28 04:57:20 -0700 (Wed, 28 Mar 2007) Log Message: ----------- 1.0-beta10 Modified Paths: -------------- trunk/version.txt Modified: trunk/version.txt =================================================================== --- trunk/version.txt 2007-03-25 17:42:32 UTC (rev 1009) +++ trunk/version.txt 2007-03-28 11:57:20 UTC (rev 1010) @@ -1 +1 @@ -1.0-beta10-pre +1.0-beta10 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-25 17:42:32
|
Revision: 1009 http://svn.sourceforge.net/phpfreechat/?rev=1009&view=rev Author: kerphi Date: 2007-03-25 10:42:32 -0700 (Sun, 25 Mar 2007) Log Message: ----------- Bug fix: users were not considered online when they connected first time Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/invite.class.php trunk/src/commands/updatemynick.class.php trunk/src/pfccontainer.class.php trunk/src/pfcuserconfig.class.php trunk/src/proxies/auth.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-03-25 16:55:12 UTC (rev 1008) +++ trunk/src/commands/connect.class.php 2007-03-25 17:42:32 UTC (rev 1009) @@ -39,16 +39,9 @@ $isadmin = true; } - // setup some user meta + // create the nickid and setup some user meta $nickid = $u->nickid; - - // create the nickid $ct->joinChan($nickid, NULL); // join the server - - // setup the active flag in user session - // $u->active = true; - // $u->saveInCache(); - // store the user ip $ip = isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"]; if ($ip == "::1") $ip = "127.0.0.1"; // fix for konqueror & localhost Modified: trunk/src/commands/invite.class.php =================================================================== --- trunk/src/commands/invite.class.php 2007-03-25 16:55:12 UTC (rev 1008) +++ trunk/src/commands/invite.class.php 2007-03-25 17:42:32 UTC (rev 1009) @@ -66,7 +66,7 @@ } // check that the inviter is already in the channeltarget - if ($ct->isNickOnline(pfcCommand_join::GetRecipient($channeltarget),$u->nickid) == -1) + if (!$ct->isNickOnline(pfcCommand_join::GetRecipient($channeltarget),$u->nickid)) { $cmdp = $p; $cmdp["params"] = array(); Modified: trunk/src/commands/updatemynick.class.php =================================================================== --- trunk/src/commands/updatemynick.class.php 2007-03-25 16:55:12 UTC (rev 1008) +++ trunk/src/commands/updatemynick.class.php 2007-03-25 17:42:32 UTC (rev 1009) @@ -14,9 +14,9 @@ $c =& pfcGlobalConfig::Instance(); $u =& pfcUserConfig::Instance(); - - $container =& pfcContainer::Instance(); - $container->updateNick($u->nickid); + $ct =& pfcContainer::Instance(); + + $ct->updateNick($u->nickid); } } Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2007-03-25 16:55:12 UTC (rev 1008) +++ trunk/src/pfccontainer.class.php 2007-03-25 17:42:32 UTC (rev 1009) @@ -129,7 +129,7 @@ $this->setMeta("channelid-to-nickid", $this->encode($chan), $nickid); // update the SERVER channel - if ($chan != 'SERVER') $this->updateNick($nickid); + if ($chan == 'SERVER') $this->updateNick($nickid); return true; } @@ -348,18 +348,17 @@ /** * Returns returns a positive number if the nick is online in the given channel * @param $chan if NULL then check if the user is online on the server, otherwise check if the user has joined the channel - * @return -1 if the user is off line, a positive (>=0) if the user is online + * @return false if the user is off line, true if the user is online */ function isNickOnline($chan, $nickid) { if ($chan == NULL) $chan = 'SERVER'; - $ret = $this->getMeta("channelid-to-nickid", $this->encode($chan)); - for($i = 0; $i<count($ret['timestamp']); $i++) - { - if ($ret['value'][$i] == $nickid) return $i; - } - return -1; + $ret = $this->getMeta("channelid-to-nickid", + $this->encode($chan), + $nickid); + + return (count($ret['timestamp']) > 0); } /** Modified: trunk/src/pfcuserconfig.class.php =================================================================== --- trunk/src/pfcuserconfig.class.php 2007-03-25 16:55:12 UTC (rev 1008) +++ trunk/src/pfcuserconfig.class.php 2007-03-25 17:42:32 UTC (rev 1009) @@ -111,7 +111,7 @@ function isOnline() { $ct =& pfcContainer::Instance(); - $online = ($ct->isNickOnline(NULL, $this->nickid) >= 0); + $online = $ct->isNickOnline(NULL, $this->nickid); return $online; } Modified: trunk/src/proxies/auth.class.php =================================================================== --- trunk/src/proxies/auth.class.php 2007-03-25 16:55:12 UTC (rev 1008) +++ trunk/src/proxies/auth.class.php 2007-03-25 17:42:32 UTC (rev 1009) @@ -43,10 +43,10 @@ // do not allow someone to run a command if he is not online - if ($this->name != 'error' && - $this->name != 'connect' && - $this->name != 'update' && - !$u->isOnline()) + if ( !$u->isOnline() && + $this->name != 'error' && + $this->name != 'connect' && + $this->name != 'update' ) { $cmdp = $p; $cmdp["param"] = _pfc("Your must be connected to send a message"); @@ -113,4 +113,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-25 16:55:12
|
Revision: 1008 http://svn.sourceforge.net/phpfreechat/?rev=1008&view=rev Author: kerphi Date: 2007-03-25 09:55:12 -0700 (Sun, 25 Mar 2007) Log Message: ----------- code cleaning Modified Paths: -------------- trunk/src/pfccommand.class.php Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2007-03-25 15:58:22 UTC (rev 1007) +++ trunk/src/pfccommand.class.php 2007-03-25 16:55:12 UTC (rev 1008) @@ -301,13 +301,41 @@ $params = array_values($params); $params = array_map("trim",$params); $params = array_merge(array($clientid,$recipientid), $params); + + $result['cmdstr'] = $cmd_str; + $result['cmdname'] = $cmd; + $result['params'] = $params; + } + return $result; + } + + /* + // THIS IS ANOTHER WAY TO PARSE THE PARAMETERS + // IT'S NOT SIMPLIER BUT MAYBE FASTER + // @todo : take the faster methode + function ParseCommand($cmd_str, $one_parameter = false) + { + $pattern_command = '/^\/([a-z0-9]+)\s*([a-z0-9]+)\s*([a-z0-9]+)\s*(.*)/'; + $result = array(); + + // parse the command name (ex: '/invite') + if (preg_match($pattern_command, $cmd_str, $res)) + { + $cmd = $res[1]; + $clientid = $res[2]; + $recipientid = $res[3]; + $params_str = $res[4]; + // don't parse multiple parameters for special commands with only one parameter + // this make possible to send double quotes (") in these commands + if ($one_parameter || $cmd == 'send' || $cmd == 'notice' || $cmd == 'me') + { + $result['cmdstr'] = $cmd_str; + $result['cmdname'] = $cmd; + $result['params'] = array($clientid, $recipientid, $params_str); + return $result; + } - // THIS IS ANOTHER WAY TO PARSE THE PARAMETERS - // IT'S NOT SIMPLIER BUT MAYBE FASTER - // @todo : take the faster methode - /* - $params = array($clientid, $recipientid); $sep = preg_match('/[^\\\\]"/',$params_str) ? '"' : ' '; if ($sep == ' ') $params_str = ' ' . $params_str; @@ -345,8 +373,6 @@ // append the tail if ($offset < strlen($params_str)) $params[] = substr($params_str,$offset); - */ - $result['cmdstr'] = $cmd_str; $result['cmdname'] = $cmd; @@ -354,6 +380,8 @@ } return $result; } +*/ + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-25 15:58:25
|
Revision: 1007 http://svn.sourceforge.net/phpfreechat/?rev=1007&view=rev Author: kerphi Date: 2007-03-25 08:58:22 -0700 (Sun, 25 Mar 2007) Log Message: ----------- Bug fix : the private messages was broken Modified Paths: -------------- trunk/src/commands/privmsg.class.php Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2007-03-25 15:47:50 UTC (rev 1006) +++ trunk/src/commands/privmsg.class.php 2007-03-25 15:58:22 UTC (rev 1007) @@ -21,7 +21,7 @@ $pvnickid = ''; if ($this->name == 'privmsg2') { - $pvnickid = $ct->getNickId($param); + $pvnickid = $param; $pvname = $ct->getNickname($pvnickid); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-25 15:47:50
|
Revision: 1006 http://svn.sourceforge.net/phpfreechat/?rev=1006&view=rev Author: kerphi Date: 2007-03-25 08:47:50 -0700 (Sun, 25 Mar 2007) Log Message: ----------- improve the non-wanted timeout disconnections managment Modified Paths: -------------- trunk/data/public/js/pfcclient.js trunk/src/commands/connect.class.php trunk/src/pfcuserconfig.class.php Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-03-20 17:28:34 UTC (rev 1005) +++ trunk/data/public/js/pfcclient.js 2007-03-25 15:47:50 UTC (rev 1006) @@ -171,72 +171,13 @@ if (cmd == "connect") { - //alert(cmd + "-"+resp+"-"+param); if (resp == "ok") { this.nickname = param[0]; this.sendRequest('/nick "'+this.nickname+'"'); -/* - if (this.nickname == '') - // ask to choose a nickname - this.askNick(this.nickname); - else - { - this.sendRequest('/nick "'+this.nickname+'"'); - } -*/ + this.isconnected = true; -/* - // join the default channels comming from the parameter list - // and the user's channels comming from the - var ch = pfc_defaultchan; - for (var i=0; i<pfc_userchan.length; i++) - { - if (indexOf(ch,pfc_userchan[i]) == -1) - ch.push(pfc_userchan[i]); - } -*/ - // join the default channels comming from the parameter list - if (pfc_userchan.length == 0) - for (var i=0; i<pfc_defaultchan.length; i++) - { - if (i<pfc_defaultchan.length-1) - cmd = '/join2'; - else - cmd = '/join'; - cmd += ' "'+pfc_defaultchan[i]+'"'; - this.sendRequest(cmd); - } - else - // join channels comming from user sessions - for (var i=0; i<pfc_userchan.length; i++) - { - if (i<pfc_userchan.length-1) - cmd = '/join2'; - else - cmd = '/join'; - cmd += ' "'+pfc_userchan[i]+'"'; - this.sendRequest(cmd); - } - - // join the default privmsg comming from the parameter list - for (var i=0; i<pfc_defaultprivmsg.length; i++) - { - if (i<pfc_defaultprivmsg.length-1) - cmd = '/privmsg2'; - else - cmd = '/privmsg'; - cmd += ' "'+pfc_defaultprivmsg[i]+'"'; - this.sendRequest(cmd); - } - // now join privmsg comming from the sessions - for (var i=0; i<pfc_userprivmsg.length; i++) - { - this.sendRequest('/privmsg "'+pfc_userprivmsg[i]+'"'); - } - - // start the polling system this.updateChat(true); } @@ -335,45 +276,6 @@ if (resp == "connected" || resp == "notchanged") { cmd = ''; - -/* - // join the default channels comming from the parameter list - for (var i=0; i<pfc_defaultchan.length; i++) - { - if (i<pfc_defaultchan.length-1) - cmd = '/join2'; - else - cmd = '/join'; - cmd += ' "'+pfc_defaultchan[i]+'"'; - this.sendRequest(cmd); - } - // now join channels comming from sessions - for (var i=0; i<pfc_userchan.length; i++) - { - if (i<pfc_userchan.length-1) - cmd = '/join2'; - else - cmd = '/join'; - cmd += ' "'+pfc_userchan[i]+'"'; - this.sendRequest(cmd); - } - - // join the default privmsg comming from the parameter list - for (var i=0; i<pfc_defaultprivmsg.length; i++) - { - if (i<pfc_defaultprivmsg.length-1) - cmd = '/privmsg2'; - else - cmd = '/privmsg'; - cmd += ' "'+pfc_defaultprivmsg[i]+'"'; - this.sendRequest(cmd); - } - // now join privmsg comming from the sessions - for (var i=0; i<pfc_userprivmsg.length; i++) - { - this.sendRequest('/privmsg "'+pfc_userprivmsg[i]+'"'); - } -*/ } if (resp == "ok" || resp == "notchanged" || resp == "changed" || resp == "connected") Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-03-20 17:28:34 UTC (rev 1005) +++ trunk/src/commands/connect.class.php 2007-03-25 15:47:50 UTC (rev 1006) @@ -1,6 +1,6 @@ <?php -require_once(dirname(__FILE__)."/../pfccommand.class.php"); +require_once dirname(__FILE__).'/../pfccommand.class.php'; class pfcCommand_connect extends pfcCommand { @@ -64,13 +64,26 @@ $cmdp["param"] = $nick; $cmd =& pfcCommand::Factory('nick'); $ret = $cmd->run($xml_reponse, $cmdp); - if ($ret) { - // @todo join the channels if $joinoldchan is true (see /update command code) - // @todo remove the /join client side in pfcclient.js.php - + $chanlist = (count($u->channels) == 0) ? $c->channels : $u->getChannelNames(); + for($i = 0 ; $i < count($chanlist) ; $i++) + { + $cmdp = array(); + $cmdp["param"] = $chanlist[$i]; + $cmd =& pfcCommand::Factory( $i < count($chanlist)-1 || !$joinoldchan ? 'join2' : 'join' ); + $cmd->run($xml_reponse, $cmdp); + } + $pvlist = (count($u->privmsg) == 0) ? $c->privmsg : $u->getPrivMsgNames(); + for($i = 0 ; $i < count($pvlist) ; $i++) + { + $cmdp = array(); + $cmdp["param"] = $pvlist[$i]; + $cmd =& pfcCommand::Factory( $i < count($pvlist)-1 || !$joinoldchan ? 'join2' : 'join' ); + $cmd->run($xml_reponse, $cmdp); + } + $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ok', Array('".addslashes($nick)."'));"); } else Modified: trunk/src/pfcuserconfig.class.php =================================================================== --- trunk/src/pfcuserconfig.class.php 2007-03-20 17:28:34 UTC (rev 1005) +++ trunk/src/pfcuserconfig.class.php 2007-03-25 15:47:50 UTC (rev 1006) @@ -121,6 +121,21 @@ $ct =& pfcContainer::Instance(); return $ct->getNickname($this->nickid); } + + function getChannelNames() + { + $list = array(); + foreach( $this->channels as $v ) + $list[] = $v["name"]; + return $list; + } + function getPrivMsgNames() + { + $list = array(); + foreach( $this->privmsg as $v ) + $list[] = $v["name"]; + return $list; + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-03-20 19:28:14
|
Revision: 1005 http://svn.sourceforge.net/phpfreechat/?rev=1005&view=rev Author: kerphi Date: 2007-03-20 10:28:34 -0700 (Tue, 20 Mar 2007) Log Message: ----------- Work in progresse : fix the "You must be connected to send a message" [3h00] Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/nick.class.php trunk/src/commands/update.class.php trunk/src/proxies/auth.class.php trunk/src/proxies/checktimeout.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-03-20 08:51:29 UTC (rev 1004) +++ trunk/src/commands/connect.class.php 2007-03-20 17:28:34 UTC (rev 1005) @@ -13,6 +13,7 @@ $recipient = $p["recipient"]; $recipientid = $p["recipientid"]; $getoldmsg = isset($p["getoldmsg"]) ? $p["getoldmsg"] : true; + $joinoldchan = isset($p["joinoldchan"]) ? $p["joinoldchan"] : true; // nickname must be given to be able to connect to the chat $nick = $params[0]; @@ -24,43 +25,7 @@ // reset the message id indicator (see getnewmsg.class.php) // i.e. be ready to re-get all last posted messages if ($getoldmsg) - { - // reset the channel identifiers - require_once(dirname(__FILE__)."/join.class.php"); - $channels = array(); - if (count($u->channels) == 0) - $channels = $c->channels; - else - foreach($u->channels as $chan) - $channels[] = $chan["name"]; - foreach($channels as $channame) - { - $chanrecip = pfcCommand_join::GetRecipient($channame); - $chanid = pfcCommand_join::GetRecipientId($channame); - // reset the fromid flag - $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$chanid; - $from_id = $ct->getLastId($chanrecip)-$c->max_msg; - $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; - // reset the oldmsg flag - $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; - $_SESSION[$oldmsg_sid] = true; - } - // reset the private messages identifiers - if (count($u->privmsg) > 0) - { - foreach($u->privmsg as $recipientid2 => $pv) - { - $recipient2 = $pv['recipient']; - // reset the fromid flag - $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$recipientid2; - $from_id = $ct->getLastId($recipient2)-$c->max_msg; - $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; - // reset the oldmsg flag - $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$recipientid2; - $_SESSION[$oldmsg_sid] = true; - } - } - } + $this->_resetChannelIdentifier($clientid); // check if the user is alone on the server, and give it the admin status if yes $isadmin = $ct->getUserMeta($u->nickid, 'isadmin'); @@ -102,6 +67,10 @@ if ($ret) { + // @todo join the channels if $joinoldchan is true (see /update command code) + // @todo remove the /join client side in pfcclient.js.php + + $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ok', Array('".addslashes($nick)."'));"); } else @@ -109,6 +78,53 @@ $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ko', Array('".addslashes($nick)."'));"); } } + + /** + * reset the channel identifiers + */ + function _resetChannelIdentifier($clientid) + { + $c =& pfcGlobalConfig::Instance(); + $u =& pfcUserConfig::Instance(); + $ct =& pfcContainer::Instance(); + + // reset the channel identifiers + require_once(dirname(__FILE__)."/join.class.php"); + $channels = array(); + if (count($u->channels) == 0) + $channels = $c->channels; + else + foreach($u->channels as $chan) + $channels[] = $chan["name"]; + foreach($channels as $channame) + { + $chanrecip = pfcCommand_join::GetRecipient($channame); + $chanid = pfcCommand_join::GetRecipientId($channame); + // reset the fromid flag + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$chanid; + $from_id = $ct->getLastId($chanrecip)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + // reset the oldmsg flag + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; + $_SESSION[$oldmsg_sid] = true; + } + // reset the private messages identifiers + if (count($u->privmsg) > 0) + { + foreach($u->privmsg as $recipientid2 => $pv) + { + $recipient2 = $pv['recipient']; + // reset the fromid flag + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$recipientid2; + $from_id = $ct->getLastId($recipient2)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + // reset the oldmsg flag + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$recipientid2; + $_SESSION[$oldmsg_sid] = true; + } + } + } + } ?> \ No newline at end of file Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2007-03-20 08:51:29 UTC (rev 1004) +++ trunk/src/commands/nick.class.php 2007-03-20 17:28:34 UTC (rev 1005) @@ -77,7 +77,7 @@ { // this is a first connection : create the nickname on the server $ct->createNick($u->nickid, $newnick); - $u->nick = $nick; + $u->nick = $newnick; $u->saveInCache(); $this->forceWhoisReload($u->nickid); Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2007-03-20 08:51:29 UTC (rev 1004) +++ trunk/src/commands/update.class.php 2007-03-20 17:28:34 UTC (rev 1005) @@ -14,21 +14,22 @@ $c =& pfcGlobalConfig::Instance(); $u =& pfcUserConfig::Instance(); + + // check the user has not been disconnected from the server by timeout + // if he has been disconnected, then I reconnect him with /connect command + if ($u->nick != '' && !$u->isOnline()) + { + $cmd =& pfcCommand::Factory("connect"); + $cmdp = $p; + $cmdp['params'] = array($u->nick); + $cmdp['getoldmsg'] = false; + $cmdp['joinoldchan'] = false; + $cmd->run($xml_reponse, $cmdp); + } // do not update if user isn't active (didn't connect) if ($u->isOnline()) { - // check the user has not been disconnected from the server by timeout - // if I found he has been disconnected, then I reconnect him with /connect command - $ct =& pfcContainer::Instance(); - if ($ct->isNickOnline(NULL, $u->nickid) < 0) - { - $cmd =& pfcCommand::Factory("connect"); - $cmdp = $p; - $cmdp["getoldmsg"] = false; - $cmd->run($xml_reponse, $cmdp); - } - $cmdp = $p; // update the user nickname timestamp on the server @@ -72,7 +73,9 @@ $xml_reponse->script("pfc.handleResponse('update', 'ok', '');"); } else + { $xml_reponse->script("pfc.handleResponse('update', 'ko', '');"); + } } } Modified: trunk/src/proxies/auth.class.php =================================================================== --- trunk/src/proxies/auth.class.php 2007-03-20 08:51:29 UTC (rev 1004) +++ trunk/src/proxies/auth.class.php 2007-03-20 17:28:34 UTC (rev 1005) @@ -45,6 +45,7 @@ // do not allow someone to run a command if he is not online if ($this->name != 'error' && $this->name != 'connect' && + $this->name != 'update' && !$u->isOnline()) { $cmdp = $p; Modified: trunk/src/proxies/checktimeout.class.php =================================================================== --- trunk/src/proxies/checktimeout.class.php 2007-03-20 08:51:29 UTC (rev 1004) +++ trunk/src/proxies/checktimeout.class.php 2007-03-20 17:28:34 UTC (rev 1005) @@ -39,7 +39,7 @@ $recipient = $p["recipient"]; $recipientid = $p["recipientid"]; - if ($this->name == 'update') + if ($this->name == 'update' || $this->name == 'connect') { $c =& pfcGlobalConfig::Instance(); $u =& pfcUserConfig::Instance(); @@ -53,17 +53,19 @@ for($j=0; $j<count($disconnected_users["channels"][$i]); $j++) { $chan = $disconnected_users["channels"][$i][$j]; - $online_users = $ct->getOnlineNick($chan); - if ($chan != 'SERVER' && - count($online_users['nickid'])) + if ($chan != 'SERVER') { - $cmdp = $p; - $cmdp["param"] = _pfc("%s quit (timeout)", $nick); - $cmdp["flag"] = 2; - $cmdp["recipient"] = $chan; - $cmdp["recipientid"] = md5($chan); // @todo: clean the recipient/recipientid notion - $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $cmdp); + $online_users = $ct->getOnlineNick($chan); + if (count($online_users['nickid']) > 0) + { + $cmdp = $p; + $cmdp["param"] = _pfc("%s quit (timeout)", $nick); + $cmdp["flag"] = 2; + $cmdp["recipient"] = $chan; + $cmdp["recipientid"] = md5($chan); // @todo: clean the recipient/recipientid notion + $cmd =& pfcCommand::Factory("notice"); + $cmd->run($xml_reponse, $cmdp); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |