diff --git a/bootstrap/addons/morris/_morris.js b/bootstrap/addons/morris/_morris.js deleted file mode 100644 index 3a1a830..0000000 --- a/bootstrap/addons/morris/_morris.js +++ /dev/null @@ -1,1892 +0,0 @@ -/* @license -morris.js v0.5.0 -Copyright 2014 Olly Smith All rights reserved. -Licensed under the BSD-2-Clause License. -*/ - - -(function() { - var $, Morris, minutesSpecHelper, secondsSpecHelper, - __slice = [].slice, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Morris = window.Morris = {}; - - $ = jQuery; - - Morris.EventEmitter = (function() { - function EventEmitter() {} - - EventEmitter.prototype.on = function(name, handler) { - if (this.handlers == null) { - this.handlers = {}; - } - if (this.handlers[name] == null) { - this.handlers[name] = []; - } - this.handlers[name].push(handler); - return this; - }; - - EventEmitter.prototype.fire = function() { - var args, handler, name, _i, _len, _ref, _results; - name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - if ((this.handlers != null) && (this.handlers[name] != null)) { - _ref = this.handlers[name]; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - handler = _ref[_i]; - _results.push(handler.apply(null, args)); - } - return _results; - } - }; - - return EventEmitter; - - })(); - - Morris.commas = function(num) { - var absnum, intnum, ret, strabsnum; - if (num != null) { - ret = num < 0 ? "-" : ""; - absnum = Math.abs(num); - intnum = Math.floor(absnum).toFixed(0); - ret += intnum.replace(/(?=(?:\d{3})+$)(?!^)/g, ','); - strabsnum = absnum.toString(); - if (strabsnum.length > intnum.length) { - ret += strabsnum.slice(intnum.length); - } - return ret; - } else { - return '-'; - } - }; - - Morris.pad2 = function(number) { - return (number < 10 ? '0' : '') + number; - }; - - Morris.Grid = (function(_super) { - __extends(Grid, _super); - - function Grid(options) { - this.resizeHandler = __bind(this.resizeHandler, this); - var _this = this; - if (typeof options.element === 'string') { - this.el = $(document.getElementById(options.element)); - } else { - this.el = $(options.element); - } - if ((this.el == null) || this.el.length === 0) { - throw new Error("Graph container element not found"); - } - if (this.el.css('position') === 'static') { - this.el.css('position', 'relative'); - } - this.options = $.extend({}, this.gridDefaults, this.defaults || {}, options); - if (typeof this.options.units === 'string') { - this.options.postUnits = options.units; - } - this.raphael = new Raphael(this.el[0]); - this.elementWidth = null; - this.elementHeight = null; - this.dirty = false; - this.selectFrom = null; - if (this.init) { - this.init(); - } - this.setData(this.options.data); - this.el.bind('mousemove', function(evt) { - var left, offset, right, width, x; - offset = _this.el.offset(); - x = evt.pageX - offset.left; - if (_this.selectFrom) { - left = _this.data[_this.hitTest(Math.min(x, _this.selectFrom))]._x; - right = _this.data[_this.hitTest(Math.max(x, _this.selectFrom))]._x; - width = right - left; - return _this.selectionRect.attr({ - x: left, - width: width - }); - } else { - return _this.fire('hovermove', x, evt.pageY - offset.top); - } - }); - this.el.bind('mouseleave', function(evt) { - if (_this.selectFrom) { - _this.selectionRect.hide(); - _this.selectFrom = null; - } - return _this.fire('hoverout'); - }); - this.el.bind('touchstart touchmove touchend', function(evt) { - var offset, touch; - touch = evt.originalEvent.touches[0] || evt.originalEvent.changedTouches[0]; - offset = _this.el.offset(); - return _this.fire('hovermove', touch.pageX - offset.left, touch.pageY - offset.top); - }); - this.el.bind('click', function(evt) { - var offset; - offset = _this.el.offset(); - return _this.fire('gridclick', evt.pageX - offset.left, evt.pageY - offset.top); - }); - if (this.options.rangeSelect) { - this.selectionRect = this.raphael.rect(0, 0, 0, this.el.innerHeight()).attr({ - fill: this.options.rangeSelectColor, - stroke: false - }).toBack().hide(); - this.el.bind('mousedown', function(evt) { - var offset; - offset = _this.el.offset(); - return _this.startRange(evt.pageX - offset.left); - }); - this.el.bind('mouseup', function(evt) { - var offset; - offset = _this.el.offset(); - _this.endRange(evt.pageX - offset.left); - return _this.fire('hovermove', evt.pageX - offset.left, evt.pageY - offset.top); - }); - } - if (this.options.resize) { - $(window).bind('resize', function(evt) { - if (_this.timeoutId != null) { - window.clearTimeout(_this.timeoutId); - } - return _this.timeoutId = window.setTimeout(_this.resizeHandler, 100); - }); - } - this.el.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); - if (this.postInit) { - this.postInit(); - } - } - - Grid.prototype.gridDefaults = { - dateFormat: null, - axes: true, - grid: true, - gridLineColor: '#aaa', - gridStrokeWidth: 0.5, - gridTextColor: '#888', - gridTextSize: 12, - gridTextFamily: 'sans-serif', - gridTextWeight: 'normal', - hideHover: false, - yLabelFormat: null, - xLabelAngle: 0, - numLines: 5, - padding: 25, - parseTime: true, - postUnits: '', - preUnits: '', - ymax: 'auto', - ymin: 'auto 0', - goals: [], - goalStrokeWidth: 1.0, - goalLineColors: ['#666633', '#999966', '#cc6666', '#663333'], - events: [], - eventStrokeWidth: 1.0, - eventLineColors: ['#005a04', '#ccffbb', '#3a5f0b', '#005502'], - rangeSelect: null, - rangeSelectColor: '#eef', - resize: false - }; - - Grid.prototype.setData = function(data, redraw) { - var e, idx, index, maxGoal, minGoal, ret, row, step, total, y, ykey, ymax, ymin, yval, _ref; - if (redraw == null) { - redraw = true; - } - this.options.data = data; - if ((data == null) || data.length === 0) { - this.data = []; - this.raphael.clear(); - if (this.hover != null) { - this.hover.hide(); - } - return; - } - ymax = this.cumulative ? 0 : null; - ymin = this.cumulative ? 0 : null; - if (this.options.goals.length > 0) { - minGoal = Math.min.apply(Math, this.options.goals); - maxGoal = Math.max.apply(Math, this.options.goals); - ymin = ymin != null ? Math.min(ymin, minGoal) : minGoal; - ymax = ymax != null ? Math.max(ymax, maxGoal) : maxGoal; - } - this.data = (function() { - var _i, _len, _results; - _results = []; - for (index = _i = 0, _len = data.length; _i < _len; index = ++_i) { - row = data[index]; - ret = { - src: row - }; - ret.label = row[this.options.xkey]; - if (this.options.parseTime) { - ret.x = Morris.parseDate(ret.label); - if (this.options.dateFormat) { - ret.label = this.options.dateFormat(ret.x); - } else if (typeof ret.label === 'number') { - ret.label = new Date(ret.label).toString(); - } - } else { - ret.x = index; - if (this.options.xLabelFormat) { - ret.label = this.options.xLabelFormat(ret); - } - } - total = 0; - ret.y = (function() { - var _j, _len1, _ref, _results1; - _ref = this.options.ykeys; - _results1 = []; - for (idx = _j = 0, _len1 = _ref.length; _j < _len1; idx = ++_j) { - ykey = _ref[idx]; - yval = row[ykey]; - if (typeof yval === 'string') { - yval = parseFloat(yval); - } - if ((yval != null) && typeof yval !== 'number') { - yval = null; - } - if (yval != null) { - if (this.cumulative) { - total += yval; - } else { - if (ymax != null) { - ymax = Math.max(yval, ymax); - ymin = Math.min(yval, ymin); - } else { - ymax = ymin = yval; - } - } - } - if (this.cumulative && (total != null)) { - ymax = Math.max(total, ymax); - ymin = Math.min(total, ymin); - } - _results1.push(yval); - } - return _results1; - }).call(this); - _results.push(ret); - } - return _results; - }).call(this); - if (this.options.parseTime) { - this.data = this.data.sort(function(a, b) { - return (a.x > b.x) - (b.x > a.x); - }); - } - this.xmin = this.data[0].x; - this.xmax = this.data[this.data.length - 1].x; - this.events = []; - if (this.options.events.length > 0) { - if (this.options.parseTime) { - this.events = (function() { - var _i, _len, _ref, _results; - _ref = this.options.events; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - e = _ref[_i]; - _results.push(Morris.parseDate(e)); - } - return _results; - }).call(this); - } else { - this.events = this.options.events; - } - this.xmax = Math.max(this.xmax, Math.max.apply(Math, this.events)); - this.xmin = Math.min(this.xmin, Math.min.apply(Math, this.events)); - } - if (this.xmin === this.xmax) { - this.xmin -= 1; - this.xmax += 1; - } - this.ymin = this.yboundary('min', ymin); - this.ymax = this.yboundary('max', ymax); - if (this.ymin === this.ymax) { - if (ymin) { - this.ymin -= 1; - } - this.ymax += 1; - } - if (((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'y') || this.options.grid === true) { - if (this.options.ymax === this.gridDefaults.ymax && this.options.ymin === this.gridDefaults.ymin) { - this.grid = this.autoGridLines(this.ymin, this.ymax, this.options.numLines); - this.ymin = Math.min(this.ymin, this.grid[0]); - this.ymax = Math.max(this.ymax, this.grid[this.grid.length - 1]); - } else { - step = (this.ymax - this.ymin) / (this.options.numLines - 1); - this.grid = (function() { - var _i, _ref1, _ref2, _results; - _results = []; - for (y = _i = _ref1 = this.ymin, _ref2 = this.ymax; step > 0 ? _i <= _ref2 : _i >= _ref2; y = _i += step) { - _results.push(y); - } - return _results; - }).call(this); - } - } - this.dirty = true; - if (redraw) { - return this.redraw(); - } - }; - - Grid.prototype.yboundary = function(boundaryType, currentValue) { - var boundaryOption, suggestedValue; - boundaryOption = this.options["y" + boundaryType]; - if (typeof boundaryOption === 'string') { - if (boundaryOption.slice(0, 4) === 'auto') { - if (boundaryOption.length > 5) { - suggestedValue = parseInt(boundaryOption.slice(5), 10); - if (currentValue == null) { - return suggestedValue; - } - return Math[boundaryType](currentValue, suggestedValue); - } else { - if (currentValue != null) { - return currentValue; - } else { - return 0; - } - } - } else { - return parseInt(boundaryOption, 10); - } - } else { - return boundaryOption; - } - }; - - Grid.prototype.autoGridLines = function(ymin, ymax, nlines) { - var gmax, gmin, grid, smag, span, step, unit, y, ymag; - span = ymax - ymin; - ymag = Math.floor(Math.log(span) / Math.log(10)); - unit = Math.pow(10, ymag); - gmin = Math.floor(ymin / unit) * unit; - gmax = Math.ceil(ymax / unit) * unit; - step = (gmax - gmin) / (nlines - 1); - if (unit === 1 && step > 1 && Math.ceil(step) !== step) { - step = Math.ceil(step); - gmax = gmin + step * (nlines - 1); - } - if (gmin < 0 && gmax > 0) { - gmin = Math.floor(ymin / step) * step; - gmax = Math.ceil(ymax / step) * step; - } - if (step < 1) { - smag = Math.floor(Math.log(step) / Math.log(10)); - grid = (function() { - var _i, _results; - _results = []; - for (y = _i = gmin; step > 0 ? _i <= gmax : _i >= gmax; y = _i += step) { - _results.push(parseFloat(y.toFixed(1 - smag))); - } - return _results; - })(); - } else { - grid = (function() { - var _i, _results; - _results = []; - for (y = _i = gmin; step > 0 ? _i <= gmax : _i >= gmax; y = _i += step) { - _results.push(y); - } - return _results; - })(); - } - return grid; - }; - - Grid.prototype._calc = function() { - var bottomOffsets, gridLine, h, i, w, yLabelWidths, _ref, _ref1; - w = this.el.width(); - h = this.el.height(); - if (this.elementWidth !== w || this.elementHeight !== h || this.dirty) { - this.elementWidth = w; - this.elementHeight = h; - this.dirty = false; - this.left = this.options.padding; - this.right = this.elementWidth - this.options.padding; - this.top = this.options.padding; - this.bottom = this.elementHeight - this.options.padding; - if ((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'y') { - yLabelWidths = (function() { - var _i, _len, _ref1, _results; - _ref1 = this.grid; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - gridLine = _ref1[_i]; - _results.push(this.measureText(this.yAxisFormat(gridLine)).width); - } - return _results; - }).call(this); - this.left += Math.max.apply(Math, yLabelWidths); - } - if ((_ref1 = this.options.axes) === true || _ref1 === 'both' || _ref1 === 'x') { - bottomOffsets = (function() { - var _i, _ref2, _results; - _results = []; - for (i = _i = 0, _ref2 = this.data.length; 0 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 0 <= _ref2 ? ++_i : --_i) { - _results.push(this.measureText(this.data[i].text, -this.options.xLabelAngle).height); - } - return _results; - }).call(this); - this.bottom -= Math.max.apply(Math, bottomOffsets); - } - this.width = Math.max(1, this.right - this.left); - this.height = Math.max(1, this.bottom - this.top); - this.dx = this.width / (this.xmax - this.xmin); - this.dy = this.height / (this.ymax - this.ymin); - if (this.calc) { - return this.calc(); - } - } - }; - - Grid.prototype.transY = function(y) { - return this.bottom - (y - this.ymin) * this.dy; - }; - - Grid.prototype.transX = function(x) { - if (this.data.length === 1) { - return (this.left + this.right) / 2; - } else { - return this.left + (x - this.xmin) * this.dx; - } - }; - - Grid.prototype.redraw = function() { - this.raphael.clear(); - this._calc(); - this.drawGrid(); - this.drawGoals(); - this.drawEvents(); - if (this.draw) { - return this.draw(); - } - }; - - Grid.prototype.measureText = function(text, angle) { - var ret, tt; - if (angle == null) { - angle = 0; - } - tt = this.raphael.text(100, 100, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).rotate(angle); - ret = tt.getBBox(); - tt.remove(); - return ret; - }; - - Grid.prototype.yAxisFormat = function(label) { - return this.yLabelFormat(label); - }; - - Grid.prototype.yLabelFormat = function(label) { - if (typeof this.options.yLabelFormat === 'function') { - return this.options.yLabelFormat(label); - } else { - return "" + this.options.preUnits + (Morris.commas(label)) + this.options.postUnits; - } - }; - - Grid.prototype.drawGrid = function() { - var lineY, y, _i, _len, _ref, _ref1, _ref2, _results; - if (this.options.grid === false && ((_ref = this.options.axes) !== true && _ref !== 'both' && _ref !== 'y')) { - return; - } - _ref1 = this.grid; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - lineY = _ref1[_i]; - y = this.transY(lineY); - if ((_ref2 = this.options.axes) === true || _ref2 === 'both' || _ref2 === 'y') { - this.drawYAxisLabel(this.left - this.options.padding / 2, y, this.yAxisFormat(lineY)); - } - if (this.options.grid) { - _results.push(this.drawGridLine("M" + this.left + "," + y + "H" + (this.left + this.width))); - } else { - _results.push(void 0); - } - } - return _results; - }; - - Grid.prototype.drawGoals = function() { - var color, goal, i, _i, _len, _ref, _results; - _ref = this.options.goals; - _results = []; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - goal = _ref[i]; - color = this.options.goalLineColors[i % this.options.goalLineColors.length]; - _results.push(this.drawGoal(goal, color)); - } - return _results; - }; - - Grid.prototype.drawEvents = function() { - var color, event, i, _i, _len, _ref, _results; - _ref = this.events; - _results = []; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - event = _ref[i]; - color = this.options.eventLineColors[i % this.options.eventLineColors.length]; - _results.push(this.drawEvent(event, color)); - } - return _results; - }; - - Grid.prototype.drawGoal = function(goal, color) { - return this.raphael.path("M" + this.left + "," + (this.transY(goal)) + "H" + this.right).attr('stroke', color).attr('stroke-width', this.options.goalStrokeWidth); - }; - - Grid.prototype.drawEvent = function(event, color) { - return this.raphael.path("M" + (this.transX(event)) + "," + this.bottom + "V" + this.top).attr('stroke', color).attr('stroke-width', this.options.eventStrokeWidth); - }; - - Grid.prototype.drawYAxisLabel = function(xPos, yPos, text) { - return this.raphael.text(xPos, yPos, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).attr('fill', this.options.gridTextColor).attr('text-anchor', 'end'); - }; - - Grid.prototype.drawGridLine = function(path) { - return this.raphael.path(path).attr('stroke', this.options.gridLineColor).attr('stroke-width', this.options.gridStrokeWidth); - }; - - Grid.prototype.startRange = function(x) { - this.hover.hide(); - this.selectFrom = x; - return this.selectionRect.attr({ - x: x, - width: 0 - }).show(); - }; - - Grid.prototype.endRange = function(x) { - var end, start; - if (this.selectFrom) { - start = Math.min(this.selectFrom, x); - end = Math.max(this.selectFrom, x); - this.options.rangeSelect.call(this.el, { - start: this.data[this.hitTest(start)].x, - end: this.data[this.hitTest(end)].x - }); - return this.selectFrom = null; - } - }; - - Grid.prototype.resizeHandler = function() { - this.timeoutId = null; - this.raphael.setSize(this.el.width(), this.el.height()); - return this.redraw(); - }; - - return Grid; - - })(Morris.EventEmitter); - - Morris.parseDate = function(date) { - var isecs, m, msecs, n, o, offsetmins, p, q, r, ret, secs; - if (typeof date === 'number') { - return date; - } - m = date.match(/^(\d+) Q(\d)$/); - n = date.match(/^(\d+)-(\d+)$/); - o = date.match(/^(\d+)-(\d+)-(\d+)$/); - p = date.match(/^(\d+) W(\d+)$/); - q = date.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/); - r = date.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/); - if (m) { - return new Date(parseInt(m[1], 10), parseInt(m[2], 10) * 3 - 1, 1).getTime(); - } else if (n) { - return new Date(parseInt(n[1], 10), parseInt(n[2], 10) - 1, 1).getTime(); - } else if (o) { - return new Date(parseInt(o[1], 10), parseInt(o[2], 10) - 1, parseInt(o[3], 10)).getTime(); - } else if (p) { - ret = new Date(parseInt(p[1], 10), 0, 1); - if (ret.getDay() !== 4) { - ret.setMonth(0, 1 + ((4 - ret.getDay()) + 7) % 7); - } - return ret.getTime() + parseInt(p[2], 10) * 604800000; - } else if (q) { - if (!q[6]) { - return new Date(parseInt(q[1], 10), parseInt(q[2], 10) - 1, parseInt(q[3], 10), parseInt(q[4], 10), parseInt(q[5], 10)).getTime(); - } else { - offsetmins = 0; - if (q[6] !== 'Z') { - offsetmins = parseInt(q[8], 10) * 60 + parseInt(q[9], 10); - if (q[7] === '+') { - offsetmins = 0 - offsetmins; - } - } - return Date.UTC(parseInt(q[1], 10), parseInt(q[2], 10) - 1, parseInt(q[3], 10), parseInt(q[4], 10), parseInt(q[5], 10) + offsetmins); - } - } else if (r) { - secs = parseFloat(r[6]); - isecs = Math.floor(secs); - msecs = Math.round((secs - isecs) * 1000); - if (!r[8]) { - return new Date(parseInt(r[1], 10), parseInt(r[2], 10) - 1, parseInt(r[3], 10), parseInt(r[4], 10), parseInt(r[5], 10), isecs, msecs).getTime(); - } else { - offsetmins = 0; - if (r[8] !== 'Z') { - offsetmins = parseInt(r[10], 10) * 60 + parseInt(r[11], 10); - if (r[9] === '+') { - offsetmins = 0 - offsetmins; - } - } - return Date.UTC(parseInt(r[1], 10), parseInt(r[2], 10) - 1, parseInt(r[3], 10), parseInt(r[4], 10), parseInt(r[5], 10) + offsetmins, isecs, msecs); - } - } else { - return new Date(parseInt(date, 10), 0, 1).getTime(); - } - }; - - Morris.Hover = (function() { - Hover.defaults = { - "class": 'morris-hover morris-default-style' - }; - - function Hover(options) { - if (options == null) { - options = {}; - } - this.options = $.extend({}, Morris.Hover.defaults, options); - this.el = $("
"); - this.el.hide(); - this.options.parent.append(this.el); - } - - Hover.prototype.update = function(html, x, y) { - if (!html) { - return this.hide(); - } else { - this.html(html); - this.show(); - return this.moveTo(x, y); - } - }; - - Hover.prototype.html = function(content) { - return this.el.html(content); - }; - - Hover.prototype.moveTo = function(x, y) { - var hoverHeight, hoverWidth, left, parentHeight, parentWidth, top; - parentWidth = this.options.parent.innerWidth(); - parentHeight = this.options.parent.innerHeight(); - hoverWidth = this.el.outerWidth(); - hoverHeight = this.el.outerHeight(); - left = Math.min(Math.max(0, x - hoverWidth / 2), parentWidth - hoverWidth); - if (y != null) { - top = y - hoverHeight - 10; - if (top < 0) { - top = y + 10; - if (top + hoverHeight > parentHeight) { - top = parentHeight / 2 - hoverHeight / 2; - } - } - } else { - top = parentHeight / 2 - hoverHeight / 2; - } - return this.el.css({ - left: left + "px", - top: parseInt(top) + "px" - }); - }; - - Hover.prototype.show = function() { - return this.el.show(); - }; - - Hover.prototype.hide = function() { - return this.el.hide(); - }; - - return Hover; - - })(); - - Morris.Line = (function(_super) { - __extends(Line, _super); - - function Line(options) { - this.hilight = __bind(this.hilight, this); - this.onHoverOut = __bind(this.onHoverOut, this); - this.onHoverMove = __bind(this.onHoverMove, this); - this.onGridClick = __bind(this.onGridClick, this); - if (!(this instanceof Morris.Line)) { - return new Morris.Line(options); - } - Line.__super__.constructor.call(this, options); - } - - Line.prototype.init = function() { - if (this.options.hideHover !== 'always') { - this.hover = new Morris.Hover({ - parent: this.el - }); - this.on('hovermove', this.onHoverMove); - this.on('hoverout', this.onHoverOut); - return this.on('gridclick', this.onGridClick); - } - }; - - Line.prototype.defaults = { - lineWidth: 3, - pointSize: 4, - lineColors: ['#0b62a4', '#7A92A3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed'], - pointStrokeWidths: [1], - pointStrokeColors: ['#ffffff'], - pointFillColors: [], - smooth: true, - xLabels: 'auto', - xLabelFormat: null, - xLabelMargin: 24, - hideHover: false - }; - - Line.prototype.calc = function() { - this.calcPoints(); - return this.generatePaths(); - }; - - Line.prototype.calcPoints = function() { - var row, y, _i, _len, _ref, _results; - _ref = this.data; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - row = _ref[_i]; - row._x = this.transX(row.x); - row._y = (function() { - var _j, _len1, _ref1, _results1; - _ref1 = row.y; - _results1 = []; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - y = _ref1[_j]; - if (y != null) { - _results1.push(this.transY(y)); - } else { - _results1.push(y); - } - } - return _results1; - }).call(this); - _results.push(row._ymax = Math.min.apply(Math, [this.bottom].concat((function() { - var _j, _len1, _ref1, _results1; - _ref1 = row._y; - _results1 = []; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - y = _ref1[_j]; - if (y != null) { - _results1.push(y); - } - } - return _results1; - })()))); - } - return _results; - }; - - Line.prototype.hitTest = function(x) { - var index, r, _i, _len, _ref; - if (this.data.length === 0) { - return null; - } - _ref = this.data.slice(1); - for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { - r = _ref[index]; - if (x < (r._x + this.data[index]._x) / 2) { - break; - } - } - return index; - }; - - Line.prototype.onGridClick = function(x, y) { - var index; - index = this.hitTest(x); - return this.fire('click', index, this.data[index].src, x, y); - }; - - Line.prototype.onHoverMove = function(x, y) { - var index; - index = this.hitTest(x); - return this.displayHoverForRow(index); - }; - - Line.prototype.onHoverOut = function() { - if (this.options.hideHover !== false) { - return this.displayHoverForRow(null); - } - }; - - Line.prototype.displayHoverForRow = function(index) { - var _ref; - if (index != null) { - (_ref = this.hover).update.apply(_ref, this.hoverContentForRow(index)); - return this.hilight(index); - } else { - this.hover.hide(); - return this.hilight(); - } - }; - - Line.prototype.hoverContentForRow = function(index) { - var content, j, row, y, _i, _len, _ref; - row = this.data[index]; - content = "
" + row.label + "
"; - _ref = row.y; - for (j = _i = 0, _len = _ref.length; _i < _len; j = ++_i) { - y = _ref[j]; - content += "
\n " + this.options.labels[j] + ":\n " + (this.yLabelFormat(y)) + "\n
"; - } - if (typeof this.options.hoverCallback === 'function') { - content = this.options.hoverCallback(index, this.options, content, row.src); - } - return [content, row._x, row._ymax]; - }; - - Line.prototype.generatePaths = function() { - var coords, i, r, smooth; - return this.paths = (function() { - var _i, _ref, _ref1, _results; - _results = []; - for (i = _i = 0, _ref = this.options.ykeys.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { - smooth = typeof this.options.smooth === "boolean" ? this.options.smooth : (_ref1 = this.options.ykeys[i], __indexOf.call(this.options.smooth, _ref1) >= 0); - coords = (function() { - var _j, _len, _ref2, _results1; - _ref2 = this.data; - _results1 = []; - for (_j = 0, _len = _ref2.length; _j < _len; _j++) { - r = _ref2[_j]; - if (r._y[i] !== void 0) { - _results1.push({ - x: r._x, - y: r._y[i] - }); - } - } - return _results1; - }).call(this); - if (coords.length > 1) { - _results.push(Morris.Line.createPath(coords, smooth, this.bottom)); - } else { - _results.push(null); - } - } - return _results; - }).call(this); - }; - - Line.prototype.draw = function() { - var _ref; - if ((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'x') { - this.drawXAxis(); - } - this.drawSeries(); - if (this.options.hideHover === false) { - return this.displayHoverForRow(this.data.length - 1); - } - }; - - Line.prototype.drawXAxis = function() { - var drawLabel, l, labels, prevAngleMargin, prevLabelMargin, row, ypos, _i, _len, _results, - _this = this; - ypos = this.bottom + this.options.padding / 2; - prevLabelMargin = null; - prevAngleMargin = null; - drawLabel = function(labelText, xpos) { - var label, labelBox, margin, offset, textBox; - label = _this.drawXAxisLabel(_this.transX(xpos), ypos, labelText); - textBox = label.getBBox(); - label.transform("r" + (-_this.options.xLabelAngle)); - labelBox = label.getBBox(); - label.transform("t0," + (labelBox.height / 2) + "..."); - if (_this.options.xLabelAngle !== 0) { - offset = -0.5 * textBox.width * Math.cos(_this.options.xLabelAngle * Math.PI / 180.0); - label.transform("t" + offset + ",0..."); - } - labelBox = label.getBBox(); - if (((prevLabelMargin == null) || prevLabelMargin >= labelBox.x + labelBox.width || (prevAngleMargin != null) && prevAngleMargin >= labelBox.x) && labelBox.x >= 0 && (labelBox.x + labelBox.width) < _this.el.width()) { - if (_this.options.xLabelAngle !== 0) { - margin = 1.25 * _this.options.gridTextSize / Math.sin(_this.options.xLabelAngle * Math.PI / 180.0); - prevAngleMargin = labelBox.x - margin; - } - return prevLabelMargin = labelBox.x - _this.options.xLabelMargin; - } else { - return label.remove(); - } - }; - if (this.options.parseTime) { - if (this.data.length === 1 && this.options.xLabels === 'auto') { - labels = [[this.data[0].label, this.data[0].x]]; - } else { - labels = Morris.labelSeries(this.xmin, this.xmax, this.width, this.options.xLabels, this.options.xLabelFormat); - } - } else { - labels = (function() { - var _i, _len, _ref, _results; - _ref = this.data; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - row = _ref[_i]; - _results.push([row.label, row.x]); - } - return _results; - }).call(this); - } - labels.reverse(); - _results = []; - for (_i = 0, _len = labels.length; _i < _len; _i++) { - l = labels[_i]; - _results.push(drawLabel(l[0], l[1])); - } - return _results; - }; - - Line.prototype.drawSeries = function() { - var i, _i, _j, _ref, _ref1, _results; - this.seriesPoints = []; - for (i = _i = _ref = this.options.ykeys.length - 1; _ref <= 0 ? _i <= 0 : _i >= 0; i = _ref <= 0 ? ++_i : --_i) { - this._drawLineFor(i); - } - _results = []; - for (i = _j = _ref1 = this.options.ykeys.length - 1; _ref1 <= 0 ? _j <= 0 : _j >= 0; i = _ref1 <= 0 ? ++_j : --_j) { - _results.push(this._drawPointFor(i)); - } - return _results; - }; - - Line.prototype._drawPointFor = function(index) { - var circle, row, _i, _len, _ref, _results; - this.seriesPoints[index] = []; - _ref = this.data; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - row = _ref[_i]; - circle = null; - if (row._y[index] != null) { - circle = this.drawLinePoint(row._x, row._y[index], this.colorFor(row, index, 'point'), index); - } - _results.push(this.seriesPoints[index].push(circle)); - } - return _results; - }; - - Line.prototype._drawLineFor = function(index) { - var path; - path = this.paths[index]; - if (path !== null) { - return this.drawLinePath(path, this.colorFor(null, index, 'line'), index); - } - }; - - Line.createPath = function(coords, smooth, bottom) { - var coord, g, grads, i, ix, lg, path, prevCoord, x1, x2, y1, y2, _i, _len; - path = ""; - if (smooth) { - grads = Morris.Line.gradients(coords); - } - prevCoord = { - y: null - }; - for (i = _i = 0, _len = coords.length; _i < _len; i = ++_i) { - coord = coords[i]; - if (coord.y != null) { - if (prevCoord.y != null) { - if (smooth) { - g = grads[i]; - lg = grads[i - 1]; - ix = (coord.x - prevCoord.x) / 4; - x1 = prevCoord.x + ix; - y1 = Math.min(bottom, prevCoord.y + ix * lg); - x2 = coord.x - ix; - y2 = Math.min(bottom, coord.y - ix * g); - path += "C" + x1 + "," + y1 + "," + x2 + "," + y2 + "," + coord.x + "," + coord.y; - } else { - path += "L" + coord.x + "," + coord.y; - } - } else { - if (!smooth || (grads[i] != null)) { - path += "M" + coord.x + "," + coord.y; - } - } - } - prevCoord = coord; - } - return path; - }; - - Line.gradients = function(coords) { - var coord, grad, i, nextCoord, prevCoord, _i, _len, _results; - grad = function(a, b) { - return (a.y - b.y) / (a.x - b.x); - }; - _results = []; - for (i = _i = 0, _len = coords.length; _i < _len; i = ++_i) { - coord = coords[i]; - if (coord.y != null) { - nextCoord = coords[i + 1] || { - y: null - }; - prevCoord = coords[i - 1] || { - y: null - }; - if ((prevCoord.y != null) && (nextCoord.y != null)) { - _results.push(grad(prevCoord, nextCoord)); - } else if (prevCoord.y != null) { - _results.push(grad(prevCoord, coord)); - } else if (nextCoord.y != null) { - _results.push(grad(coord, nextCoord)); - } else { - _results.push(null); - } - } else { - _results.push(null); - } - } - return _results; - }; - - Line.prototype.hilight = function(index) { - var i, _i, _j, _ref, _ref1; - if (this.prevHilight !== null && this.prevHilight !== index) { - for (i = _i = 0, _ref = this.seriesPoints.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; i = 0 <= _ref ? ++_i : --_i) { - if (this.seriesPoints[i][this.prevHilight]) { - this.seriesPoints[i][this.prevHilight].animate(this.pointShrinkSeries(i)); - } - } - } - if (index !== null && this.prevHilight !== index) { - for (i = _j = 0, _ref1 = this.seriesPoints.length - 1; 0 <= _ref1 ? _j <= _ref1 : _j >= _ref1; i = 0 <= _ref1 ? ++_j : --_j) { - if (this.seriesPoints[i][index]) { - this.seriesPoints[i][index].animate(this.pointGrowSeries(i)); - } - } - } - return this.prevHilight = index; - }; - - Line.prototype.colorFor = function(row, sidx, type) { - if (typeof this.options.lineColors === 'function') { - return this.options.lineColors.call(this, row, sidx, type); - } else if (type === 'point') { - return this.options.pointFillColors[sidx % this.options.pointFillColors.length] || this.options.lineColors[sidx % this.options.lineColors.length]; - } else { - return this.options.lineColors[sidx % this.options.lineColors.length]; - } - }; - - Line.prototype.drawXAxisLabel = function(xPos, yPos, text) { - return this.raphael.text(xPos, yPos, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).attr('fill', this.options.gridTextColor); - }; - - Line.prototype.drawLinePath = function(path, lineColor, lineIndex) { - return this.raphael.path(path).attr('stroke', lineColor).attr('stroke-width', this.lineWidthForSeries(lineIndex)); - }; - - Line.prototype.drawLinePoint = function(xPos, yPos, pointColor, lineIndex) { - return this.raphael.circle(xPos, yPos, this.pointSizeForSeries(lineIndex)).attr('fill', pointColor).attr('stroke-width', this.pointStrokeWidthForSeries(lineIndex)).attr('stroke', this.pointStrokeColorForSeries(lineIndex)); - }; - - Line.prototype.pointStrokeWidthForSeries = function(index) { - return this.options.pointStrokeWidths[index % this.options.pointStrokeWidths.length]; - }; - - Line.prototype.pointStrokeColorForSeries = function(index) { - return this.options.pointStrokeColors[index % this.options.pointStrokeColors.length]; - }; - - Line.prototype.lineWidthForSeries = function(index) { - if (this.options.lineWidth instanceof Array) { - return this.options.lineWidth[index % this.options.lineWidth.length]; - } else { - return this.options.lineWidth; - } - }; - - Line.prototype.pointSizeForSeries = function(index) { - if (this.options.pointSize instanceof Array) { - return this.options.pointSize[index % this.options.pointSize.length]; - } else { - return this.options.pointSize; - } - }; - - Line.prototype.pointGrowSeries = function(index) { - return Raphael.animation({ - r: this.pointSizeForSeries(index) + 3 - }, 25, 'linear'); - }; - - Line.prototype.pointShrinkSeries = function(index) { - return Raphael.animation({ - r: this.pointSizeForSeries(index) - }, 25, 'linear'); - }; - - return Line; - - })(Morris.Grid); - - Morris.labelSeries = function(dmin, dmax, pxwidth, specName, xLabelFormat) { - var d, d0, ddensity, name, ret, s, spec, t, _i, _len, _ref; - ddensity = 200 * (dmax - dmin) / pxwidth; - d0 = new Date(dmin); - spec = Morris.LABEL_SPECS[specName]; - if (spec === void 0) { - _ref = Morris.AUTO_LABEL_ORDER; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - name = _ref[_i]; - s = Morris.LABEL_SPECS[name]; - if (ddensity >= s.span) { - spec = s; - break; - } - } - } - if (spec === void 0) { - spec = Morris.LABEL_SPECS["second"]; - } - if (xLabelFormat) { - spec = $.extend({}, spec, { - fmt: xLabelFormat - }); - } - d = spec.start(d0); - ret = []; - while ((t = d.getTime()) <= dmax) { - if (t >= dmin) { - ret.push([spec.fmt(d), t]); - } - spec.incr(d); - } - return ret; - }; - - minutesSpecHelper = function(interval) { - return { - span: interval * 60 * 1000, - start: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()); - }, - fmt: function(d) { - return "" + (Morris.pad2(d.getHours())) + ":" + (Morris.pad2(d.getMinutes())); - }, - incr: function(d) { - return d.setUTCMinutes(d.getUTCMinutes() + interval); - } - }; - }; - - secondsSpecHelper = function(interval) { - return { - span: interval * 1000, - start: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes()); - }, - fmt: function(d) { - return "" + (Morris.pad2(d.getHours())) + ":" + (Morris.pad2(d.getMinutes())) + ":" + (Morris.pad2(d.getSeconds())); - }, - incr: function(d) { - return d.setUTCSeconds(d.getUTCSeconds() + interval); - } - }; - }; - - Morris.LABEL_SPECS = { - "decade": { - span: 172800000000, - start: function(d) { - return new Date(d.getFullYear() - d.getFullYear() % 10, 0, 1); - }, - fmt: function(d) { - return "" + (d.getFullYear()); - }, - incr: function(d) { - return d.setFullYear(d.getFullYear() + 10); - } - }, - "year": { - span: 17280000000, - start: function(d) { - return new Date(d.getFullYear(), 0, 1); - }, - fmt: function(d) { - return "" + (d.getFullYear()); - }, - incr: function(d) { - return d.setFullYear(d.getFullYear() + 1); - } - }, - "month": { - span: 2419200000, - start: function(d) { - return new Date(d.getFullYear(), d.getMonth(), 1); - }, - fmt: function(d) { - return "" + (d.getFullYear()) + "-" + (Morris.pad2(d.getMonth() + 1)); - }, - incr: function(d) { - return d.setMonth(d.getMonth() + 1); - } - }, - "week": { - span: 604800000, - start: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate()); - }, - fmt: function(d) { - return "" + (d.getFullYear()) + "-" + (Morris.pad2(d.getMonth() + 1)) + "-" + (Morris.pad2(d.getDate())); - }, - incr: function(d) { - return d.setDate(d.getDate() + 7); - } - }, - "day": { - span: 86400000, - start: function(d) { - return new Date(d.getFullYear(), d.getMonth(), d.getDate()); - }, - fmt: function(d) { - return "" + (d.getFullYear()) + "-" + (Morris.pad2(d.getMonth() + 1)) + "-" + (Morris.pad2(d.getDate())); - }, - incr: function(d) { - return d.setDate(d.getDate() + 1); - } - }, - "hour": minutesSpecHelper(60), - "30min": minutesSpecHelper(30), - "15min": minutesSpecHelper(15), - "10min": minutesSpecHelper(10), - "5min": minutesSpecHelper(5), - "minute": minutesSpecHelper(1), - "30sec": secondsSpecHelper(30), - "15sec": secondsSpecHelper(15), - "10sec": secondsSpecHelper(10), - "5sec": secondsSpecHelper(5), - "second": secondsSpecHelper(1) - }; - - Morris.AUTO_LABEL_ORDER = ["decade", "year", "month", "week", "day", "hour", "30min", "15min", "10min", "5min", "minute", "30sec", "15sec", "10sec", "5sec", "second"]; - - Morris.Area = (function(_super) { - var areaDefaults; - - __extends(Area, _super); - - areaDefaults = { - fillOpacity: 'auto', - behaveLikeLine: false - }; - - function Area(options) { - var areaOptions; - if (!(this instanceof Morris.Area)) { - return new Morris.Area(options); - } - areaOptions = $.extend({}, areaDefaults, options); - this.cumulative = !areaOptions.behaveLikeLine; - if (areaOptions.fillOpacity === 'auto') { - areaOptions.fillOpacity = areaOptions.behaveLikeLine ? .8 : 1; - } - Area.__super__.constructor.call(this, areaOptions); - } - - Area.prototype.calcPoints = function() { - var row, total, y, _i, _len, _ref, _results; - _ref = this.data; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - row = _ref[_i]; - row._x = this.transX(row.x); - total = 0; - row._y = (function() { - var _j, _len1, _ref1, _results1; - _ref1 = row.y; - _results1 = []; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - y = _ref1[_j]; - if (this.options.behaveLikeLine) { - _results1.push(this.transY(y)); - } else { - total += y || 0; - _results1.push(this.transY(total)); - } - } - return _results1; - }).call(this); - _results.push(row._ymax = Math.max.apply(Math, row._y)); - } - return _results; - }; - - Area.prototype.drawSeries = function() { - var i, range, _i, _j, _k, _len, _ref, _ref1, _results, _results1, _results2; - this.seriesPoints = []; - if (this.options.behaveLikeLine) { - range = (function() { - _results = []; - for (var _i = 0, _ref = this.options.ykeys.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); } - return _results; - }).apply(this); - } else { - range = (function() { - _results1 = []; - for (var _j = _ref1 = this.options.ykeys.length - 1; _ref1 <= 0 ? _j <= 0 : _j >= 0; _ref1 <= 0 ? _j++ : _j--){ _results1.push(_j); } - return _results1; - }).apply(this); - } - _results2 = []; - for (_k = 0, _len = range.length; _k < _len; _k++) { - i = range[_k]; - this._drawFillFor(i); - this._drawLineFor(i); - _results2.push(this._drawPointFor(i)); - } - return _results2; - }; - - Area.prototype._drawFillFor = function(index) { - var path; - path = this.paths[index]; - if (path !== null) { - path = path + ("L" + (this.transX(this.xmax)) + "," + this.bottom + "L" + (this.transX(this.xmin)) + "," + this.bottom + "Z"); - return this.drawFilledPath(path, this.fillForSeries(index)); - } - }; - - Area.prototype.fillForSeries = function(i) { - var color; - color = Raphael.rgb2hsl(this.colorFor(this.data[i], i, 'line')); - return Raphael.hsl(color.h, this.options.behaveLikeLine ? color.s * 0.9 : color.s * 0.75, Math.min(0.98, this.options.behaveLikeLine ? color.l * 1.2 : color.l * 1.25)); - }; - - Area.prototype.drawFilledPath = function(path, fill) { - return this.raphael.path(path).attr('fill', fill).attr('fill-opacity', this.options.fillOpacity).attr('stroke', 'none'); - }; - - return Area; - - })(Morris.Line); - - Morris.Bar = (function(_super) { - __extends(Bar, _super); - - function Bar(options) { - this.onHoverOut = __bind(this.onHoverOut, this); - this.onHoverMove = __bind(this.onHoverMove, this); - this.onGridClick = __bind(this.onGridClick, this); - if (!(this instanceof Morris.Bar)) { - return new Morris.Bar(options); - } - Bar.__super__.constructor.call(this, $.extend({}, options, { - parseTime: false - })); - } - - Bar.prototype.init = function() { - this.cumulative = this.options.stacked; - if (this.options.hideHover !== 'always') { - this.hover = new Morris.Hover({ - parent: this.el - }); - this.on('hovermove', this.onHoverMove); - this.on('hoverout', this.onHoverOut); - return this.on('gridclick', this.onGridClick); - } - }; - - Bar.prototype.defaults = { - barSizeRatio: 0.75, - barGap: 3, - barColors: ['#0b62a4', '#7a92a3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed'], - barOpacity: 1.0, - barRadius: [0, 0, 0, 0], - xLabelMargin: 50 - }; - - Bar.prototype.calc = function() { - var _ref; - this.calcBars(); - if (this.options.hideHover === false) { - return (_ref = this.hover).update.apply(_ref, this.hoverContentForRow(this.data.length - 1)); - } - }; - - Bar.prototype.calcBars = function() { - var idx, row, y, _i, _len, _ref, _results; - _ref = this.data; - _results = []; - for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) { - row = _ref[idx]; - row._x = this.left + this.width * (idx + 0.5) / this.data.length; - _results.push(row._y = (function() { - var _j, _len1, _ref1, _results1; - _ref1 = row.y; - _results1 = []; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - y = _ref1[_j]; - if (y != null) { - _results1.push(this.transY(y)); - } else { - _results1.push(null); - } - } - return _results1; - }).call(this)); - } - return _results; - }; - - Bar.prototype.draw = function() { - var _ref; - if ((_ref = this.options.axes) === true || _ref === 'both' || _ref === 'x') { - this.drawXAxis(); - } - return this.drawSeries(); - }; - - Bar.prototype.drawXAxis = function() { - var i, label, labelBox, margin, offset, prevAngleMargin, prevLabelMargin, row, textBox, ypos, _i, _ref, _results; - ypos = this.bottom + (this.options.xAxisLabelTopPadding || this.options.padding / 2); - prevLabelMargin = null; - prevAngleMargin = null; - _results = []; - for (i = _i = 0, _ref = this.data.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { - row = this.data[this.data.length - 1 - i]; - label = this.drawXAxisLabel(row._x, ypos, row.label); - textBox = label.getBBox(); - label.transform("r" + (-this.options.xLabelAngle)); - labelBox = label.getBBox(); - label.transform("t0," + (labelBox.height / 2) + "..."); - if (this.options.xLabelAngle !== 0) { - offset = -0.5 * textBox.width * Math.cos(this.options.xLabelAngle * Math.PI / 180.0); - label.transform("t" + offset + ",0..."); - } - if (((prevLabelMargin == null) || prevLabelMargin >= labelBox.x + labelBox.width || (prevAngleMargin != null) && prevAngleMargin >= labelBox.x) && labelBox.x >= 0 && (labelBox.x + labelBox.width) < this.el.width()) { - if (this.options.xLabelAngle !== 0) { - margin = 1.25 * this.options.gridTextSize / Math.sin(this.options.xLabelAngle * Math.PI / 180.0); - prevAngleMargin = labelBox.x - margin; - } - _results.push(prevLabelMargin = labelBox.x - this.options.xLabelMargin); - } else { - _results.push(label.remove()); - } - } - return _results; - }; - - Bar.prototype.drawSeries = function() { - var barWidth, bottom, groupWidth, idx, lastTop, left, leftPadding, numBars, row, sidx, size, spaceLeft, top, ypos, zeroPos; - groupWidth = this.width / this.options.data.length; - numBars = this.options.stacked ? 1 : this.options.ykeys.length; - barWidth = (groupWidth * this.options.barSizeRatio - this.options.barGap * (numBars - 1)) / numBars; - if (this.options.barSize) { - barWidth = Math.min(barWidth, this.options.barSize); - } - spaceLeft = groupWidth - barWidth * numBars - this.options.barGap * (numBars - 1); - leftPadding = spaceLeft / 2; - zeroPos = this.ymin <= 0 && this.ymax >= 0 ? this.transY(0) : null; - return this.bars = (function() { - var _i, _len, _ref, _results; - _ref = this.data; - _results = []; - for (idx = _i = 0, _len = _ref.length; _i < _len; idx = ++_i) { - row = _ref[idx]; - lastTop = 0; - _results.push((function() { - var _j, _len1, _ref1, _results1; - _ref1 = row._y; - _results1 = []; - for (sidx = _j = 0, _len1 = _ref1.length; _j < _len1; sidx = ++_j) { - ypos = _ref1[sidx]; - if (ypos !== null) { - if (zeroPos) { - top = Math.min(ypos, zeroPos); - bottom = Math.max(ypos, zeroPos); - } else { - top = ypos; - bottom = this.bottom; - } - left = this.left + idx * groupWidth + leftPadding; - if (!this.options.stacked) { - left += sidx * (barWidth + this.options.barGap); - } - size = bottom - top; - if (this.options.verticalGridCondition && this.options.verticalGridCondition(row.x)) { - this.drawBar(this.left + idx * groupWidth, this.top, groupWidth, Math.abs(this.top - this.bottom), this.options.verticalGridColor, this.options.verticalGridOpacity, this.options.barRadius); - } - if (this.options.stacked) { - top -= lastTop; - } - this.drawBar(left, top, barWidth, size, this.colorFor(row, sidx, 'bar'), this.options.barOpacity, this.options.barRadius); - _results1.push(lastTop += size); - } else { - _results1.push(null); - } - } - return _results1; - }).call(this)); - } - return _results; - }).call(this); - }; - - Bar.prototype.colorFor = function(row, sidx, type) { - var r, s; - if (typeof this.options.barColors === 'function') { - r = { - x: row.x, - y: row.y[sidx], - label: row.label - }; - s = { - index: sidx, - key: this.options.ykeys[sidx], - label: this.options.labels[sidx] - }; - return this.options.barColors.call(this, r, s, type); - } else { - return this.options.barColors[sidx % this.options.barColors.length]; - } - }; - - Bar.prototype.hitTest = function(x) { - if (this.data.length === 0) { - return null; - } - x = Math.max(Math.min(x, this.right), this.left); - return Math.min(this.data.length - 1, Math.floor((x - this.left) / (this.width / this.data.length))); - }; - - Bar.prototype.onGridClick = function(x, y) { - var index; - index = this.hitTest(x); - return this.fire('click', index, this.data[index].src, x, y); - }; - - Bar.prototype.onHoverMove = function(x, y) { - var index, _ref; - index = this.hitTest(x); - return (_ref = this.hover).update.apply(_ref, this.hoverContentForRow(index)); - }; - - Bar.prototype.onHoverOut = function() { - if (this.options.hideHover !== false) { - return this.hover.hide(); - } - }; - - Bar.prototype.hoverContentForRow = function(index) { - var content, j, row, x, y, _i, _len, _ref; - row = this.data[index]; - content = "
" + row.label + "
"; - _ref = row.y; - for (j = _i = 0, _len = _ref.length; _i < _len; j = ++_i) { - y = _ref[j]; - content += "
\n " + this.options.labels[j] + ":\n " + (this.yLabelFormat(y)) + "\n
"; - } - if (typeof this.options.hoverCallback === 'function') { - content = this.options.hoverCallback(index, this.options, content, row.src); - } - x = this.left + (index + 0.5) * this.width / this.data.length; - return [content, x]; - }; - - Bar.prototype.drawXAxisLabel = function(xPos, yPos, text) { - var label; - return label = this.raphael.text(xPos, yPos, text).attr('font-size', this.options.gridTextSize).attr('font-family', this.options.gridTextFamily).attr('font-weight', this.options.gridTextWeight).attr('fill', this.options.gridTextColor); - }; - - Bar.prototype.drawBar = function(xPos, yPos, width, height, barColor, opacity, radiusArray) { - var maxRadius, path; - maxRadius = Math.max.apply(Math, radiusArray); - if (maxRadius === 0 || maxRadius > height) { - path = this.raphael.rect(xPos, yPos, width, height); - } else { - path = this.raphael.path(this.roundedRect(xPos, yPos, width, height, radiusArray)); - } - return path.attr('fill', barColor).attr('fill-opacity', opacity).attr('stroke', 'none'); - }; - - Bar.prototype.roundedRect = function(x, y, w, h, r) { - if (r == null) { - r = [0, 0, 0, 0]; - } - return ["M", x, r[0] + y, "Q", x, y, x + r[0], y, "L", x + w - r[1], y, "Q", x + w, y, x + w, y + r[1], "L", x + w, y + h - r[2], "Q", x + w, y + h, x + w - r[2], y + h, "L", x + r[3], y + h, "Q", x, y + h, x, y + h - r[3], "Z"]; - }; - - return Bar; - - })(Morris.Grid); - - Morris.Donut = (function(_super) { - __extends(Donut, _super); - - Donut.prototype.defaults = { - colors: ['#0B62A4', '#3980B5', '#679DC6', '#95BBD7', '#B0CCE1', '#095791', '#095085', '#083E67', '#052C48', '#042135'], - backgroundColor: '#FFFFFF', - labelColor: '#000000', - formatter: Morris.commas, - resize: false - }; - - function Donut(options) { - this.resizeHandler = __bind(this.resizeHandler, this); - this.select = __bind(this.select, this); - this.click = __bind(this.click, this); - var _this = this; - if (!(this instanceof Morris.Donut)) { - return new Morris.Donut(options); - } - this.options = $.extend({}, this.defaults, options); - if (typeof options.element === 'string') { - this.el = $(document.getElementById(options.element)); - } else { - this.el = $(options.element); - } - if (this.el === null || this.el.length === 0) { - throw new Error("Graph placeholder not found."); - } - if (options.data === void 0 || options.data.length === 0) { - return; - } - this.raphael = new Raphael(this.el[0]); - if (this.options.resize) { - $(window).bind('resize', function(evt) { - if (_this.timeoutId != null) { - window.clearTimeout(_this.timeoutId); - } - return _this.timeoutId = window.setTimeout(_this.resizeHandler, 100); - }); - } - this.setData(options.data); - } - - Donut.prototype.redraw = function() { - var C, cx, cy, i, idx, last, max_value, min, next, seg, total, value, w, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results; - this.raphael.clear(); - cx = this.el.width() / 2; - cy = this.el.height() / 2; - w = (Math.min(cx, cy) - 10) / 3; - total = 0; - _ref = this.values; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - value = _ref[_i]; - total += value; - } - min = 5 / (2 * w); - C = 1.9999 * Math.PI - min * this.data.length; - last = 0; - idx = 0; - this.segments = []; - _ref1 = this.values; - for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) { - value = _ref1[i]; - next = last + min + C * (value / total); - seg = new Morris.DonutSegment(cx, cy, w * 2, w, last, next, this.data[i].color || this.options.colors[idx % this.options.colors.length], this.options.backgroundColor, idx, this.raphael); - seg.render(); - this.segments.push(seg); - seg.on('hover', this.select); - seg.on('click', this.click); - last = next; - idx += 1; - } - this.text1 = this.drawEmptyDonutLabel(cx, cy - 10, this.options.labelColor, 15, 800); - this.text2 = this.drawEmptyDonutLabel(cx, cy + 10, this.options.labelColor, 14); - max_value = Math.max.apply(Math, this.values); - idx = 0; - _ref2 = this.values; - _results = []; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - value = _ref2[_k]; - if (value === max_value) { - this.select(idx); - break; - } - _results.push(idx += 1); - } - return _results; - }; - - Donut.prototype.setData = function(data) { - var row; - this.data = data; - this.values = (function() { - var _i, _len, _ref, _results; - _ref = this.data; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - row = _ref[_i]; - _results.push(parseFloat(row.value)); - } - return _results; - }).call(this); - return this.redraw(); - }; - - Donut.prototype.click = function(idx) { - return this.fire('click', idx, this.data[idx]); - }; - - Donut.prototype.select = function(idx) { - var row, s, segment, _i, _len, _ref; - _ref = this.segments; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - s = _ref[_i]; - s.deselect(); - } - segment = this.segments[idx]; - segment.select(); - row = this.data[idx]; - return this.setLabels(row.label, this.options.formatter(row.value, row)); - }; - - Donut.prototype.setLabels = function(label1, label2) { - var inner, maxHeightBottom, maxHeightTop, maxWidth, text1bbox, text1scale, text2bbox, text2scale; - inner = (Math.min(this.el.width() / 2, this.el.height() / 2) - 10) * 2 / 3; - maxWidth = 1.8 * inner; - maxHeightTop = inner / 2; - maxHeightBottom = inner / 3; - this.text1.attr({ - text: label1, - transform: '' - }); - text1bbox = this.text1.getBBox(); - text1scale = Math.min(maxWidth / text1bbox.width, maxHeightTop / text1bbox.height); - this.text1.attr({ - transform: "S" + text1scale + "," + text1scale + "," + (text1bbox.x + text1bbox.width / 2) + "," + (text1bbox.y + text1bbox.height) - }); - this.text2.attr({ - text: label2, - transform: '' - }); - text2bbox = this.text2.getBBox(); - text2scale = Math.min(maxWidth / text2bbox.width, maxHeightBottom / text2bbox.height); - return this.text2.attr({ - transform: "S" + text2scale + "," + text2scale + "," + (text2bbox.x + text2bbox.width / 2) + "," + text2bbox.y - }); - }; - - Donut.prototype.drawEmptyDonutLabel = function(xPos, yPos, color, fontSize, fontWeight) { - var text; - text = this.raphael.text(xPos, yPos, '').attr('font-size', fontSize).attr('fill', color); - if (fontWeight != null) { - text.attr('font-weight', fontWeight); - } - return text; - }; - - Donut.prototype.resizeHandler = function() { - this.timeoutId = null; - this.raphael.setSize(this.el.width(), this.el.height()); - return this.redraw(); - }; - - return Donut; - - })(Morris.EventEmitter); - - Morris.DonutSegment = (function(_super) { - __extends(DonutSegment, _super); - - function DonutSegment(cx, cy, inner, outer, p0, p1, color, backgroundColor, index, raphael) { - this.cx = cx; - this.cy = cy; - this.inner = inner; - this.outer = outer; - this.color = color; - this.backgroundColor = backgroundColor; - this.index = index; - this.raphael = raphael; - this.deselect = __bind(this.deselect, this); - this.select = __bind(this.select, this); - this.sin_p0 = Math.sin(p0); - this.cos_p0 = Math.cos(p0); - this.sin_p1 = Math.sin(p1); - this.cos_p1 = Math.cos(p1); - this.is_long = (p1 - p0) > Math.PI ? 1 : 0; - this.path = this.calcSegment(this.inner + 3, this.inner + this.outer - 5); - this.selectedPath = this.calcSegment(this.inner + 3, this.inner + this.outer); - this.hilight = this.calcArc(this.inner); - } - - DonutSegment.prototype.calcArcPoints = function(r) { - return [this.cx + r * this.sin_p0, this.cy + r * this.cos_p0, this.cx + r * this.sin_p1, this.cy + r * this.cos_p1]; - }; - - DonutSegment.prototype.calcSegment = function(r1, r2) { - var ix0, ix1, iy0, iy1, ox0, ox1, oy0, oy1, _ref, _ref1; - _ref = this.calcArcPoints(r1), ix0 = _ref[0], iy0 = _ref[1], ix1 = _ref[2], iy1 = _ref[3]; - _ref1 = this.calcArcPoints(r2), ox0 = _ref1[0], oy0 = _ref1[1], ox1 = _ref1[2], oy1 = _ref1[3]; - return ("M" + ix0 + "," + iy0) + ("A" + r1 + "," + r1 + ",0," + this.is_long + ",0," + ix1 + "," + iy1) + ("L" + ox1 + "," + oy1) + ("A" + r2 + "," + r2 + ",0," + this.is_long + ",1," + ox0 + "," + oy0) + "Z"; - }; - - DonutSegment.prototype.calcArc = function(r) { - var ix0, ix1, iy0, iy1, _ref; - _ref = this.calcArcPoints(r), ix0 = _ref[0], iy0 = _ref[1], ix1 = _ref[2], iy1 = _ref[3]; - return ("M" + ix0 + "," + iy0) + ("A" + r + "," + r + ",0," + this.is_long + ",0," + ix1 + "," + iy1); - }; - - DonutSegment.prototype.render = function() { - var _this = this; - this.arc = this.drawDonutArc(this.hilight, this.color); - return this.seg = this.drawDonutSegment(this.path, this.color, this.backgroundColor, function() { - return _this.fire('hover', _this.index); - }, function() { - return _this.fire('click', _this.index); - }); - }; - - DonutSegment.prototype.drawDonutArc = function(path, color) { - return this.raphael.path(path).attr({ - stroke: color, - 'stroke-width': 2, - opacity: 0 - }); - }; - - DonutSegment.prototype.drawDonutSegment = function(path, fillColor, strokeColor, hoverFunction, clickFunction) { - return this.raphael.path(path).attr({ - fill: fillColor, - stroke: strokeColor, - 'stroke-width': 3 - }).hover(hoverFunction).click(clickFunction); - }; - - DonutSegment.prototype.select = function() { - if (!this.selected) { - this.seg.animate({ - path: this.selectedPath - }, 150, '<>'); - this.arc.animate({ - opacity: 1 - }, 150, '<>'); - return this.selected = true; - } - }; - - DonutSegment.prototype.deselect = function() { - if (this.selected) { - this.seg.animate({ - path: this.path - }, 150, '<>'); - this.arc.animate({ - opacity: 0 - }, 150, '<>'); - return this.selected = false; - } - }; - - return DonutSegment; - - })(Morris.EventEmitter); - -}).call(this); diff --git a/bootstrap/addons/morris/morris-data.js b/bootstrap/addons/morris/morris-data.js deleted file mode 100644 index f9dcb05..0000000 --- a/bootstrap/addons/morris/morris-data.js +++ /dev/null @@ -1,227 +0,0 @@ -// Morris.js Charts sample data for SB Admin template - -$(function() { - - // Area Chart - Morris.Area({ - element: 'morris-area-chart', - data: [{ - period: '2010 Q1', - iphone: 2666, - ipad: null, - itouch: 2647 - }, { - period: '2010 Q2', - iphone: 2778, - ipad: 2294, - itouch: 2441 - }, { - period: '2010 Q3', - iphone: 4912, - ipad: 1969, - itouch: 2501 - }, { - period: '2010 Q4', - iphone: 3767, - ipad: 3597, - itouch: 5689 - }, { - period: '2011 Q1', - iphone: 6810, - ipad: 1914, - itouch: 2293 - }, { - period: '2011 Q2', - iphone: 5670, - ipad: 4293, - itouch: 1881 - }, { - period: '2011 Q3', - iphone: 4820, - ipad: 3795, - itouch: 1588 - }, { - period: '2011 Q4', - iphone: 15073, - ipad: 5967, - itouch: 5175 - }, { - period: '2012 Q1', - iphone: 10687, - ipad: 4460, - itouch: 2028 - }, { - period: '2012 Q2', - iphone: 8432, - ipad: 5713, - itouch: 1791 - }], - xkey: 'period', - ykeys: ['iphone', 'ipad', 'itouch'], - labels: ['iPhone', 'iPad', 'iPod Touch'], - pointSize: 2, - hideHover: 'auto', - resize: true - }); - - // Donut Chart - Morris.Donut({ - element: 'morris-donut-chart', - data: [{ - label: "Download Sales", - value: 12 - }, { - label: "In-Store Sales", - value: 30 - }, { - label: "Mail-Order Sales", - value: 20 - }], - resize: true - }); - - // Line Chart - Morris.Line({ - // ID of the element in which to draw the chart. - element: 'morris-line-chart', - // Chart data records -- each entry in this array corresponds to a point on - // the chart. - data: [{ - d: '2012-10-01', - visits: 802 - }, { - d: '2012-10-02', - visits: 783 - }, { - d: '2012-10-03', - visits: 820 - }, { - d: '2012-10-04', - visits: 839 - }, { - d: '2012-10-05', - visits: 792 - }, { - d: '2012-10-06', - visits: 859 - }, { - d: '2012-10-07', - visits: 790 - }, { - d: '2012-10-08', - visits: 1680 - }, { - d: '2012-10-09', - visits: 1592 - }, { - d: '2012-10-10', - visits: 1420 - }, { - d: '2012-10-11', - visits: 882 - }, { - d: '2012-10-12', - visits: 889 - }, { - d: '2012-10-13', - visits: 819 - }, { - d: '2012-10-14', - visits: 849 - }, { - d: '2012-10-15', - visits: 870 - }, { - d: '2012-10-16', - visits: 1063 - }, { - d: '2012-10-17', - visits: 1192 - }, { - d: '2012-10-18', - visits: 1224 - }, { - d: '2012-10-19', - visits: 1329 - }, { - d: '2012-10-20', - visits: 1329 - }, { - d: '2012-10-21', - visits: 1239 - }, { - d: '2012-10-22', - visits: 1190 - }, { - d: '2012-10-23', - visits: 1312 - }, { - d: '2012-10-24', - visits: 1293 - }, { - d: '2012-10-25', - visits: 1283 - }, { - d: '2012-10-26', - visits: 1248 - }, { - d: '2012-10-27', - visits: 1323 - }, { - d: '2012-10-28', - visits: 1390 - }, { - d: '2012-10-29', - visits: 1420 - }, { - d: '2012-10-30', - visits: 1529 - }, { - d: '2012-10-31', - visits: 1892 - }, ], - // The name of the data record attribute that contains x-visitss. - xkey: 'd', - // A list of names of data record attributes that contain y-visitss. - ykeys: ['visits'], - // Labels for the ykeys -- will be displayed when you hover over the - // chart. - labels: ['Visits'], - // Disables line smoothing - smooth: false, - resize: true - }); - - // Bar Chart - Morris.Bar({ - element: 'morris-bar-chart', - data: [{ - device: 'iPhone', - geekbench: 136 - }, { - device: 'iPhone 3G', - geekbench: 137 - }, { - device: 'iPhone 3GS', - geekbench: 275 - }, { - device: 'iPhone 4', - geekbench: 380 - }, { - device: 'iPhone 4S', - geekbench: 655 - }, { - device: 'iPhone 5', - geekbench: 1571 - }], - xkey: 'device', - ykeys: ['geekbench'], - labels: ['Geekbench'], - barRatio: 0.4, - xLabelAngle: 35, - hideHover: 'auto', - resize: true - }); - - -}); diff --git a/bootstrap/addons/morris/morris.css b/bootstrap/addons/morris/morris.css index 209f091..59b8178 100644 --- a/bootstrap/addons/morris/morris.css +++ b/bootstrap/addons/morris/morris.css @@ -1,2 +1,22 @@ -.morris-hover{position:absolute;z-index:1000}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255,255,255,0.8);border:solid 2px rgba(230,230,230,0.8);font-family:sans-serif;font-size:12px;text-align:center}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0} -.morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0} +.morris-hover { + position: absolute; + z-index: 1000 +} +.morris-hover.morris-default-style { + border-radius: 10px; + padding: 6px; + color: #666; + background: rgba(255, 255, 255, 0.8); + border: solid 2px rgba(230, 230, 230, 0.8); + font-family: sans-serif; + font-size: 12px; + text-align: center +} +.morris-hover.morris-default-style .morris-hover-row-label { + font-weight: bold; + margin: 0.25em 0 +} +.morris-hover.morris-default-style .morris-hover-point { + white-space: nowrap; + margin: 0.1em 0 +} \ No newline at end of file diff --git a/bootstrap/addons/morris/morris.min.js b/bootstrap/addons/morris/morris.min.js index c3bda2f..c7c2e43 100644 --- a/bootstrap/addons/morris/morris.min.js +++ b/bootstrap/addons/morris/morris.min.js @@ -3,5 +3,5 @@ morris.js v0.5.0 Copyright 2014 Olly Smith All rights reserved. Licensed under the BSD-2-Clause License. */ -(function(){var a,b,c,d,e=[].slice,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},i=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=window.Morris={},a=jQuery,b.EventEmitter=function(){function a(){}return a.prototype.on=function(a,b){return null==this.handlers&&(this.handlers={}),null==this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this},a.prototype.fire=function(){var a,b,c,d,f,g,h;if(c=arguments[0],a=2<=arguments.length?e.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[c]){for(g=this.handlers[c],h=[],d=0,f=g.length;f>d;d++)b=g[d],h.push(b.apply(null,a));return h}},a}(),b.commas=function(a){var b,c,d,e;return null!=a?(d=0>a?"-":"",b=Math.abs(a),c=Math.floor(b).toFixed(0),d+=c.replace(/(?=(?:\d{3})+$)(?!^)/g,","),e=b.toString(),e.length>c.length&&(d+=e.slice(c.length)),d):"-"},b.pad2=function(a){return(10>a?"0":"")+a},b.Grid=function(c){function d(b){this.resizeHandler=f(this.resizeHandler,this);var c=this;if(this.el="string"==typeof b.element?a(document.getElementById(b.element)):a(b.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=a.extend({},this.gridDefaults,this.defaults||{},b),"string"==typeof this.options.units&&(this.options.postUnits=b.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(a){var b,d,e,f,g;return d=c.el.offset(),g=a.pageX-d.left,c.selectFrom?(b=c.data[c.hitTest(Math.min(g,c.selectFrom))]._x,e=c.data[c.hitTest(Math.max(g,c.selectFrom))]._x,f=e-b,c.selectionRect.attr({x:b,width:f})):c.fire("hovermove",g,a.pageY-d.top)}),this.el.bind("mouseleave",function(){return c.selectFrom&&(c.selectionRect.hide(),c.selectFrom=null),c.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(a){var b,d;return d=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],b=c.el.offset(),c.fire("hovermove",d.pageX-b.left,d.pageY-b.top)}),this.el.bind("click",function(a){var b;return b=c.el.offset(),c.fire("gridclick",a.pageX-b.left,a.pageY-b.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(a){var b;return b=c.el.offset(),c.startRange(a.pageX-b.left)}),this.el.bind("mouseup",function(a){var b;return b=c.el.offset(),c.endRange(a.pageX-b.left),c.fire("hovermove",a.pageX-b.left,a.pageY-b.top)})),this.options.resize&&a(window).bind("resize",function(){return null!=c.timeoutId&&window.clearTimeout(c.timeoutId),c.timeoutId=window.setTimeout(c.resizeHandler,100)}),this.el.css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),this.postInit&&this.postInit()}return h(d,c),d.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},d.prototype.setData=function(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return null==c&&(c=!0),this.options.data=a,null==a||0===a.length?(this.data=[],this.raphael.clear(),null!=this.hover&&this.hover.hide(),void 0):(o=this.cumulative?0:null,p=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),g=Math.max.apply(Math,this.options.goals),p=null!=p?Math.min(p,h):h,o=null!=o?Math.max(o,g):g),this.data=function(){var c,d,g;for(g=[],f=c=0,d=a.length;d>c;f=++c)j=a[f],i={src:j},i.label=j[this.options.xkey],this.options.parseTime?(i.x=b.parseDate(i.label),this.options.dateFormat?i.label=this.options.dateFormat(i.x):"number"==typeof i.label&&(i.label=new Date(i.label).toString())):(i.x=f,this.options.xLabelFormat&&(i.label=this.options.xLabelFormat(i))),l=0,i.y=function(){var a,b,c,d;for(c=this.options.ykeys,d=[],e=a=0,b=c.length;b>a;e=++a)n=c[e],q=j[n],"string"==typeof q&&(q=parseFloat(q)),null!=q&&"number"!=typeof q&&(q=null),null!=q&&(this.cumulative?l+=q:null!=o?(o=Math.max(q,o),p=Math.min(q,p)):o=p=q),this.cumulative&&null!=l&&(o=Math.max(l,o),p=Math.min(l,p)),d.push(q);return d}.call(this),g.push(i);return g}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(a,b){return(a.x>b.x)-(b.x>a.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var a,c,e,f;for(e=this.options.events,f=[],a=0,c=e.length;c>a;a++)d=e[a],f.push(b.parseDate(d));return f}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",p),this.ymax=this.yboundary("max",o),this.ymin===this.ymax&&(p&&(this.ymin-=1),this.ymax+=1),((r=this.options.axes)===!0||"both"===r||"y"===r||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(k=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var a,b,c,d;for(d=[],m=a=b=this.ymin,c=this.ymax;k>0?c>=a:a>=c;m=a+=k)d.push(m);return d}.call(this))),this.dirty=!0,c?this.redraw():void 0)},d.prototype.yboundary=function(a,b){var c,d;return c=this.options["y"+a],"string"==typeof c?"auto"===c.slice(0,4)?c.length>5?(d=parseInt(c.slice(5),10),null==b?d:Math[a](b,d)):null!=b?b:0:parseInt(c,10):c},d.prototype.autoGridLines=function(a,b,c){var d,e,f,g,h,i,j,k,l;return h=b-a,l=Math.floor(Math.log(h)/Math.log(10)),j=Math.pow(10,l),e=Math.floor(a/j)*j,d=Math.ceil(b/j)*j,i=(d-e)/(c-1),1===j&&i>1&&Math.ceil(i)!==i&&(i=Math.ceil(i),d=e+i*(c-1)),0>e&&d>0&&(e=Math.floor(a/i)*i,d=Math.ceil(b/i)*i),1>i?(g=Math.floor(Math.log(i)/Math.log(10)),f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(parseFloat(k.toFixed(1-g)));return b}()):f=function(){var a,b;for(b=[],k=a=e;i>0?d>=a:a>=d;k=a+=i)b.push(k);return b}(),f},d.prototype._calc=function(){var a,b,c,d,e,f,g,h;return e=this.el.width(),c=this.el.height(),(this.elementWidth!==e||this.elementHeight!==c||this.dirty)&&(this.elementWidth=e,this.elementHeight=c,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((g=this.options.axes)===!0||"both"===g||"y"===g)&&(f=function(){var a,c,d,e;for(d=this.grid,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(this.measureText(this.yAxisFormat(b)).width);return e}.call(this),this.left+=Math.max.apply(Math,f)),((h=this.options.axes)===!0||"both"===h||"x"===h)&&(a=function(){var a,b,c;for(c=[],d=a=0,b=this.data.length;b>=0?b>a:a>b;d=b>=0?++a:--a)c.push(this.measureText(this.data[d].text,-this.options.xLabelAngle).height);return c}.call(this),this.bottom-=Math.max.apply(Math,a)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},d.prototype.transY=function(a){return this.bottom-(a-this.ymin)*this.dy},d.prototype.transX=function(a){return 1===this.data.length?(this.left+this.right)/2:this.left+(a-this.xmin)*this.dx},d.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},d.prototype.measureText=function(a,b){var c,d;return null==b&&(b=0),d=this.raphael.text(100,100,a).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(b),c=d.getBBox(),d.remove(),c},d.prototype.yAxisFormat=function(a){return this.yLabelFormat(a)},d.prototype.yLabelFormat=function(a){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(a):""+this.options.preUnits+b.commas(a)+this.options.postUnits},d.prototype.drawGrid=function(){var a,b,c,d,e,f,g,h;if(this.options.grid!==!1||(e=this.options.axes)===!0||"both"===e||"y"===e){for(f=this.grid,h=[],c=0,d=f.length;d>c;c++)a=f[c],b=this.transY(a),((g=this.options.axes)===!0||"both"===g||"y"===g)&&this.drawYAxisLabel(this.left-this.options.padding/2,b,this.yAxisFormat(a)),this.options.grid?h.push(this.drawGridLine("M"+this.left+","+b+"H"+(this.left+this.width))):h.push(void 0);return h}},d.prototype.drawGoals=function(){var a,b,c,d,e,f,g;for(f=this.options.goals,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.goalLineColors[c%this.options.goalLineColors.length],g.push(this.drawGoal(b,a));return g},d.prototype.drawEvents=function(){var a,b,c,d,e,f,g;for(f=this.events,g=[],c=d=0,e=f.length;e>d;c=++d)b=f[c],a=this.options.eventLineColors[c%this.options.eventLineColors.length],g.push(this.drawEvent(b,a));return g},d.prototype.drawGoal=function(a,b){return this.raphael.path("M"+this.left+","+this.transY(a)+"H"+this.right).attr("stroke",b).attr("stroke-width",this.options.goalStrokeWidth)},d.prototype.drawEvent=function(a,b){return this.raphael.path("M"+this.transX(a)+","+this.bottom+"V"+this.top).attr("stroke",b).attr("stroke-width",this.options.eventStrokeWidth)},d.prototype.drawYAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},d.prototype.drawGridLine=function(a){return this.raphael.path(a).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},d.prototype.startRange=function(a){return this.hover.hide(),this.selectFrom=a,this.selectionRect.attr({x:a,width:0}).show()},d.prototype.endRange=function(a){var b,c;return this.selectFrom?(c=Math.min(this.selectFrom,a),b=Math.max(this.selectFrom,a),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(c)].x,end:this.data[this.hitTest(b)].x}),this.selectFrom=null):void 0},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.parseDate=function(a){var b,c,d,e,f,g,h,i,j,k,l;return"number"==typeof a?a:(c=a.match(/^(\d+) Q(\d)$/),e=a.match(/^(\d+)-(\d+)$/),f=a.match(/^(\d+)-(\d+)-(\d+)$/),h=a.match(/^(\d+) W(\d+)$/),i=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),j=a.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),c?new Date(parseInt(c[1],10),3*parseInt(c[2],10)-1,1).getTime():e?new Date(parseInt(e[1],10),parseInt(e[2],10)-1,1).getTime():f?new Date(parseInt(f[1],10),parseInt(f[2],10)-1,parseInt(f[3],10)).getTime():h?(k=new Date(parseInt(h[1],10),0,1),4!==k.getDay()&&k.setMonth(0,1+(4-k.getDay()+7)%7),k.getTime()+6048e5*parseInt(h[2],10)):i?i[6]?(g=0,"Z"!==i[6]&&(g=60*parseInt(i[8],10)+parseInt(i[9],10),"+"===i[7]&&(g=0-g)),Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)+g)):new Date(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)).getTime():j?(l=parseFloat(j[6]),b=Math.floor(l),d=Math.round(1e3*(l-b)),j[8]?(g=0,"Z"!==j[8]&&(g=60*parseInt(j[10],10)+parseInt(j[11],10),"+"===j[9]&&(g=0-g)),Date.UTC(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10)+g,b,d)):new Date(parseInt(j[1],10),parseInt(j[2],10)-1,parseInt(j[3],10),parseInt(j[4],10),parseInt(j[5],10),b,d).getTime()):new Date(parseInt(a,10),0,1).getTime())},b.Hover=function(){function c(c){null==c&&(c={}),this.options=a.extend({},b.Hover.defaults,c),this.el=a("
"),this.el.hide(),this.options.parent.append(this.el)}return c.defaults={"class":"morris-hover morris-default-style"},c.prototype.update=function(a,b,c){return a?(this.html(a),this.show(),this.moveTo(b,c)):this.hide()},c.prototype.html=function(a){return this.el.html(a)},c.prototype.moveTo=function(a,b){var c,d,e,f,g,h;return g=this.options.parent.innerWidth(),f=this.options.parent.innerHeight(),d=this.el.outerWidth(),c=this.el.outerHeight(),e=Math.min(Math.max(0,a-d/2),g-d),null!=b?(h=b-c-10,0>h&&(h=b+10,h+c>f&&(h=f/2-c/2))):h=f/2-c/2,this.el.css({left:e+"px",top:parseInt(h)+"px"})},c.prototype.show=function(){return this.el.show()},c.prototype.hide=function(){return this.el.hide()},c}(),b.Line=function(a){function c(a){return this.hilight=f(this.hilight,this),this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Line?(c.__super__.constructor.call(this,a),void 0):new b.Line(a)}return h(c,a),c.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},c.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,hideHover:!1},c.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},c.prototype.calcPoints=function(){var a,b,c,d,e,f;for(e=this.data,f=[],c=0,d=e.length;d>c;c++)a=e[c],a._x=this.transX(a.x),a._y=function(){var c,d,e,f;for(e=a.y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b?f.push(this.transY(b)):f.push(b);return f}.call(this),f.push(a._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var c,d,e,f;for(e=a._y,f=[],c=0,d=e.length;d>c;c++)b=e[c],null!=b&&f.push(b);return f}())));return f},c.prototype.hitTest=function(a){var b,c,d,e,f;if(0===this.data.length)return null;for(f=this.data.slice(1),b=d=0,e=f.length;e>d&&(c=f[b],!(a<(c._x+this.data[b]._x)/2));b=++d);return b},c.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},c.prototype.onHoverMove=function(a){var b;return b=this.hitTest(a),this.displayHoverForRow(b)},c.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},c.prototype.displayHoverForRow=function(a){var b;return null!=a?((b=this.hover).update.apply(b,this.hoverContentForRow(a)),this.hilight(a)):(this.hover.hide(),this.hilight())},c.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h;for(d=this.data[a],b="
"+d.label+"
",h=d.y,c=f=0,g=h.length;g>f;c=++f)e=h[c],b+="
\n "+this.options.labels[c]+":\n "+this.yLabelFormat(e)+"\n
";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),[b,d._x,d._ymax]},c.prototype.generatePaths=function(){var a,c,d,e;return this.paths=function(){var f,g,h,j;for(j=[],c=f=0,g=this.options.ykeys.length;g>=0?g>f:f>g;c=g>=0?++f:--f)e="boolean"==typeof this.options.smooth?this.options.smooth:(h=this.options.ykeys[c],i.call(this.options.smooth,h)>=0),a=function(){var a,b,e,f;for(e=this.data,f=[],a=0,b=e.length;b>a;a++)d=e[a],void 0!==d._y[c]&&f.push({x:d._x,y:d._y[c]});return f}.call(this),a.length>1?j.push(b.Line.createPath(a,e,this.bottom)):j.push(null);return j}.call(this)},c.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},c.prototype.drawXAxis=function(){var a,c,d,e,f,g,h,i,j,k,l=this;for(h=this.bottom+this.options.padding/2,f=null,e=null,a=function(a,b){var c,d,g,i,j;return c=l.drawXAxisLabel(l.transX(b),h,a),j=c.getBBox(),c.transform("r"+-l.options.xLabelAngle),d=c.getBBox(),c.transform("t0,"+d.height/2+"..."),0!==l.options.xLabelAngle&&(i=-.5*j.width*Math.cos(l.options.xLabelAngle*Math.PI/180),c.transform("t"+i+",0...")),d=c.getBBox(),(null==f||f>=d.x+d.width||null!=e&&e>=d.x)&&d.x>=0&&d.x+d.widtha;a++)g=c[a],d.push([g.label,g.x]);return d}.call(this),d.reverse(),k=[],i=0,j=d.length;j>i;i++)c=d[i],k.push(a(c[0],c[1]));return k},c.prototype.drawSeries=function(){var a,b,c,d,e,f;for(this.seriesPoints=[],a=b=d=this.options.ykeys.length-1;0>=d?0>=b:b>=0;a=0>=d?++b:--b)this._drawLineFor(a);for(f=[],a=c=e=this.options.ykeys.length-1;0>=e?0>=c:c>=0;a=0>=e?++c:--c)f.push(this._drawPointFor(a));return f},c.prototype._drawPointFor=function(a){var b,c,d,e,f,g;for(this.seriesPoints[a]=[],f=this.data,g=[],d=0,e=f.length;e>d;d++)c=f[d],b=null,null!=c._y[a]&&(b=this.drawLinePoint(c._x,c._y[a],this.colorFor(c,a,"point"),a)),g.push(this.seriesPoints[a].push(b));return g},c.prototype._drawLineFor=function(a){var b;return b=this.paths[a],null!==b?this.drawLinePath(b,this.colorFor(null,a,"line"),a):void 0},c.createPath=function(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(k="",c&&(g=b.Line.gradients(a)),l={y:null},h=q=0,r=a.length;r>q;h=++q)e=a[h],null!=e.y&&(null!=l.y?c?(f=g[h],j=g[h-1],i=(e.x-l.x)/4,m=l.x+i,o=Math.min(d,l.y+i*j),n=e.x-i,p=Math.min(d,e.y-i*f),k+="C"+m+","+o+","+n+","+p+","+e.x+","+e.y):k+="L"+e.x+","+e.y:c&&null==g[h]||(k+="M"+e.x+","+e.y)),l=e;return k},c.gradients=function(a){var b,c,d,e,f,g,h,i;for(c=function(a,b){return(a.y-b.y)/(a.x-b.x)},i=[],d=g=0,h=a.length;h>g;d=++g)b=a[d],null!=b.y?(e=a[d+1]||{y:null},f=a[d-1]||{y:null},null!=f.y&&null!=e.y?i.push(c(f,e)):null!=f.y?i.push(c(f,b)):null!=e.y?i.push(c(b,e)):i.push(null)):i.push(null);return i},c.prototype.hilight=function(a){var b,c,d,e,f;if(null!==this.prevHilight&&this.prevHilight!==a)for(b=c=0,e=this.seriesPoints.length-1;e>=0?e>=c:c>=e;b=e>=0?++c:--c)this.seriesPoints[b][this.prevHilight]&&this.seriesPoints[b][this.prevHilight].animate(this.pointShrinkSeries(b));if(null!==a&&this.prevHilight!==a)for(b=d=0,f=this.seriesPoints.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)this.seriesPoints[b][a]&&this.seriesPoints[b][a].animate(this.pointGrowSeries(b));return this.prevHilight=a},c.prototype.colorFor=function(a,b,c){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,a,b,c):"point"===c?this.options.pointFillColors[b%this.options.pointFillColors.length]||this.options.lineColors[b%this.options.lineColors.length]:this.options.lineColors[b%this.options.lineColors.length]},c.prototype.drawXAxisLabel=function(a,b,c){return this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},c.prototype.drawLinePath=function(a,b,c){return this.raphael.path(a).attr("stroke",b).attr("stroke-width",this.lineWidthForSeries(c))},c.prototype.drawLinePoint=function(a,b,c,d){return this.raphael.circle(a,b,this.pointSizeForSeries(d)).attr("fill",c).attr("stroke-width",this.pointStrokeWidthForSeries(d)).attr("stroke",this.pointStrokeColorForSeries(d))},c.prototype.pointStrokeWidthForSeries=function(a){return this.options.pointStrokeWidths[a%this.options.pointStrokeWidths.length]},c.prototype.pointStrokeColorForSeries=function(a){return this.options.pointStrokeColors[a%this.options.pointStrokeColors.length]},c.prototype.lineWidthForSeries=function(a){return this.options.lineWidth instanceof Array?this.options.lineWidth[a%this.options.lineWidth.length]:this.options.lineWidth},c.prototype.pointSizeForSeries=function(a){return this.options.pointSize instanceof Array?this.options.pointSize[a%this.options.pointSize.length]:this.options.pointSize},c.prototype.pointGrowSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)+3},25,"linear")},c.prototype.pointShrinkSeries=function(a){return Raphael.animation({r:this.pointSizeForSeries(a)},25,"linear")},c}(b.Grid),b.labelSeries=function(c,d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r;if(j=200*(d-c)/e,i=new Date(c),n=b.LABEL_SPECS[f],void 0===n)for(r=b.AUTO_LABEL_ORDER,p=0,q=r.length;q>p;p++)if(k=r[p],m=b.LABEL_SPECS[k],j>=m.span){n=m;break}for(void 0===n&&(n=b.LABEL_SPECS.second),g&&(n=a.extend({},n,{fmt:g})),h=n.start(i),l=[];(o=h.getTime())<=d;)o>=c&&l.push([n.fmt(h),o]),n.incr(h);return l},c=function(a){return{span:60*a*1e3,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())},incr:function(b){return b.setUTCMinutes(b.getUTCMinutes()+a)}}},d=function(a){return{span:1e3*a,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes())},fmt:function(a){return""+b.pad2(a.getHours())+":"+b.pad2(a.getMinutes())+":"+b.pad2(a.getSeconds())},incr:function(b){return b.setUTCSeconds(b.getUTCSeconds()+a)}}},b.LABEL_SPECS={decade:{span:1728e8,start:function(a){return new Date(a.getFullYear()-a.getFullYear()%10,0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+10)}},year:{span:1728e7,start:function(a){return new Date(a.getFullYear(),0,1)},fmt:function(a){return""+a.getFullYear()},incr:function(a){return a.setFullYear(a.getFullYear()+1)}},month:{span:24192e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),1)},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)},incr:function(a){return a.setMonth(a.getMonth()+1)}},week:{span:6048e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+7)}},day:{span:864e5,start:function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())},fmt:function(a){return""+a.getFullYear()+"-"+b.pad2(a.getMonth()+1)+"-"+b.pad2(a.getDate())},incr:function(a){return a.setDate(a.getDate()+1)}},hour:c(60),"30min":c(30),"15min":c(15),"10min":c(10),"5min":c(5),minute:c(1),"30sec":d(30),"15sec":d(15),"10sec":d(10),"5sec":d(5),second:d(1)},b.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],b.Area=function(c){function d(c){var f;return this instanceof b.Area?(f=a.extend({},e,c),this.cumulative=!f.behaveLikeLine,"auto"===f.fillOpacity&&(f.fillOpacity=f.behaveLikeLine?.8:1),d.__super__.constructor.call(this,f),void 0):new b.Area(c)}var e;return h(d,c),e={fillOpacity:"auto",behaveLikeLine:!1},d.prototype.calcPoints=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],d=0,e=f.length;e>d;d++)a=f[d],a._x=this.transX(a.x),b=0,a._y=function(){var d,e,f,g;for(f=a.y,g=[],d=0,e=f.length;e>d;d++)c=f[d],this.options.behaveLikeLine?g.push(this.transY(c)):(b+=c||0,g.push(this.transY(b)));return g}.call(this),g.push(a._ymax=Math.max.apply(Math,a._y));return g},d.prototype.drawSeries=function(){var a,b,c,d,e,f,g,h;for(this.seriesPoints=[],b=this.options.behaveLikeLine?function(){f=[];for(var a=0,b=this.options.ykeys.length-1;b>=0?b>=a:a>=b;b>=0?a++:a--)f.push(a);return f}.apply(this):function(){g=[];for(var a=e=this.options.ykeys.length-1;0>=e?0>=a:a>=0;0>=e?a++:a--)g.push(a);return g}.apply(this),h=[],c=0,d=b.length;d>c;c++)a=b[c],this._drawFillFor(a),this._drawLineFor(a),h.push(this._drawPointFor(a));return h},d.prototype._drawFillFor=function(a){var b;return b=this.paths[a],null!==b?(b+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(b,this.fillForSeries(a))):void 0},d.prototype.fillForSeries=function(a){var b;return b=Raphael.rgb2hsl(this.colorFor(this.data[a],a,"line")),Raphael.hsl(b.h,this.options.behaveLikeLine?.9*b.s:.75*b.s,Math.min(.98,this.options.behaveLikeLine?1.2*b.l:1.25*b.l))},d.prototype.drawFilledPath=function(a,b){return this.raphael.path(a).attr("fill",b).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},d}(b.Line),b.Bar=function(c){function d(c){return this.onHoverOut=f(this.onHoverOut,this),this.onHoverMove=f(this.onHoverMove,this),this.onGridClick=f(this.onGridClick,this),this instanceof b.Bar?(d.__super__.constructor.call(this,a.extend({},c,{parseTime:!1})),void 0):new b.Bar(c)}return h(d,c),d.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new b.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},d.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},d.prototype.calc=function(){var a;return this.calcBars(),this.options.hideHover===!1?(a=this.hover).update.apply(a,this.hoverContentForRow(this.data.length-1)):void 0},d.prototype.calcBars=function(){var a,b,c,d,e,f,g;for(f=this.data,g=[],a=d=0,e=f.length;e>d;a=++d)b=f[a],b._x=this.left+this.width*(a+.5)/this.data.length,g.push(b._y=function(){var a,d,e,f;for(e=b.y,f=[],a=0,d=e.length;d>a;a++)c=e[a],null!=c?f.push(this.transY(c)):f.push(null);return f}.call(this));return g},d.prototype.draw=function(){var a;return((a=this.options.axes)===!0||"both"===a||"x"===a)&&this.drawXAxis(),this.drawSeries()},d.prototype.drawXAxis=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(j=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),g=null,f=null,m=[],a=k=0,l=this.data.length;l>=0?l>k:k>l;a=l>=0?++k:--k)h=this.data[this.data.length-1-a],b=this.drawXAxisLabel(h._x,j,h.label),i=b.getBBox(),b.transform("r"+-this.options.xLabelAngle),c=b.getBBox(),b.transform("t0,"+c.height/2+"..."),0!==this.options.xLabelAngle&&(e=-.5*i.width*Math.cos(this.options.xLabelAngle*Math.PI/180),b.transform("t"+e+",0...")),(null==g||g>=c.x+c.width||null!=f&&f>=c.x)&&c.x>=0&&c.x+c.width=0?this.transY(0):null,this.bars=function(){var h,l,p,q;for(p=this.data,q=[],d=h=0,l=p.length;l>h;d=++h)i=p[d],e=0,q.push(function(){var h,l,p,q;for(p=i._y,q=[],j=h=0,l=p.length;l>h;j=++h)n=p[j],null!==n?(o?(m=Math.min(n,o),b=Math.max(n,o)):(m=n,b=this.bottom),f=this.left+d*c+g,this.options.stacked||(f+=j*(a+this.options.barGap)),k=b-m,this.options.verticalGridCondition&&this.options.verticalGridCondition(i.x)&&this.drawBar(this.left+d*c,this.top,c,Math.abs(this.top-this.bottom),this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius),this.options.stacked&&(m-=e),this.drawBar(f,m,a,k,this.colorFor(i,j,"bar"),this.options.barOpacity,this.options.barRadius),q.push(e+=k)):q.push(null);return q}.call(this));return q}.call(this)},d.prototype.colorFor=function(a,b,c){var d,e;return"function"==typeof this.options.barColors?(d={x:a.x,y:a.y[b],label:a.label},e={index:b,key:this.options.ykeys[b],label:this.options.labels[b]},this.options.barColors.call(this,d,e,c)):this.options.barColors[b%this.options.barColors.length]},d.prototype.hitTest=function(a){return 0===this.data.length?null:(a=Math.max(Math.min(a,this.right),this.left),Math.min(this.data.length-1,Math.floor((a-this.left)/(this.width/this.data.length))))},d.prototype.onGridClick=function(a,b){var c;return c=this.hitTest(a),this.fire("click",c,this.data[c].src,a,b)},d.prototype.onHoverMove=function(a){var b,c;return b=this.hitTest(a),(c=this.hover).update.apply(c,this.hoverContentForRow(b))},d.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},d.prototype.hoverContentForRow=function(a){var b,c,d,e,f,g,h,i;for(d=this.data[a],b="
"+d.label+"
",i=d.y,c=g=0,h=i.length;h>g;c=++g)f=i[c],b+="
\n "+this.options.labels[c]+":\n "+this.yLabelFormat(f)+"\n
";return"function"==typeof this.options.hoverCallback&&(b=this.options.hoverCallback(a,this.options,b,d.src)),e=this.left+(a+.5)*this.width/this.data.length,[b,e]},d.prototype.drawXAxisLabel=function(a,b,c){var d;return d=this.raphael.text(a,b,c).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},d.prototype.drawBar=function(a,b,c,d,e,f,g){var h,i;return h=Math.max.apply(Math,g),i=0===h||h>d?this.raphael.rect(a,b,c,d):this.raphael.path(this.roundedRect(a,b,c,d,g)),i.attr("fill",e).attr("fill-opacity",f).attr("stroke","none")},d.prototype.roundedRect=function(a,b,c,d,e){return null==e&&(e=[0,0,0,0]),["M",a,e[0]+b,"Q",a,b,a+e[0],b,"L",a+c-e[1],b,"Q",a+c,b,a+c,b+e[1],"L",a+c,b+d-e[2],"Q",a+c,b+d,a+c-e[2],b+d,"L",a+e[3],b+d,"Q",a,b+d,a,b+d-e[3],"Z"]},d}(b.Grid),b.Donut=function(c){function d(c){this.resizeHandler=f(this.resizeHandler,this),this.select=f(this.select,this),this.click=f(this.click,this);var d=this;if(!(this instanceof b.Donut))return new b.Donut(c);if(this.options=a.extend({},this.defaults,c),this.el="string"==typeof c.element?a(document.getElementById(c.element)):a(c.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==c.data&&0!==c.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&a(window).bind("resize",function(){return null!=d.timeoutId&&window.clearTimeout(d.timeoutId),d.timeoutId=window.setTimeout(d.resizeHandler,100)}),this.setData(c.data))}return h(d,c),d.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:b.commas,resize:!1},d.prototype.redraw=function(){var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;for(this.raphael.clear(),c=this.el.width()/2,d=this.el.height()/2,n=(Math.min(c,d)-10)/3,l=0,u=this.values,o=0,r=u.length;r>o;o++)m=u[o],l+=m;for(i=5/(2*n),a=1.9999*Math.PI-i*this.data.length,g=0,f=0,this.segments=[],v=this.values,e=p=0,s=v.length;s>p;e=++p)m=v[e],j=g+i+a*(m/l),k=new b.DonutSegment(c,d,2*n,n,g,j,this.data[e].color||this.options.colors[f%this.options.colors.length],this.options.backgroundColor,f,this.raphael),k.render(),this.segments.push(k),k.on("hover",this.select),k.on("click",this.click),g=j,f+=1;for(this.text1=this.drawEmptyDonutLabel(c,d-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(c,d+10,this.options.labelColor,14),h=Math.max.apply(Math,this.values),f=0,w=this.values,x=[],q=0,t=w.length;t>q;q++){if(m=w[q],m===h){this.select(f); -break}x.push(f+=1)}return x},d.prototype.setData=function(a){var b;return this.data=a,this.values=function(){var a,c,d,e;for(d=this.data,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(parseFloat(b.value));return e}.call(this),this.redraw()},d.prototype.click=function(a){return this.fire("click",a,this.data[a])},d.prototype.select=function(a){var b,c,d,e,f,g;for(g=this.segments,e=0,f=g.length;f>e;e++)c=g[e],c.deselect();return d=this.segments[a],d.select(),b=this.data[a],this.setLabels(b.label,this.options.formatter(b.value,b))},d.prototype.setLabels=function(a,b){var c,d,e,f,g,h,i,j;return c=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,f=1.8*c,e=c/2,d=c/3,this.text1.attr({text:a,transform:""}),g=this.text1.getBBox(),h=Math.min(f/g.width,e/g.height),this.text1.attr({transform:"S"+h+","+h+","+(g.x+g.width/2)+","+(g.y+g.height)}),this.text2.attr({text:b,transform:""}),i=this.text2.getBBox(),j=Math.min(f/i.width,d/i.height),this.text2.attr({transform:"S"+j+","+j+","+(i.x+i.width/2)+","+i.y})},d.prototype.drawEmptyDonutLabel=function(a,b,c,d,e){var f;return f=this.raphael.text(a,b,"").attr("font-size",d).attr("fill",c),null!=e&&f.attr("font-weight",e),f},d.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},d}(b.EventEmitter),b.DonutSegment=function(a){function b(a,b,c,d,e,g,h,i,j,k){this.cx=a,this.cy=b,this.inner=c,this.outer=d,this.color=h,this.backgroundColor=i,this.index=j,this.raphael=k,this.deselect=f(this.deselect,this),this.select=f(this.select,this),this.sin_p0=Math.sin(e),this.cos_p0=Math.cos(e),this.sin_p1=Math.sin(g),this.cos_p1=Math.cos(g),this.is_long=g-e>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(b,a),b.prototype.calcArcPoints=function(a){return[this.cx+a*this.sin_p0,this.cy+a*this.cos_p0,this.cx+a*this.sin_p1,this.cy+a*this.cos_p1]},b.prototype.calcSegment=function(a,b){var c,d,e,f,g,h,i,j,k,l;return k=this.calcArcPoints(a),c=k[0],e=k[1],d=k[2],f=k[3],l=this.calcArcPoints(b),g=l[0],i=l[1],h=l[2],j=l[3],"M"+c+","+e+("A"+a+","+a+",0,"+this.is_long+",0,"+d+","+f)+("L"+h+","+j)+("A"+b+","+b+",0,"+this.is_long+",1,"+g+","+i)+"Z"},b.prototype.calcArc=function(a){var b,c,d,e,f;return f=this.calcArcPoints(a),b=f[0],d=f[1],c=f[2],e=f[3],"M"+b+","+d+("A"+a+","+a+",0,"+this.is_long+",0,"+c+","+e)},b.prototype.render=function(){var a=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return a.fire("hover",a.index)},function(){return a.fire("click",a.index)})},b.prototype.drawDonutArc=function(a,b){return this.raphael.path(a).attr({stroke:b,"stroke-width":2,opacity:0})},b.prototype.drawDonutSegment=function(a,b,c,d,e){return this.raphael.path(a).attr({fill:b,stroke:c,"stroke-width":3}).hover(d).click(e)},b.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},b.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},b}(b.EventEmitter)}).call(this); \ No newline at end of file +(function(){var t,i,e,o,s=[].slice,n=function(t,i){return function(){return t.apply(i,arguments)}},r={}.hasOwnProperty,h=function(t,i){function e(){this.constructor=t}for(var o in i)r.call(i,o)&&(t[o]=i[o]);return e.prototype=i.prototype,t.prototype=new e,t.__super__=i.prototype,t},a=[].indexOf||function(t){for(var i=0,e=this.length;e>i;i++)if(i in this&&this[i]===t)return i;return-1};i=window.Morris={},t=jQuery,i.EventEmitter=function(){function t(){}return t.prototype.on=function(t,i){return null==this.handlers&&(this.handlers={}),null==this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(i),this},t.prototype.fire=function(){var t,i,e,o,n,r,h;if(e=arguments[0],t=2<=arguments.length?s.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[e]){for(r=this.handlers[e],h=[],o=0,n=r.length;n>o;o++)i=r[o],h.push(i.apply(null,t));return h}},t}(),i.commas=function(t){var i,e,o,s;return null!=t?(o=0>t?"-":"",i=Math.abs(t),e=Math.floor(i).toFixed(0),o+=e.replace(/(?=(?:\d{3})+$)(?!^)/g,","),s=i.toString(),s.length>e.length&&(o+=s.slice(e.length)),o):"-"},i.pad2=function(t){return(10>t?"0":"")+t},i.Grid=function(e){function o(i){this.resizeHandler=n(this.resizeHandler,this);var e=this;if(this.el=t("string"==typeof i.element?document.getElementById(i.element):i.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=t.extend({},this.gridDefaults,this.defaults||{},i),"string"==typeof this.options.units&&(this.options.postUnits=i.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(t){var i,o,s,n,r;return o=e.el.offset(),r=t.pageX-o.left,e.selectFrom?(i=e.data[e.hitTest(Math.min(r,e.selectFrom))]._x,s=e.data[e.hitTest(Math.max(r,e.selectFrom))]._x,n=s-i,e.selectionRect.attr({x:i,width:n})):e.fire("hovermove",r,t.pageY-o.top)}),this.el.bind("mouseleave",function(){return e.selectFrom&&(e.selectionRect.hide(),e.selectFrom=null),e.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(t){var i,o;return o=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],i=e.el.offset(),e.fire("hovermove",o.pageX-i.left,o.pageY-i.top)}),this.el.bind("click",function(t){var i;return i=e.el.offset(),e.fire("gridclick",t.pageX-i.left,t.pageY-i.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(t){var i;return i=e.el.offset(),e.startRange(t.pageX-i.left)}),this.el.bind("mouseup",function(t){var i;return i=e.el.offset(),e.endRange(t.pageX-i.left),e.fire("hovermove",t.pageX-i.left,t.pageY-i.top)})),this.options.resize&&t(window).bind("resize",function(){return null!=e.timeoutId&&window.clearTimeout(e.timeoutId),e.timeoutId=window.setTimeout(e.resizeHandler,100)}),this.el.css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),this.postInit&&this.postInit()}return h(o,e),o.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},o.prototype.setData=function(t,e){var o,s,n,r,h,a,l,p,u,c,d,f,g,m,y;return null==e&&(e=!0),this.options.data=t,null==t||0===t.length?(this.data=[],this.raphael.clear(),void(null!=this.hover&&this.hover.hide())):(f=this.cumulative?0:null,g=this.cumulative?0:null,this.options.goals.length>0&&(h=Math.min.apply(Math,this.options.goals),r=Math.max.apply(Math,this.options.goals),g=null!=g?Math.min(g,h):h,f=null!=f?Math.max(f,r):r),this.data=function(){var e,o,r;for(r=[],n=e=0,o=t.length;o>e;n=++e)l=t[n],a={src:l},a.label=l[this.options.xkey],this.options.parseTime?(a.x=i.parseDate(a.label),this.options.dateFormat?a.label=this.options.dateFormat(a.x):"number"==typeof a.label&&(a.label=new Date(a.label).toString())):(a.x=n,this.options.xLabelFormat&&(a.label=this.options.xLabelFormat(a))),u=0,a.y=function(){var t,i,e,o;for(e=this.options.ykeys,o=[],s=t=0,i=e.length;i>t;s=++t)d=e[s],m=l[d],"string"==typeof m&&(m=parseFloat(m)),null!=m&&"number"!=typeof m&&(m=null),null!=m&&(this.cumulative?u+=m:null!=f?(f=Math.max(m,f),g=Math.min(m,g)):f=g=m),this.cumulative&&null!=u&&(f=Math.max(u,f),g=Math.min(u,g)),o.push(m);return o}.call(this),r.push(a);return r}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(t,i){return(t.x>i.x)-(i.x>t.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var t,e,s,n;for(s=this.options.events,n=[],t=0,e=s.length;e>t;t++)o=s[t],n.push(i.parseDate(o));return n}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",g),this.ymax=this.yboundary("max",f),this.ymin===this.ymax&&(g&&(this.ymin-=1),this.ymax+=1),((y=this.options.axes)===!0||"both"===y||"y"===y||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(p=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var t,i,e,o;for(o=[],c=t=i=this.ymin,e=this.ymax;p>0?e>=t:t>=e;c=t+=p)o.push(c);return o}.call(this))),this.dirty=!0,e?this.redraw():void 0)},o.prototype.yboundary=function(t,i){var e,o;return e=this.options["y"+t],"string"==typeof e?"auto"===e.slice(0,4)?e.length>5?(o=parseInt(e.slice(5),10),null==i?o:Math[t](i,o)):null!=i?i:0:parseInt(e,10):e},o.prototype.autoGridLines=function(t,i,e){var o,s,n,r,h,a,l,p,u;return h=i-t,u=Math.floor(Math.log(h)/Math.log(10)),l=Math.pow(10,u),s=Math.floor(t/l)*l,o=Math.ceil(i/l)*l,a=(o-s)/(e-1),1===l&&a>1&&Math.ceil(a)!==a&&(a=Math.ceil(a),o=s+a*(e-1)),0>s&&o>0&&(s=Math.floor(t/a)*a,o=Math.ceil(i/a)*a),1>a?(r=Math.floor(Math.log(a)/Math.log(10)),n=function(){var t,i;for(i=[],p=t=s;a>0?o>=t:t>=o;p=t+=a)i.push(parseFloat(p.toFixed(1-r)));return i}()):n=function(){var t,i;for(i=[],p=t=s;a>0?o>=t:t>=o;p=t+=a)i.push(p);return i}(),n},o.prototype._calc=function(){var t,i,e,o,s,n,r,h;return s=this.el.width(),e=this.el.height(),(this.elementWidth!==s||this.elementHeight!==e||this.dirty)&&(this.elementWidth=s,this.elementHeight=e,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((r=this.options.axes)===!0||"both"===r||"y"===r)&&(n=function(){var t,e,o,s;for(o=this.grid,s=[],t=0,e=o.length;e>t;t++)i=o[t],s.push(this.measureText(this.yAxisFormat(i)).width);return s}.call(this),this.left+=Math.max.apply(Math,n)),((h=this.options.axes)===!0||"both"===h||"x"===h)&&(t=function(){var t,i,e;for(e=[],o=t=0,i=this.data.length;i>=0?i>t:t>i;o=i>=0?++t:--t)e.push(this.measureText(this.data[o].text,-this.options.xLabelAngle).height);return e}.call(this),this.bottom-=Math.max.apply(Math,t)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},o.prototype.transY=function(t){return this.bottom-(t-this.ymin)*this.dy},o.prototype.transX=function(t){return 1===this.data.length?(this.left+this.right)/2:this.left+(t-this.xmin)*this.dx},o.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},o.prototype.measureText=function(t,i){var e,o;return null==i&&(i=0),o=this.raphael.text(100,100,t).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(i),e=o.getBBox(),o.remove(),e},o.prototype.yAxisFormat=function(t){return this.yLabelFormat(t)},o.prototype.yLabelFormat=function(t){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(t):""+this.options.preUnits+i.commas(t)+this.options.postUnits},o.prototype.drawGrid=function(){var t,i,e,o,s,n,r,h;if(this.options.grid!==!1||(s=this.options.axes)===!0||"both"===s||"y"===s){for(n=this.grid,h=[],e=0,o=n.length;o>e;e++)t=n[e],i=this.transY(t),((r=this.options.axes)===!0||"both"===r||"y"===r)&&this.drawYAxisLabel(this.left-this.options.padding/2,i,this.yAxisFormat(t)),this.options.grid?h.push(this.drawGridLine("M"+this.left+","+i+"H"+(this.left+this.width))):h.push(void 0);return h}},o.prototype.drawGoals=function(){var t,i,e,o,s,n,r;for(n=this.options.goals,r=[],e=o=0,s=n.length;s>o;e=++o)i=n[e],t=this.options.goalLineColors[e%this.options.goalLineColors.length],r.push(this.drawGoal(i,t));return r},o.prototype.drawEvents=function(){var t,i,e,o,s,n,r;for(n=this.events,r=[],e=o=0,s=n.length;s>o;e=++o)i=n[e],t=this.options.eventLineColors[e%this.options.eventLineColors.length],r.push(this.drawEvent(i,t));return r},o.prototype.drawGoal=function(t,i){return this.raphael.path("M"+this.left+","+this.transY(t)+"H"+this.right).attr("stroke",i).attr("stroke-width",this.options.goalStrokeWidth)},o.prototype.drawEvent=function(t,i){return this.raphael.path("M"+this.transX(t)+","+this.bottom+"V"+this.top).attr("stroke",i).attr("stroke-width",this.options.eventStrokeWidth)},o.prototype.drawYAxisLabel=function(t,i,e){return this.raphael.text(t,i,e).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},o.prototype.drawGridLine=function(t){return this.raphael.path(t).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},o.prototype.startRange=function(t){return this.hover.hide(),this.selectFrom=t,this.selectionRect.attr({x:t,width:0}).show()},o.prototype.endRange=function(t){var i,e;return this.selectFrom?(e=Math.min(this.selectFrom,t),i=Math.max(this.selectFrom,t),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(e)].x,end:this.data[this.hitTest(i)].x}),this.selectFrom=null):void 0},o.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},o}(i.EventEmitter),i.parseDate=function(t){var i,e,o,s,n,r,h,a,l,p,u;return"number"==typeof t?t:(e=t.match(/^(\d+) Q(\d)$/),s=t.match(/^(\d+)-(\d+)$/),n=t.match(/^(\d+)-(\d+)-(\d+)$/),h=t.match(/^(\d+) W(\d+)$/),a=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),l=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),e?new Date(parseInt(e[1],10),3*parseInt(e[2],10)-1,1).getTime():s?new Date(parseInt(s[1],10),parseInt(s[2],10)-1,1).getTime():n?new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10)).getTime():h?(p=new Date(parseInt(h[1],10),0,1),4!==p.getDay()&&p.setMonth(0,1+(4-p.getDay()+7)%7),p.getTime()+6048e5*parseInt(h[2],10)):a?a[6]?(r=0,"Z"!==a[6]&&(r=60*parseInt(a[8],10)+parseInt(a[9],10),"+"===a[7]&&(r=0-r)),Date.UTC(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10)+r)):new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),parseInt(a[4],10),parseInt(a[5],10)).getTime():l?(u=parseFloat(l[6]),i=Math.floor(u),o=Math.round(1e3*(u-i)),l[8]?(r=0,"Z"!==l[8]&&(r=60*parseInt(l[10],10)+parseInt(l[11],10),"+"===l[9]&&(r=0-r)),Date.UTC(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)+r,i,o)):new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10),i,o).getTime()):new Date(parseInt(t,10),0,1).getTime())},i.Hover=function(){function e(e){null==e&&(e={}),this.options=t.extend({},i.Hover.defaults,e),this.el=t("
"),this.el.hide(),this.options.parent.append(this.el)}return e.defaults={"class":"morris-hover morris-default-style"},e.prototype.update=function(t,i,e){return t?(this.html(t),this.show(),this.moveTo(i,e)):this.hide()},e.prototype.html=function(t){return this.el.html(t)},e.prototype.moveTo=function(t,i){var e,o,s,n,r,h;return r=this.options.parent.innerWidth(),n=this.options.parent.innerHeight(),o=this.el.outerWidth(),e=this.el.outerHeight(),s=Math.min(Math.max(0,t-o/2),r-o),null!=i?(h=i-e-10,0>h&&(h=i+10,h+e>n&&(h=n/2-e/2))):h=n/2-e/2,this.el.css({left:s+"px",top:parseInt(h)+"px"})},e.prototype.show=function(){return this.el.show()},e.prototype.hide=function(){return this.el.hide()},e}(),i.Line=function(t){function e(t){return this.hilight=n(this.hilight,this),this.onHoverOut=n(this.onHoverOut,this),this.onHoverMove=n(this.onHoverMove,this),this.onGridClick=n(this.onGridClick,this),this instanceof i.Line?void e.__super__.constructor.call(this,t):new i.Line(t)}return h(e,t),e.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new i.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},e.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,hideHover:!1},e.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},e.prototype.calcPoints=function(){var t,i,e,o,s,n;for(s=this.data,n=[],e=0,o=s.length;o>e;e++)t=s[e],t._x=this.transX(t.x),t._y=function(){var e,o,s,n;for(s=t.y,n=[],e=0,o=s.length;o>e;e++)i=s[e],null!=i?n.push(this.transY(i)):n.push(i);return n}.call(this),n.push(t._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var e,o,s,n;for(s=t._y,n=[],e=0,o=s.length;o>e;e++)i=s[e],null!=i&&n.push(i);return n}())));return n},e.prototype.hitTest=function(t){var i,e,o,s,n;if(0===this.data.length)return null;for(n=this.data.slice(1),i=o=0,s=n.length;s>o&&(e=n[i],!(t<(e._x+this.data[i]._x)/2));i=++o);return i},e.prototype.onGridClick=function(t,i){var e;return e=this.hitTest(t),this.fire("click",e,this.data[e].src,t,i)},e.prototype.onHoverMove=function(t){var i;return i=this.hitTest(t),this.displayHoverForRow(i)},e.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},e.prototype.displayHoverForRow=function(t){var i;return null!=t?((i=this.hover).update.apply(i,this.hoverContentForRow(t)),this.hilight(t)):(this.hover.hide(),this.hilight())},e.prototype.hoverContentForRow=function(t){var i,e,o,s,n,r,h;for(o=this.data[t],i="
"+o.label+"
",h=o.y,e=n=0,r=h.length;r>n;e=++n)s=h[e],i+="
\n "+this.options.labels[e]+":\n "+this.yLabelFormat(s)+"\n
";return"function"==typeof this.options.hoverCallback&&(i=this.options.hoverCallback(t,this.options,i,o.src)),[i,o._x,o._ymax]},e.prototype.generatePaths=function(){var t,e,o,s;return this.paths=function(){var n,r,h,l;for(l=[],e=n=0,r=this.options.ykeys.length;r>=0?r>n:n>r;e=r>=0?++n:--n)s="boolean"==typeof this.options.smooth?this.options.smooth:(h=this.options.ykeys[e],a.call(this.options.smooth,h)>=0),t=function(){var t,i,s,n;for(s=this.data,n=[],t=0,i=s.length;i>t;t++)o=s[t],void 0!==o._y[e]&&n.push({x:o._x,y:o._y[e]});return n}.call(this),t.length>1?l.push(i.Line.createPath(t,s,this.bottom)):l.push(null);return l}.call(this)},e.prototype.draw=function(){var t;return((t=this.options.axes)===!0||"both"===t||"x"===t)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},e.prototype.drawXAxis=function(){var t,e,o,s,n,r,h,a,l,p,u=this;for(h=this.bottom+this.options.padding/2,n=null,s=null,t=function(t,i){var e,o,r,a,l;return e=u.drawXAxisLabel(u.transX(i),h,t),l=e.getBBox(),e.transform("r"+-u.options.xLabelAngle),o=e.getBBox(),e.transform("t0,"+o.height/2+"..."),0!==u.options.xLabelAngle&&(a=-.5*l.width*Math.cos(u.options.xLabelAngle*Math.PI/180),e.transform("t"+a+",0...")),o=e.getBBox(),(null==n||n>=o.x+o.width||null!=s&&s>=o.x)&&o.x>=0&&o.x+o.widtht;t++)r=e[t],o.push([r.label,r.x]);return o}.call(this),o.reverse(),p=[],a=0,l=o.length;l>a;a++)e=o[a],p.push(t(e[0],e[1]));return p},e.prototype.drawSeries=function(){var t,i,e,o,s,n;for(this.seriesPoints=[],t=i=o=this.options.ykeys.length-1;0>=o?0>=i:i>=0;t=0>=o?++i:--i)this._drawLineFor(t);for(n=[],t=e=s=this.options.ykeys.length-1;0>=s?0>=e:e>=0;t=0>=s?++e:--e)n.push(this._drawPointFor(t));return n},e.prototype._drawPointFor=function(t){var i,e,o,s,n,r;for(this.seriesPoints[t]=[],n=this.data,r=[],o=0,s=n.length;s>o;o++)e=n[o],i=null,null!=e._y[t]&&(i=this.drawLinePoint(e._x,e._y[t],this.colorFor(e,t,"point"),t)),r.push(this.seriesPoints[t].push(i));return r},e.prototype._drawLineFor=function(t){var i;return i=this.paths[t],null!==i?this.drawLinePath(i,this.colorFor(null,t,"line"),t):void 0},e.createPath=function(t,e,o){var s,n,r,h,a,l,p,u,c,d,f,g,m,y;for(p="",e&&(r=i.Line.gradients(t)),u={y:null},h=m=0,y=t.length;y>m;h=++m)s=t[h],null!=s.y&&(null!=u.y?e?(n=r[h],l=r[h-1],a=(s.x-u.x)/4,c=u.x+a,f=Math.min(o,u.y+a*l),d=s.x-a,g=Math.min(o,s.y-a*n),p+="C"+c+","+f+","+d+","+g+","+s.x+","+s.y):p+="L"+s.x+","+s.y:e&&null==r[h]||(p+="M"+s.x+","+s.y)),u=s;return p},e.gradients=function(t){var i,e,o,s,n,r,h,a;for(e=function(t,i){return(t.y-i.y)/(t.x-i.x)},a=[],o=r=0,h=t.length;h>r;o=++r)i=t[o],null!=i.y?(s=t[o+1]||{y:null},n=t[o-1]||{y:null},null!=n.y&&null!=s.y?a.push(e(n,s)):null!=n.y?a.push(e(n,i)):null!=s.y?a.push(e(i,s)):a.push(null)):a.push(null);return a},e.prototype.hilight=function(t){var i,e,o,s,n;if(null!==this.prevHilight&&this.prevHilight!==t)for(i=e=0,s=this.seriesPoints.length-1;s>=0?s>=e:e>=s;i=s>=0?++e:--e)this.seriesPoints[i][this.prevHilight]&&this.seriesPoints[i][this.prevHilight].animate(this.pointShrinkSeries(i));if(null!==t&&this.prevHilight!==t)for(i=o=0,n=this.seriesPoints.length-1;n>=0?n>=o:o>=n;i=n>=0?++o:--o)this.seriesPoints[i][t]&&this.seriesPoints[i][t].animate(this.pointGrowSeries(i));return this.prevHilight=t},e.prototype.colorFor=function(t,i,e){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,t,i,e):"point"===e?this.options.pointFillColors[i%this.options.pointFillColors.length]||this.options.lineColors[i%this.options.lineColors.length]:this.options.lineColors[i%this.options.lineColors.length]},e.prototype.drawXAxisLabel=function(t,i,e){return this.raphael.text(t,i,e).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},e.prototype.drawLinePath=function(t,i,e){return this.raphael.path(t).attr("stroke",i).attr("stroke-width",this.lineWidthForSeries(e))},e.prototype.drawLinePoint=function(t,i,e,o){return this.raphael.circle(t,i,this.pointSizeForSeries(o)).attr("fill",e).attr("stroke-width",this.pointStrokeWidthForSeries(o)).attr("stroke",this.pointStrokeColorForSeries(o))},e.prototype.pointStrokeWidthForSeries=function(t){return this.options.pointStrokeWidths[t%this.options.pointStrokeWidths.length]},e.prototype.pointStrokeColorForSeries=function(t){return this.options.pointStrokeColors[t%this.options.pointStrokeColors.length]},e.prototype.lineWidthForSeries=function(t){return this.options.lineWidth instanceof Array?this.options.lineWidth[t%this.options.lineWidth.length]:this.options.lineWidth},e.prototype.pointSizeForSeries=function(t){return this.options.pointSize instanceof Array?this.options.pointSize[t%this.options.pointSize.length]:this.options.pointSize},e.prototype.pointGrowSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)+3},25,"linear")},e.prototype.pointShrinkSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)},25,"linear")},e}(i.Grid),i.labelSeries=function(e,o,s,n,r){var h,a,l,p,u,c,d,f,g,m,y;if(l=200*(o-e)/s,a=new Date(e),d=i.LABEL_SPECS[n],void 0===d)for(y=i.AUTO_LABEL_ORDER,g=0,m=y.length;m>g;g++)if(p=y[g],c=i.LABEL_SPECS[p],l>=c.span){d=c;break}for(void 0===d&&(d=i.LABEL_SPECS.second),r&&(d=t.extend({},d,{fmt:r})),h=d.start(a),u=[];(f=h.getTime())<=o;)f>=e&&u.push([d.fmt(h),f]),d.incr(h);return u},e=function(t){return{span:60*t*1e3,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours())},fmt:function(t){return""+i.pad2(t.getHours())+":"+i.pad2(t.getMinutes())},incr:function(i){return i.setUTCMinutes(i.getUTCMinutes()+t)}}},o=function(t){return{span:1e3*t,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes())},fmt:function(t){return""+i.pad2(t.getHours())+":"+i.pad2(t.getMinutes())+":"+i.pad2(t.getSeconds())},incr:function(i){return i.setUTCSeconds(i.getUTCSeconds()+t)}}},i.LABEL_SPECS={decade:{span:1728e8,start:function(t){return new Date(t.getFullYear()-t.getFullYear()%10,0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+10)}},year:{span:1728e7,start:function(t){return new Date(t.getFullYear(),0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+1)}},month:{span:24192e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),1)},fmt:function(t){return""+t.getFullYear()+"-"+i.pad2(t.getMonth()+1)},incr:function(t){return t.setMonth(t.getMonth()+1)}},week:{span:6048e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return""+t.getFullYear()+"-"+i.pad2(t.getMonth()+1)+"-"+i.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+7)}},day:{span:864e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return""+t.getFullYear()+"-"+i.pad2(t.getMonth()+1)+"-"+i.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+1)}},hour:e(60),"30min":e(30),"15min":e(15),"10min":e(10),"5min":e(5),minute:e(1),"30sec":o(30),"15sec":o(15),"10sec":o(10),"5sec":o(5),second:o(1)},i.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],i.Area=function(e){function o(e){var n;return this instanceof i.Area?(n=t.extend({},s,e),this.cumulative=!n.behaveLikeLine,"auto"===n.fillOpacity&&(n.fillOpacity=n.behaveLikeLine?.8:1),void o.__super__.constructor.call(this,n)):new i.Area(e)}var s;return h(o,e),s={fillOpacity:"auto",behaveLikeLine:!1},o.prototype.calcPoints=function(){var t,i,e,o,s,n,r;for(n=this.data,r=[],o=0,s=n.length;s>o;o++)t=n[o],t._x=this.transX(t.x),i=0,t._y=function(){var o,s,n,r;for(n=t.y,r=[],o=0,s=n.length;s>o;o++)e=n[o],this.options.behaveLikeLine?r.push(this.transY(e)):(i+=e||0,r.push(this.transY(i)));return r}.call(this),r.push(t._ymax=Math.max.apply(Math,t._y));return r},o.prototype.drawSeries=function(){var t,i,e,o,s,n,r,h;for(this.seriesPoints=[],i=this.options.behaveLikeLine?function(){n=[];for(var t=0,i=this.options.ykeys.length-1;i>=0?i>=t:t>=i;i>=0?t++:t--)n.push(t);return n}.apply(this):function(){r=[];for(var t=s=this.options.ykeys.length-1;0>=s?0>=t:t>=0;0>=s?t++:t--)r.push(t);return r}.apply(this),h=[],e=0,o=i.length;o>e;e++)t=i[e],this._drawFillFor(t),this._drawLineFor(t),h.push(this._drawPointFor(t));return h},o.prototype._drawFillFor=function(t){var i;return i=this.paths[t],null!==i?(i+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(i,this.fillForSeries(t))):void 0},o.prototype.fillForSeries=function(t){var i;return i=Raphael.rgb2hsl(this.colorFor(this.data[t],t,"line")),Raphael.hsl(i.h,this.options.behaveLikeLine?.9*i.s:.75*i.s,Math.min(.98,this.options.behaveLikeLine?1.2*i.l:1.25*i.l))},o.prototype.drawFilledPath=function(t,i){return this.raphael.path(t).attr("fill",i).attr("fill-opacity",.4).attr("stroke","none")},o}(i.Line),i.Bar=function(e){function o(e){return this.onHoverOut=n(this.onHoverOut,this),this.onHoverMove=n(this.onHoverMove,this),this.onGridClick=n(this.onGridClick,this),this instanceof i.Bar?void o.__super__.constructor.call(this,t.extend({},e,{parseTime:!1})):new i.Bar(e)}return h(o,e),o.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new i.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},o.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},o.prototype.calc=function(){var t;return this.calcBars(),this.options.hideHover===!1?(t=this.hover).update.apply(t,this.hoverContentForRow(this.data.length-1)):void 0},o.prototype.calcBars=function(){var t,i,e,o,s,n,r;for(n=this.data,r=[],t=o=0,s=n.length;s>o;t=++o)i=n[t],i._x=this.left+this.width*(t+.5)/this.data.length,r.push(i._y=function(){var t,o,s,n;for(s=i.y,n=[],t=0,o=s.length;o>t;t++)e=s[t],null!=e?n.push(this.transY(e)):n.push(null);return n}.call(this));return r},o.prototype.draw=function(){var t;return((t=this.options.axes)===!0||"both"===t||"x"===t)&&this.drawXAxis(),this.drawSeries()},o.prototype.drawXAxis=function(){var t,i,e,o,s,n,r,h,a,l,p,u,c;for(l=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),r=null,n=null,c=[],t=p=0,u=this.data.length;u>=0?u>p:p>u;t=u>=0?++p:--p)h=this.data[this.data.length-1-t],i=this.drawXAxisLabel(h._x,l,h.label),a=i.getBBox(),i.transform("r"+-this.options.xLabelAngle),e=i.getBBox(),i.transform("t0,"+e.height/2+"..."),0!==this.options.xLabelAngle&&(s=-.5*a.width*Math.cos(this.options.xLabelAngle*Math.PI/180),i.transform("t"+s+",0...")),(null==r||r>=e.x+e.width||null!=n&&n>=e.x)&&e.x>=0&&e.x+e.width=0?this.transY(0):null,this.bars=function(){var h,u,g,m;for(g=this.data,m=[],o=h=0,u=g.length;u>h;o=++h)a=g[o],s=0,m.push(function(){var h,u,g,m;for(g=a._y,m=[],l=h=0,u=g.length;u>h;l=++h)d=g[l],null!==d?(f?(c=Math.min(d,f),i=Math.max(d,f)):(c=d,i=this.bottom),n=this.left+o*e+r,this.options.stacked||(n+=l*(t+this.options.barGap)),p=i-c,this.options.verticalGridCondition&&this.options.verticalGridCondition(a.x)&&this.drawBar(this.left+o*e,this.top,e,Math.abs(this.top-this.bottom),this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius),this.options.stacked&&(c-=s),this.drawBar(n,c,t,p,this.colorFor(a,l,"bar"),this.options.barOpacity,this.options.barRadius),m.push(s+=p)):m.push(null);return m}.call(this));return m}.call(this)},o.prototype.colorFor=function(t,i,e){var o,s;return"function"==typeof this.options.barColors?(o={x:t.x,y:t.y[i],label:t.label},s={index:i,key:this.options.ykeys[i],label:this.options.labels[i]},this.options.barColors.call(this,o,s,e)):this.options.barColors[i%this.options.barColors.length]},o.prototype.hitTest=function(t){return 0===this.data.length?null:(t=Math.max(Math.min(t,this.right),this.left),Math.min(this.data.length-1,Math.floor((t-this.left)/(this.width/this.data.length))))},o.prototype.onGridClick=function(t,i){var e;return e=this.hitTest(t),this.fire("click",e,this.data[e].src,t,i)},o.prototype.onHoverMove=function(t){var i,e;return i=this.hitTest(t),(e=this.hover).update.apply(e,this.hoverContentForRow(i))},o.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},o.prototype.hoverContentForRow=function(t){var i,e,o,s,n,r,h,a;for(o=this.data[t],i="
"+o.label+"
",a=o.y,e=r=0,h=a.length;h>r;e=++r)n=a[e],i+="
\n "+this.options.labels[e]+":\n "+this.yLabelFormat(n)+"\n
";return"function"==typeof this.options.hoverCallback&&(i=this.options.hoverCallback(t,this.options,i,o.src)),s=this.left+(t+.5)*this.width/this.data.length,[i,s]},o.prototype.drawXAxisLabel=function(t,i,e){var o;return o=this.raphael.text(t,i,e).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},o.prototype.drawBar=function(t,i,e,o,s,n,r){var h,a;return h=Math.max.apply(Math,r),a=0===h||h>o?this.raphael.rect(t,i,e,o):this.raphael.path(this.roundedRect(t,i,e,o,r)),a.attr("fill",s).attr("fill-opacity",n).attr("stroke","none")},o.prototype.roundedRect=function(t,i,e,o,s){return null==s&&(s=[0,0,0,0]),["M",t,s[0]+i,"Q",t,i,t+s[0],i,"L",t+e-s[1],i,"Q",t+e,i,t+e,i+s[1],"L",t+e,i+o-s[2],"Q",t+e,i+o,t+e-s[2],i+o,"L",t+s[3],i+o,"Q",t,i+o,t,i+o-s[3],"Z"]},o}(i.Grid),i.Donut=function(e){function o(e){this.resizeHandler=n(this.resizeHandler,this),this.select=n(this.select,this),this.click=n(this.click,this);var o=this;if(!(this instanceof i.Donut))return new i.Donut(e);if(this.options=t.extend({},this.defaults,e),this.el=t("string"==typeof e.element?document.getElementById(e.element):e.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==e.data&&0!==e.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&t(window).bind("resize",function(){return null!=o.timeoutId&&window.clearTimeout(o.timeoutId),o.timeoutId=window.setTimeout(o.resizeHandler,100)}),this.setData(e.data))}return h(o,e),o.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:i.commas,resize:!1},o.prototype.redraw=function(){var t,e,o,s,n,r,h,a,l,p,u,c,d,f,g,m,y,v,x,w,b,M,F;for(this.raphael.clear(),e=this.el.width()/2,o=this.el.height()/2,d=(Math.min(e,o)-10)/3,u=0,w=this.values,f=0,y=w.length;y>f;f++)c=w[f],u+=c;for(a=5/(2*d),t=1.9999*Math.PI-a*this.data.length,r=0,n=0,this.segments=[],b=this.values,s=g=0,v=b.length;v>g;s=++g)c=b[s],l=r+a+t*(c/u),p=new i.DonutSegment(e,o,2*d,d,r,l,this.data[s].color||this.options.colors[n%this.options.colors.length],this.options.backgroundColor,n,this.raphael),p.render(),this.segments.push(p),p.on("hover",this.select),p.on("click",this.click),r=l,n+=1;for(this.text1=this.drawEmptyDonutLabel(e,o-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(e,o+10,this.options.labelColor,14), +h=Math.max.apply(Math,this.values),n=0,M=this.values,F=[],m=0,x=M.length;x>m;m++){if(c=M[m],c===h){this.select(n);break}F.push(n+=1)}return F},o.prototype.setData=function(t){var i;return this.data=t,this.values=function(){var t,e,o,s;for(o=this.data,s=[],t=0,e=o.length;e>t;t++)i=o[t],s.push(parseFloat(i.value));return s}.call(this),this.redraw()},o.prototype.click=function(t){return this.fire("click",t,this.data[t])},o.prototype.select=function(t){var i,e,o,s,n,r;for(r=this.segments,s=0,n=r.length;n>s;s++)e=r[s],e.deselect();return o=this.segments[t],o.select(),i=this.data[t],this.setLabels(i.label,this.options.formatter(i.value,i))},o.prototype.setLabels=function(t,i){var e,o,s,n,r,h,a,l;return e=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,n=1.8*e,s=e/2,o=e/3,this.text1.attr({text:t,transform:""}),r=this.text1.getBBox(),h=Math.min(n/r.width,s/r.height),this.text1.attr({transform:"S"+h+","+h+","+(r.x+r.width/2)+","+(r.y+r.height)}),this.text2.attr({text:i,transform:""}),a=this.text2.getBBox(),l=Math.min(n/a.width,o/a.height),this.text2.attr({transform:"S"+l+","+l+","+(a.x+a.width/2)+","+a.y})},o.prototype.drawEmptyDonutLabel=function(t,i,e,o,s){var n;return n=this.raphael.text(t,i,"").attr("font-size",o).attr("fill",e),null!=s&&n.attr("font-weight",s),n},o.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},o}(i.EventEmitter),i.DonutSegment=function(t){function i(t,i,e,o,s,r,h,a,l,p){this.cx=t,this.cy=i,this.inner=e,this.outer=o,this.color=h,this.backgroundColor=a,this.index=l,this.raphael=p,this.deselect=n(this.deselect,this),this.select=n(this.select,this),this.sin_p0=Math.sin(s),this.cos_p0=Math.cos(s),this.sin_p1=Math.sin(r),this.cos_p1=Math.cos(r),this.is_long=r-s>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return h(i,t),i.prototype.calcArcPoints=function(t){return[this.cx+t*this.sin_p0,this.cy+t*this.cos_p0,this.cx+t*this.sin_p1,this.cy+t*this.cos_p1]},i.prototype.calcSegment=function(t,i){var e,o,s,n,r,h,a,l,p,u;return p=this.calcArcPoints(t),e=p[0],s=p[1],o=p[2],n=p[3],u=this.calcArcPoints(i),r=u[0],a=u[1],h=u[2],l=u[3],"M"+e+","+s+("A"+t+","+t+",0,"+this.is_long+",0,"+o+","+n)+("L"+h+","+l)+("A"+i+","+i+",0,"+this.is_long+",1,"+r+","+a)+"Z"},i.prototype.calcArc=function(t){var i,e,o,s,n;return n=this.calcArcPoints(t),i=n[0],o=n[1],e=n[2],s=n[3],"M"+i+","+o+("A"+t+","+t+",0,"+this.is_long+",0,"+e+","+s)},i.prototype.render=function(){var t=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return t.fire("hover",t.index)},function(){return t.fire("click",t.index)})},i.prototype.drawDonutArc=function(t,i){return this.raphael.path(t).attr({stroke:i,"stroke-width":2,opacity:0})},i.prototype.drawDonutSegment=function(t,i,e,o,s){return this.raphael.path(t).attr({fill:i,stroke:e,"stroke-width":3}).hover(o).click(s)},i.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},i.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},i}(i.EventEmitter)}).call(this); \ No newline at end of file diff --git a/bootstrap/addons/sb-admin.css b/bootstrap/addons/sb-admin.css index b9f904e..effc7a9 100644 --- a/bootstrap/addons/sb-admin.css +++ b/bootstrap/addons/sb-admin.css @@ -2,4 +2,4 @@ * Start Bootstrap - SB Admin Bootstrap Admin Template (http://startbootstrap.com) * Code licensed under the Apache License v2.0. * For details, see http://www.apache.org/licenses/LICENSE-2.0. - */body{margin-top:100px;background-color:#222}#wrapper{padding-left:0}#page-wrapper{width:100%;padding:0;background-color:#fff}.huge{line-height:normal;font-size:40px}@media(min-width:768px){body{margin-top:50px}#wrapper{padding-left:225px}#page-wrapper{padding:10px}}.top-nav{padding:0 15px}.top-nav>li{display:inline-block;float:left}.top-nav>li>a{padding-top:15px;padding-bottom:15px;line-height:20px;color:#999}.top-nav>.open>a,.top-nav>.open>a:focus,.top-nav>.open>a:hover,.top-nav>li>a:focus,.top-nav>li>a:hover{color:#fff;background-color:#000}.top-nav>.open>.dropdown-menu{float:left;position:absolute;margin-top:0;border:1px solid rgba(0,0,0,.15);border-top-left-radius:0;border-top-right-radius:0;background-color:#fff;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.top-nav>.open>.dropdown-menu>li>a{white-space:normal}ul.message-dropdown{padding:0;max-height:250px;overflow-x:hidden;overflow-y:auto}li.message-preview{width:275px;border-bottom:1px solid rgba(0,0,0,.15)}li.message-preview>a{padding-top:15px;padding-bottom:15px}li.message-footer{margin:5px 0}ul.alert-dropdown{width:200px}@media(min-width:768px){.side-nav,.side-nav>li>a{width:225px}.side-nav{position:fixed;top:51px;left:225px;margin-left:-225px;border:none;border-radius:0;overflow-y:auto;background-color:#222;bottom:0;overflow-x:hidden;padding-bottom:40px}.side-nav li a:focus,.side-nav li a:hover{outline:0;background-color:#000!important}}.side-nav>li>ul{padding:0}.side-nav>li>ul>li>a{display:block;padding:10px 15px 10px 38px;text-decoration:none;color:#999}.side-nav>li>ul>li>a:hover{color:#fff}.flot-chart{display:block;height:400px}.flot-chart-content{width:100%;height:100%}.panel-green{border-color:#5cb85c}.panel-green>.panel-heading{border-color:#5cb85c;color:#fff;background-color:#5cb85c}.panel-green>a{color:#5cb85c}.panel-green>a:hover{color:#3d8b3d}.panel-red{border-color:#d9534f}.panel-red>.panel-heading{border-color:#d9534f;color:#fff;background-color:#d9534f}.panel-red>a{color:#d9534f}.panel-red>a:hover{color:#b52b27}.panel-yellow{border-color:#f0ad4e}.panel-yellow>.panel-heading{border-color:#f0ad4e;color:#fff;background-color:#f0ad4e}.panel-yellow>a{color:#f0ad4e}.panel-yellow>a:hover{color:#df8a13}.pull-bottom{display:inline-block;vertical-align:bottom;float:none}.fixed {top:50px;position:fixed;display:none;color:#000;background-color:#fff!important;} \ No newline at end of file + */body{margin-top:100px;background-color:#222}#wrapper{padding-left:0}#page-wrapper{width:100%;padding:0;background-color:#fff}.huge{line-height:normal;font-size:40px}@media(min-width:768px){body{margin-top:50px}#wrapper{padding-left:225px}#page-wrapper{padding:10px}}.top-nav{padding:0 15px}.top-nav>li{display:inline-block;float:left}.top-nav>li>a{padding-top:15px;padding-bottom:15px;line-height:20px;color:#999}.top-nav>.open>a,.top-nav>.open>a:focus,.top-nav>.open>a:hover,.top-nav>li>a:focus,.top-nav>li>a:hover{color:#fff;background-color:#000}.top-nav>.open>.dropdown-menu{float:left;position:absolute;margin-top:0;border:1px solid rgba(0,0,0,.15);border-top-left-radius:0;border-top-right-radius:0;background-color:#fff;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.top-nav>.open>.dropdown-menu>li>a{white-space:normal}ul.message-dropdown{padding:0;max-height:250px;overflow-x:hidden;overflow-y:auto}li.message-preview{width:275px;border-bottom:1px solid rgba(0,0,0,.15)}li.message-preview>a{padding-top:15px;padding-bottom:15px}li.message-footer{margin:5px 0}ul.alert-dropdown{width:200px}@media(min-width:768px){.side-nav,.side-nav>li>a{width:225px}.side-nav{position:fixed;top:51px;left:225px;margin-left:-225px;border:none;border-radius:0;overflow-y:auto;background-color:#222;bottom:0;overflow-x:hidden;padding-bottom:40px}.side-nav li a:focus,.side-nav li a:hover{outline:0;background-color:#000!important}}.side-nav>li>ul{padding:0}.side-nav>li>ul>li>a{display:block;padding:10px 15px 10px 38px;text-decoration:none;color:#999}.side-nav>li>ul>li>a:hover{color:#fff}.flot-chart{display:block;height:400px}.flot-chart-content{width:100%;height:100%}.panel-green{border-color:#5cb85c}.panel-green>.panel-heading{border-color:#5cb85c;color:#fff;background-color:#5cb85c}.panel-green>a{color:#5cb85c}.panel-green>a:hover{color:#3d8b3d}.panel-red{border-color:#d9534f}.panel-red>.panel-heading{border-color:#d9534f;color:#fff;background-color:#d9534f}.panel-red>a{color:#d9534f}.panel-red>a:hover{color:#b52b27}.panel-yellow{border-color:#f0ad4e}.panel-yellow>.panel-heading{border-color:#f0ad4e;color:#fff;background-color:#f0ad4e}.panel-yellow>a{color:#f0ad4e}.panel-yellow>a:hover{color:#df8a13}.pull-bottom{display:inline-block;vertical-align:bottom;float:none}.fixed {top:50px;width:calc(100% - 275px);position:fixed;display:none;color:#000;background-color:#fff!important;} \ No newline at end of file diff --git a/install.php b/install.php index 723bcd4..ab895bd 100644 --- a/install.php +++ b/install.php @@ -46,7 +46,7 @@ if(isset($_POST['confweb'])) { $sqlconerr = 'SQL Connection failed: '.$e->getMessage(); exit; } - if($mysqlcon->exec("INSERT INTO config (webuser,webpass,tshost,tsquery,tsvoice,tsuser,language,queryname,queryname2,grouptime,resetbydbchange,msgtouser,upcheck,uniqueid,updateinfotime,currvers,exceptuuid,exceptgroup,dateformat,showexgrp,showexcld,showcolcld,showcoluuid,showcoldbid,showcolot,showcolit,showcolat,showcolnx,showcolsg,bgcolor,hdcolor,txcolor,hvcolor,ifcolor,wncolor,sccolor,showgen,showcolrg,showcolls,slowmode,cleanclients,cleanperiod,showhighest,boost,showcolas,defchid,timezone,logpath) VALUES ('$user','$pass','localhost','10011','9987','serveradmin','en','http://ts-n.net/ranksystem.php','www.ts-n.net/ranksystem.php','31536000=>47,31536060=>50','1','1','1','xrTKhT/HDl4ea0WoFDQH2zOpmKg=,9odBYAU7z2E2feUz965sL0/MyBom=','7200','1.0.1','xrTKhT/HDl4ea0WoFDQH2zOpmKg=','2,6','%a days, %h hours, %i mins, %s secs','1','1','1','1','1','1','1','1','1','1','#101010','#909090','#707070','#FFFFFF','#3366CC','#CC0000','#008000','1','1','1','0','1','86400','1','','1','','Europe/Berlin','$logpath')") === false) { + if($mysqlcon->exec("INSERT INTO config (webuser,webpass,tshost,tsquery,tsvoice,tsuser,language,queryname,queryname2,grouptime,resetbydbchange,msgtouser,upcheck,uniqueid,updateinfotime,currvers,exceptuuid,exceptgroup,dateformat,showexgrp,showexcld,showcolcld,showcoluuid,showcoldbid,showcolot,showcolit,showcolat,showcolnx,showcolsg,bgcolor,hdcolor,txcolor,hvcolor,ifcolor,wncolor,sccolor,showgen,showcolrg,showcolls,slowmode,cleanclients,cleanperiod,showhighest,boost,showcolas,defchid,timezone,logpath) VALUES ('$user','$pass','localhost','10011','9987','serveradmin','en','http://ts-n.net/ranksystem.php','www.ts-n.net/ranksystem.php','31536000=>47,31536060=>50','1','1','1','xrTKhT/HDl4ea0WoFDQH2zOpmKg=,9odBYAU7z2E2feUz965sL0/MyBom=','7200','1.0.2','xrTKhT/HDl4ea0WoFDQH2zOpmKg=','2,6','%a days, %h hours, %i mins, %s secs','1','1','1','1','1','1','1','1','1','1','#101010','#909090','#707070','#FFFFFF','#3366CC','#CC0000','#008000','1','1','1','0','1','86400','1','','1','','Europe/Berlin','$logpath')") === false) { echo '',$mysqlcon->errorCode(),'
'; } else { echo''.$lang['isntwiusr'].'

'; diff --git a/jobs/bot.php b/jobs/bot.php index 1c83250..9396ac0 100644 --- a/jobs/bot.php +++ b/jobs/bot.php @@ -1,2 +1,165 @@ #!/usr/bin/php -exec("INSERT INTO $dbname.job_log (timestamp,job_name,status) VALUES ('$timestamp','$jobname','9')")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),print_r($mysqlcon->errorInfo()),"\n";}else{return $jobid=$mysqlcon->lastInsertId();}}function check_shutdown($timezone){if(!is_file(substr(__DIR__,0,-4).'logs/pid')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Received signal to stop. Shutting down...\n";exit;}}check_db($mysqlcon,$lang,$dbname,$timezone,$currvers);echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Connect to TS3 Server (Address: \"",$ts['host'],"\" Voice-Port: \"",$ts['voice'],"\" Query-Port: \"",$ts['query'],"\")...";try{$ts3=TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']."&blocking=0");echo " [done]\n";try{usleep($slowmode);$ts3->selfUpdate(array('client_nickname'=>$queryname));}catch(Exception $e){try{usleep($slowmode);$ts3->selfUpdate(array('client_nickname'=>$queryname2));}catch(Exception $e){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['error'],$e->getCode(),': ',$e->getMessage(),"\n";}}echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Join to specified Channel...";usleep($slowmode);$whoami=$ts3->whoami();if($defchid!=0){try{usleep($slowmode);$ts3->clientMove($whoami['client_id'],$defchid);echo " [done]\n";}catch(Exception $e){if($e->getCode()!=770){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['error'],$e->getCode(),': ',$e->getMessage(),"\n";}else{echo " [done]\n";}}}else{echo " no Channel defined\n";}echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Bot starts now his work!\n";$looptime=1;while(1){if($looptime<1){$loopsleep=1 - $looptime;check_shutdown($timezone);usleep($loopsleep);}$starttime=microtime(true);check_shutdown($timezone);usleep($slowmode);$ts3->clientListReset();$allclients=$ts3->clientList();check_shutdown($timezone);usleep($slowmode);$ts3->serverInfoReset();$serverinfo=$ts3->serverInfo();if($defchid!=0){try{usleep($slowmode);$ts3->clientMove($whoami['client_id'],$defchid);}catch(Exception $e){}}$jobid=log_mysql('calc_user',$mysqlcon,$timezone);calc_user($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$showgen,$update,$grouptime,$boostarr,$resetbydbchange,$msgtouser,$uniqueid,$updateinfotime,$currvers,$substridle,$exceptuuid,$exceptgroup,$allclients);check_shutdown($timezone);usleep($slowmode);$jobid=log_mysql('get_avatars',$mysqlcon,$timezone);get_avatars($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone);check_shutdown($timezone);usleep($slowmode);$jobid=log_mysql('update_groups',$mysqlcon,$timezone);update_groups($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$serverinfo);check_shutdown($timezone);usleep($slowmode);$jobid=log_mysql('calc_serverstats',$mysqlcon,$timezone);calc_serverstats($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$serverinfo,$substridle,$grouptime);check_shutdown($timezone);usleep($slowmode);$jobid=log_mysql('calc_userstats',$mysqlcon,$timezone);calc_userstats($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone);check_shutdown($timezone);usleep($slowmode);$jobid=log_mysql('clean',$mysqlcon,$timezone);clean($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$cleanclients,$cleanperiod);$looptime=microtime(true)- $starttime;}}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['error'].$e->getCode().': '.$e->getMessage(),"\n";$offline_status=array(110,257,258,1024,1026,1031,1032,1033,1034,1280,1793);if(in_array($e->getCode(),$offline_status)){if($mysqlcon->exec("UPDATE $dbname.stats_server SET server_status='0'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['error'],print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}?> \ No newline at end of file +setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ").$loglevel.$logtext."\n"; + $loghandle = fopen($file, 'a'); + fwrite($loghandle, $input); + if (filesize($file) > 5242880) { + fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Logfile filesie of 5 MiB reached.. Rotate logfile.\n"); + fwrite($loghandle, DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u ")." NOTICE Restart Bot to continue with new log file...\n"); + fclose($loghandle); + $file2 = "$file.old"; + if (file_exists($file2)) unlink($file2); + rename($file, $file2); + if (substr(php_uname(), 0, 7) == "Windows") { + exec("del /F ".substr(__DIR__,0,-4).'logs/pid'); + $WshShell = new COM("WScript.Shell"); + $oExec = $WshShell->Run("cmd /C php ".substr(__DIR__,0,-4)."worker.php start", 0, false); + exit; + } else { + exec("rm -f ".substr(__DIR__,0,-4).'logs/pid'); + exec("php ".substr(__DIR__,0,-4)."worker.php start"); + exit; + } + } +} + +require_once(substr(__DIR__,0,-4).'other/config.php'); + +enter_logfile($logpath,$timezone,5,"Initialize Bot..."); +require_once(substr(__DIR__,0,-4).'ts3_lib/TeamSpeak3.php'); +require_once(substr(__DIR__,0,-4).'jobs/calc_user.php'); +require_once(substr(__DIR__,0,-4).'jobs/get_avatars.php'); +require_once(substr(__DIR__,0,-4).'jobs/update_groups.php'); +require_once(substr(__DIR__,0,-4).'jobs/calc_serverstats.php'); +require_once(substr(__DIR__,0,-4).'jobs/calc_userstats.php'); +require_once(substr(__DIR__,0,-4).'jobs/clean.php'); +require_once(substr(__DIR__,0,-4).'jobs/check_db.php'); + +function log_mysql($jobname,$mysqlcon,$timezone) { + $timestamp = time(); + if($mysqlcon->exec("INSERT INTO $dbname.job_log (timestamp,job_name,status) VALUES ('$timestamp','$jobname','9')") === false) { + enter_logfile($logpath,$timezone,2,print_r($mysqlcon->errorInfo())); + } else { + return $jobid = $mysqlcon->lastInsertId(); + } +} + +function check_shutdown($timezone,$logpath) { + if(!is_file(substr(__DIR__,0,-4).'logs/pid')) { + enter_logfile($logpath,$timezone,5,"Received signal to stop. Shutting down!\n\n"); + exit; + } +} + +$currvers = check_db($mysqlcon,$lang,$dbname,$timezone,$currvers,$logpath); +enter_logfile($logpath,$timezone,5," Ranksystem Version: ".$currvers); + +enter_logfile($logpath,$timezone,5,"Connect to TS3 Server (Address: \"".$ts['host']."\" Voice-Port: \"".$ts['voice']."\" Query-Port: \"".$ts['query']."\")."); +try { + $ts3 = TeamSpeak3::factory("serverquery://" . $ts['user'] . ":" . $ts['pass'] . "@" . $ts['host'] . ":" . $ts['query'] . "/?server_port=" . $ts['voice'] . "&blocking=0"); + enter_logfile($logpath,$timezone,5," Conenction to TS3 Server established."); + + try { + usleep($slowmode); + $ts3->selfUpdate(array('client_nickname' => $queryname)); + } + catch (Exception $e) { + try { + usleep($slowmode); + $ts3->selfUpdate(array('client_nickname' => $queryname2)); + } + catch (Exception $e) { + enter_logfile($logpath,$timezone,2,$lang['error'].$e->getCode().': '.$e->getMessage()); + } + } + + usleep($slowmode); + $whoami = $ts3->whoami(); + if($defchid != 0) { + try { + usleep($slowmode); + $ts3->clientMove($whoami['client_id'],$defchid); + enter_logfile($logpath,$timezone,5," Joined to specified Channel."); + } catch (Exception $e) { + if($e->getCode() != 770) { + echo "\n",DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['error'], $e->getCode(), ': ', $e->getMessage(),"\n"; + } else { + enter_logfile($logpath,$timezone,5," Joined to specified channel."); + } + } + } else { + enter_logfile($logpath,$timezone,4," No channel defined where the Ranksystem should be entered."); + } + + enter_logfile($logpath,$timezone,5,"Bot starts now his work!"); + $looptime = 1; + while(1) { + if($looptime<1) { + $loopsleep = 1 - $looptime; + check_shutdown($timezone,$logpath); usleep($loopsleep); + } + $starttime = microtime(true); + check_shutdown($timezone,$logpath); usleep($slowmode); + $ts3->clientListReset(); + $allclients = $ts3->clientList(); + check_shutdown($timezone,$logpath); usleep($slowmode); + $ts3->serverInfoReset(); + $serverinfo = $ts3->serverInfo(); + if($defchid != 0) { + try { usleep($slowmode); $ts3->clientMove($whoami['client_id'],$defchid); } catch (Exception $e) {} + } + $jobid = log_mysql('calc_user',$mysqlcon,$timezone); + calc_user($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$showgen,$update,$grouptime,$boostarr,$resetbydbchange,$msgtouser,$uniqueid,$updateinfotime,$currvers,$substridle,$exceptuuid,$exceptgroup,$allclients,$logpath); + check_shutdown($timezone,$logpath); usleep($slowmode); + $jobid = log_mysql('get_avatars',$mysqlcon,$timezone); + get_avatars($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$logpath); + check_shutdown($timezone,$logpath); usleep($slowmode); + $jobid = log_mysql('update_groups',$mysqlcon,$timezone); + update_groups($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$serverinfo,$logpath); + check_shutdown($timezone,$logpath); usleep($slowmode); + $jobid = log_mysql('calc_serverstats',$mysqlcon,$timezone); + calc_serverstats($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$serverinfo,$substridle,$grouptime,$logpath); + check_shutdown($timezone,$logpath); usleep($slowmode); + $jobid = log_mysql('calc_userstats',$mysqlcon,$timezone); + calc_userstats($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$logpath); + check_shutdown($timezone,$logpath); usleep($slowmode); + $jobid = log_mysql('clean',$mysqlcon,$timezone); + clean($ts3,$mysqlcon,$lang,$dbname,$slowmode,$jobid,$timezone,$cleanclients,$cleanperiod,$logpath); + //check auf fehler in job_log + $looptime = microtime(true) - $starttime; + //echo DateTime::createFromFormat('U.u', number_format(microtime(true), 6, '.', ''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Loop: ",$looptime,"\n"; + } +} +catch (Exception $e) { + enter_logfile($logpath,$timezone,2,$lang['error'].$e->getCode().': '.$e->getMessage()); + $offline_status = array(110,257,258,1024,1026,1031,1032,1033,1034,1280,1793); + if(in_array($e->getCode(), $offline_status)) { + if($mysqlcon->exec("UPDATE $dbname.stats_server SET server_status='0'") === false) { + enter_logfile($logpath,$timezone,2,$lang['error'].print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; +} +?> \ No newline at end of file diff --git a/jobs/calc_serverstats.php b/jobs/calc_serverstats.php index b201726..53cec9f 100644 --- a/jobs/calc_serverstats.php +++ b/jobs/calc_serverstats.php @@ -1 +1,326 @@ -query("SELECT uuid,count,idle,platform,nation FROM $dbname.user"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 1:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$uuids=$uuids->fetchAll();foreach($uuids as $uuid){$sqlhis[$uuid['uuid']]=array("uuid"=>$uuid['uuid'],"count"=>$uuid['count'],"idle"=>$uuid['idle']);if($uuid['nation']!=NULL)$country_string.=$uuid['nation'].' ';if($uuid['platform']!=NULL){$uuid_platform=str_replace(' ','',$uuid['platform']);$platform_string.=$uuid_platform.' ';}$total_online_time=$total_online_time + $uuid['count'];$total_active_time=$total_active_time + $uuid['count'] - $uuid['idle'];$total_inactive_time=$total_inactive_time + $uuid['idle'];}if(($max_entry_usersnap=$mysqlcon->query("SELECT MAX(DISTINCT(timestamp)) AS timestamp FROM $dbname.user_snapshot"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 2:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$max_entry_usersnap=$max_entry_usersnap->fetch(PDO::FETCH_ASSOC);$diff_max_usersnap=$nowtime - $max_entry_usersnap['timestamp'];if($diff_max_usersnap>21600){if(isset($sqlhis)){$allinsertsnap='';foreach($sqlhis as $insertsnap){$allinsertsnap=$allinsertsnap."('$nowtime','".$insertsnap['uuid']."', '".$insertsnap['count']."', '".$insertsnap['idle']."'),";}$allinsertsnap=substr($allinsertsnap,0,-1);if($allinsertsnap!=''){if($mysqlcon->exec("INSERT INTO $dbname.user_snapshot (timestamp, uuid, count, idle) VALUES $allinsertsnap")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 3:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}$deletiontime=$nowtime - 2678400;if($mysqlcon->exec("DELETE FROM $dbname.user_snapshot WHERE timestamp=$deletiontime")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 4:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}if($serverinfo['virtualserver_status']=="online"){$server_status=1;}elseif($serverinfo['virtualserver_status']=="offline"){$server_status=2;}elseif($serverinfo['virtualserver_status']=="virtual online"){$server_status=3;}else{$server_status=4;}if(($entry_snapshot_count=$mysqlcon->query("SELECT count(DISTINCT(timestamp)) AS timestamp FROM $dbname.user_snapshot"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 5:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$entry_snapshot_count=$entry_snapshot_count->fetch(PDO::FETCH_ASSOC);if($entry_snapshot_count['timestamp']>27){if(($snapshot_count_week=$mysqlcon->query("SELECT (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)) - (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)) AS count"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 6:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$snapshot_count_week=$snapshot_count_week->fetch(PDO::FETCH_ASSOC);$total_online_week=$snapshot_count_week['count'];}else{$total_online_week=0;}if($entry_snapshot_count['timestamp']>119){if(($snapshot_count_month=$mysqlcon->query("SELECT (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)) - (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)) AS count"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 7:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$snapshot_count_month=$snapshot_count_month->fetch(PDO::FETCH_ASSOC);$total_online_month=$snapshot_count_month['count'];}else{$total_online_month=0;}$country_array=array_count_values(str_word_count($country_string,1));arsort($country_array);$country_counter=0;$country_nation_other=0;$country_nation_name_2=0;$country_nation_name_3=0;$country_nation_name_4=0;$country_nation_name_5=0;$country_nation_2=0;$country_nation_3=0;$country_nation_4=0;$country_nation_5=0;foreach($country_array as $k=>$v){$country_counter++;if($country_counter==1){$country_nation_name_1=$k;$country_nation_1=$v;}elseif($country_counter==2){$country_nation_name_2=$k;$country_nation_2=$v;}elseif($country_counter==3){$country_nation_name_3=$k;$country_nation_3=$v;}elseif($country_counter==4){$country_nation_name_4=$k;$country_nation_4=$v;}elseif($country_counter==5){$country_nation_name_5=$k;$country_nation_5=$v;}else{$country_nation_other=$country_nation_other + $v;}}$platform_array=array_count_values(str_word_count($platform_string,1));$platform_other=0;$platform_1=0;$platform_2=0;$platform_3=0;$platform_4=0;$platform_5=0;foreach($platform_array as $k=>$v){if($k=="Windows"){$platform_1=$v;}elseif($k=="iOS"){$platform_2=$v;}elseif($k=="Linux"){$platform_3=$v;}elseif($k=="Android"){$platform_4=$v;}elseif($k=="OSX"){$platform_5=$v;}else{$platform_other=$platform_other + $v;}}$version_1=0;$version_2=0;$version_3=0;$version_4=0;$version_5=0;$version_name_1=0;$version_name_2=0;$version_name_3=0;$version_name_4=0;$version_name_5=0;$client_versions=$mysqlcon->query("SELECT version, COUNT(version) AS count FROM $dbname.user GROUP BY version ORDER BY count DESC LIMIT 5")->fetchAll(PDO::FETCH_ASSOC);$count_version=0;$version_other=$mysqlcon->query("SELECT COUNT(version) AS count FROM $dbname.user ORDER BY count DESC")->fetchAll(PDO::FETCH_ASSOC);foreach($client_versions as $version){$count_version++;if($count_version==1){$version_1=$version['count'];$version_name_1=$version['version'];}elseif($count_version==2){$version_2=$version['count'];$version_name_2=$version['version'];}elseif($count_version==3){$version_3=$version['count'];$version_name_3=$version['version'];}elseif($count_version==4){$version_4=$version['count'];$version_name_4=$version['version'];}elseif($count_version==5){$version_5=$version['count'];$version_name_5=$version['version'];}}$version_other=$version_other[0]['count'] - $version_1 + $version_2 + $version_3 + $version_4 + $version_5;$total_user=count($sqlhis);$server_used_slots=$serverinfo['virtualserver_clientsonline'] - $serverinfo['virtualserver_queryclientsonline'];$server_free_slots=$serverinfo['virtualserver_maxclients'] - $server_used_slots;$server_channel_amount=$serverinfo['virtualserver_channelsonline'];$server_ping=$serverinfo['virtualserver_total_ping'];$server_packet_loss=$serverinfo['virtualserver_total_packetloss_total'];$server_bytes_down=$serverinfo['connection_bytes_received_total'];$server_bytes_up=$serverinfo['connection_bytes_sent_total'];$server_uptime=$serverinfo['virtualserver_uptime'];$server_id=$serverinfo['virtualserver_id'];$server_name=str_replace('\\','\\\\',htmlspecialchars($serverinfo['virtualserver_name'],ENT_QUOTES));$server_pass=$serverinfo['virtualserver_flag_password'];$server_creation_date=$serverinfo['virtualserver_created'];$server_platform=$serverinfo['virtualserver_platform'];$server_weblist=$serverinfo['virtualserver_weblist_enabled'];$server_version=$serverinfo['virtualserver_version'];if($mysqlcon->exec("UPDATE $dbname.stats_server SET total_user='$total_user', total_online_time='$total_online_time', total_online_month='$total_online_month', total_online_week='$total_online_week', total_active_time='$total_active_time', total_inactive_time='$total_inactive_time', country_nation_name_1='$country_nation_name_1', country_nation_name_2='$country_nation_name_2', country_nation_name_3='$country_nation_name_3', country_nation_name_4='$country_nation_name_4', country_nation_name_5='$country_nation_name_5', country_nation_1='$country_nation_1', country_nation_2='$country_nation_2', country_nation_3='$country_nation_3', country_nation_4='$country_nation_4', country_nation_5='$country_nation_5', country_nation_other='$country_nation_other', platform_1='$platform_1', platform_2='$platform_2', platform_3='$platform_3', platform_4='$platform_4', platform_5='$platform_5', platform_other='$platform_other', version_name_1='$version_name_1', version_name_2='$version_name_2', version_name_3='$version_name_3', version_name_4='$version_name_4', version_name_5='$version_name_5', version_1='$version_1', version_2='$version_2', version_3='$version_3', version_4='$version_4', version_5='$version_5', version_other='$version_other', version_name_1='$version_name_1', server_status='$server_status', server_free_slots='$server_free_slots', server_used_slots='$server_used_slots', server_channel_amount='$server_channel_amount', server_ping='$server_ping', server_packet_loss='$server_packet_loss', server_bytes_down='$server_bytes_down', server_bytes_up='$server_bytes_up', server_uptime='$server_uptime', server_id='$server_id', server_name='$server_name', server_pass='$server_pass', server_creation_date='$server_creation_date', server_platform='$server_platform', server_weblist='$server_weblist', server_version='$server_version'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 8:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if(($max_entry_serverusage=$mysqlcon->query("SELECT MAX(timestamp) AS timestamp FROM $dbname.server_usage"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 9:",print_r($mysqlcon->errorInfo()),"\n";$sqlerr++;}$max_entry_serverusage=$max_entry_serverusage->fetch(PDO::FETCH_ASSOC);$diff_max_serverusage=$nowtime - $max_entry_serverusage['timestamp'];if($max_entry_serverusage['timestamp']==0||$diff_max_serverusage>899){if($mysqlcon->exec("INSERT INTO $dbname.server_usage (timestamp, clients, channel) VALUES ($nowtime,$server_used_slots,$server_channel_amount)")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 10:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}$upnextuptime=$nowtime - 86400;if(($uuidsoff=$mysqlcon->query("SELECT uuid,idle,count FROM $dbname.user WHERE online<>1 AND lastseen>$upnextuptime"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 11:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($uuidsoff->rowCount()!=0){$uuidsoff=$uuidsoff->fetchAll(PDO::FETCH_ASSOC);foreach($uuidsoff as $uuid){$idle=$uuid['idle'];$count=$uuid['count'];if($substridle==1){$activetime=$count - $idle;$dtF=new DateTime("@0");$dtT=new DateTime("@$activetime");}else{$activetime=$count;$dtF=new DateTime("@0");$dtT=new DateTime("@$count");}foreach($grouptime as $time=>$groupid){if($activetime>$time){$nextup=0;}else{$nextup=$time - $activetime;}}$updatenextup[]=array("uuid"=>$uuid['uuid'],"nextup"=>$nextup);}}if(isset($updatenextup)){$allupdateuuid='';$allupdatenextup='';foreach($updatenextup as $updatedata){$allupdateuuid=$allupdateuuid."'".$updatedata['uuid']."',";$allupdatenextup=$allupdatenextup."WHEN '".$updatedata['uuid']."' THEN '".$updatedata['nextup']."' ";}$allupdateuuid=substr($allupdateuuid,0,-1);if($mysqlcon->exec("UPDATE $dbname.user set nextup = CASE uuid $allupdatenextup END WHERE uuid IN ($allupdateuuid)")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 12:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}if($mysqlcon->exec("SET @a:=0")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 13:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($mysqlcon->exec("UPDATE $dbname.user u INNER JOIN (SELECT @a:=@a+1 nr,uuid FROM $dbname.user WHERE except!=1 ORDER BY count DESC) s USING (uuid) SET u.rank=s.nr")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 14:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$buildtime=microtime(true)- $starttime;if($sqlerr==0){if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 15:",print_r($mysqlcon->errorInfo()),"\n";}}else{if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_serverstats 16:",print_r($mysqlcon->errorInfo()),"\n";}}}?> \ No newline at end of file +query("SELECT uuid,count,idle,platform,nation FROM $dbname.user")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 1:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $uuids = $uuids->fetchAll(); + foreach($uuids as $uuid) { + $sqlhis[$uuid['uuid']] = array( + "uuid" => $uuid['uuid'], + "count" => $uuid['count'], + "idle" => $uuid['idle'] + ); + if ($uuid['nation']!=NULL) $country_string .= $uuid['nation'] . ' '; + if ($uuid['platform']!=NULL) { + $uuid_platform = str_replace(' ','',$uuid['platform']); + $platform_string .= $uuid_platform . ' '; + } + $total_online_time = $total_online_time + $uuid['count']; + $total_active_time = $total_active_time + $uuid['count'] - $uuid['idle']; + $total_inactive_time = $total_inactive_time + $uuid['idle']; + } + + // Event Handling each 6 hours + // Duplicate users Table in snapshot Table + if(($max_entry_usersnap = $mysqlcon->query("SELECT MAX(DISTINCT(timestamp)) AS timestamp FROM $dbname.user_snapshot")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 2:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $max_entry_usersnap = $max_entry_usersnap->fetch(PDO::FETCH_ASSOC); + $diff_max_usersnap = $nowtime - $max_entry_usersnap['timestamp']; + if($diff_max_usersnap > 21600) { + if(isset($sqlhis)) { + $allinsertsnap = ''; + foreach ($sqlhis as $insertsnap) { + $allinsertsnap = $allinsertsnap . "('$nowtime','" . $insertsnap['uuid'] . "', '" . $insertsnap['count'] . "', '" . $insertsnap['idle'] . "'),"; + } + $allinsertsnap = substr($allinsertsnap, 0, -1); + if ($allinsertsnap != '') { + if($mysqlcon->exec("INSERT INTO $dbname.user_snapshot (timestamp, uuid, count, idle) VALUES $allinsertsnap") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 3:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + //Delete old Entries in user_snapshot + $deletiontime = $nowtime - 2678400; + if($mysqlcon->exec("DELETE FROM $dbname.user_snapshot WHERE timestamp=$deletiontime") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 4:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + if($serverinfo['virtualserver_status']=="online") { + $server_status = 1; + } elseif($serverinfo['virtualserver_status']=="offline") { + $server_status = 2; + } elseif($serverinfo['virtualserver_status']=="virtual online") { + $server_status = 3; + } else { + $server_status = 4; + } + + // Calc Values for server stats + if(($entry_snapshot_count = $mysqlcon->query("SELECT count(DISTINCT(timestamp)) AS timestamp FROM $dbname.user_snapshot")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 5:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $entry_snapshot_count = $entry_snapshot_count->fetch(PDO::FETCH_ASSOC); + if ($entry_snapshot_count['timestamp'] > 27) { + // Calc total_online_week + if(($snapshot_count_week = $mysqlcon->query("SELECT (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)) - (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp) AND uuid IN (SELECT uuid FROM $dbname.user)) AS count")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 6:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $snapshot_count_week = $snapshot_count_week->fetch(PDO::FETCH_ASSOC); + $total_online_week = $snapshot_count_week['count']; + } else { + $total_online_week = 0; + } + if ($entry_snapshot_count['timestamp'] > 119) { + // Calc total_online_month + if(($snapshot_count_month = $mysqlcon->query("SELECT (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)) - (SELECT SUM(count) FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp) AND uuid IN (SELECT uuid FROM $dbname.user)) AS count")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 7:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $snapshot_count_month = $snapshot_count_month->fetch(PDO::FETCH_ASSOC); + $total_online_month = $snapshot_count_month['count']; + } else { + $total_online_month = 0; + } + + $country_array = array_count_values(str_word_count($country_string, 1)); + arsort($country_array); + $country_counter = 0; + $country_nation_other = 0; + $country_nation_name_2 = 0; + $country_nation_name_3 = 0; + $country_nation_name_4 = 0; + $country_nation_name_5 = 0; + $country_nation_2 = 0; + $country_nation_3 = 0; + $country_nation_4 = 0; + $country_nation_5 = 0; + foreach ($country_array as $k => $v) { + $country_counter++; + if ($country_counter == 1) { + $country_nation_name_1 = $k; + $country_nation_1 = $v; + } elseif ($country_counter == 2) { + $country_nation_name_2 = $k; + $country_nation_2 = $v; + } elseif ($country_counter == 3) { + $country_nation_name_3 = $k; + $country_nation_3 = $v; + } elseif ($country_counter == 4) { + $country_nation_name_4 = $k; + $country_nation_4 = $v; + } elseif ($country_counter == 5) { + $country_nation_name_5 = $k; + $country_nation_5 = $v; + } else { + $country_nation_other = $country_nation_other + $v; + } + } + + $platform_array = array_count_values(str_word_count($platform_string, 1)); + $platform_other = 0; + $platform_1 = 0; + $platform_2 = 0; + $platform_3 = 0; + $platform_4 = 0; + $platform_5 = 0; + foreach ($platform_array as $k => $v) { + if ($k == "Windows") { + $platform_1 = $v; + } elseif ($k == "iOS") { + $platform_2 = $v; + } elseif ($k == "Linux") { + $platform_3 = $v; + } elseif ($k == "Android") { + $platform_4 = $v; + } elseif ($k == "OSX") { + $platform_5 = $v; + } else { + $platform_other = $platform_other + $v; + } + } + + $version_1 = 0; + $version_2 = 0; + $version_3 = 0; + $version_4 = 0; + $version_5 = 0; + $version_name_1 = 0; + $version_name_2 = 0; + $version_name_3 = 0; + $version_name_4 = 0; + $version_name_5 = 0; + $client_versions = $mysqlcon->query("SELECT version, COUNT(version) AS count FROM $dbname.user GROUP BY version ORDER BY count DESC LIMIT 5")->fetchAll(PDO::FETCH_ASSOC); + $count_version = 0; + $version_other = $mysqlcon->query("SELECT COUNT(version) AS count FROM $dbname.user ORDER BY count DESC")->fetchAll(PDO::FETCH_ASSOC); + + foreach($client_versions as $version) { + $count_version++; + if ($count_version == 1) { + $version_1 = $version['count']; + $version_name_1 = $version['version']; + } elseif ($count_version == 2) { + $version_2 = $version['count']; + $version_name_2 = $version['version']; + } elseif ($count_version == 3) { + $version_3 = $version['count']; + $version_name_3 = $version['version']; + } elseif ($count_version == 4) { + $version_4 = $version['count']; + $version_name_4 = $version['version']; + } elseif ($count_version == 5) { + $version_5 = $version['count']; + $version_name_5 = $version['version']; + } + } + $version_other = $version_other[0]['count'] - $version_1 + $version_2 + $version_3 + $version_4 + $version_5; + + $total_user = count($sqlhis); + $server_used_slots = $serverinfo['virtualserver_clientsonline'] - $serverinfo['virtualserver_queryclientsonline']; + $server_free_slots = $serverinfo['virtualserver_maxclients'] - $server_used_slots; + $server_channel_amount = $serverinfo['virtualserver_channelsonline']; + $server_ping = $serverinfo['virtualserver_total_ping']; + $server_packet_loss = $serverinfo['virtualserver_total_packetloss_total']; + $server_bytes_down = $serverinfo['connection_bytes_received_total']; + $server_bytes_up = $serverinfo['connection_bytes_sent_total']; + $server_uptime = $serverinfo['virtualserver_uptime']; + $server_id = $serverinfo['virtualserver_id']; + $server_name = str_replace('\\', '\\\\', htmlspecialchars($serverinfo['virtualserver_name'], ENT_QUOTES)); + $server_pass = $serverinfo['virtualserver_flag_password']; + $server_creation_date = $serverinfo['virtualserver_created']; + $server_platform = $serverinfo['virtualserver_platform']; + $server_weblist = $serverinfo['virtualserver_weblist_enabled']; + $server_version = $serverinfo['virtualserver_version']; + + if($mysqlcon->exec("UPDATE $dbname.stats_server SET total_user='$total_user', total_online_time='$total_online_time', total_online_month='$total_online_month', total_online_week='$total_online_week', total_active_time='$total_active_time', total_inactive_time='$total_inactive_time', country_nation_name_1='$country_nation_name_1', country_nation_name_2='$country_nation_name_2', country_nation_name_3='$country_nation_name_3', country_nation_name_4='$country_nation_name_4', country_nation_name_5='$country_nation_name_5', country_nation_1='$country_nation_1', country_nation_2='$country_nation_2', country_nation_3='$country_nation_3', country_nation_4='$country_nation_4', country_nation_5='$country_nation_5', country_nation_other='$country_nation_other', platform_1='$platform_1', platform_2='$platform_2', platform_3='$platform_3', platform_4='$platform_4', platform_5='$platform_5', platform_other='$platform_other', version_name_1='$version_name_1', version_name_2='$version_name_2', version_name_3='$version_name_3', version_name_4='$version_name_4', version_name_5='$version_name_5', version_1='$version_1', version_2='$version_2', version_3='$version_3', version_4='$version_4', version_5='$version_5', version_other='$version_other', version_name_1='$version_name_1', server_status='$server_status', server_free_slots='$server_free_slots', server_used_slots='$server_used_slots', server_channel_amount='$server_channel_amount', server_ping='$server_ping', server_packet_loss='$server_packet_loss', server_bytes_down='$server_bytes_down', server_bytes_up='$server_bytes_up', server_uptime='$server_uptime', server_id='$server_id', server_name='$server_name', server_pass='$server_pass', server_creation_date='$server_creation_date', server_platform='$server_platform', server_weblist='$server_weblist', server_version='$server_version'") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 8:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + + // Stats for Server Usage + if(($max_entry_serverusage = $mysqlcon->query("SELECT MAX(timestamp) AS timestamp FROM $dbname.server_usage")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 9:".print_r($mysqlcon->errorInfo())); + $sqlerr++; + } + $max_entry_serverusage = $max_entry_serverusage->fetch(PDO::FETCH_ASSOC); + $diff_max_serverusage = $nowtime - $max_entry_serverusage['timestamp']; + if ($max_entry_serverusage['timestamp'] == 0 || $diff_max_serverusage > 898) { // every 15 mins + if($mysqlcon->exec("INSERT INTO $dbname.server_usage (timestamp, clients, channel) VALUES ($nowtime,$server_used_slots,$server_channel_amount)") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 10:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + //Calc time next rankup + $upnextuptime = $nowtime - 86400; + if(($uuidsoff = $mysqlcon->query("SELECT uuid,idle,count FROM $dbname.user WHERE online<>1 AND lastseen>$upnextuptime")) === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 11:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + if ($uuidsoff->rowCount() != 0) { + $uuidsoff = $uuidsoff->fetchAll(PDO::FETCH_ASSOC); + foreach($uuidsoff as $uuid) { + $idle = $uuid['idle']; + $count = $uuid['count']; + if ($substridle == 1) { + $activetime = $count - $idle; + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$activetime"); + } else { + $activetime = $count; + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$count"); + } + foreach ($grouptime as $time => $groupid) { + if ($activetime > $time) { + $nextup = 0; + } else { + $nextup = $time - $activetime; + } + } + $updatenextup[] = array( + "uuid" => $uuid['uuid'], + "nextup" => $nextup + ); + } + } + + if (isset($updatenextup)) { + $allupdateuuid = ''; + $allupdatenextup = ''; + foreach ($updatenextup as $updatedata) { + $allupdateuuid = $allupdateuuid . "'" . $updatedata['uuid'] . "',"; + $allupdatenextup = $allupdatenextup . "WHEN '" . $updatedata['uuid'] . "' THEN '" . $updatedata['nextup'] . "' "; + } + $allupdateuuid = substr($allupdateuuid, 0, -1); + if ($mysqlcon->exec("UPDATE $dbname.user set nextup = CASE uuid $allupdatenextup END WHERE uuid IN ($allupdateuuid)") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 12:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + //Calc Rank + if($mysqlcon->exec("SET @a:=0") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 13:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + if ($substridle == 1) { + if($mysqlcon->exec("UPDATE $dbname.user u INNER JOIN (SELECT @a:=@a+1 nr,uuid FROM $dbname.user WHERE except!=1 ORDER BY (count - idle) DESC) s USING (uuid) SET u.rank=s.nr") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 14:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } else { + if($mysqlcon->exec("UPDATE $dbname.user u INNER JOIN (SELECT @a:=@a+1 nr,uuid FROM $dbname.user WHERE except!=1 ORDER BY count DESC) s USING (uuid) SET u.rank=s.nr") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 14:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + $buildtime = microtime(true) - $starttime; + if ($buildtime < 0) { $buildtime = 0; } + + if ($sqlerr == 0) { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 15:".print_r($mysqlcon->errorInfo())); + } + } else { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"calc_serverstats 16:".print_r($mysqlcon->errorInfo())); + } + } +} +?> \ No newline at end of file diff --git a/jobs/calc_user.php b/jobs/calc_user.php index 9f292c4..f56816f 100644 --- a/jobs/calc_user.php +++ b/jobs/calc_user.php @@ -1 +1,359 @@ -query("SELECT * FROM $dbname.job_check WHERE job_name='check_update'"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 1:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$lastupdate=$lastupdate->fetchAll();if($lastupdate[0]['timestamp']<$updatetime){set_error_handler(function(){});$newversion=file_get_contents('http://ts-n.net/ranksystem/version');restore_error_handler();if(substr($newversion,0,4)!=substr($currvers,0,4)&&$newversion!=''){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['upinf'],"\n";foreach($uniqueid as $clientid){check_shutdown($timezone);usleep($slowmode);try{$ts3->clientGetByUid($clientid)->message(sprintf($lang['upmsg'],$currvers,$newversion));echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['upusrinf'],$clientid),"\n";}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['upusrerr'],$clientid),"\n";$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}}}if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp=$nowtime WHERE job_name='check_update'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 3:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}if(($dbdata=$mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='calc_user_lastscan'"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 4:",print_r($mysqlcon->errorInfo()),"\n";exit;}$lastscanarr=$dbdata->fetchAll();$lastscan=$lastscanarr[0]['timestamp'];if($lastscan<($nowtime - 86400)){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Much time gone since last scan.. reset time difference to zero.\n";$lastscan=$nowtime;}if($dbdata->rowCount()!=0){if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$nowtime' WHERE job_name='calc_user_lastscan'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 5:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if(($dbuserdata=$mysqlcon->query("SELECT uuid,cldbid,count,grpid,nextup,idle,boosttime FROM $dbname.user"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 6:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$uuids=$dbuserdata->fetchAll();foreach($uuids as $uuid){$sqlhis[$uuid['uuid']]=array("uuid"=>$uuid['uuid'],"cldbid"=>$uuid['cldbid'],"count"=>$uuid['count'],"grpid"=>$uuid['grpid'],"nextup"=>$uuid['nextup'],"idle"=>$uuid['idle'],"boosttime"=>$uuid['boosttime']);$uidarr[]=$uuid['uuid'];}}unset($uuids);check_shutdown($timezone);usleep($slowmode);$yetonline[]='';$insertdata='';if(empty($grouptime)){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 7:",$lang['wiconferr'],"\n";exit;}krsort($grouptime);$sumentries=0;$nextupforinsert=key($grouptime)- 1;foreach($allclients as $client){$sumentries++;$cldbid=$client['client_database_id'];$ip=ip2long($client['connection_client_ip']);$name=str_replace('\\','\\\\',htmlspecialchars($client['client_nickname'],ENT_QUOTES));$uid=htmlspecialchars($client['client_unique_identifier'],ENT_QUOTES);$cldgroup=$client['client_servergroups'];$sgroups=explode(",",$cldgroup);$platform=$client['client_platform'];$nation=$client['client_country'];$version=$client['client_version'];$firstconnect=$client['client_created'];if(!in_array($uid,$yetonline)&&$client['client_version']!="ServerQuery"){$clientidle=floor($client['client_idle_time'] / 1000);$yetonline[]=$uid;if(in_array($uid,$exceptuuid)||array_intersect($sgroups,$exceptgroup)){$except=1;}else{$except=0;}if(in_array($uid,$uidarr)){$idle=$sqlhis[$uid]['idle'] + $clientidle;$grpid=$sqlhis[$uid]['grpid'];$nextup=$sqlhis[$uid]['nextup'];if($sqlhis[$uid]['cldbid']!=$cldbid&&$resetbydbchange==1){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['changedbid'],$name,$uid,$cldbid,$sqlhis[$uid]['cldbid']),"\n";$count=1;$idle=0;}else{$hitboost=0;$boosttime=$sqlhis[$uid]['boosttime'];if($boostarr!=0){foreach($boostarr as $boost){if(in_array($boost['group'],$sgroups)){$hitboost=1;if($sqlhis[$uid]['boosttime']==0){$boosttime=$nowtime;}else{if($nowtime>$sqlhis[$uid]['boosttime'] + $boost['time']){check_shutdown($timezone);usleep($slowmode);try{$ts3->serverGroupClientDel($boost['group'],$cldbid);$boosttime=0;echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['sgrprm'],$sqlhis[$uid]['grpid'],$name,$uid,$cldbid),"\n";}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 8:",sprintf($lang['sgrprerr'],$name,$uid,$cldbid),"\n";$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}}}$count=($nowtime - $lastscan)* $boost['factor'] + $sqlhis[$uid]['count'];if($clientidle>($nowtime - $lastscan)){$idle=($nowtime - $lastscan)* $boost['factor'] + $sqlhis[$uid]['idle'];}}}}if($boostarr==0 or $hitboost==0){$count=$nowtime - $lastscan + $sqlhis[$uid]['count'];if($clientidle>($nowtime - $lastscan)){$idle=$nowtime - $lastscan + $sqlhis[$uid]['idle'];}}}$dtF=new DateTime("@0");if($substridle==1){$activetime=$count - $idle;}else{$activetime=$count;}$dtT=new DateTime("@$activetime");foreach($grouptime as $time=>$groupid){if(in_array($groupid,$sgroups)){$grpid=$groupid;break;}}$grpcount=0;foreach($grouptime as $time=>$groupid){$grpcount++;if($activetime>$time&&!in_array($uid,$exceptuuid)&&!array_intersect($sgroups,$exceptgroup)){if($sqlhis[$uid]['grpid']!=$groupid){if($sqlhis[$uid]['grpid']!=0&&in_array($sqlhis[$uid]['grpid'],$sgroups)){check_shutdown($timezone);usleep($slowmode);try{$ts3->serverGroupClientDel($sqlhis[$uid]['grpid'],$cldbid);echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['sgrprm'],$sqlhis[$uid]['grpid'],$name,$uid,$cldbid),"\n";}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 9:",sprintf($lang['sgrprerr'],$name,$uid,$cldbid),"\n";$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}}if(!in_array($groupid,$sgroups)){check_shutdown($timezone);usleep($slowmode);try{$ts3->serverGroupClientAdd($groupid,$cldbid);echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['sgrpadd'],$groupid,$name,$uid,$cldbid),"\n";}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 10:",sprintf($lang['sgrprerr'],$name,$uid,$cldbid),"\n";$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}}$grpid=$groupid;if($msgtouser==1){check_shutdown($timezone);usleep($slowmode);$days=$dtF->diff($dtT)->format('%a');$hours=$dtF->diff($dtT)->format('%h');$mins=$dtF->diff($dtT)->format('%i');$secs=$dtF->diff($dtT)->format('%s');if($substridle==1){try{$ts3->clientGetByUid($uid)->message(sprintf($lang['usermsgactive'],$days,$hours,$mins,$secs));}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 11:",sprintf($lang['sgrprerr'],$name,$uid,$cldbid),"\n";$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}}else{try{$ts3->clientGetByUid($uid)->message(sprintf($lang['usermsgonline'],$days,$hours,$mins,$secs));}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 12:",sprintf($lang['sgrprerr'],$name,$uid,$cldbid),"\n";$sqlmsg.=$e->getCode().': '.$e->getMessage();$sqlerr++;}}}}if($grpcount==1){$nextup=0;}break;}else{$nextup=$time - $activetime;}}$updatedata[]=array("uuid"=>$uid,"cldbid"=>$cldbid,"count"=>$count,"ip"=>$ip,"name"=>$name,"lastseen"=>$nowtime,"grpid"=>$grpid,"nextup"=>$nextup,"idle"=>$idle,"cldgroup"=>$cldgroup,"boosttime"=>$boosttime,"platform"=>$platform,"nation"=>$nation,"version"=>$version,"except"=>$except);}else{$grpid='0';foreach($grouptime as $time=>$groupid){if(in_array($groupid,$sgroups)){$grpid=$groupid;break;}}$insertdata[]=array("uuid"=>$uid,"cldbid"=>$cldbid,"ip"=>$ip,"name"=>$name,"lastseen"=>$nowtime,"grpid"=>$grpid,"nextup"=>$nextupforinsert,"cldgroup"=>$cldgroup,"platform"=>$platform,"nation"=>$nation,"version"=>$version,"firstcon"=>$firstconnect,"except"=>$except);$uidarr[]=$uid;echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['adduser'],$name,$uid,$cldbid),"\n";}}}if($mysqlcon->exec("UPDATE $dbname.user SET online='0'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 13:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($insertdata!=''){$allinsertdata='';foreach($insertdata as $insertarr){$allinsertdata=$allinsertdata."('".$insertarr['uuid']."', '".$insertarr['cldbid']."', '1', '".$insertarr['ip']."', '".$insertarr['name']."', '".$insertarr['lastseen']."', '".$insertarr['grpid']."', '".$insertarr['nextup']."', '".$insertarr['cldgroup']."', '".$insertarr['platform']."', '".$insertarr['nation']."', '".$insertarr['version']."', '".$insertarr['firstcon']."', '".$insertarr['except']."','1'),";}$allinsertdata=substr($allinsertdata,0,-1);if($allinsertdata!=''){if($mysqlcon->exec("INSERT INTO $dbname.user (uuid, cldbid, count, ip, name, lastseen, grpid, nextup, cldgroup, platform, nation, version, firstcon, except, online) VALUES $allinsertdata")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 14:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}unset($insertdata);unset($allinsertdata);if($updatedata!=0){$allupdateuuid='';$allupdatecldbid='';$allupdatecount='';$allupdateip='';$allupdatename='';$allupdatelastseen='';$allupdategrpid='';$allupdatenextup='';$allupdateidle='';$allupdatecldgroup='';$allupdateboosttime='';$allupdateplatform='';$allupdatenation='';$allupdateversion='';$allupdateexcept='';foreach($updatedata as $updatearr){$allupdateuuid=$allupdateuuid."'".$updatearr['uuid']."',";$allupdatecldbid=$allupdatecldbid."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['cldbid']."' ";$allupdatecount=$allupdatecount."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['count']."' ";$allupdateip=$allupdateip."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['ip']."' ";$allupdatename=$allupdatename."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['name']."' ";$allupdatelastseen=$allupdatelastseen."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['lastseen']."' ";$allupdategrpid=$allupdategrpid."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['grpid']."' ";$allupdatenextup=$allupdatenextup."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['nextup']."' ";$allupdateidle=$allupdateidle."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['idle']."' ";$allupdatecldgroup=$allupdatecldgroup."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['cldgroup']."' ";$allupdateboosttime=$allupdateboosttime."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['boosttime']."' ";$allupdateplatform=$allupdateplatform."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['platform']."' ";$allupdatenation=$allupdatenation."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['nation']."' ";$allupdateversion=$allupdateversion."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['version']."' ";$allupdateexcept=$allupdateexcept."WHEN '".$updatearr['uuid']."' THEN '".$updatearr['except']."' ";}$allupdateuuid=substr($allupdateuuid,0,-1);if($mysqlcon->exec("UPDATE $dbname.user set cldbid = CASE uuid $allupdatecldbid END, count = CASE uuid $allupdatecount END, ip = CASE uuid $allupdateip END, name = CASE uuid $allupdatename END, lastseen = CASE uuid $allupdatelastseen END, grpid = CASE uuid $allupdategrpid END, nextup = CASE uuid $allupdatenextup END, idle = CASE uuid $allupdateidle END, cldgroup = CASE uuid $allupdatecldgroup END, boosttime = CASE uuid $allupdateboosttime END, platform = CASE uuid $allupdateplatform END, nation = CASE uuid $allupdatenation END, version = CASE uuid $allupdateversion END, except = CASE uuid $allupdateexcept END, online = 1 WHERE uuid IN ($allupdateuuid)")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 15:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}$buildtime=microtime(true)- $starttime;if($sqlerr==0){if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 16:",print_r($mysqlcon->errorInfo()),"\n";}}else{if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_user 17:",print_r($mysqlcon->errorInfo()),"\n";}}}?> \ No newline at end of file +query("SELECT * FROM $dbname.job_check WHERE job_name='check_update'")) === false) { + enter_logfile($logpath,$timezone,2,"calc_user 1:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $lastupdate = $lastupdate->fetchAll(); + if ($lastupdate[0]['timestamp'] < $updatetime) { + set_error_handler(function() { }); + $newversion = file_get_contents('http://ts-n.net/ranksystem/version'); + restore_error_handler(); + if (substr($newversion, 0, 4) != substr($currvers, 0, 4) && $newversion != '') { + enter_logfile($logpath,$timezone,4,$lang['upinf']); + foreach ($uniqueid as $clientid) { + check_shutdown($timezone); usleep($slowmode); + try { + $ts3->clientGetByUid($clientid)->message(sprintf($lang['upmsg'], $currvers, $newversion)); + enter_logfile($logpath,$timezone,5," ".sprintf($lang['upusrinf'], $clientid)); + } + catch (Exception $e) { + enter_logfile($logpath,$timezone,2," ".sprintf($lang['upusrerr'], $clientid)); + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; + } + } + } + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp=$nowtime WHERE job_name='check_update'") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 3:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + + if(($dbdata = $mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='calc_user_lastscan'")) === false) { + enter_logfile($logpath,$timezone,2,"calc_user 4:".print_r($mysqlcon->errorInfo())); + exit; + } + $lastscanarr = $dbdata->fetchAll(); + $lastscan = $lastscanarr[0]['timestamp']; + if($lastscan < ($nowtime - 1800)) { + enter_logfile($logpath,$timezone,4,"Much time gone since last scan.. reset time difference to zero."); + $lastscan = $nowtime; + } elseif($lastscan > $nowtime) { + enter_logfile($logpath,$timezone,4,"Negative time between now and last scan (Error in your server time!).. reset time difference to zero."); + $lastscan = $nowtime; + } + if ($dbdata->rowCount() != 0) { + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$nowtime' WHERE job_name='calc_user_lastscan'") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 5:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + if(($dbuserdata = $mysqlcon->query("SELECT uuid,cldbid,count,grpid,nextup,idle,boosttime FROM $dbname.user")) === false) { + enter_logfile($logpath,$timezone,2,"calc_user 6:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $uuids = $dbuserdata->fetchAll(); + foreach($uuids as $uuid) { + $sqlhis[$uuid['uuid']] = array( + "uuid" => $uuid['uuid'], + "cldbid" => $uuid['cldbid'], + "count" => $uuid['count'], + "grpid" => $uuid['grpid'], + "nextup" => $uuid['nextup'], + "idle" => $uuid['idle'], + "boosttime" => $uuid['boosttime'] + ); + $uidarr[] = $uuid['uuid']; + } + } + unset($uuids); + + check_shutdown($timezone); usleep($slowmode); + $yetonline[] = ''; + $insertdata = ''; + if(empty($grouptime)) { + enter_logfile($logpath,$timezone,2,"calc_user 7:".$lang['wiconferr']); + exit; + } + krsort($grouptime); + $sumentries = 0; + $nextupforinsert = key($grouptime) - 1; + + foreach ($allclients as $client) { + $sumentries++; + $cldbid = $client['client_database_id']; + $ip = ip2long($client['connection_client_ip']); + $name = str_replace('\\', '\\\\', htmlspecialchars($client['client_nickname'], ENT_QUOTES)); + $uid = htmlspecialchars($client['client_unique_identifier'], ENT_QUOTES); + $cldgroup = $client['client_servergroups']; + $sgroups = explode(",", $cldgroup); + $platform=$client['client_platform']; + $nation=$client['client_country']; + $version=$client['client_version']; + $firstconnect=$client['client_created']; + if (!in_array($uid, $yetonline) && $client['client_version'] != "ServerQuery") { + $clientidle = floor($client['client_idle_time'] / 1000); + $yetonline[] = $uid; + if(in_array($uid, $exceptuuid) || array_intersect($sgroups, $exceptgroup)) { + $except = 1; + } else { + $except = 0; + } + if (in_array($uid, $uidarr)) { + $idle = $sqlhis[$uid]['idle'] + $clientidle; + $grpid = $sqlhis[$uid]['grpid']; + $nextup = $sqlhis[$uid]['nextup']; + if ($sqlhis[$uid]['cldbid'] != $cldbid && $resetbydbchange == 1) { + enter_logfile($logpath,$timezone,5,sprintf($lang['changedbid'], $name, $uid, $cldbid, $sqlhis[$uid]['cldbid'])); + $count = 1; + $idle = 0; + } else { + $hitboost = 0; + $boosttime = $sqlhis[$uid]['boosttime']; + if($boostarr!=0) { + foreach($boostarr as $boost) { + if(in_array($boost['group'], $sgroups)) { + $hitboost = 1; + if($sqlhis[$uid]['boosttime']==0) { + $boosttime = $nowtime; + } else { + if ($nowtime > $sqlhis[$uid]['boosttime'] + $boost['time']) { + check_shutdown($timezone); usleep($slowmode); + try { + $ts3->serverGroupClientDel($boost['group'], $cldbid); + $boosttime = 0; + enter_logfile($logpath,$timezone,5,sprintf($lang['sgrprm'], $sqlhis[$uid]['grpid'], $name, $uid, $cldbid)); + } + catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"calc_user 8:".sprintf($lang['sgrprerr'], $name, $uid, $cldbid)); + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; + } + } + } + $count = ($nowtime - $lastscan) * $boost['factor'] + $sqlhis[$uid]['count']; + if ($clientidle > ($nowtime - $lastscan)) { + $idle = ($nowtime - $lastscan) * $boost['factor'] + $sqlhis[$uid]['idle']; + } + } + } + } + if($boostarr == 0 or $hitboost == 0) { + $count = $nowtime - $lastscan + $sqlhis[$uid]['count']; + if ($clientidle > ($nowtime - $lastscan)) { + $idle = $nowtime - $lastscan + $sqlhis[$uid]['idle']; + } + } + } + $dtF = new DateTime("@0"); + if ($substridle == 1) { + $activetime = $count - $idle; + } else { + $activetime = $count; + } + $dtT = new DateTime("@$activetime"); + foreach ($grouptime as $time => $groupid) { + if (in_array($groupid, $sgroups)) { + $grpid = $groupid; + break; + } + } + $grpcount=0; + foreach ($grouptime as $time => $groupid) { + $grpcount++; + if ($activetime > $time && !in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { + if ($sqlhis[$uid]['grpid'] != $groupid) { + if ($sqlhis[$uid]['grpid'] != 0 && in_array($sqlhis[$uid]['grpid'], $sgroups)) { + check_shutdown($timezone); usleep($slowmode); + try { + $ts3->serverGroupClientDel($sqlhis[$uid]['grpid'], $cldbid); + enter_logfile($logpath,$timezone,5,sprintf($lang['sgrprm'], $sqlhis[$uid]['grpid'], $name, $uid, $cldbid)); + } + catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"calc_user 9:".sprintf($lang['sgrprerr'], $name, $uid, $cldbid)); + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; + } + } + if (!in_array($groupid, $sgroups)) { + check_shutdown($timezone); usleep($slowmode); + try { + $ts3->serverGroupClientAdd($groupid, $cldbid); + enter_logfile($logpath,$timezone,5,sprintf($lang['sgrpadd'], $groupid, $name, $uid, $cldbid)); + } + catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"calc_user 10:".sprintf($lang['sgrprerr'], $name, $uid, $cldbid)); + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; + } + } + $grpid = $groupid; + if ($msgtouser == 1) { + check_shutdown($timezone); usleep($slowmode); + $days = $dtF->diff($dtT)->format('%a'); + $hours = $dtF->diff($dtT)->format('%h'); + $mins = $dtF->diff($dtT)->format('%i'); + $secs = $dtF->diff($dtT)->format('%s'); + if ($substridle == 1) { + try { + $ts3->clientGetByUid($uid)->message(sprintf($lang['usermsgactive'], $days, $hours, $mins, $secs)); + } catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"calc_user 11:".sprintf($lang['sgrprerr'], $name, $uid, $cldbid)); + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; + } + } else { + try { + $ts3->clientGetByUid($uid)->message(sprintf($lang['usermsgonline'], $days, $hours, $mins, $secs)); + } catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"calc_user 12:".sprintf($lang['sgrprerr'], $name, $uid, $cldbid)); + $sqlmsg .= $e->getCode() . ': ' . $e->getMessage(); + $sqlerr++; + } + } + } + } + if($grpcount == 1) { + $nextup = 0; + } + break; + } else { + $nextup = $time - $activetime; + } + } + $updatedata[] = array( + "uuid" => $uid, + "cldbid" => $cldbid, + "count" => $count, + "ip" => $ip, + "name" => $name, + "lastseen" => $nowtime, + "grpid" => $grpid, + "nextup" => $nextup, + "idle" => $idle, + "cldgroup" => $cldgroup, + "boosttime" => $boosttime, + "platform" => $platform, + "nation" => $nation, + "version" => $version, + "except" => $except + ); + } else { + $grpid = '0'; + foreach ($grouptime as $time => $groupid) { + if (in_array($groupid, $sgroups)) { + $grpid = $groupid; + break; + } + } + $insertdata[] = array( + "uuid" => $uid, + "cldbid" => $cldbid, + "ip" => $ip, + "name" => $name, + "lastseen" => $nowtime, + "grpid" => $grpid, + "nextup" => $nextupforinsert, + "cldgroup" => $cldgroup, + "platform" => $platform, + "nation" => $nation, + "version" => $version, + "firstcon" => $firstconnect, + "except" => $except + ); + $uidarr[] = $uid; + enter_logfile($logpath,$timezone,5,sprintf($lang['adduser'], $name, $uid, $cldbid)); + } + } + } + + if($mysqlcon->exec("UPDATE $dbname.user SET online='0'") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 13:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + + if ($insertdata != '') { + $allinsertdata = ''; + foreach ($insertdata as $insertarr) { + $allinsertdata = $allinsertdata . "('" . $insertarr['uuid'] . "', '" . $insertarr['cldbid'] . "', '1', '" . $insertarr['ip'] . "', '" . $insertarr['name'] . "', '" . $insertarr['lastseen'] . "', '" . $insertarr['grpid'] . "', '" . $insertarr['nextup'] . "', '" . $insertarr['cldgroup'] . "', '" . $insertarr['platform'] . "', '" . $insertarr['nation'] . "', '" . $insertarr['version'] . "', '" . $insertarr['firstcon'] . "', '" . $insertarr['except'] . "','1'),"; + } + $allinsertdata = substr($allinsertdata, 0, -1); + if ($allinsertdata != '') { + if($mysqlcon->exec("INSERT INTO $dbname.user (uuid, cldbid, count, ip, name, lastseen, grpid, nextup, cldgroup, platform, nation, version, firstcon, except, online) VALUES $allinsertdata") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 14:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + + unset($insertdata); + unset($allinsertdata); + if ($updatedata != 0) { + $allupdateuuid = ''; + $allupdatecldbid = ''; + $allupdatecount = ''; + $allupdateip = ''; + $allupdatename = ''; + $allupdatelastseen = ''; + $allupdategrpid = ''; + $allupdatenextup = ''; + $allupdateidle = ''; + $allupdatecldgroup = ''; + $allupdateboosttime = ''; + $allupdateplatform = ''; + $allupdatenation = ''; + $allupdateversion = ''; + $allupdateexcept = ''; + foreach ($updatedata as $updatearr) { + $allupdateuuid = $allupdateuuid . "'" . $updatearr['uuid'] . "',"; + $allupdatecldbid = $allupdatecldbid . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['cldbid'] . "' "; + $allupdatecount = $allupdatecount . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['count'] . "' "; + $allupdateip = $allupdateip . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['ip'] . "' "; + $allupdatename = $allupdatename . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['name'] . "' "; + $allupdatelastseen = $allupdatelastseen . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['lastseen'] . "' "; + $allupdategrpid = $allupdategrpid . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['grpid'] . "' "; + $allupdatenextup = $allupdatenextup . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['nextup'] . "' "; + $allupdateidle = $allupdateidle . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['idle'] . "' "; + $allupdatecldgroup = $allupdatecldgroup . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['cldgroup'] . "' "; + $allupdateboosttime = $allupdateboosttime . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['boosttime'] . "' "; + $allupdateplatform = $allupdateplatform . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['platform'] . "' "; + $allupdatenation = $allupdatenation . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['nation'] . "' "; + $allupdateversion = $allupdateversion . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['version'] . "' "; + $allupdateexcept = $allupdateexcept . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['except'] . "' "; + } + $allupdateuuid = substr($allupdateuuid, 0, -1); + if($mysqlcon->exec("UPDATE $dbname.user set cldbid = CASE uuid $allupdatecldbid END, count = CASE uuid $allupdatecount END, ip = CASE uuid $allupdateip END, name = CASE uuid $allupdatename END, lastseen = CASE uuid $allupdatelastseen END, grpid = CASE uuid $allupdategrpid END, nextup = CASE uuid $allupdatenextup END, idle = CASE uuid $allupdateidle END, cldgroup = CASE uuid $allupdatecldgroup END, boosttime = CASE uuid $allupdateboosttime END, platform = CASE uuid $allupdateplatform END, nation = CASE uuid $allupdatenation END, version = CASE uuid $allupdateversion END, except = CASE uuid $allupdateexcept END, online = 1 WHERE uuid IN ($allupdateuuid)") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 15:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + $buildtime = microtime(true) - $starttime; + if ($buildtime < 0) { $buildtime = 0; } + + if ($sqlerr == 0) { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 16:".print_r($mysqlcon->errorInfo())); + } + } else { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"calc_user 17:".print_r($mysqlcon->errorInfo())); + } + } +} +?> \ No newline at end of file diff --git a/jobs/calc_userstats.php b/jobs/calc_userstats.php index 0e55fbc..da957ab 100644 --- a/jobs/calc_userstats.php +++ b/jobs/calc_userstats.php @@ -1 +1,179 @@ -query("SELECT count(*) as count FROM ((SELECT u.uuid FROM $dbname.user AS u INNER JOIN $dbname.stats_user As s On u.uuid=s.uuid) UNION (SELECT u.uuid FROM $dbname.user AS u LEFT JOIN $dbname.stats_user As s On u.uuid=s.uuid WHERE s.uuid IS NULL)) x"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 1:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$count_user=$count_user->fetchAll(PDO::FETCH_ASSOC);$total_user=$count_user[0]['count'];if(($job_begin=$mysqlcon->query("SELECT timestamp FROM $dbname.job_check WHERE job_name='calc_user_limit'"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 2:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$job_begin=$job_begin->fetchAll();$job_begin=$job_begin[0]['timestamp'];$job_end=ceil($total_user / 10)* 10;if($job_begin>=$job_end){$job_begin=0;$job_end=10;}else{$job_end=$job_begin + 10;}if(($uuids=$mysqlcon->query("(SELECT u.uuid,u.rank,u.cldbid FROM $dbname.user AS u INNER JOIN $dbname.stats_user As s On u.uuid=s.uuid) UNION (SELECT u.uuid,u.rank,u.cldbid FROM $dbname.user AS u LEFT JOIN $dbname.stats_user As s On u.uuid=s.uuid WHERE s.uuid IS NULL) ORDER BY cldbid ASC LIMIT $job_begin, 10"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 3:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$uuids=$uuids->fetchAll();foreach($uuids as $uuid){$sqlhis[$uuid['uuid']]=array("uuid"=>$uuid['uuid'],"rank"=>$uuid['rank'],"cldbid"=>$uuid['cldbid']);}if($mysqlcon->exec("UPDATE $dbname.stats_user AS t LEFT JOIN $dbname.user AS u ON t.uuid=u.uuid SET t.removed='1' WHERE u.uuid IS NULL")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 4:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if(($statsuserhis=$mysqlcon->query("SELECT uuid, removed FROM $dbname.stats_user"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 5:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$statsuserhis=$statsuserhis->fetchAll();foreach($statsuserhis as $userhis){$uidarrstats[$userhis['uuid']]=$userhis['removed'];}unset($statsuserhis);if(isset($sqlhis)){if(($userdataweekbegin=$mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 6:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$userdataweekbegin=$userdataweekbegin->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);if(($userdataweekend=$mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 7:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$userdataweekend=$userdataweekend->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);if(($userdatamonthbegin=$mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 8:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$userdatamonthbegin=$userdatamonthbegin->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);if(($userdatamonthend=$mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 9:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$userdatamonthend=$userdatamonthend->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC);$allupdateuuid='';$allupdaterank='';$allupdatecountw='';$allupdatecountm='';$allupdateidlew='';$allupdateidlem='';$allupdatetotac='';$allupdatebase64='';$allupdatecldtup='';$allupdatecldtdo='';$allupdateclddes='';$allinsertuserstats='';foreach($sqlhis as $userstats){try{$clientinfo=$ts3->clientInfoDb($userstats['cldbid']);if(isset($userdataweekend[$userstats['uuid']])&&isset($userdataweekbegin[$userstats['uuid']])){$count_week=$userdataweekend[$userstats['uuid']][0]['count'] - $userdataweekbegin[$userstats['uuid']][0]['count'];$idle_week=$userdataweekend[$userstats['uuid']][0]['idle'] - $userdataweekbegin[$userstats['uuid']][0]['idle'];}else{$count_week=0;$idle_week=0;}if(isset($userdatamonthend[$userstats['uuid']])&&isset($userdatamonthbegin[$userstats['uuid']])){$count_month=$userdatamonthend[$userstats['uuid']][0]['count'] - $userdatamonthbegin[$userstats['uuid']][0]['count'];$idle_month=$userdatamonthend[$userstats['uuid']][0]['idle'] - $userdatamonthbegin[$userstats['uuid']][0]['idle'];}else{$count_month=0;$idle_month=0;}$clientdesc=str_replace('\\','\\\\',htmlspecialchars($clientinfo['client_description'],ENT_QUOTES));if(isset($uidarrstats[$userstats['uuid']])){$allupdateuuid=$allupdateuuid."'".$userstats['uuid']."',";$allupdaterank=$allupdaterank."WHEN '".$userstats['uuid']."' THEN '".$userstats['rank']."' ";$allupdatecountw=$allupdatecountw."WHEN '".$userstats['uuid']."' THEN '".$count_week."' ";$allupdatecountm=$allupdatecountm."WHEN '".$userstats['uuid']."' THEN '".$count_month."' ";$allupdateidlew=$allupdateidlew."WHEN '".$userstats['uuid']."' THEN '".$idle_week."' ";$allupdateidlem=$allupdateidlem."WHEN '".$userstats['uuid']."' THEN '".$idle_month."' ";$allupdatetotac=$allupdatetotac."WHEN '".$userstats['uuid']."' THEN '".$clientinfo['client_totalconnections']."' ";$allupdatebase64=$allupdatebase64."WHEN '".$userstats['uuid']."' THEN '".$clientinfo['client_base64HashClientUID']."' ";$allupdatecldtup=$allupdatecldtup."WHEN '".$userstats['uuid']."' THEN '".$clientinfo['client_total_bytes_uploaded']."' ";$allupdatecldtdo=$allupdatecldtdo."WHEN '".$userstats['uuid']."' THEN '".$clientinfo['client_total_bytes_downloaded']."' ";$allupdateclddes=$allupdateclddes."WHEN '".$userstats['uuid']."' THEN '".$clientdesc."' ";}else{$allinsertuserstats=$allinsertuserstats."('".$userstats['uuid']."', '".$userstats['rank']."', '".$count_week."', '".$count_month."', '".$idle_week."', '".$idle_month."', '".$clientinfo['client_totalconnections']."', '".$clientinfo['client_base64HashClientUID']."', '".$clientinfo['client_total_bytes_uploaded']."', '".$clientinfo['client_total_bytes_downloaded']."', '".$clientdesc."'),";}}catch(Exception $e){}}if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp=$job_end WHERE job_name='calc_user_limit'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 11:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($allupdateuuid!=''){$allupdateuuid=substr($allupdateuuid,0,-1);if($mysqlcon->exec("UPDATE $dbname.stats_user set rank = CASE uuid $allupdaterank END, count_week = CASE uuid $allupdatecountw END, count_month = CASE uuid $allupdatecountm END, idle_week = CASE uuid $allupdateidlew END, idle_month = CASE uuid $allupdateidlem END, total_connections = CASE uuid $allupdatetotac END, base64hash = CASE uuid $allupdatebase64 END, client_total_up = CASE uuid $allupdatecldtup END, client_total_down = CASE uuid $allupdatecldtdo END, client_description = CASE uuid $allupdateclddes END WHERE uuid IN ($allupdateuuid)")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 12:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}if($allinsertuserstats!=''){$allinsertuserstats=substr($allinsertuserstats,0,-1);if($mysqlcon->exec("INSERT INTO $dbname.stats_user (uuid,rank,count_week,count_month,idle_week,idle_month,total_connections,base64hash,client_total_up,client_total_down,client_description) VALUES $allinsertuserstats")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 13:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}$buildtime=microtime(true)- $starttime;if($sqlerr==0){if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 14:",print_r($mysqlcon->errorInfo()),"\n";}}else{if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"calc_userstats 15:",print_r($mysqlcon->errorInfo()),"\n";}}}?> \ No newline at end of file +query("SELECT count(*) as count FROM ((SELECT u.uuid FROM $dbname.user AS u INNER JOIN $dbname.stats_user As s On u.uuid=s.uuid) UNION (SELECT u.uuid FROM $dbname.user AS u LEFT JOIN $dbname.stats_user As s On u.uuid=s.uuid WHERE s.uuid IS NULL)) x")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 1:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $count_user = $count_user->fetchAll(PDO::FETCH_ASSOC); + $total_user = $count_user[0]['count']; + + if(($job_begin = $mysqlcon->query("SELECT timestamp FROM $dbname.job_check WHERE job_name='calc_user_limit'")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 2:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $job_begin = $job_begin->fetchAll(); + $job_begin = $job_begin[0]['timestamp']; + $job_end = ceil($total_user / 10) * 10; + if ($job_begin >= $job_end) { + $job_begin = 0; + $job_end = 10; + } else { + $job_end = $job_begin + 10; + } + + if(($uuids = $mysqlcon->query("(SELECT u.uuid,u.rank,u.cldbid FROM $dbname.user AS u INNER JOIN $dbname.stats_user As s On u.uuid=s.uuid) UNION (SELECT u.uuid,u.rank,u.cldbid FROM $dbname.user AS u LEFT JOIN $dbname.stats_user As s On u.uuid=s.uuid WHERE s.uuid IS NULL) ORDER BY cldbid ASC LIMIT $job_begin, 10")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 3:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $uuids = $uuids->fetchAll(); + foreach($uuids as $uuid) { + $sqlhis[$uuid['uuid']] = array( + "uuid" => $uuid['uuid'], + "rank" => $uuid['rank'], + "cldbid" => $uuid['cldbid'] + ); + } + + // Calc Client Stats + if ($mysqlcon->exec("UPDATE $dbname.stats_user AS t LEFT JOIN $dbname.user AS u ON t.uuid=u.uuid SET t.removed='1' WHERE u.uuid IS NULL") === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 4:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + + if(($statsuserhis = $mysqlcon->query("SELECT uuid, removed FROM $dbname.stats_user")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 5:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $statsuserhis = $statsuserhis->fetchAll(); + foreach($statsuserhis as $userhis) { + $uidarrstats[$userhis['uuid']] = $userhis['removed']; + } + unset($statsuserhis); + + if(isset($sqlhis)) { + //enter_logfile($logpath,$timezone,2,"Update User Stats between ".$job_begin." and ".$job_end.":"); + if(($userdataweekbegin = $mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 6:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $userdataweekbegin = $userdataweekbegin->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC); + if(($userdataweekend = $mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 28) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 7:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $userdataweekend = $userdataweekend->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC); + if(($userdatamonthbegin = $mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MIN(s2.timestamp) AS value2 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 8:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $userdatamonthbegin = $userdatamonthbegin->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC); + if(($userdatamonthend = $mysqlcon->query("SELECT uuid,count,idle FROM $dbname.user_snapshot WHERE timestamp=(SELECT MAX(s2.timestamp) AS value1 FROM (SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 120) AS s2, $dbname.user_snapshot AS s1 WHERE s1.timestamp=s2.timestamp)")) === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 9:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $userdatamonthend = $userdatamonthend->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_ASSOC); + + $allupdateuuid = ''; + $allupdaterank = ''; + $allupdatecountw = ''; + $allupdatecountm = ''; + $allupdateidlew = ''; + $allupdateidlem = ''; + $allupdatetotac = ''; + $allupdatebase64 = ''; + $allupdatecldtup = ''; + $allupdatecldtdo = ''; + $allupdateclddes = ''; + $allinsertuserstats = ''; + + foreach ($sqlhis as $userstats) { + try { + $clientinfo = $ts3->clientInfoDb($userstats['cldbid']); + + if(isset($userdataweekend[$userstats['uuid']]) && isset($userdataweekbegin[$userstats['uuid']])) { + $count_week = $userdataweekend[$userstats['uuid']][0]['count'] - $userdataweekbegin[$userstats['uuid']][0]['count']; + $idle_week = $userdataweekend[$userstats['uuid']][0]['idle'] - $userdataweekbegin[$userstats['uuid']][0]['idle']; + } else { + $count_week = 0; + $idle_week = 0; + } + if(isset($userdatamonthend[$userstats['uuid']]) && isset($userdatamonthbegin[$userstats['uuid']])) { + $count_month = $userdatamonthend[$userstats['uuid']][0]['count'] - $userdatamonthbegin[$userstats['uuid']][0]['count']; + $idle_month = $userdatamonthend[$userstats['uuid']][0]['idle'] - $userdatamonthbegin[$userstats['uuid']][0]['idle']; + } else { + $count_month = 0; + $idle_month = 0; + } + $clientdesc = str_replace('\\', '\\\\', htmlspecialchars($clientinfo['client_description'], ENT_QUOTES)); + if(isset($uidarrstats[$userstats['uuid']])) { + $allupdateuuid = $allupdateuuid . "'" . $userstats['uuid'] . "',"; + $allupdaterank = $allupdaterank . "WHEN '" . $userstats['uuid'] . "' THEN '" . $userstats['rank'] . "' "; + $allupdatecountw = $allupdatecountw . "WHEN '" . $userstats['uuid'] . "' THEN '" . $count_week . "' "; + $allupdatecountm = $allupdatecountm . "WHEN '" . $userstats['uuid'] . "' THEN '" . $count_month . "' "; + $allupdateidlew = $allupdateidlew . "WHEN '" . $userstats['uuid'] . "' THEN '" . $idle_week . "' "; + $allupdateidlem = $allupdateidlem . "WHEN '" . $userstats['uuid'] . "' THEN '" . $idle_month . "' "; + $allupdatetotac = $allupdatetotac . "WHEN '" . $userstats['uuid'] . "' THEN '" . $clientinfo['client_totalconnections'] . "' "; + $allupdatebase64 = $allupdatebase64 . "WHEN '" . $userstats['uuid'] . "' THEN '" . $clientinfo['client_base64HashClientUID'] . "' "; + $allupdatecldtup = $allupdatecldtup . "WHEN '" . $userstats['uuid'] . "' THEN '" . $clientinfo['client_total_bytes_uploaded'] . "' "; + $allupdatecldtdo = $allupdatecldtdo . "WHEN '" . $userstats['uuid'] . "' THEN '" . $clientinfo['client_total_bytes_downloaded'] . "' "; + $allupdateclddes = $allupdateclddes . "WHEN '" . $userstats['uuid'] . "' THEN '" . $clientdesc . "' "; + } else { + $allinsertuserstats = $allinsertuserstats . "('" . $userstats['uuid'] . "', '" .$userstats['rank'] . "', '" . $count_week . "', '" . $count_month . "', '" . $idle_week . "', '" . $idle_month . "', '" . $clientinfo['client_totalconnections'] . "', '" . $clientinfo['client_base64HashClientUID'] . "', '" . $clientinfo['client_total_bytes_uploaded'] . "', '" . $clientinfo['client_total_bytes_downloaded'] . "', '" . $clientdesc . "'),"; + } + } catch (Exception $e) { + //error would be, when client is missing in ts db + } + } + + if ($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp=$job_end WHERE job_name='calc_user_limit'") === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 11:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + + if ($allupdateuuid != '') { + $allupdateuuid = substr($allupdateuuid, 0, -1); + if ($mysqlcon->exec("UPDATE $dbname.stats_user set rank = CASE uuid $allupdaterank END, count_week = CASE uuid $allupdatecountw END, count_month = CASE uuid $allupdatecountm END, idle_week = CASE uuid $allupdateidlew END, idle_month = CASE uuid $allupdateidlem END, total_connections = CASE uuid $allupdatetotac END, base64hash = CASE uuid $allupdatebase64 END, client_total_up = CASE uuid $allupdatecldtup END, client_total_down = CASE uuid $allupdatecldtdo END, client_description = CASE uuid $allupdateclddes END WHERE uuid IN ($allupdateuuid)") === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 12:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + if($allinsertuserstats != '') { + $allinsertuserstats = substr($allinsertuserstats, 0, -1); + if ($mysqlcon->exec("INSERT INTO $dbname.stats_user (uuid,rank,count_week,count_month,idle_week,idle_month,total_connections,base64hash,client_total_up,client_total_down,client_description) VALUES $allinsertuserstats") === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 13:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + + $buildtime = microtime(true) - $starttime; + if ($buildtime < 0) { $buildtime = 0; } + + if ($sqlerr == 0) { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 14:".print_r($mysqlcon->errorInfo())); + } + } else { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"calc_userstats 15:".print_r($mysqlcon->errorInfo())); + } + } +} +?> \ No newline at end of file diff --git a/jobs/check_db.php b/jobs/check_db.php index 0064b1e..d18888c 100644 --- a/jobs/check_db.php +++ b/jobs/check_db.php @@ -1 +1,239 @@ -setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Check Database for updates...";function set_new_version($mysqlcon,$dbname,$timezone){if($mysqlcon->exec("UPDATE $dbname.config set currvers='1.0.1'")===false){echo " [failed]\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"An error happens due updating the Ranksystem Database: ",print_r($mysqlcon->errorInfo()),"\nCheck the database connection properties in other/dbconfig.php and check also the database permissions.\n";exit;}else{echo " [done]\n";}}function check_chmod($timezone){if(substr(sprintf('%o',fileperms('./icons/')),-4)!='0777'){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Write Permissions failed on folder \"icons\". Please give them a chmod 777 and try to start the Ranksystem again.\n";}if(substr(sprintf('%o',fileperms('./logs/')),-4)!='0777'){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Write Permissions failed on folder \"logs\". Please give them a chmod 777 and try to start the Ranksystem again.\n";}if(substr(sprintf('%o',fileperms('./avatars/')),-4)!='0777'){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Write Permissions failed on folder \"avatars\". Please give them a chmod 777 and try to start the Ranksystem again.\n";}}function old_files($timezone){if(is_file('install.php')){if(!unlink('install.php')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: install.php\n";}}if(is_file('list_rankup.php')){if(!unlink('list_rankup.php')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: list_rankup.php\n";}}if(is_file('lang.php')){if(!unlink('lang.php')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: lang.php\n";}}if(is_file('license.txt')){if(!unlink('license.txt')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: license.txt\n";}}if(is_file('jquerylib/jquery.ajaxQueue.js')){if(!unlink('jquerylib/jquery.ajaxQueue.js')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/jquery.ajaxQueue.js\n";}}if(is_file('jquerylib/jquery.autocomplete.js')){if(!unlink('jquerylib/jquery.autocomplete.js')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/jquery.autocomplete.js\n";}}if(is_file('jquerylib/jquery.autocomplete.min.js')){if(!unlink('jquerylib/jquery.autocomplete.min.js')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/jquery.autocomplete.min.js\n";}}if(is_file('jquerylib/jquery.bgiframe.min.js')){if(!unlink('jquerylib/jquery.bgiframe.min.js')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/jquery.bgiframe.min.js\n";}}if(is_file('jquerylib/jquery.css')){if(!unlink('jquerylib/jquery.css')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/jquery.css\n";}}if(is_file('jquerylib/localdata.js')){if(!unlink('jquerylib/localdata.js')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/localdata.js\n";}}if(is_file('jquerylib/thickbox.css')){if(!unlink('jquerylib/thickbox.css')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/thickbox.css\n";}}if(is_file('jquerylib/thickbox-compressed.js')){if(!unlink('jquerylib/thickbox-compressed.js')){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Unnecessary file, please delete it from your webserver: jquerylib/thickbox-compressed.js\n";}}}if($currvers=="1.0.1"){echo " [done]\n";old_files($timezone);check_chmod($timezone);}elseif($currvers=="1.00"){set_new_version($mysqlcon,$dbname,$timezone);old_files($timezone);check_chmod($timezone);}elseif($currvers!="1.0.1"){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Update the Ranksystem Database to version 1.01...";$errcount=1;if($mysqlcon->exec("ALTER TABLE $dbname.user ADD (boosttime bigint(11) NOT NULL default '0', rank bigint(11) NOT NULL default '0', platform text default NULL, nation text default NULL, version text default NULL, firstcon bigint(11) NOT NULL default '0', except int(1) NOT NULL default '0')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"user\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("ALTER TABLE $dbname.config ADD (boost text default NULL, showcolas int(1) NOT NULL default '0', defchid bigint(11) NOT NULL default '0', timezone varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci, logpath varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci)")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"config\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}$logpath=addslashes(__DIR__."/logs/");if($mysqlcon->exec("ALTER TABLE $dbname.config MODIFY slowmode bigint(11) NOT NULL default '0'")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"config\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;if($mysqlcon->exec("UPDATE $dbname.config set defchid='0', timezome='Europe/Berlin', slowmode='0', logpath='$logpath'")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"config\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}}if($mysqlcon->exec("ALTER TABLE $dbname.groups ADD (icondate bigint(11) NOT NULL default '0')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"groups\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE TABLE $dbname.server_usage (timestamp bigint(11) NOT NULL default '0', clients bigint(11) NOT NULL default '0', channel bigint(11) NOT NULL default '0')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"server_usage\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE TABLE $dbname.user_snapshot (timestamp bigint(11) NOT NULL default '0', uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci, count bigint(11) NOT NULL default '0', idle bigint(11) NOT NULL default '0')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"user_snapshot\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE INDEX snapshot_timestamp ON $dbname.user_snapshot (timestamp)")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"snapshot_timestamp\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE TABLE $dbname.stats_server (total_user bigint(11) NOT NULL default '0', total_online_time bigint(13) NOT NULL default '0', total_online_month bigint(11) NOT NULL default '0', total_online_week bigint(11) NOT NULL default '0', total_active_time bigint(11) NOT NULL default '0', total_inactive_time bigint(11) NOT NULL default '0', country_nation_name_1 varchar(3) NOT NULL default '0', country_nation_name_2 varchar(3) NOT NULL default '0', country_nation_name_3 varchar(3) NOT NULL default '0', country_nation_name_4 varchar(3) NOT NULL default '0', country_nation_name_5 varchar(3) NOT NULL default '0', country_nation_1 bigint(11) NOT NULL default '0', country_nation_2 bigint(11) NOT NULL default '0', country_nation_3 bigint(11) NOT NULL default '0', country_nation_4 bigint(11) NOT NULL default '0', country_nation_5 bigint(11) NOT NULL default '0', country_nation_other bigint(11) NOT NULL default '0', platform_1 bigint(11) NOT NULL default '0', platform_2 bigint(11) NOT NULL default '0', platform_3 bigint(11) NOT NULL default '0', platform_4 bigint(11) NOT NULL default '0', platform_5 bigint(11) NOT NULL default '0', platform_other bigint(11) NOT NULL default '0', version_name_1 varchar(35) NOT NULL default '0', version_name_2 varchar(35) NOT NULL default '0', version_name_3 varchar(35) NOT NULL default '0', version_name_4 varchar(35) NOT NULL default '0', version_name_5 varchar(35) NOT NULL default '0', version_1 bigint(11) NOT NULL default '0', version_2 bigint(11) NOT NULL default '0', version_3 bigint(11) NOT NULL default '0', version_4 bigint(11) NOT NULL default '0', version_5 bigint(11) NOT NULL default '0', version_other bigint(11) NOT NULL default '0', server_status int(1) NOT NULL default '0', server_free_slots bigint(11) NOT NULL default '0', server_used_slots bigint(11) NOT NULL default '0', server_channel_amount bigint(11) NOT NULL default '0', server_ping bigint(11) NOT NULL default '0', server_packet_loss float (4,4), server_bytes_down bigint(11) NOT NULL default '0', server_bytes_up bigint(11) NOT NULL default '0', server_uptime bigint(11) NOT NULL default '0', server_id bigint(11) NOT NULL default '0', server_name text CHARACTER SET utf8 COLLATE utf8_unicode_ci, server_pass int(1) NOT NULL default '0', server_creation_date bigint(11) NOT NULL default '0', server_platform text CHARACTER SET utf8 COLLATE utf8_unicode_ci, server_weblist text CHARACTER SET utf8 COLLATE utf8_unicode_ci, server_version text CHARACTER SET utf8 COLLATE utf8_unicode_ci)")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"stats_server\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE TABLE $dbname.stats_user (uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY, removed int(1) NOT NULL default '0', rank bigint(11) NOT NULL default '0', total_connections bigint(11) NOT NULL default '0', count_week bigint(11) NOT NULL default '0', count_month bigint(11) NOT NULL default '0', idle_week bigint(11) NOT NULL default '0', idle_month bigint(11) NOT NULL default '0', achiev_count bigint(11) NOT NULL default '0', achiev_time bigint(11) NOT NULL default '0', achiev_connects bigint(11) NOT NULL default '0', achiev_battles bigint(11) NOT NULL default '0', achiev_time_perc int(3) NOT NULL default '0', achiev_connects_perc int(3) NOT NULL default '0', achiev_battles_perc int(3) NOT NULL default '0', battles_total bigint(11) NOT NULL default '0', battles_won bigint(11) NOT NULL default '0', battles_lost bigint(11) NOT NULL default '0', client_description text CHARACTER SET utf8 COLLATE utf8_unicode_ci, base64hash varchar(58) CHARACTER SET utf8 COLLATE utf8_unicode_ci, client_total_up bigint(15) NOT NULL default '0', client_total_down bigint(15) NOT NULL default '0')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"stats_user\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("INSERT INTO $dbname.stats_server SET total_user='9999'")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"stats_server\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE TABLE $dbname.job_check (job_name varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY, timestamp bigint(11) NOT NULL default '0')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"job_check\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("INSERT INTO $dbname.job_check (job_name) VALUES ('calc_user_limit'),('calc_user_lastscan'),('check_update'),('check_clean')")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"job_check\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if($mysqlcon->exec("CREATE TABLE $dbname.job_log (id bigint(11) AUTO_INCREMENT PRIMARY KEY, timestamp bigint(11) NOT NULL default '0', job_name varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci, status int(1) NOT NULL default '0', err_msg text CHARACTER SET utf8 COLLATE utf8_unicode_ci, runtime float (4,4))")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"job_log\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}if(($lastscan=$mysqlcon->query("SELECT timestamp FROM $dbname.lastscan"))===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"lastscan\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}else{$timestampls=$lastscan->fetchAll();$calc_user_lastscan=$timestampls[0]['timestamp'];if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$calc_user_lastscan' WHERE job_name='calc_user_lastscan'")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"job_check\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}elseif($mysqlcon->exec("DROP TABLE $dbname.lastscan")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"lastscan\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}}if(($lastupdate=$mysqlcon->query("SELECT timestamp FROM $dbname.upcheck"))===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"upcheck\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}else{$timestampuc=$lastupdate->fetchAll();$check_update=$timestampuc[0]['timestamp'];if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$check_update' WHERE job_name='check_update'")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"job_check\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}elseif($mysqlcon->exec("DROP TABLE $dbname.upcheck")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"upcheck\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}}if(($lastclean=$mysqlcon->query("SELECT timestamp FROM $dbname.cleanclients"))===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"upcheck\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}else{$timestamplc=$lastclean->fetchAll();$check_clean=$timestampls[0]['timestamp'];if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$check_clean' WHERE job_name='check_clean'")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"upcheck\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}elseif($mysqlcon->exec("DROP TABLE $dbname.cleanclients")===false){echo "\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"DB Update Error: table \"upcheck\" ",print_r($mysqlcon->errorInfo()),"\n";$errcount++;}}if($errcount==1){set_new_version($mysqlcon,$dbname,$timezone);old_files($timezone);check_chmod($timezone);}else{echo " [failed]\n",DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"An error happens due updating the Ranksystem Database!\nCheck the database connection properties in other/dbconfig.php and check also the database permissions.\n";exit;}}}?> \ No newline at end of file +exec("UPDATE $dbname.config set currvers='$newversion'") === false) { + enter_logfile($logpath,$timezone,1," An error happens due updating the Ranksystem Database:".print_r($mysqlcon->errorInfo())); + enter_logfile($logpath,$timezone,1," Check the database connection properties in other/dbconfig.php and check also the database permissions."); + exit; + } else { + $currvers = $newversion; + enter_logfile($logpath,$timezone,5," Database successfully updated!"); + return $currvers; + } + } + + function check_chmod($timezone) { + if (substr(sprintf('%o', fileperms(substr(__DIR__,0,-4).'icons/')), -4)!='0777') { + enter_logfile($logpath,$timezone,2,"Write Permissions failed on folder \"icons\". Please give them a chmod 777 and try to start the Ranksystem again."); + } + if (substr(sprintf('%o', fileperms(substr(__DIR__,0,-4).'logs/')), -4)!='0777') { + enter_logfile($logpath,$timezone,2,"Write Permissions failed on folder \"logs\". Please give them a chmod 777 and try to start the Ranksystem again."); + } + if (substr(sprintf('%o', fileperms(substr(__DIR__,0,-4).'avatars/')), -4)!='0777') { + enter_logfile($logpath,$timezone,2,"Write Permissions failed on folder \"avatars\". Please give them a chmod 777 and try to start the Ranksystem again."); + } + } + + function old_files($timezone) { + if(is_file(substr(__DIR__,0,-4).'install.php')) { + if(!unlink('install.php')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: install.php"); + } + } + if(is_file(substr(__DIR__,0,-4).'list_rankup.php')) { + if(!unlink(substr(__DIR__,0,-4).'list_rankup.php')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: list_rankup.php"); + } + } + if(is_file(substr(__DIR__,0,-4).'lang.php')) { + if(!unlink(substr(__DIR__,0,-4).'lang.php')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: lang.php"); + } + } + if(is_file(substr(__DIR__,0,-4).'license.txt')) { + if(!unlink(substr(__DIR__,0,-4).'license.txt')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: license.txt"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/jquery.ajaxQueue.js')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/jquery.ajaxQueue.js')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/jquery.ajaxQueue.js"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/jquery.autocomplete.js')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/jquery.autocomplete.js')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/jquery.autocomplete.js"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/jquery.autocomplete.min.js')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/jquery.autocomplete.min.js')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/jquery.autocomplete.min.js"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/jquery.bgiframe.min.js')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/jquery.bgiframe.min.js')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/jquery.bgiframe.min.js"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/jquery.css')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/jquery.css')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/jquery.css"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/localdata.js')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/localdata.js')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/localdata.js"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/thickbox.css')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/thickbox.css')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/thickbox.css"); + } + } + if(is_file(substr(__DIR__,0,-4).'jquerylib/thickbox-compressed.js')) { + if(!unlink(substr(__DIR__,0,-4).'jquerylib/thickbox-compressed.js')) { + enter_logfile($logpath,$timezone,4,"Unnecessary file, please delete it from your webserver: jquerylib/thickbox-compressed.js"); + } + } + } + + if($currvers==$newversion) { + enter_logfile($logpath,$timezone,5," No newer version detected; Database check finished."); + old_files($timezone); + check_chmod($timezone); + } elseif($currvers=="0.13-beta") { + enter_logfile($logpath,$timezone,5," Update the Ranksystem Database to version 1.01."); + + $errcount=1; + + if($mysqlcon->exec("ALTER TABLE $dbname.user ADD (boosttime bigint(11) NOT NULL default '0', rank bigint(11) NOT NULL default '0', platform text default NULL, nation text default NULL, version text default NULL, firstcon bigint(11) NOT NULL default '0', except int(1) NOT NULL default '0')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"user\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("ALTER TABLE $dbname.config ADD (boost text default NULL, showcolas int(1) NOT NULL default '0', defchid bigint(11) NOT NULL default '0', timezone varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci, logpath varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci)") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"config\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + $logpath = addslashes(__DIR__."/logs/"); + if($mysqlcon->exec("ALTER TABLE $dbname.config MODIFY slowmode bigint(11) NOT NULL default '0'") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"config\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + if($mysqlcon->exec("UPDATE $dbname.config set defchid='0', timezome='Europe/Berlin', slowmode='0', logpath='$logpath'") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"config\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + } + + if($mysqlcon->exec("ALTER TABLE $dbname.groups ADD (icondate bigint(11) NOT NULL default '0')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"groups\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE TABLE $dbname.server_usage (timestamp bigint(11) NOT NULL default '0', clients bigint(11) NOT NULL default '0', channel bigint(11) NOT NULL default '0')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"server_usage\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE TABLE $dbname.user_snapshot (timestamp bigint(11) NOT NULL default '0', uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci, count bigint(11) NOT NULL default '0', idle bigint(11) NOT NULL default '0')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"user_snapshot\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE INDEX snapshot_timestamp ON $dbname.user_snapshot (timestamp)") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"snapshot_timestamp\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE INDEX serverusage_timestamp ON $dbname.server_usage (timestamp)") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"snapshot_timestamp\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE TABLE $dbname.stats_server (total_user bigint(11) NOT NULL default '0', total_online_time bigint(13) NOT NULL default '0', total_online_month bigint(11) NOT NULL default '0', total_online_week bigint(11) NOT NULL default '0', total_active_time bigint(11) NOT NULL default '0', total_inactive_time bigint(11) NOT NULL default '0', country_nation_name_1 varchar(3) NOT NULL default '0', country_nation_name_2 varchar(3) NOT NULL default '0', country_nation_name_3 varchar(3) NOT NULL default '0', country_nation_name_4 varchar(3) NOT NULL default '0', country_nation_name_5 varchar(3) NOT NULL default '0', country_nation_1 bigint(11) NOT NULL default '0', country_nation_2 bigint(11) NOT NULL default '0', country_nation_3 bigint(11) NOT NULL default '0', country_nation_4 bigint(11) NOT NULL default '0', country_nation_5 bigint(11) NOT NULL default '0', country_nation_other bigint(11) NOT NULL default '0', platform_1 bigint(11) NOT NULL default '0', platform_2 bigint(11) NOT NULL default '0', platform_3 bigint(11) NOT NULL default '0', platform_4 bigint(11) NOT NULL default '0', platform_5 bigint(11) NOT NULL default '0', platform_other bigint(11) NOT NULL default '0', version_name_1 varchar(35) NOT NULL default '0', version_name_2 varchar(35) NOT NULL default '0', version_name_3 varchar(35) NOT NULL default '0', version_name_4 varchar(35) NOT NULL default '0', version_name_5 varchar(35) NOT NULL default '0', version_1 bigint(11) NOT NULL default '0', version_2 bigint(11) NOT NULL default '0', version_3 bigint(11) NOT NULL default '0', version_4 bigint(11) NOT NULL default '0', version_5 bigint(11) NOT NULL default '0', version_other bigint(11) NOT NULL default '0', server_status int(1) NOT NULL default '0', server_free_slots bigint(11) NOT NULL default '0', server_used_slots bigint(11) NOT NULL default '0', server_channel_amount bigint(11) NOT NULL default '0', server_ping bigint(11) NOT NULL default '0', server_packet_loss float (4,4), server_bytes_down bigint(11) NOT NULL default '0', server_bytes_up bigint(11) NOT NULL default '0', server_uptime bigint(11) NOT NULL default '0', server_id bigint(11) NOT NULL default '0', server_name text CHARACTER SET utf8 COLLATE utf8_unicode_ci, server_pass int(1) NOT NULL default '0', server_creation_date bigint(11) NOT NULL default '0', server_platform text CHARACTER SET utf8 COLLATE utf8_unicode_ci, server_weblist text CHARACTER SET utf8 COLLATE utf8_unicode_ci, server_version text CHARACTER SET utf8 COLLATE utf8_unicode_ci)") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"stats_server\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE TABLE $dbname.stats_user (uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY, removed int(1) NOT NULL default '0', rank bigint(11) NOT NULL default '0', total_connections bigint(11) NOT NULL default '0', count_week bigint(11) NOT NULL default '0', count_month bigint(11) NOT NULL default '0', idle_week bigint(11) NOT NULL default '0', idle_month bigint(11) NOT NULL default '0', achiev_count bigint(11) NOT NULL default '0', achiev_time bigint(11) NOT NULL default '0', achiev_connects bigint(11) NOT NULL default '0', achiev_battles bigint(11) NOT NULL default '0', achiev_time_perc int(3) NOT NULL default '0', achiev_connects_perc int(3) NOT NULL default '0', achiev_battles_perc int(3) NOT NULL default '0', battles_total bigint(11) NOT NULL default '0', battles_won bigint(11) NOT NULL default '0', battles_lost bigint(11) NOT NULL default '0', client_description text CHARACTER SET utf8 COLLATE utf8_unicode_ci, base64hash varchar(58) CHARACTER SET utf8 COLLATE utf8_unicode_ci, client_total_up bigint(15) NOT NULL default '0', client_total_down bigint(15) NOT NULL default '0')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"stats_user\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("INSERT INTO $dbname.stats_server SET total_user='9999'") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"stats_server\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE TABLE $dbname.job_check (job_name varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY, timestamp bigint(11) NOT NULL default '0')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"job_check\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("INSERT INTO $dbname.job_check (job_name) VALUES ('calc_user_limit'),('calc_user_lastscan'),('check_update'),('check_clean')") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"job_check\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if($mysqlcon->exec("CREATE TABLE $dbname.job_log (id bigint(11) AUTO_INCREMENT PRIMARY KEY, timestamp bigint(11) NOT NULL default '0', job_name varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci, status int(1) NOT NULL default '0', err_msg text CHARACTER SET utf8 COLLATE utf8_unicode_ci, runtime float (4,4))") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"job_log\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + + if(($lastscan = $mysqlcon->query("SELECT timestamp FROM $dbname.lastscan")) === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"lastscan\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } else { + $timestampls = $lastscan->fetchAll(); + $calc_user_lastscan = $timestampls[0]['timestamp']; + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$calc_user_lastscan' WHERE job_name='calc_user_lastscan'") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"job_check\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } elseif($mysqlcon->exec("DROP TABLE $dbname.lastscan") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"lastscan\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + } + + if(($lastupdate = $mysqlcon->query("SELECT timestamp FROM $dbname.upcheck")) === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"upcheck\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } else { + $timestampuc = $lastupdate->fetchAll(); + $check_update = $timestampuc[0]['timestamp']; + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$check_update' WHERE job_name='check_update'") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"job_check\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } elseif($mysqlcon->exec("DROP TABLE $dbname.upcheck") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"upcheck\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + } + + if(($lastclean = $mysqlcon->query("SELECT timestamp FROM $dbname.cleanclients")) === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"upcheck\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } else { + $timestamplc = $lastclean->fetchAll(); + $check_clean = $timestampls[0]['timestamp']; + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$check_clean' WHERE job_name='check_clean'") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"upcheck\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } elseif($mysqlcon->exec("DROP TABLE $dbname.cleanclients") === false) { + enter_logfile($logpath,$timezone,1,"DB Update Error: table \"upcheck\" ".print_r($mysqlcon->errorInfo())); + $errcount++; + } + } + + if ($errcount == 1) { + $currvers = set_new_version($mysqlcon,$dbname,$timezone,$newversion,$logpath); + old_files($timezone); + check_chmod($timezone); + } else { + enter_logfile($logpath,$timezone,1,"An error happens due updating the Ranksystem Database!"); + enter_logfile($logpath,$timezone,1,"Check the database connection properties in other/dbconfig.php and check also the database permissions."); + exit; + } + } else { + if($mysqlcon->exec("CREATE INDEX serverusage_timestamp ON $dbname.server_usage (timestamp)") === false) { } + $currvers = set_new_version($mysqlcon,$dbname,$timezone,$newversion,$logpath); + old_files($timezone); + check_chmod($timezone); + } + return $currvers; +} +?> \ No newline at end of file diff --git a/jobs/clean.php b/jobs/clean.php index 748c1da..fb0b3ab 100644 --- a/jobs/clean.php +++ b/jobs/clean.php @@ -1 +1,119 @@ -query("DELETE a FROM $dbname.job_log AS a CROSS JOIN(SELECT id FROM $dbname.job_log ORDER BY id DESC LIMIT 1 OFFSET 1000) AS b WHERE b.id>a.id")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 1:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($mysqlcon->query("DELETE a FROM $dbname.user_snapshot AS a CROSS JOIN(SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 1000 OFFSET 121) AS b WHERE a.timestamp=b.timestamp")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 2:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($cleanclients==1){$cleantime=$nowtime - $cleanperiod;if(($lastclean=$mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='check_clean'"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 3:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$lastclean=$lastclean->fetchAll();if(($dbuserdata=$mysqlcon->query("SELECT uuid FROM $dbname.user"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 4:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}$countrs=$dbuserdata->rowCount();$uuids=$dbuserdata->fetchAll();if($lastclean[0]['timestamp']<$cleantime){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['clean'],"\n";$start=0;$break=200;$clientdblist=array();$countdel=0;$countts=0;while($getclientdblist=$ts3->clientListDb($start,$break)){$clientdblist=array_merge($clientdblist,$getclientdblist);$start=$start+$break;$count_tsuser=array_shift($getclientdblist);if($start==100000||$count_tsuser['count']<=$start){break;}check_shutdown($timezone);usleep($slowmode);}foreach($clientdblist as $uuidts){$single_uuid=$uuidts['client_unique_identifier']->toString();$uidarrts[$single_uuid]=1;}unset($clientdblist);foreach($uuids as $uuid){if(isset($uidarrts[$uuid[0]])){$countts++;}else{$deleteuuids[]=$uuid[0];$countdel++;}}unset($uidarrts);echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['cleants'],$countts,$count_tsuser['count']),"\n";echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['cleanrs'],$countrs),"\n";if(isset($deleteuuids)){$alldeldata='';foreach($deleteuuids as $dellarr){$alldeldata=$alldeldata."'".$dellarr."',";}$alldeldata=substr($alldeldata,0,-1);$alldeldata="(".$alldeldata.")";if($alldeldata!=''){if($mysqlcon->exec("DELETE FROM $dbname.user WHERE uuid IN $alldeldata")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 5:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}else{echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),sprintf($lang['cleandel'],$countdel),"\n";if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$nowtime' WHERE job_name='check_clean'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 6:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}}else{echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),$lang['cleanno'],"\n";if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$nowtime' WHERE job_name='check_clean'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 7:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}}$buildtime=microtime(true)- $starttime;if($sqlerr==0){if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 8:",print_r($mysqlcon->errorInfo()),"\n";}}else{if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"clean 9:",print_r($mysqlcon->errorInfo()),"\n";}}}?> \ No newline at end of file +query("DELETE a FROM $dbname.job_log AS a CROSS JOIN(SELECT id FROM $dbname.job_log ORDER BY id DESC LIMIT 1 OFFSET 1000) AS b WHERE b.id>a.id") === false) { + enter_logfile($logpath,$timezone,2,"clean 1:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + + // clean usersnaps older then 1 month + if($mysqlcon->query("DELETE a FROM $dbname.user_snapshot AS a CROSS JOIN(SELECT DISTINCT(timestamp) FROM $dbname.user_snapshot ORDER BY timestamp DESC LIMIT 1000 OFFSET 121) AS b WHERE a.timestamp=b.timestamp") === false) { + enter_logfile($logpath,$timezone,2,"clean 2:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + + // clean old clients out of the database + if ($cleanclients == 1) { + $cleantime = $nowtime - $cleanperiod; + if(($lastclean = $mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='check_clean'")) === false) { + enter_logfile($logpath,$timezone,2,"clean 3:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $lastclean = $lastclean->fetchAll(); + if(($dbuserdata = $mysqlcon->query("SELECT uuid FROM $dbname.user")) === false) { + enter_logfile($logpath,$timezone,2,"clean 4:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + $countrs = $dbuserdata->rowCount(); + $uuids = $dbuserdata->fetchAll(); + if ($lastclean[0]['timestamp'] < $cleantime) { + enter_logfile($logpath,$timezone,5,$lang['clean']); + $start=0; + $break=200; + $clientdblist=array(); + $countdel=0; + $countts=0; + while($getclientdblist=$ts3->clientListDb($start, $break)) { + $clientdblist=array_merge($clientdblist, $getclientdblist); + $start=$start+$break; + $count_tsuser=array_shift($getclientdblist); + if ($start == 100000 || $count_tsuser['count'] <= $start) { + break; + } + check_shutdown($timezone); usleep($slowmode); + } + foreach($clientdblist as $uuidts) { + $single_uuid = $uuidts['client_unique_identifier']->toString(); + $uidarrts[$single_uuid]= 1; + } + unset($clientdblist); + + foreach($uuids as $uuid) { + if(isset($uidarrts[$uuid[0]])) { + $countts++; + } else { + $deleteuuids[] = $uuid[0]; + $countdel++; + } + } + + unset($uidarrts); + enter_logfile($logpath,$timezone,5," ".sprintf($lang['cleants'], $countts, $count_tsuser['count'])); + enter_logfile($logpath,$timezone,5," ".sprintf($lang['cleanrs'], $countrs)); + + if(isset($deleteuuids)) { + $alldeldata = ''; + foreach ($deleteuuids as $dellarr) { + $alldeldata = $alldeldata . "'" . $dellarr . "',"; + } + $alldeldata = substr($alldeldata, 0, -1); + $alldeldata = "(".$alldeldata.")"; + if ($alldeldata != '') { + if($mysqlcon->exec("DELETE FROM $dbname.user WHERE uuid IN $alldeldata") === false) { + enter_logfile($logpath,$timezone,2,"clean 5:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } else { + enter_logfile($logpath,$timezone,5," ".sprintf($lang['cleandel'], $countdel)); + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$nowtime' WHERE job_name='check_clean'") === false) { + enter_logfile($logpath,$timezone,2,"clean 6:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + } else { + enter_logfile($logpath,$timezone,2," ".$lang['cleanno']); + if($mysqlcon->exec("UPDATE $dbname.job_check SET timestamp='$nowtime' WHERE job_name='check_clean'") === false) { + enter_logfile($logpath,$timezone,2,"clean 7:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + } + + $buildtime = microtime(true) - $starttime; + if ($buildtime < 0) { $buildtime = 0; } + + if ($sqlerr == 0) { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"clean 8:".print_r($mysqlcon->errorInfo())); + } + } else { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"clean 9:".print_r($mysqlcon->errorInfo())); + } + } +} +?> \ No newline at end of file diff --git a/jobs/get_avatars.php b/jobs/get_avatars.php index fc94402..8f6bc12 100644 --- a/jobs/get_avatars.php +++ b/jobs/get_avatars.php @@ -1 +1,66 @@ -channelFileList($cid="0",$cpw="",$path="/");}catch(Exception $e){if($e->getCode()!=1281){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"get_avatars 1:",$e->getCode(),': ',"Error by getting Avatarlist: ",$e->getMessage(),"\n";$sqlmsg.=$e->getCode().': '."Error by getting Avatarlist: ".$e->getMessage();$sqlerr++;}}$fsfilelist=opendir(substr(__DIR__,0,-4).'avatars/');while(false!==($fsfile=readdir($fsfilelist))){if($fsfile!='.'&&$fsfile!='..'){$fsfilelistarray[$fsfile]=filemtime(substr(__DIR__,0,-4).'avatars/'.$fsfile);}}if(isset($tsfilelist)){foreach($tsfilelist as $tsfile){$fullfilename='/'.$tsfile['name'];$uuidasbase16=substr($tsfile['name'],7);if(!isset($fsfilelistarray[$uuidasbase16.'.png'])||$tsfile['datetime']>$fsfilelistarray[$uuidasbase16.'.png']){if(substr($tsfile['name'],0,7)=='avatar_'){try{check_shutdown($timezone);usleep($slowmode);$avatar=$ts3->transferInitDownload($clientftfid="5",$cid="0",$name=$fullfilename,$cpw="",$seekpos=0);$transfer=TeamSpeak3::factory("filetransfer://".$avatar["host"].":".$avatar["port"]);$tsfile=$transfer->download($avatar["ftkey"],$avatar["size"]);$avatarfilepath=substr(__DIR__,0,-4).'avatars/'.$uuidasbase16.'.png';echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Download avatar: ",$fullfilename,"\n";file_put_contents($avatarfilepath,$tsfile);$count++;}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"get_avatars 2:",$e->getCode(),': ',"Error by download Avatar: ",$e->getMessage(),"\n";$sqlmsg.=$e->getCode().': '."Error by download Avatar: ".$e->getMessage();$sqlerr++;}}}}}$buildtime=microtime(true)- $starttime;if($sqlerr==0){if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"get_avatars 3:",print_r($mysqlcon->errorInfo()),"\n";}}else{if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"get_avatars 4:",print_r($mysqlcon->errorInfo()),"\n";}}}?> \ No newline at end of file +channelFileList($cid="0", $cpw="", $path="/"); + } catch (Exception $e) { + if ($e->getCode() != 1281) { + enter_logfile($logpath,$timezone,2,"get_avatars 1:".$e->getCode().': '."Error while getting avatarlist: ".$e->getMessage()); + $sqlmsg .= $e->getCode() . ': ' . "Error while getting avatarlist: " . $e->getMessage(); + $sqlerr++; + } + } + $fsfilelist = opendir(substr(__DIR__,0,-4).'avatars/'); + while (false !== ($fsfile = readdir($fsfilelist))) { + if ($fsfile != '.' && $fsfile != '..') { + $fsfilelistarray[$fsfile] = filemtime(substr(__DIR__,0,-4).'avatars/'.$fsfile); + } + } + + if (isset($tsfilelist)) { + foreach($tsfilelist as $tsfile) { + $fullfilename = '/'.$tsfile['name']; + $uuidasbase16 = substr($tsfile['name'],7); + if (!isset($fsfilelistarray[$uuidasbase16.'.png']) || $tsfile['datetime']>$fsfilelistarray[$uuidasbase16.'.png']) { + if (substr($tsfile['name'],0,7) == 'avatar_') { + try { + check_shutdown($timezone); usleep($slowmode); + $avatar = $ts3->transferInitDownload($clientftfid="5",$cid="0",$name=$fullfilename,$cpw="", $seekpos=0); + $transfer = TeamSpeak3::factory("filetransfer://" . $avatar["host"] . ":" . $avatar["port"]); + $tsfile = $transfer->download($avatar["ftkey"], $avatar["size"]); + $avatarfilepath = substr(__DIR__,0,-4).'avatars/'.$uuidasbase16.'.png'; + enter_logfile($logpath,$timezone,5,"Download avatar: ".$fullfilename); + if(file_put_contents($avatarfilepath, $tsfile) === false) { + enter_logfile($logpath,$timezone,2,"Error while writing out the avatar. Please check the permission for the folder 'avatars'"); + } + $count++; + } + catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"get_avatars 2:".$e->getCode().': '."Error while downloading avatar: ".$e->getMessage()); + $sqlmsg .= $e->getCode() . ': ' . "Error while downloading avatar: " . $e->getMessage(); + $sqlerr++; + } + } + } + } + } + + $buildtime = microtime(true) - $starttime; + if ($buildtime < 0) { $buildtime = 0; } + + if ($sqlerr == 0) { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"get_avatars 3:".print_r($mysqlcon->errorInfo())); + } + } else { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"get_avatars 4:".print_r($mysqlcon->errorInfo())); + } + } +} +?> \ No newline at end of file diff --git a/jobs/update_groups.php b/jobs/update_groups.php index 37d3ddd..58364fa 100644 --- a/jobs/update_groups.php +++ b/jobs/update_groups.php @@ -1 +1,212 @@ -channelFileList($cid="0",$cpw="",$path="/icons/");}catch(Exception $e){if($e->getCode()!=1281){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 1:",$e->getCode(),': ',"Error by getting servergrouplist: ",$e->getMessage(),"\n";$sqlmsg.=$e->getCode().': '."Error by getting servergrouplist: ".$e->getMessage();$sqlerr++;}}foreach($iconlist as $icon){$iconid="i".substr($icon['name'],5);$iconarr[$iconid]=$icon['datetime'];}try{check_shutdown($timezone);usleep($slowmode);$ts3->serverGroupListReset();$ts3groups=$ts3->serverGroupList();}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 2:",$e->getCode(),': ',"Error by getting servergrouplist: ",$e->getMessage(),"\n";$sqlmsg.=$e->getCode().': '."Error by getting servergrouplist: ".$e->getMessage();$sqlerr++;}if(($dbgroups=$mysqlcon->query("SELECT * FROM $dbname.groups"))===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 3:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}if($dbgroups->rowCount()==0){$sqlhisgroup="empty";}else{$servergroups=$dbgroups->fetchAll(PDO::FETCH_ASSOC);foreach($servergroups as $servergroup){$sqlhisgroup[$servergroup['sgid']]=array("sgid"=>$servergroup['sgid'],"iconid"=>$servergroup['iconid'],"sgidname"=>$servergroup['sgidname'],"icondate"=>$servergroup['icondate']);}}$sIconId=$serverinfo['virtualserver_icon_id'];$sIconId=($sIconId<0)?(pow(2,32))-($sIconId * -1):$sIconId;$sIconFile=0;if(!isset($sqlhisgroup['0'])||$sqlhisgroup['0']['iconid']!=$sIconId||$iconarr["i".$sIconId]>$sqlhisgroup['0']['icondate']){if($sIconId>600){try{check_shutdown($timezone);usleep($slowmode);echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Download new ServerIcon\n";$sIconFile=$ts3->iconDownload();file_put_contents(substr(dirname(__FILE__),0,-4)."icons/servericon.png",$sIconFile);}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 4:",$e->getCode(),': ',"Error by downloading Icon: ",$e->getMessage(),"\n";$sqlmsg.=$e->getCode().': '."Error by downloading Icon: ".$e->getMessage();$sqlerr++;}}if(!isset($sqlhisgroup['0'])){$insertgroups[]=array("sgid"=>"0","sgidname"=>"ServerIcon","iconid"=>$sIconId,"icon"=>$sIconFile,"icondate"=>$iconarr["i".$sIconId]);}else{$updategroups[]=array("sgid"=>"0","sgidname"=>"ServerIcon","iconid"=>$sIconId,"icon"=>$sIconFile,"icondate"=>$iconarr["i".$sIconId]);}}foreach($ts3groups as $servergroup){$tsgroupids[]=$servergroup['sgid'];$sgid=$servergroup['sgid'];$sgname=str_replace('\\','\\\\',htmlspecialchars($servergroup['name'],ENT_QUOTES));$gefunden=2;$iconid=$servergroup['iconid'];$iconid=($iconid<0)?(pow(2,32))-($iconid * -1):$iconid;$iconfile=0;if($iconid>600){if(!isset($sqlhisgroup[$sgid])||$sqlhisgroup[$sgid]['iconid']!=$iconid||$iconarr["i".$iconid]>$sqlhisgroup[$sgid]['icondate']){try{echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"Download new ServerGroupIcon for group ",$sgname," with ID: ",$sgid,"\n";$iconfile=$servergroup->iconDownload();file_put_contents(substr(dirname(__FILE__),0,-4)."icons/".$sgid.".png",$iconfile);}catch(Exception $e){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 5:",$e->getCode(),': ',"Error by downloading Icon: ",$e->getMessage(),"\n";$sqlmsg.=$e->getCode().': '."Error by downloading Icon: ".$e->getMessage();$sqlerr++;}}}if($sqlhisgroup!="empty"){foreach($sqlhisgroup as $groups){if($groups['sgid']==$sgid){$gefunden=1;$updategroups[]=array("sgid"=>$sgid,"sgidname"=>$sgname,"iconid"=>$iconid,"icon"=>$iconfile,"icondate"=>$iconarr["i".$iconid]);break;}}if($gefunden!=1){$insertgroups[]=array("sgid"=>$servergroup['sgid'],"sgidname"=>$sgname,"iconid"=>$iconid,"icon"=>$iconfile,"icondate"=>$iconarr["i".$iconid]);}}else{$insertgroups[]=array("sgid"=>$servergroup['sgid'],"sgidname"=>$sgname,"iconid"=>$iconid,"icon"=>$iconfile,"icondate"=>$iconarr["i".$iconid]);}}if(isset($insertgroups)){$allinsertdata='';foreach($insertgroups as $insertarr){$allinsertdata=$allinsertdata."('".$insertarr['sgid']."', '".$insertarr['sgidname']."', '".$insertarr['iconid']."', '".$insertarr['icondate']."'),";}$allinsertdata=substr($allinsertdata,0,-1);if($allinsertdata!=''){if($mysqlcon->exec("INSERT INTO $dbname.groups (sgid, sgidname, iconid, icondate) VALUES $allinsertdata")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 6:",$allinsertdata,print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}}if(isset($updategroups)){$allsgids='';$allupdatesgid='';$allupdateiconid='';$allupdatedate='';foreach($updategroups as $updatedata){$allsgids=$allsgids."'".$updatedata['sgid']."',";$allupdatesgid=$allupdatesgid."WHEN '".$updatedata['sgid']."' THEN '".$updatedata['sgidname']."' ";$allupdateiconid=$allupdateiconid."WHEN '".$updatedata['sgid']."' THEN '".$updatedata['iconid']."' ";$allupdatedate=$allupdatedate."WHEN '".$updatedata['sgid']."' THEN '".$updatedata['icondate']."' ";}$allsgids=substr($allsgids,0,-1);if($mysqlcon->exec("UPDATE $dbname.groups set sgidname = CASE sgid $allupdatesgid END, iconid = CASE sgid $allupdateiconid END, icondate = CASE sgid $allupdatedate END WHERE sgid IN ($allsgids)")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 7:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}if(isset($sqlhisgroup)){foreach($sqlhisgroup as $groups){if(!in_array($groups['sgid'],$tsgroupids)&&$groups['sgid']!=0){$delsgroupids=$delsgroupids."'".$groups['sgid']."',";}}}if(isset($delsgroupids)){$delsgroupids=substr($delsgroupids,0,-1);if($mysqlcon->exec("DELETE FROM groups WHERE sgid IN ($delsgroupids)")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 8:",print_r($mysqlcon->errorInfo()),"\n";$sqlmsg.=print_r($mysqlcon->errorInfo());$sqlerr++;}}$buildtime=microtime(true)- $starttime;if($sqlerr==0){if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 9:",print_r($mysqlcon->errorInfo()),"\n";}}else{if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'")===false){echo DateTime::createFromFormat('U.u',number_format(microtime(true),6,'.',''))->setTimeZone(new DateTimeZone($timezone))->format("Y-m-d H:i:s.u "),"update_groups 10:",print_r($mysqlcon->errorInfo()),"\n";}}}?> \ No newline at end of file +channelFileList($cid="0", $cpw="", $path="/icons/"); + } catch (Exception $e) { + if ($e->getCode() != 1281) { + enter_logfile($logpath,$timezone,2,"update_groups 1:".$e->getCode().': '."Error while getting servergrouplist: ".$e->getMessage()); + $sqlmsg .= $e->getCode() . ': ' . "Error by getting servergrouplist: " . $e->getMessage(); + $sqlerr++; + } + } + + foreach($iconlist as $icon) { + $iconid = "i".substr($icon['name'], 5); + $iconarr[$iconid] = $icon['datetime']; + } + + try { + check_shutdown($timezone); usleep($slowmode); + $ts3->serverGroupListReset(); + $ts3groups = $ts3->serverGroupList(); + } catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"update_groups 2:".$e->getCode().': '."Error while getting servergrouplist: ".$e->getMessage()); + $sqlmsg .= $e->getCode() . ': ' . "Error by getting servergrouplist: " . $e->getMessage(); + $sqlerr++; + } + + if(($dbgroups = $mysqlcon->query("SELECT * FROM $dbname.groups")) === false) { + enter_logfile($logpath,$timezone,2,"update_groups 3:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + if ($dbgroups->rowCount() == 0) { + $sqlhisgroup = "empty"; + } else { + $servergroups = $dbgroups->fetchAll(PDO::FETCH_ASSOC); + foreach($servergroups as $servergroup) { + $sqlhisgroup[$servergroup['sgid']] = array ( + "sgid" => $servergroup['sgid'], + "iconid" => $servergroup['iconid'], + "sgidname" => $servergroup['sgidname'], + "icondate" => $servergroup['icondate'] + ); + } + } + + // ServerIcon + $sIconId = $serverinfo['virtualserver_icon_id']; + $sIconId = ($sIconId < 0) ? (pow(2, 32)) - ($sIconId * -1) : $sIconId; + $sIconFile = 0; + if (!isset($sqlhisgroup['0']) || $sqlhisgroup['0']['iconid'] != $sIconId || $iconarr["i".$sIconId] > $sqlhisgroup['0']['icondate']) { + if($sIconId > 600) { + try { + check_shutdown($timezone); usleep($slowmode); + enter_logfile($logpath,$timezone,5,"Download new ServerIcon"); + $sIconFile = $ts3->iconDownload(); + if(file_put_contents(substr(dirname(__FILE__),0,-4) . "icons/servericon.png", $sIconFile) === false) { + enter_logfile($logpath,$timezone,2,"Error while writing out the servericon. Please check the permission for the folder 'icons'"); + } + } catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"update_groups 4:".$e->getCode().': '."Error while downloading servericon: ".$e->getMessage()); + $sqlmsg .= $e->getCode() . ': ' . "Error while downloading servericon: " . $e->getMessage(); + $sqlerr++; + } + } + if (!isset($sqlhisgroup['0'])) { + $insertgroups[] = array( + "sgid" => "0", + "sgidname" => "ServerIcon", + "iconid" => $sIconId, + "icon" => $sIconFile, + "icondate" => $iconarr["i".$sIconId] + ); + } else { + $updategroups[] = array( + "sgid" => "0", + "sgidname" => "ServerIcon", + "iconid" => $sIconId, + "icon" => $sIconFile, + "icondate" => $iconarr["i".$sIconId] + ); + } + } + + // GroupIcons + foreach ($ts3groups as $servergroup) { + $tsgroupids[] = $servergroup['sgid']; + $sgid = $servergroup['sgid']; + $sgname = str_replace('\\', '\\\\', htmlspecialchars($servergroup['name'], ENT_QUOTES)); + $gefunden = 2; + $iconid = $servergroup['iconid']; + $iconid = ($iconid < 0) ? (pow(2, 32)) - ($iconid * -1) : $iconid; + $iconfile = 0; + if($iconid > 600) { + if (!isset($sqlhisgroup[$sgid]) || $sqlhisgroup[$sgid]['iconid'] != $iconid || $iconarr["i".$iconid] > $sqlhisgroup[$sgid]['icondate']) { + try { + enter_logfile($logpath,$timezone,5,"Download new ServerGroupIcon for group ".$sgname." with ID: ".$sgid); + $iconfile = $servergroup->iconDownload(); + if(file_put_contents(substr(dirname(__FILE__),0,-4) . "icons/" . $sgid . ".png", $iconfile) === false) { + enter_logfile($logpath,$timezone,2,"Error while writing out the servergroup icon. Please check the permission for the folder 'icons'"); + } + } catch (Exception $e) { + enter_logfile($logpath,$timezone,2,"update_groups 5:".$e->getCode().': '."Error while downloading servergroup icon: ".$e->getMessage()); + $sqlmsg .= $e->getCode() . ': ' . "Error while downloading servergroup icon: " . $e->getMessage(); + $sqlerr++; + } + } + } + if ($sqlhisgroup != "empty") { + foreach ($sqlhisgroup as $groups) { + if ($groups['sgid'] == $sgid) { + $gefunden = 1; + $updategroups[] = array( + "sgid" => $sgid, + "sgidname" => $sgname, + "iconid" => $iconid, + "icon" => $iconfile, + "icondate" => $iconarr["i".$iconid] + ); + break; + } + } + if ($gefunden != 1) { + $insertgroups[] = array( + "sgid" => $servergroup['sgid'], + "sgidname" => $sgname, + "iconid" => $iconid, + "icon" => $iconfile, + "icondate" => $iconarr["i".$iconid] + ); + } + } else { + $insertgroups[] = array( + "sgid" => $servergroup['sgid'], + "sgidname" => $sgname, + "iconid" => $iconid, + "icon" => $iconfile, + "icondate" => $iconarr["i".$iconid] + ); + } + } + + if (isset($insertgroups)) { + $allinsertdata = ''; + foreach ($insertgroups as $insertarr) { + $allinsertdata = $allinsertdata . "('" . $insertarr['sgid'] . "', '" . $insertarr['sgidname'] . "', '" . $insertarr['iconid'] . "', '" . $insertarr['icondate'] . "'),"; + } + $allinsertdata = substr($allinsertdata, 0, -1); + if ($allinsertdata != '') { + if($mysqlcon->exec("INSERT INTO $dbname.groups (sgid, sgidname, iconid, icondate) VALUES $allinsertdata") === false) { + enter_logfile($logpath,$timezone,2,"update_groups 6:".$allinsertdata.print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + } + + if (isset($updategroups)) { + $allsgids = ''; + $allupdatesgid = ''; + $allupdateiconid = ''; + $allupdatedate = ''; + foreach ($updategroups as $updatedata) { + $allsgids = $allsgids . "'" . $updatedata['sgid'] . "',"; + $allupdatesgid = $allupdatesgid . "WHEN '" . $updatedata['sgid'] . "' THEN '" . $updatedata['sgidname'] . "' "; + $allupdateiconid = $allupdateiconid . "WHEN '" . $updatedata['sgid'] . "' THEN '" . $updatedata['iconid'] . "' "; + $allupdatedate = $allupdatedate . "WHEN '" . $updatedata['sgid'] . "' THEN '" . $updatedata['icondate'] . "' "; + } + $allsgids = substr($allsgids, 0, -1); + if($mysqlcon->exec("UPDATE $dbname.groups set sgidname = CASE sgid $allupdatesgid END, iconid = CASE sgid $allupdateiconid END, icondate = CASE sgid $allupdatedate END WHERE sgid IN ($allsgids)") === false) { + enter_logfile($logpath,$timezone,2,"update_groups 7:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + if(isset($sqlhisgroup)) { + foreach ($sqlhisgroup as $groups) { + if(!in_array($groups['sgid'], $tsgroupids) && $groups['sgid'] != 0) { + $delsgroupids = $delsgroupids . "'" . $groups['sgid'] . "',"; + } + } + } + + if(isset($delsgroupids)) { + $delsgroupids = substr($delsgroupids, 0, -1); + if($mysqlcon->exec("DELETE FROM groups WHERE sgid IN ($delsgroupids)") === false) { + enter_logfile($logpath,$timezone,2,"update_groups 8:".print_r($mysqlcon->errorInfo())); + $sqlmsg .= print_r($mysqlcon->errorInfo()); + $sqlerr++; + } + } + + $buildtime = microtime(true) - $starttime; + if ($buildtime < 0) { $buildtime = 0; } + + if ($sqlerr == 0) { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='0', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"update_groups 9:".print_r($mysqlcon->errorInfo())); + } + } else { + if($mysqlcon->exec("UPDATE $dbname.job_log SET status='1', err_msg='$sqlmsg', runtime='$buildtime' WHERE id='$jobid'") === false) { + enter_logfile($logpath,$timezone,2,"update_groups 10:".print_r($mysqlcon->errorInfo())); + } + } +} +?> \ No newline at end of file diff --git a/languages/core_de.php b/languages/core_de.php index c7b848c..8232eda 100644 --- a/languages/core_de.php +++ b/languages/core_de.php @@ -1 +1,359 @@ - wurde nun zum Ranksystem hinzugefügt.";$lang['alrup']="Das Ranksystem ist bereits up to date. Bitte lösche diese Datei von deinem Webserver!";$lang['changedbid']="User %s (eindeutige Client-ID: %s) hat eine neue TeamSpeak Client-Datenbank-ID (%s). Ersetze die alte Client-Datenbank-ID (%s) und setze die gesammelte Zeiten zurück";$lang['crawl']="Scanne nach verbundenen Usern und sammle die online Zeit...";$lang['clean']="Scanne nach Usern, welche zu löschen sind...";$lang['cleanc']="Clientlöschung";$lang['cleancdesc']="Mit dieser Funktion werden alte Clients aus dem Ranksystem gelöscht.

Hierzu wird die TeamSpeak Datenbank mit dem Ranksystem abgeglichen. Clients, welche nicht mehr in der TeamSpeak Datenbank existieren, werden aus dem Ranksystem gelöscht.

Diese Funktion kann nur genutzt werden, wenn der 'Slowmode' deaktiviert ist!


Zur automatischen Bereinigung der TeamSpeak Datenbank kann der ClientCleaner genutzt werden:
http://ts-n.net/clientcleaner.php";$lang['cleandel']="Es wurden %s Clients aus der Ranksystem-Datenbank gelöscht, da sie nicht mehr in der TeamSpeak Datenbank vorhanden sind.";$lang['cleanno']="Es gab nicht zu löschen...";$lang['cleanp']="Löschintervall";$lang['cleanpdesc']="Bestimme einen Intervall, wie of die 'Clientlöschung' laufen soll.

Angabe der Zeit in Sekunden!

Empfohlen wird die Clientlöschung nur einmal am Tag laufen zu lassen, da für größere Datenbanken die Laufzeit extrem steigt.";$lang['cleanrs']="Clients in der Ranksystem Datenbank: %s";$lang['cleants']="Clients in der TeamSpeak Datenbank gefunden: %s (von %s)";$lang['days']="Tage";$lang['dbconerr']="Verbindung zur MySQL-Datenbank gescheitert: ";$lang['delcldgrpif']="Fehler beim Löschen der Servergruppen aus der Datenbank: %s";$lang['delcldgrpsc']="Knowledge der Servergruppen für %s User erfolgreich gelöscht.";$lang['delclientsif']="%s Clients aus der Ranksystem Datenbank gelöscht!";$lang['delclientssc']="%s Clients aus der Ranksystem Datenbank erfolgreich gelöscht!";$lang['errlogin']="Benutzername und/oder Passwort sind falsch! Versuche es erneut...";$lang['error']="Fehler ";$lang['errremgrp']="Fehler beim Entfernen des Users mit der eindeutigen Client-ID %s aus der Servergruppe mit der Servergruppen-Datenbank-ID %s!";$lang['errremdb']="Fehler beim Löschen des Users mit der eindeutigen Client-ID % aus der Ranksystem Datenbank!";$lang['errsel']="Fehler bei der Auswahl der Bedingungen!
ausgewählte User: %s
Option 'lösche Clients': %s
Option 'ges. online Zeit': %s";$lang['errukwn']="Unbekannter Fehler aufgetreten!";$lang['errupcount']="Fehler beim Überschreiben der ges. online Zeit %s bei User mit der eindeutigen Client-ID %s!";$lang['firstuse']="Scheint der erste Lauf zu sein. Starte loggen der Userhistorie...";$lang['highest']="höchster Rang erreicht";$lang['instdb']="Installiere Datenbank:";$lang['instdberr']="Fehler beim Erstellen der Datenbank: ";$lang['instdbsubm']="Datenbank einrichten";$lang['instdbsuc']="Datenbank %s wurde erfolgreich angelegt.";$lang['insttb']="Installiere Tabellen:";$lang['insttberr']="Fehler beim Erstellen der Tabelle: ";$lang['insttbsuc']="Tabelle %s wurde erfolgreich angelegt.";$lang['isntwicfg']="Die Datenbankkonfigurationen konnten nicht gespeichert werden! Bitte versehe die 'other/dbconfig.php' mit einem chmod 0777 und versuche es anschließend erneut.";$lang['isntwichm']="Bitte versehe die 'other/dbconfig.php' und die Ordner 'avatars/', 'icons/' und 'logs/' mit den nötigen Dateiberechtigungen. Hierfür je die Berechtigung auf einem chmod 0777 setzen. Anschließend versuche es erneut (Seite neu laden).";$lang['isntwidb']="Trage deine Datenbank Einstellungen ein:";$lang['isntwidberr']="Bitte überprüfe, ob alle Felder korrekt ausgefüllt wurden!";$lang['isntwidbhost']="DB Hostadresse:";$lang['isntwidbhostdesc']="Datenbank Server Adresse
(IP oder DNS)";$lang['isntwidbmsg']="Datenbank-Fehler: ";$lang['isntwidbname']="DB Name:";$lang['isntwidbnamedesc']="Name der Datenbank";$lang['isntwidbpass']="DB Passwort:";$lang['isntwidbpassdesc']="Passwort für die Datenbank";$lang['isntwidbtype']="DB Typ:";$lang['isntwidbtypedesc']="Datenbank Typ

Der benötigte PDO Treiber muss installiert sein.
Für mehr Informationen beachte die Anforderungen auf http://ts-n.net/ranksystem.php";$lang['isntwidbusr']="DB Benutzer:";$lang['isntwidbusrdesc']="Username für die Datenbank";$lang['isntwidel']="Bitte lösche noch die Datei 'install.php' und alle 'update_x-xx.php' Dateien vom Webserver und öffne danach das %s um das Ranksystem zu konfigurieren!";$lang['isntwiusr']="Benutzer für das Webinterface wurde erfolgreich erstellt.";$lang['isntwiusrcr']="erstelle Zugang";$lang['isntwiusrdesc']="Gib einen frei wählbaren Benutzer und ein Passwort für das Webinterface ein. Mit dem Webinterface wird das Ranksystem konfiguriert.";$lang['isntwiusrh']="Zugang - Webinterface";$lang['listacsg']="atkuelle Servergruppe";$lang['listcldbid']="Client-Datenbank-ID";$lang['listexgrp']="Ist vom Ranksystem ausgeschlossen (Servergruppen-Ausnahmen).";$lang['listexuid']="Ist vom Ranksystem ausgeschlossen (Client-Ausnahmen).";$lang['listip']="IP Adresse";$lang['listnick']="Client-Name";$lang['listnxsg']="nächste Servergruppe";$lang['listnxup']="nächster Rang";$lang['listrank']="Rang";$lang['listseen']="zuletzt gesehen";$lang['listsuma']="ges. aktive Zeit";$lang['listsumi']="ges. idle Zeit";$lang['listsumo']="ges. online Zeit";$lang['listtime']="%s Tag(e), %s Std., %s Min., %s Sek.";$lang['listuid']="eindeutige Client-ID";$lang['new']="neu";$lang['nocount']="User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) ist ein Query-User oder ist mehrmals online (nur erste Verbindung zählt) -> diese wird nicht gewertet!";$lang['noentry']="Keine Einträge gefunden..";$lang['pass']="Passwort: ";$lang['queryname']="Erster Botname ist bereits in Verwendung. Versuche zweiten Botnamen zu nutzen...";$lang['sccrmcld']="User mit der eindeutigen Client-ID %s wurde erfolgreich aus der Ranksystem Datenbank gelöscht.";$lang['sccupcount']="User mit der eindeutigen Client-ID %s erhielt erfolgreich ein neue ges. online Zeit von %s.";$lang['setontime']="ges. online Zeit";$lang['setontimedesc']="Gib eine neue ges. online Zeit ein, welche bei den zuvor selektierten Usern hinterlegt werden soll. Mit dieser wird die alte ges. online Zeit überschrieben.

Die eingegeben ges. online Zeit wird für die nächsten Rangsteigerungen berücksichtigt.";$lang['sgrpadd']="Servergruppe %s zu User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) hinzugefügt.";$lang['sgrprerr']="Es ist ein Problem mit den Servergruppen des Users %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) aufgetreten!";$lang['sgrprm']="Servergruppe %s von User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) entfernt.";$lang['sitegen']="Seite generiert in %s Sekunden mit %s Clients.";$lang['sitegenl']="Seite generiert in %s Sekunden mit %s Clients (davon %s angezeigt; %s betroffen von Ausnahmeregeln; %s im höchsten Rang).";$lang['stix0001']="Server Statistiken";$lang['stix0002']="Anzahl User";$lang['stix0003']="zeige Liste aller User";$lang['stix0004']="Online Zeit aller User / Total";$lang['stix0005']="zeige Top User aller Zeiten";$lang['stix0006']="zeige Top User des Monats";$lang['stix0007']="zeige Top User der Woche";$lang['stix0008']="Server Nutzung";$lang['stix0009']="der letzten 7 Tage";$lang['stix0010']="der letzten 30 Tage";$lang['stix0011']="der letzten 24 Stunden";$lang['stix0012']="wähle Zeitraum";$lang['stix0013']="letzten 24 Stunden";$lang['stix0014']="letzte Woche";$lang['stix0015']="letzer Monat";$lang['stix0016']="Aktive / Inaktive Zeit (aller User)";$lang['stix0017']="Versionen (aller User)";$lang['stix0018']="Nationalitäten (aller User)";$lang['stix0019']="Plattformen (aller User)";$lang['stix0020']="Server Details";$lang['stix0023']="Server Status";$lang['stix0024']="Online";$lang['stix0025']="Offline";$lang['stix0026']="User (Online / Max)";$lang['stix0027']="Anzahl aller Channel";$lang['stix0028']="Server Ping (Mittelwert)";$lang['stix0029']="Eingehende Daten insg.";$lang['stix0030']="Ausgehende Daten insg.";$lang['stix0031']="Server online seit";$lang['stix0032']="vor Offlineschaltung:";$lang['stix0033']="00 Tage, 00 Stunden, 00 Min., 00 Sek.";$lang['stix0034']="Paketverlust (Mittelwert)";$lang['stix0035']=" ";$lang['stix0036']="Server Name";$lang['stix0037']="Server Adresse (Host Adresse : Port)";$lang['stix0038']="Server Passwort";$lang['stix0039']="Nein (Öffentlich)";$lang['stix0040']="Ja (Privat)";$lang['stix0041']="Server ID";$lang['stix0042']="Server Plattform";$lang['stix0043']="Server Version";$lang['stix0044']="Server Erstelldatum (dd/mm/yyyy)";$lang['stix0045']="Report an Serverliste";$lang['stix0046']="Aktiv";$lang['stix0047']="Deaktiviert";$lang['stix0048']="nicht genügend Daten ...";$lang['stix0049']="Online Zeit aller User / Monat";$lang['stix0050']="Online Zeit aller User / Woche";$lang['stix0051']="TeamSpeak hat gefailed, daher kein Erstelldatum...";$lang['stmy0001']="Meine Statistiken";$lang['stmy0002']="Rank";$lang['stmy0003']="Datenbank ID:";$lang['stmy0004']="Eindeutige Client ID:";$lang['stmy0005']="Insg. Verbunden zum TS";$lang['stmy0006']="Startzeitpunkt der Statistiken:";$lang['stmy0007']="Gesamte online Zeit:";$lang['stmy0008']="Online Zeit der letzten 7 Tage:";$lang['stmy0009']="Online Zeit der letzten 30 Tage:";$lang['stmy0010']="Errungenschaften:";$lang['stmy0011']="Fortschritt Errungenschaft Zeit";$lang['stmy0012']="Zeit: Legendär";$lang['stmy0013']="Da du bereits %s Stunden auf dem Server online bist.";$lang['stmy0014']="Abgeschlossen";$lang['stmy0015']="Zeit: Gold";$lang['stmy0016']="% erreicht für Legendär";$lang['stmy0017']="Zeit: Silber";$lang['stmy0018']="% errreicht für Gold";$lang['stmy0019']="Zeit: Bronze";$lang['stmy0020']="% errreicht für Silber";$lang['stmy0021']="Zeit: Unranked";$lang['stmy0022']="% errreicht für Bronze";$lang['stmy0023']="Fortschritt Errungenschaft Verbindungen";$lang['stmy0024']="Verbindungen: Legendär";$lang['stmy0025']="Da du bereits %s zum Server verbunden warst.";$lang['stmy0026']="Verbindungen: Gold";$lang['stmy0027']="Verbindungen: Silber";$lang['stmy0028']="Verbindungen: Bronze";$lang['stmy0029']="Verbindungen: Unranked";$lang['stnv0001']="Server News";$lang['stnv0002']="Schließen";$lang['stnv0003']="Client Informationen aktualisieren";$lang['stnv0004']="Benutze diese Funktion, wenn sich deine TS3 Daten geändert haben, wie z.B. dein Username.";$lang['stnv0005']="Du musst hierfür mit dem TS3 Server verbunden sein!";$lang['stnv0006']="Aktualisieren";$lang['stnv0007']="Battle Area - Page Content";$lang['stnv0008']="You can challenge other users in a battle between two users or two teams.";$lang['stnv0009']="While the battle is active the online time of the teams/users will be counted.";$lang['stnv0010']="When the battle ends the team/user with the highest online time wins.";$lang['stnv0011']="(The regular battling time is 48 hours)";$lang['stnv0012']="The winning team/user will recieve a price, which the user can use whenever the user wants.";$lang['stnv0013']="It will be displayed on the My Statistics tab.";$lang['stnv0014']="(Could be online time boost(2x) for 8 hours, instant online time (4 hours), etc.";$lang['stnv0015']="These boosts can be used for example to climb in the top users of the week)";$lang['stnv0016']="nicht verfügbar";$lang['stnv0017']="Du bist nicht mit dem TS3 Server verbunden, daher können kein Daten angezeigt werden.";$lang['stnv0018']="Bitte verbinde dich mit dem TS3 Server und aktualisiere anschließend die Session über den Aktualisierungs-Button oben rechts in der Ecke.";$lang['stnv0019']="Statistiken - Inhaltserläuterung";$lang['stnv0020']="Diese Seite zeigt u.a. eine Übersicht deiner persönlichen Statistiken und Aktivität auf dem TS3 Server.";$lang['stnv0021']="Die Informationen wurden gesammelt seit Beginn des Ranksystems, nicht seit Beginn des TS3 Servers.";$lang['stnv0022']="Die Seite erhält ihre Daten aus einer Datenbank. Es ist also möglich, dass die angezeigten Werte von den live Werten abweichen.";$lang['stnv0023']="Die Werte innerhalb der Donut-Charts können von der Anzahl der User abweichen. Hintergrund ist, dass die Daten in älteren Versionen des Ranksystems nicht gesammelt wurden.";$lang['stnv0024']="Ranksystem - Statistiken";$lang['stnv0025']="Anzahl Einträge";$lang['stnv0026']="alle";$lang['stnv0027']="Die Informationen auf dieser Seite scheinen veraltet! Es scheint, das Ranksystem ist nicht mehr mit dem TS3 verbunden.";$lang['stnv0028']="(Keine Verbindung zum TS3!)";$lang['stnv0029']="Rank-Liste";$lang['stnv0030']="Ranksystem Info";$lang['stnv0031']="DE - Deutsch";$lang['stnv0032']="EN - English";$lang['stnv0033']="RU - русский";$lang['stri0001']="Ranksystem Informationen";$lang['stri0002']="Was ist das Ranksystem?";$lang['stri0003']="Ein TS3 Bot, der automatisch Servergruppen an User für online Zeit oder aktive Zeit auf einem TeamSpeak 3 Server zuweist. Weiterhin sammelt es diverse Statistiken und stellt diese hier dar.";$lang['stri0004']="Wer hat das Ranksystem erstellt?";$lang['stri0005']="Wann wurde das Ranksystem erstellt?";$lang['stri0006']="Erste Alpha Version: 05/10/2014.";$lang['stri0007']="Erste Beta Version: 01/02/2015.";$lang['stri0008']="Die neuste Version kannst du auf der Ranksystem Website sehen.";$lang['stri0009']="Wie wurde das Ranksystem erstellt?";$lang['stri0010']="Das Ranksystem basiert auf";$lang['stri0011']="Es nutzt weiterhin die folgenden Programmbibliotheken:";$lang['stri0012']="Ein spezieller Danke ergeht an:";$lang['stri0013']="sergey - für die russische Übersertzung";$lang['stri0014']="Bejamin Frost - für die Initialisierung des Bootstrap Designs";$lang['sttw0001']="Top User";$lang['sttw0002']="der Woche";$lang['sttw0003']="mit %s Stunden online Zeit";$lang['sttw0004']="Top 10 im Vergleich";$lang['sttw0005']="Stunden (definiert 100 %)";$lang['sttw0006']="%s Stunden (%s%)";$lang['sttw0007']="Top 10 Statistiken";$lang['sttw0008']="Top 10 vs Andere; Online Zeit";$lang['sttw0009']="Top 10 Vs Others; Aktive Zeit";$lang['sttw0010']="Top 10 Vs Others; Inaktive Zeit";$lang['sttw0011']="Top 10 (in Stunden)";$lang['sttw0012']="Andere %s User (in Stunden)";$lang['sttm0001']="des Monats";$lang['stta0001']="aller Zeiten";$lang['updb']="Das Update muss nur ausgeführt werden, wenn das Ranksystem bereits mit einer älteren Version als %s genutzt wird!

Führe das Update nur einmal aus und lösche danach die 'update_%s.php' sofort von deinem Webserver.


Update Datenbank:
";$lang['updel']="Bitte lösche die folgenden Dateien vom Hauptverzeichnis des Ranksystems, sofern sie existieren:
%s";$lang['upinf']="Eine neue Version des Ranksystems ist verfügbar. Informiere Clients auf dem Server...";$lang['upmov']="Bitte verschiebe die Datei \'%s\' in das Unterverzeichnis \'%s\' und überschreibe dabei die dort vorhandene Datei!";$lang['upmsg']="\nHey, eine neue Version des [B]Ranksystems[/B] ist verfügbar!\n\naktuelle Version: %s\n[B]neue Version: %s[/B]\n\nBitte schaue auf unsere Homepage für weitere Informationen [URL]http://ts-n.net/ranksystem.php[/URL].";$lang['upsucc']="Datenbank-Update erfolgreich durchgeführt";$lang['upuser']="User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) erhält eine neue ges. online Zeit von %s (davon aktiv: %s).";$lang['upuserboost']="User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) erhält eine neue ges. online Zeit von %s (davon aktiv: %s) [BOOST %sx].";$lang['upusrerr']="Die eindeutige Client-ID %s konnte auf dem TeamSpeak nicht erreicht werden!";$lang['upusrinf']="User %s wurde erfolgreich benachrichtigt.";$lang['user']="Benutzername: ";$lang['usermsgactive']="\nHey, du bist im Rang gestiegen, da du eine Aktivität von %s Tagen, %s Stunden, %s Minuten und %s Sekunden erreicht hast.";$lang['usermsgonline']="\nHey, du bist im Rang gestiegen, da du bereits %s Tage, %s Stunden, %s Minuten und %s Sekunden online warst.";$lang['wiaction']="ausführen";$lang['wibgco']="Hintergrundfarbe:";$lang['wibgcodesc']="Lege eine Hintergrundfarbe fest
(gültiger HTML Code; muss mit # beginnen)";$lang['wiboost']="Boost";$lang['wiboostdesc']="Gebe einen User auf dem TeamSpeak Server eine Servergruppe (ist manuell zu erstellen), welche hier für das Ranksystem als Boost Gruppe deklariert werden kann. Definiere hierfür noch einen Faktor (z.B. 2x) und eine Zeit, wie lange der Boost gewährt werden soll.
Umso höher der Faktor, umso schneller erreicht ein User den nächst höheren Rang.
Ist die Zeit abgelaufen, so wird dem betroffenen User die Servergruppe automatisch entfernt. Die Zeit beginnt in dem Moment zu laufen, in dem der User die Servergruppe erhält.

Servergruppen-ID => Faktor => Zeit (in Sekunden)

Beispiel:
12=>2=>6000,13=>3=>2500,14=>5=>600

Hier werden den Usern in der Servergruppe mit der ID 12 dem Faktor 2 für 6000 Sekunden, den Usern in der Servergruppe 13 dem Faktor 3 für 2500 Sekunden gewährt, und so weiter...";$lang['wichdbid']="Client-Datenbank-ID Reset";$lang['wichdbiddesc']="Setzt die online Zeit eines Users zurück, wenn sich seine TeamSpeak Client-Datenbank-ID ändert.

Beispiel:
Wird ein Client vom TeamSpeak Server gelöscht, so erhält er mit der nächsten Verbindung zum Server eine neue Client-Datenbank-ID.";$lang['wiconferr']="Es ist ein Fehler in der Konfiguration des Ranksystems. Bitte prüfe im Webinterface die Kern-Einstellungen auf Richtigkeit. Besonders sollte die Einstellung 'Rangsteigerung' geprüft werden!";$lang['widaform']="Datumsformat";$lang['widaformdesc']="Gebe ein Datumsformat zur Anzeige vor.

Beispiel:
%a Tage, %h Std., %i Min., %s Sek.";$lang['widbcfgsuc']="Datenbank Einstellungen erfolgreich gespeichert.";$lang['widbcfgerr']="Fehler beim Speichern der Datenbank Einstellungen! Verbindung zur Datenbank oder speichern der 'other/dbconfig.php' nicht möglich.";$lang['widelcld']="lösche Clients";$lang['widelcldgrp']="Servergruppen zurücksetzen";$lang['widelcldgrpdesc']="Das Ranksystem merkt sich die vergebenen Servergruppen, sodass nicht mit jedem Lauf der worker.php diese nochmals überprüft bzw. vergeben werden.

Mit dieser Funktion ist es möglich, dieses Wissen einmalig zurückzusetzen. Dadurch versucht das Ranksystem alle User (welche auf dem TS3 Server online sind) in die aktuell gültige Servergruppe zu setzen.
Für jeden User, welcher eine Servergruppe erhält bzw. in der vorhanden verbleibt, wird die Wissensdatenbank wie zu Anfang beschrieben wieder aufgebaut.

Diese Funktion kann hilreich sein, wenn sich User nicht in der Servergruppe befinden, welche für die jeweilige online Zeit vorgesehen ist.

Achtung: Bitte diese Funktion in einem Moment ausführen, in dem für nächsten Minuten kein Rankup ansteht!!! Das Ranksystem kann dann nämlich die alten Gruppen entfernen, da es hiervon nichts mehr weiß ;-)";$lang['widelclddesc']="Lösche zuvor selektierte User aus der Ranksystem Datenbank.

Hiermit bleiben die Userdaten auf dem TeamSpeak Server unberührt!";$lang['widelsg']="entferne aus Servergruppen";$lang['widelsgdesc']="Wähle, ob Clients auch aus den Servergruppen entfernt werden sollen, wenn sie aus der Ranksystem Datenbank gelöscht werden.

Es werden nur Servergruppen beachtet, welche das Ranksystem betreffen!";$lang['wideltime']="Löschzeitraum";$lang['wideltimedesc']="Lösche alte Clients aus aus der Ranksystem Datenbank.
Gib eine Zeit in Sekunden ein, welche ein User nicht mehr online war, damit er gelöscht wird.

0 - löscht alle User aus dem Ranksystem

Hiermit bleiben die Userdaten auf dem TeamSpeak Server unberührt!";$lang['wiexgrp']="Servergruppen-Ausnahmen";$lang['wiexgrpdesc']="Eine Komma getrennte Liste von Servergruppen-IDs, welche nicht am Ranksystem teilnehmen sollen.

User in mindestens einer dieser Gruppen sind von Rangsteigerungen ausgenommen.";$lang['wiexuid']="Client-Ausnahmen";$lang['wiexuiddesc']="Eine Komma getrennte Liste von eindeutigen Client-IDs, welche nicht am Ranksystem teilnehmen sollen.

Aufgelistete User sind von Rangsteigerungen ausgenommen.";$lang['wigrptime']="Rangsteigerung";$lang['wigrptimedesc']="Definiere hier, nach welcher Zeit ein User automatisch in eine vorgegebene Servergruppe gelangen soll.

Zeit (Sekunden)=>Servergruppen ID

Entscheidend hierfür ist die online Zeit des User bzw. wenn 'Idlezeit' aktiv, dann die aktive Zeit.

Jeder Eintrag ist vom nächsten durch ein Komma zu separieren.

Die Zeiten sind kummulativ zu hinterlegen.

Beispiel:
60=>9,120=>10,180=>11

Hier werden die User nach 60 Sekunden in die Servergruppe 9, nach wiederum 60 Sekunden in die Servergruppe 10, usw..., hinzugefügt.";$lang['wihdco']="Überschriftenfarbe:";$lang['wihdcodesc']="Lege eine Überschriftenfarbe fest.
(gültiger HTML Code; muss mit # beginnen)";$lang['wihl']="Webinterface - Ranksystem";$lang['wihladm']="Admin Liste";$lang['wihlcfg']="Kern-Einstellungen";$lang['wihlclg']="Clients editieren (Global)";$lang['wihlcls']="Clients edidieren (Selektiv)";$lang['wihldb']="Datenbank-Einstellungen";$lang['wihlsty']="Style-Einstellungen";$lang['wihlts']="TeamSpeak-Einstellungen";$lang['wihvco']="Hoverfarbe:";$lang['wihvcodesc']="Lege eine Hoverfarbe fest.
(gültiger HTML Code; muss mit # beginnen)";$lang['wiifco']="Infotextfarbe:";$lang['wiifcodesc']="Lege eine Infotextfarbe fest.
(gültiger HTML Code; muss mit # beginnen)";$lang['wilogout']="Abmelden";$lang['wilog']="Log-Pfad";$lang['wilogdesc']="Pfad in dem das Logfile des Ranksystems geschrieben werden soll.

Beispiel:
/var/logs/ranksystem/

Beachte, dass der Webuser Schreibrechte in dem Verzeichnis hat.";$lang['wimsgusr']="Benachrichtigung";$lang['wimsgusrdesc']="Informiere den User per privater Textnachricht über seine Rangsteigerung.

Definiere die Nachricht in der 'lang.php'
(usermsgonline bzw. usermsgactive)";$lang['wiscco']="Erfolgsmeldungsfarbe:";$lang['wisccodesc']="Lege eine Erfolgsmeldungsfarbe fest.
(gültiger HTML Code; muss mit # beginnen)";$lang['wiselcld']="selektiere User";$lang['wiselclddesc']="Wähle User anhand des letzt bekannten Usernamen aus. Hierfür einfach losschreiben.
Mehrfachselektionen sind kommagetrennt möglich, welche automatisch vorgenommen werden.

Mit den selektierten Usern kann im nächsten Schritt eine Aktion gewählt werden.";$lang['wishcolas']="aktuelle Servergruppe";$lang['wishcolasdesc']="Zeige Spalte 'aktuelle Servergruppe' in der list_rankup.php";$lang['wishcolat']="aktive Zeit";$lang['wishcolatdesc']="Zeige Spalte 'ges. aktive Zeit' in der list_rankup.php";$lang['wishcolcld']="Client-Name";$lang['wishcolclddesc']="Zeige Spalte 'Client-Name' in der list_rankup.php";$lang['wishcoldbid']="Datenbank-ID";$lang['wishcoldbiddesc']="Zeige Spalte 'Client-Datenbank-ID' in der list_rankup.php";$lang['wishcolit']="idle Zeit";$lang['wishcolitdesc']="Zeige Spalte 'ges. idle Zeit' in der list_rankup.php";$lang['wishcolls']="zuletzt gesehen";$lang['wishcollsdesc']="Zeige Spalte 'zuletzt gesehen' in der list_rankup.php";$lang['wishcolnx']="nächster rank up";$lang['wishcolnxdesc']="Zeige Spalte 'nächster Rang' in der list_rankup.php";$lang['wishcolot']="online Zeit";$lang['wishcolotdesc']="Zeige Spalte 'ges. online Zeit' in der list_rankup.php";$lang['wishcolrg']="Rang";$lang['wishcolrgdesc']="Zeige Spalte 'Rang' in der list_rankup.php";$lang['wishcolsg']="nächste Servergruppe";$lang['wishcolsgdesc']="Zeige Spalte 'nächste Servergruppe' in der list_rankup.php";$lang['wishcoluuid']="Client-ID";$lang['wishcoluuiddesc']="Zeige Spalte 'eindeutige Client-ID' in der list_rankup.php";$lang['wishexcld']="ausgeschl. Clients";$lang['wishexclddesc']="Zeige User in der list_rankup.php, welche über die 'Client-Ausnahmen' nicht am Ranksystem teilnehmen.";$lang['wishexgrp']="ausgeschl. Servergruppen";$lang['wishexgrpdesc']="Zeige User in der list_rankup.php, welche über die 'Servergruppen-Ausnahmen' nicht am Ranksystem teilnehmen.";$lang['wishgen']="Seitengenerierung";$lang['wishgendesc']="Zeige die Zeit, welche zur Generierung der Seite benötigt wird, am Ende der Seite.";$lang['wishhicld']="User in höchestem Rang";$lang['wishhiclddesc']="Zeige User in der list_rankup.php, welche den höchsten Rang errreicht haben.";$lang['wisupidle']="Idlezeit";$lang['wisupidledesc']="Ist diese Funktion aktiv, wird die 'ges. idle Zeit' eines Users von der 'ges. online Zeit' abgezogen. Anstelle der 'ges. online Zeit' wird somit die vorgenannte Differenz für Rangsteigerungen herangezogen.";$lang['wisvconf']="speichern";$lang['wisvsuc']="Änderungen erfolgreich gesichert!";$lang['witime']="Zeitzone";$lang['witimedesc']="Wähle die Zeitzone, die für den Sever gilt.";$lang['wits3dch']="Default Channel";$lang['wits3dchdesc']="Die channel-ID, mit der sich der Bot verbindet.

In diesem Channel wechselt der Bot nach dem Verbinden mit dem TeamSpeak Server.";$lang['wits3host']="TS3 Hostadresse";$lang['wits3hostdesc']="TeamSpeak 3 Server Adresse
(IP oder DNS)";$lang['wits3sm']="Slowmode";$lang['wits3smdesc']="Mit dem Slowmode werden die Query-Anfragen an den TeamSpeak Server reduziert. Dies schützt vor einem Ban aufgrund von flooding.
TeamSpeak Query Befehle werden mit dieser Funktion verzögert abgeschickt.

!!! AUCH REDUZIERT ER DIE CPU USAGE !!!

Die Aktivierung ist nicht empfohlen, wenn nicht benötigt. Die Verzögerung (delay) erhöht die Laufzeit eines Durchgangs des Bots, dadurch wird er unpräziser.";$lang['wits3qnm']="Botname";$lang['wits3qnm2']="2. Botname";$lang['wits3qnm2desc']="Ein zweiter Botname, falls der erste bereits genutzt wird.";$lang['wits3qnmdesc']="Der Name, mit dem die Query-Verbindung augebaut werden soll.
Der Name kann frei gewählt werden.";$lang['wits3querpw']="TS3 Query-Passwort";$lang['wits3querpwdesc']="TeamSpeak 3 Query Passwort
Passwort des Query Benutzers";$lang['wits3querusr']="TS3 Query-Benutzer";$lang['wits3querusrdesc']="TeamSpeak 3 Query Benutzername
Standard ist serveradmin
Natürlich kann auch ein gesonderter Query-Benutzer erstellt und genutzt werden.
Die benötigten Rechte sind hier aufgelistet:
http://ts-n.net/ranksystem.php";$lang['wits3query']="TS3 Query-Port";$lang['wits3querydesc']="TeamSpeak 3 Query Port
Standard ist 10011 (TCP)
andere Werte sollten in der 'ts3server.ini' zu finden sein.";$lang['wits3voice']="TS3 Voice-Port";$lang['wits3voicedesc']="TeamSpeak 3 Voice Port
Standard ist 9987 (UDP)
Dieser Port wird zum Verbinden mit dem TS3 Client genutzt.";$lang['witxco']="Textfarbe:";$lang['witxcodesc']="Lege eine Textfarbe fest.
(gültiger HTML Code; muss mit # beginnen)";$lang['wiupcheck']="Update-Prüfung";$lang['wiupcheckdesc']="Ist die Update-Prüfung aktiv, werden nachfolgend genannte User mit einer privaten Textnachricht informiert, sobald ein Update verfügbar ist.";$lang['wiuptime']="Prüfungsintervall";$lang['wiuptimedesc']="Gib an alle wie viel Sekunden das Ranksystem prüfen soll, ob ein Update verfügbar ist.
Beachte, bei jeder Prüfung werden die hinterlegten User über ein verfügbares Update benachrichtigt. Ist kein hinterlegter User online, wird mit dem nächsten Intervall versucht zu benachrichtigen.";$lang['wiupuid']="Empfänger";$lang['wiupuiddesc']="Eine Komma getrennte Liste von eindeutigen Client-IDs, welche via privater Textnachricht auf dem TeamSpeak über ein Update informiert werden sollen.";$lang['wiversion']="(verwendete Version %s)";$lang['wivlang']="Sprache";$lang['wivlangdesc']="Sprache des Ranksystems

de - Deutsch
en - english
ru - русский";$lang['wiwnco']="Warntextfarbe:";$lang['wiwncodesc']="Lege eine Warntextfarbe fest.
(gültiger HTML Code; muss mit # beginnen)";?> \ No newline at end of file + wurde nun zum Ranksystem hinzugefügt."; +$lang['alrup'] = "Das Ranksystem ist bereits up to date. Bitte lösche diese Datei von deinem Webserver!"; +$lang['changedbid'] = "User %s (eindeutige Client-ID: %s) hat eine neue TeamSpeak Client-Datenbank-ID (%s). Ersetze die alte Client-Datenbank-ID (%s) und setze die gesammelte Zeiten zurück"; +$lang['crawl'] = "Scanne nach verbundenen Usern und sammle die online Zeit..."; +$lang['clean'] = "Scanne nach Usern, welche zu löschen sind..."; +$lang['cleanc'] = "Clientlöschung"; +$lang['cleancdesc'] = "Mit dieser Funktion werden alte Clients aus dem Ranksystem gelöscht.

Hierzu wird die TeamSpeak Datenbank mit dem Ranksystem abgeglichen. Clients, welche nicht mehr in der TeamSpeak Datenbank existieren, werden aus dem Ranksystem gelöscht.

Diese Funktion kann nur genutzt werden, wenn der 'Slowmode' deaktiviert ist!


Zur automatischen Bereinigung der TeamSpeak Datenbank kann der ClientCleaner genutzt werden:
http://ts-n.net/clientcleaner.php"; +$lang['cleandel'] = "Es wurden %s Clients aus der Ranksystem-Datenbank gelöscht, da sie nicht mehr in der TeamSpeak Datenbank vorhanden sind."; +$lang['cleanno'] = "Es gab nichts zu löschen..."; +$lang['cleanp'] = "Löschintervall"; +$lang['cleanpdesc'] = "Bestimme einen Intervall, wie oft die 'Clientlöschung' laufen soll.

Angabe der Zeit in Sekunden!

Empfohlen wird die Clientlöschung nur einmal am Tag laufen zu lassen, da für größere Datenbanken die Laufzeit extrem steigt."; +$lang['cleanrs'] = "Clients in der Ranksystem Datenbank: %s"; +$lang['cleants'] = "Clients in der TeamSpeak Datenbank gefunden: %s (von %s)"; +$lang['days'] = "Tage"; +$lang['dbconerr'] = "Verbindung zur MySQL-Datenbank gescheitert: "; +$lang['delcldgrpif'] = "Fehler beim Löschen der Servergruppen aus der Datenbank: %s"; +$lang['delcldgrpsc'] = "Knowledge der Servergruppen für %s User erfolgreich gelöscht."; +$lang['delclientsif'] = "%s Clients aus der Ranksystem Datenbank gelöscht!"; +$lang['delclientssc'] = "%s Clients aus der Ranksystem Datenbank erfolgreich gelöscht!"; +$lang['errlogin'] = "Benutzername und/oder Passwort sind falsch! Versuche es erneut..."; +$lang['error'] = "Fehler "; +$lang['errremgrp'] = "Fehler beim Entfernen des Users mit der eindeutigen Client-ID %s aus der Servergruppe mit der Servergruppen-Datenbank-ID %s!"; +$lang['errremdb'] = "Fehler beim Löschen des Users mit der eindeutigen Client-ID %s aus der Ranksystem Datenbank!"; +$lang['errsel'] = "Fehler bei der Auswahl der Bedingungen!
ausgewählte User: %s
Option 'lösche Clients': %s
Option 'ges. online Zeit': %s"; +$lang['errukwn'] = "Unbekannter Fehler aufgetreten!"; +$lang['errupcount'] = "Fehler beim Überschreiben der ges. online Zeit %s bei User mit der eindeutigen Client-ID %s!"; +$lang['firstuse'] = "Scheint der erste Lauf zu sein. Starte loggen der Userhistorie..."; +$lang['highest'] = "höchster Rang erreicht"; +$lang['instdb'] = "Installiere Datenbank:"; +$lang['instdberr'] = "Fehler beim Erstellen der Datenbank: "; +$lang['instdbsubm'] = "Datenbank einrichten"; +$lang['instdbsuc'] = "Datenbank %s wurde erfolgreich angelegt."; +$lang['insttb'] = "Installiere Tabellen:"; +$lang['insttberr'] = "Fehler beim Erstellen der Tabelle: "; +$lang['insttbsuc'] = "Tabelle %s wurde erfolgreich angelegt."; +$lang['isntwicfg'] = "Die Datenbankkonfigurationen konnten nicht gespeichert werden! Bitte versehe die 'other/dbconfig.php' mit einem chmod 0777 und versuche es anschließend erneut."; +$lang['isntwichm'] = "Bitte versehe die 'other/dbconfig.php' und die Ordner 'avatars/', 'icons/' und 'logs/' mit den nötigen Dateiberechtigungen. Hierfür je die Berechtigung auf einem chmod 0777 setzen. Anschließend versuche es erneut (Seite neu laden)."; +$lang['isntwidb'] = "Trage deine Datenbank Einstellungen ein:"; +$lang['isntwidberr'] = "Bitte überprüfe, ob alle Felder korrekt ausgefüllt wurden!"; +$lang['isntwidbhost'] = "DB Hostadresse:"; +$lang['isntwidbhostdesc'] = "Datenbank Server Adresse
(IP oder DNS)"; +$lang['isntwidbmsg'] = "Datenbank-Fehler: "; +$lang['isntwidbname'] = "DB Name:"; +$lang['isntwidbnamedesc'] = "Name der Datenbank"; +$lang['isntwidbpass'] = "DB Passwort:"; +$lang['isntwidbpassdesc'] = "Passwort für die Datenbank"; +$lang['isntwidbtype'] = "DB Typ:"; +$lang['isntwidbtypedesc'] = "Datenbank Typ

Der benötigte PDO Treiber muss installiert sein.
Für mehr Informationen beachte die Anforderungen auf http://ts-n.net/ranksystem.php"; +$lang['isntwidbusr'] = "DB Benutzer:"; +$lang['isntwidbusrdesc'] = "Username für die Datenbank"; +$lang['isntwidel'] = "Bitte lösche noch die Datei 'install.php' vom Webserver und öffne danach das %s um das Ranksystem zu konfigurieren!"; +$lang['isntwiusr'] = "Benutzer für das Webinterface wurde erfolgreich erstellt."; +$lang['isntwiusrcr'] = "erstelle Zugang"; +$lang['isntwiusrdesc'] = "Gib einen frei wählbaren Benutzer und ein Passwort für das Webinterface ein. Mit dem Webinterface wird das Ranksystem konfiguriert."; +$lang['isntwiusrh'] = "Zugang - Webinterface"; +$lang['listacsg'] = "atkuelle Servergruppe"; +$lang['listcldbid'] = "Client-Datenbank-ID"; +$lang['listexgrp'] = "Ist vom Ranksystem ausgeschlossen (Servergruppen-Ausnahmen)."; +$lang['listexuid'] = "Ist vom Ranksystem ausgeschlossen (Client-Ausnahmen)."; +$lang['listip'] = "IP Adresse"; +$lang['listnick'] = "Client-Name"; +$lang['listnxsg'] = "nächste Servergruppe"; +$lang['listnxup'] = "nächster Rang"; +$lang['listrank'] = "Rang"; +$lang['listseen'] = "zuletzt gesehen"; +$lang['listsuma'] = "ges. aktive Zeit"; +$lang['listsumi'] = "ges. idle Zeit"; +$lang['listsumo'] = "ges. online Zeit"; +$lang['listtime'] = "%s Tag(e), %s Std., %s Min., %s Sek."; +$lang['listuid'] = "eindeutige Client-ID"; +$lang['new'] = "neu"; +$lang['nocount'] = "User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) ist ein Query-User oder ist mehrmals online (nur erste Verbindung zählt) -> diese wird nicht gewertet!"; +$lang['noentry'] = "Keine Einträge gefunden.."; +$lang['pass'] = "Passwort: "; +$lang['queryname'] = "Erster Botname ist bereits in Verwendung. Versuche zweiten Botnamen zu nutzen..."; +$lang['sccrmcld'] = "User mit der eindeutigen Client-ID %s wurde erfolgreich aus der Ranksystem Datenbank gelöscht."; +$lang['sccupcount'] = "User mit der eindeutigen Client-ID %s erhielt erfolgreich ein neue ges. online Zeit von %s."; +$lang['setontime'] = "ges. online Zeit"; +$lang['setontimedesc'] = "Gib eine neue ges. online Zeit ein, welche bei den zuvor selektierten Usern hinterlegt werden soll. Mit dieser wird die alte ges. online Zeit überschrieben.

Die eingegeben ges. online Zeit wird für die nächsten Rangsteigerungen berücksichtigt."; +$lang['sgrpadd'] = "Servergruppe %s zu User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) hinzugefügt."; +$lang['sgrprerr'] = "Es ist ein Problem mit den Servergruppen des Users %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) aufgetreten!"; +$lang['sgrprm'] = "Servergruppe %s von User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) entfernt."; +$lang['sitegen'] = "Seite generiert in %s Sekunden mit %s Clients."; +$lang['sitegenl'] = "Seite generiert in %s Sekunden mit %s Clients (davon %s angezeigt; %s betroffen von Ausnahmeregeln; %s im höchsten Rang)."; +$lang['stix0001'] = "Server Statistiken"; +$lang['stix0002'] = "Anzahl User"; +$lang['stix0003'] = "zeige Liste aller User"; +$lang['stix0004'] = "Online Zeit aller User / Total"; +$lang['stix0005'] = "zeige Top User aller Zeiten"; +$lang['stix0006'] = "zeige Top User des Monats"; +$lang['stix0007'] = "zeige Top User der Woche"; +$lang['stix0008'] = "Server Nutzung"; +$lang['stix0009'] = "der letzten 7 Tage"; +$lang['stix0010'] = "der letzten 30 Tage"; +$lang['stix0011'] = "der letzten 24 Stunden"; +$lang['stix0012'] = "wähle Zeitraum"; +$lang['stix0013'] = "letzten 24 Stunden"; +$lang['stix0014'] = "letzte Woche"; +$lang['stix0015'] = "letzer Monat"; +$lang['stix0016'] = "Aktive / Inaktive Zeit (aller User)"; +$lang['stix0017'] = "Versionen (aller User)"; +$lang['stix0018'] = "Nationalitäten (aller User)"; +$lang['stix0019'] = "Plattformen (aller User)"; +$lang['stix0020'] = "Server Details"; +$lang['stix0023'] = "Server Status"; +$lang['stix0024'] = "Online"; +$lang['stix0025'] = "Offline"; +$lang['stix0026'] = "User (Online / Max)"; +$lang['stix0027'] = "Anzahl aller Channel"; +$lang['stix0028'] = "Server Ping (Mittelwert)"; +$lang['stix0029'] = "Eingehende Daten insg."; +$lang['stix0030'] = "Ausgehende Daten insg."; +$lang['stix0031'] = "Server online seit"; +$lang['stix0032'] = "vor Offlineschaltung:"; +$lang['stix0033'] = "00 Tage, 00 Stunden, 00 Min., 00 Sek."; +$lang['stix0034'] = "Paketverlust (Mittelwert)"; +$lang['stix0035'] = " "; +$lang['stix0036'] = "Server Name"; +$lang['stix0037'] = "Server Adresse (Host Adresse : Port)"; +$lang['stix0038'] = "Server Passwort"; +$lang['stix0039'] = "Nein (Öffentlich)"; +$lang['stix0040'] = "Ja (Privat)"; +$lang['stix0041'] = "Server ID"; +$lang['stix0042'] = "Server Plattform"; +$lang['stix0043'] = "Server Version"; +$lang['stix0044'] = "Server Erstelldatum (dd/mm/yyyy)"; +$lang['stix0045'] = "Report an Serverliste"; +$lang['stix0046'] = "Aktiv"; +$lang['stix0047'] = "Deaktiviert"; +$lang['stix0048'] = "nicht genügend Daten ..."; +$lang['stix0049'] = "Online Zeit aller User / Monat"; +$lang['stix0050'] = "Online Zeit aller User / Woche"; +$lang['stix0051'] = "TeamSpeak hat gefailed, daher kein Erstelldatum..."; +$lang['stmy0001'] = "Meine Statistiken"; +$lang['stmy0002'] = "Rank"; +$lang['stmy0003'] = "Datenbank ID:"; +$lang['stmy0004'] = "Eindeutige Client ID:"; +$lang['stmy0005'] = "Insg. Verbunden zum TS"; +$lang['stmy0006'] = "Startzeitpunkt der Statistiken:"; +$lang['stmy0007'] = "Gesamte online Zeit:"; +$lang['stmy0008'] = "Online Zeit der letzten 7 Tage:"; +$lang['stmy0009'] = "Online Zeit der letzten 30 Tage:"; +$lang['stmy0010'] = "Errungenschaften:"; +$lang['stmy0011'] = "Fortschritt Errungenschaft Zeit"; +$lang['stmy0012'] = "Zeit: Legendär"; +$lang['stmy0013'] = "Da du bereits %s Stunden auf dem Server online bist."; +$lang['stmy0014'] = "Abgeschlossen"; +$lang['stmy0015'] = "Zeit: Gold"; +$lang['stmy0016'] = "% erreicht für Legendär"; +$lang['stmy0017'] = "Zeit: Silber"; +$lang['stmy0018'] = "% erreicht für Gold"; +$lang['stmy0019'] = "Zeit: Bronze"; +$lang['stmy0020'] = "% erreicht für Silber"; +$lang['stmy0021'] = "Zeit: Unranked"; +$lang['stmy0022'] = "% erreicht für Bronze"; +$lang['stmy0023'] = "Fortschritt Errungenschaft Verbindungen"; +$lang['stmy0024'] = "Verbindungen: Legendär"; +$lang['stmy0025'] = "Da du bereits %s zum Server verbunden warst."; +$lang['stmy0026'] = "Verbindungen: Gold"; +$lang['stmy0027'] = "Verbindungen: Silber"; +$lang['stmy0028'] = "Verbindungen: Bronze"; +$lang['stmy0029'] = "Verbindungen: Unranked"; +$lang['stmy0030'] = "Fortschritt nächste Servergruppe"; +$lang['stnv0001'] = "Server News"; +$lang['stnv0002'] = "Schließen"; +$lang['stnv0003'] = "Client Informationen aktualisieren"; +$lang['stnv0004'] = "Benutze diese Funktion, wenn sich deine TS3 Daten geändert haben, wie z.B. dein Username."; +$lang['stnv0005'] = "Du musst hierfür mit dem TS3 Server verbunden sein!"; +$lang['stnv0006'] = "Aktualisieren"; +$lang['stnv0007'] = "Battle Area - Page Content"; +$lang['stnv0008'] = "You can challenge other users in a battle between two users or two teams."; +$lang['stnv0009'] = "While the battle is active the online time of the teams/users will be counted."; +$lang['stnv0010'] = "When the battle ends the team/user with the highest online time wins."; +$lang['stnv0011'] = "(The regular battling time is 48 hours)"; +$lang['stnv0012'] = "The winning team/user will recieve a price, which the user can use whenever the user wants."; +$lang['stnv0013'] = "It will be displayed on the My Statistics tab."; +$lang['stnv0014'] = "(Could be online time boost(2x) for 8 hours, instant online time (4 hours), etc."; +$lang['stnv0015'] = "These boosts can be used for example to climb in the top users of the week."; +$lang['stnv0016'] = "nicht verfügbar"; +$lang['stnv0017'] = "Du bist nicht mit dem TS3 Server verbunden, daher können kein Daten angezeigt werden."; +$lang['stnv0018'] = "Bitte verbinde dich mit dem TS3 Server und aktualisiere anschließend die Session über den Aktualisierungs-Button oben rechts in der Ecke."; +$lang['stnv0019'] = "Statistiken - Inhaltserläuterung"; +$lang['stnv0020'] = "Diese Seite zeigt u.a. eine Übersicht deiner persönlichen Statistiken und Aktivität auf dem TS3 Server."; +$lang['stnv0021'] = "Die Informationen wurden gesammelt seit Beginn des Ranksystems, nicht seit Beginn des TS3 Servers."; +$lang['stnv0022'] = "Die Seite erhält ihre Daten aus einer Datenbank. Es ist also möglich, dass die angezeigten Werte von den live Werten abweichen."; +$lang['stnv0023'] = "Die Werte innerhalb der Donut-Charts können von der Anzahl der User abweichen. Hintergrund ist, dass die Daten in älteren Versionen des Ranksystems nicht gesammelt wurden."; +$lang['stnv0024'] = "Ranksystem - Statistiken"; +$lang['stnv0025'] = "Anzahl Einträge"; +$lang['stnv0026'] = "alle"; +$lang['stnv0027'] = "Die Informationen auf dieser Seite scheinen veraltet! Es scheint, das Ranksystem ist nicht mehr mit dem TS3 verbunden."; +$lang['stnv0028'] = "(Du bist nicht zum TS3 verbunden!)"; +$lang['stnv0029'] = "Rank-Liste"; +$lang['stnv0030'] = "Ranksystem Info"; +$lang['stnv0031'] = "DE - Deutsch"; +$lang['stnv0032'] = "EN - English"; +$lang['stnv0033'] = "RU - русский"; +$lang['stnv0034'] = "IT - italiano"; +$lang['stri0001'] = "Ranksystem Informationen"; +$lang['stri0002'] = "Was ist das Ranksystem?"; +$lang['stri0003'] = "Ein TS3 Bot, der automatisch Servergruppen an User für online Zeit oder aktive Zeit auf einem TeamSpeak 3 Server zuweist. Weiterhin sammelt es diverse Statistiken und stellt diese hier dar."; +$lang['stri0004'] = "Wer hat das Ranksystem erstellt?"; +$lang['stri0005'] = "Wann wurde das Ranksystem erstellt?"; +$lang['stri0006'] = "Erste Alpha Version: 05/10/2014."; +$lang['stri0007'] = "Erste Beta Version: 01/02/2015."; +$lang['stri0008'] = "Die neuste Version kannst du auf der Ranksystem Website sehen."; +$lang['stri0009'] = "Wie wurde das Ranksystem erstellt?"; +$lang['stri0010'] = "Das Ranksystem basiert auf"; +$lang['stri0011'] = "Es nutzt weiterhin die folgenden Programmbibliotheken:"; +$lang['stri0012'] = "Ein spezieller Danke ergeht an:"; +$lang['stri0013'] = "sergey - für die russische Übersetzung"; +$lang['stri0014'] = "Bejamin Frost - für die Initialisierung des Bootstrap Designs"; +$lang['stri0015'] = "ZanK - für die italienische Übersetzung"; +$lang['sttw0001'] = "Top User"; +$lang['sttw0002'] = "der Woche"; +$lang['sttw0003'] = "mit %s Stunden online Zeit"; +$lang['sttw0004'] = "Top 10 im Vergleich"; +$lang['sttw0005'] = "Stunden (definiert 100 %)"; +$lang['sttw0006'] = "%s Stunden (%s%)"; +$lang['sttw0007'] = "Top 10 Statistiken"; +$lang['sttw0008'] = "Top 10 vs Andere; Online Zeit"; +$lang['sttw0009'] = "Top 10 Vs Others; Aktive Zeit"; +$lang['sttw0010'] = "Top 10 Vs Others; Inaktive Zeit"; +$lang['sttw0011'] = "Top 10 (in Stunden)"; +$lang['sttw0012'] = "Andere %s User (in Stunden)"; +$lang['sttw0013'] = "mit %s Stunden aktive Zeit"; +$lang['sttm0001'] = "des Monats"; +$lang['stta0001'] = "aller Zeiten"; +$lang['updb'] = "Das Update muss nur ausgeführt werden, wenn das Ranksystem bereits mit einer älteren Version als %s genutzt wird!

Führe das Update nur einmal aus und lösche danach die 'update_%s.php' sofort von deinem Webserver.


Update Datenbank:
"; +$lang['updel'] = "Bitte lösche die folgenden Dateien vom Hauptverzeichnis des Ranksystems, sofern sie existieren:
%s"; +$lang['upinf'] = "Eine neue Version des Ranksystems ist verfügbar. Informiere Clients auf dem Server..."; +$lang['upmov'] = "Bitte verschiebe die Datei \'%s\' in das Unterverzeichnis \'%s\' und überschreibe dabei die dort vorhandene Datei!"; +$lang['upmsg'] = "\nHey, eine neue Version des [B]Ranksystems[/B] ist verfügbar!\n\naktuelle Version: %s\n[B]neue Version: %s[/B]\n\nBitte schaue auf unsere Homepage für weitere Informationen [URL]http://ts-n.net/ranksystem.php[/URL]."; +$lang['upsucc'] = "Datenbank-Update erfolgreich durchgeführt"; +$lang['upuser'] = "User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) erhält eine neue ges. online Zeit von %s (davon aktiv: %s)."; +$lang['upuserboost'] = "User %s (eindeutige Client-ID: %s; Client-Datenbank-ID %s) erhält eine neue ges. online Zeit von %s (davon aktiv: %s) [BOOST %sx]."; +$lang['upusrerr'] = "Die eindeutige Client-ID %s konnte auf dem TeamSpeak nicht erreicht werden!"; +$lang['upusrinf'] = "User %s wurde erfolgreich benachrichtigt."; +$lang['user'] = "Benutzername: "; +$lang['usermsgactive'] = "\nHey, du bist im Rang gestiegen, da du eine Aktivität von %s Tagen, %s Stunden, %s Minuten und %s Sekunden erreicht hast."; +$lang['usermsgonline'] = "\nHey, du bist im Rang gestiegen, da du bereits %s Tage, %s Stunden, %s Minuten und %s Sekunden online warst."; +$lang['wiaction'] = "ausführen"; +$lang['wibgco'] = "Hintergrundfarbe:"; +$lang['wibgcodesc'] = "Lege eine Hintergrundfarbe fest
(gültiger HTML Code; muss mit # beginnen)"; +$lang['wiboost'] = "Boost"; +$lang['wiboostdesc'] = "Gebe einen User auf dem TeamSpeak Server eine Servergruppe (ist manuell zu erstellen), welche hier für das Ranksystem als Boost Gruppe deklariert werden kann. Definiere hierfür noch einen Faktor (z.B. 2x) und eine Zeit, wie lange der Boost gewährt werden soll.
Umso höher der Faktor, umso schneller erreicht ein User den nächst höheren Rang.
Ist die Zeit abgelaufen, so wird dem betroffenen User die Servergruppe automatisch entfernt. Die Zeit beginnt in dem Moment zu laufen, in dem der User die Servergruppe erhält.

Servergruppen-ID => Faktor => Zeit (in Sekunden)

Beispiel:
12=>2=>6000,13=>3=>2500,14=>5=>600

Hier werden den Usern in der Servergruppe mit der ID 12 dem Faktor 2 für 6000 Sekunden, den Usern in der Servergruppe 13 dem Faktor 3 für 2500 Sekunden gewährt, und so weiter..."; +$lang['wichdbid'] = "Client-Datenbank-ID Reset"; +$lang['wichdbiddesc'] = "Setzt die online Zeit eines Users zurück, wenn sich seine TeamSpeak Client-Datenbank-ID ändert.

Beispiel:
Wird ein Client vom TeamSpeak Server gelöscht, so erhält er mit der nächsten Verbindung zum Server eine neue Client-Datenbank-ID."; +$lang['wiconferr'] = "Es ist ein Fehler in der Konfiguration des Ranksystems. Bitte prüfe im Webinterface die Kern-Einstellungen auf Richtigkeit. Besonders sollte die Einstellung 'Rangsteigerung' geprüft werden!"; +$lang['widaform'] = "Datumsformat"; +$lang['widaformdesc'] = "Gebe ein Datumsformat zur Anzeige vor.

Beispiel:
%a Tage, %h Std., %i Min., %s Sek."; +$lang['widbcfgsuc'] = "Datenbank Einstellungen erfolgreich gespeichert."; +$lang['widbcfgerr'] = "Fehler beim Speichern der Datenbank Einstellungen! Verbindung zur Datenbank oder speichern der 'other/dbconfig.php' nicht möglich."; +$lang['widelcld'] = "lösche Clients"; +$lang['widelcldgrp'] = "Servergruppen zurücksetzen"; +$lang['widelcldgrpdesc'] = "Das Ranksystem merkt sich die vergebenen Servergruppen, sodass nicht mit jedem Lauf der worker.php diese nochmals überprüft bzw. vergeben werden.

Mit dieser Funktion ist es möglich, dieses Wissen einmalig zurückzusetzen. Dadurch versucht das Ranksystem alle User (welche auf dem TS3 Server online sind) in die aktuell gültige Servergruppe zu setzen.
Für jeden User, welcher eine Servergruppe erhält bzw. in der vorhanden verbleibt, wird die Wissensdatenbank wie zu Anfang beschrieben wieder aufgebaut.

Diese Funktion kann hilreich sein, wenn sich User nicht in der Servergruppe befinden, welche für die jeweilige online Zeit vorgesehen ist.

Achtung: Bitte diese Funktion in einem Moment ausführen, in dem für nächsten Minuten kein Rankup ansteht!!! Das Ranksystem kann dann nämlich die alten Gruppen entfernen, da es hiervon nichts mehr weiß ;-)"; +$lang['widelclddesc'] = "Lösche zuvor selektierte User aus der Ranksystem Datenbank.

Hiermit bleiben die Userdaten auf dem TeamSpeak Server unberührt!"; +$lang['widelsg'] = "entferne aus Servergruppen"; +$lang['widelsgdesc'] = "Wähle, ob Clients auch aus den Servergruppen entfernt werden sollen, wenn sie aus der Ranksystem Datenbank gelöscht werden.

Es werden nur Servergruppen beachtet, welche das Ranksystem betreffen!"; +$lang['wideltime'] = "Löschzeitraum"; +$lang['wideltimedesc'] = "Lösche alte Clients aus aus der Ranksystem Datenbank.
Gib eine Zeit in Sekunden ein, welche ein User nicht mehr online war, damit er gelöscht wird.

0 - löscht alle User aus dem Ranksystem

Hiermit bleiben die Userdaten auf dem TeamSpeak Server unberührt!"; +$lang['wiexgrp'] = "Servergruppen-Ausnahmen"; +$lang['wiexgrpdesc'] = "Eine mit Komma getrennte Liste von Servergruppen-IDs, welche nicht am Ranksystem teilnehmen sollen.

User in mindestens einer dieser Gruppen sind von Rangsteigerungen ausgenommen."; +$lang['wiexuid'] = "Client-Ausnahmen"; +$lang['wiexuiddesc'] = "Eine mit Komma getrennte Liste von eindeutigen Client-IDs, welche nicht am Ranksystem teilnehmen sollen.

Aufgelistete User sind von Rangsteigerungen ausgenommen."; +$lang['wigrptime'] = "Rangsteigerung"; +$lang['wigrptimedesc'] = "Definiere hier, nach welcher Zeit ein User automatisch in eine vorgegebene Servergruppe gelangen soll.

Zeit (Sekunden)=>Servergruppen ID

Entscheidend hierfür ist die online Zeit des User bzw. wenn 'Idlezeit' aktiv, dann die aktive Zeit.

Jeder Eintrag ist vom nächsten durch ein Komma zu separieren.

Die Zeiten sind kummulativ zu hinterlegen.

Beispiel:
60=>9,120=>10,180=>11

Hier werden die User nach 60 Sekunden in die Servergruppe 9, nach wiederum 60 Sekunden in die Servergruppe 10, usw..., hinzugefügt."; +$lang['wihdco'] = "Überschriftenfarbe:"; +$lang['wihdcodesc'] = "Lege eine Überschriftenfarbe fest.
(gültiger HTML Code; muss mit # beginnen)"; +$lang['wihl'] = "Webinterface - Ranksystem"; +$lang['wihladm'] = "Admin Liste"; +$lang['wihlcfg'] = "Kern-Einstellungen"; +$lang['wihlclg'] = "Clients editieren (Global)"; +$lang['wihlcls'] = "Clients edidieren (Selektiv)"; +$lang['wihldb'] = "Datenbank-Einstellungen"; +$lang['wihlsty'] = "Style-Einstellungen"; +$lang['wihlts'] = "TeamSpeak-Einstellungen"; +$lang['wihvco'] = "Hoverfarbe:"; +$lang['wihvcodesc'] = "Lege eine Hoverfarbe fest.
(gültiger HTML Code; muss mit # beginnen)"; +$lang['wiifco'] = "Infotextfarbe:"; +$lang['wiifcodesc'] = "Lege eine Infotextfarbe fest.
(gültiger HTML Code; muss mit # beginnen)"; +$lang['wilogout'] = "Abmelden"; +$lang['wilog'] = "Log-Pfad"; +$lang['wilogdesc'] = "Pfad in dem das Logfile des Ranksystems geschrieben werden soll.

Beispiel:
/var/logs/ranksystem/

Beachte, dass der Webuser Schreibrechte in dem Verzeichnis hat."; +$lang['wimsgusr'] = "Benachrichtigung"; +$lang['wimsgusrdesc'] = "Informiere den User per privater Textnachricht über seine Rangsteigerung.

Definiere die Nachricht in der 'lang.php'
(usermsgonline bzw. usermsgactive)"; +$lang['wiscco'] = "Erfolgsmeldungsfarbe:"; +$lang['wisccodesc'] = "Lege eine Erfolgsmeldungsfarbe fest.
(gültiger HTML Code; muss mit # beginnen)"; +$lang['wiselcld'] = "selektiere User"; +$lang['wiselclddesc'] = "Wähle User anhand des letzt bekannten Usernamen aus. Hierfür einfach losschreiben.
Mehrfachselektionen sind kommagetrennt möglich, welche automatisch vorgenommen werden.

Mit den selektierten Usern kann im nächsten Schritt eine Aktion gewählt werden."; +$lang['wishcolas'] = "aktuelle Servergruppe"; +$lang['wishcolasdesc'] = "Zeige Spalte 'aktuelle Servergruppe' in der list_rankup.php"; +$lang['wishcolat'] = "aktive Zeit"; +$lang['wishcolatdesc'] = "Zeige Spalte 'ges. aktive Zeit' in der list_rankup.php"; +$lang['wishcolcld'] = "Client-Name"; +$lang['wishcolclddesc'] = "Zeige Spalte 'Client-Name' in der list_rankup.php"; +$lang['wishcoldbid'] = "Datenbank-ID"; +$lang['wishcoldbiddesc'] = "Zeige Spalte 'Client-Datenbank-ID' in der list_rankup.php"; +$lang['wishcolit'] = "idle Zeit"; +$lang['wishcolitdesc'] = "Zeige Spalte 'ges. idle Zeit' in der list_rankup.php"; +$lang['wishcolls'] = "zuletzt gesehen"; +$lang['wishcollsdesc'] = "Zeige Spalte 'zuletzt gesehen' in der list_rankup.php"; +$lang['wishcolnx'] = "nächster rank up"; +$lang['wishcolnxdesc'] = "Zeige Spalte 'nächster Rang' in der list_rankup.php"; +$lang['wishcolot'] = "online Zeit"; +$lang['wishcolotdesc'] = "Zeige Spalte 'ges. online Zeit' in der list_rankup.php"; +$lang['wishcolrg'] = "Rang"; +$lang['wishcolrgdesc'] = "Zeige Spalte 'Rang' in der list_rankup.php"; +$lang['wishcolsg'] = "nächste Servergruppe"; +$lang['wishcolsgdesc'] = "Zeige Spalte 'nächste Servergruppe' in der list_rankup.php"; +$lang['wishcoluuid'] = "Client-ID"; +$lang['wishcoluuiddesc'] = "Zeige Spalte 'eindeutige Client-ID' in der list_rankup.php"; +$lang['wishexcld'] = "ausgeschl. Clients"; +$lang['wishexclddesc'] = "Zeige User in der list_rankup.php, welche über die 'Client-Ausnahmen' nicht am Ranksystem teilnehmen."; +$lang['wishexgrp'] = "ausgeschl. Servergruppen"; +$lang['wishexgrpdesc'] = "Zeige User in der list_rankup.php, welche über die 'Servergruppen-Ausnahmen' nicht am Ranksystem teilnehmen."; +$lang['wishgen'] = "Seitengenerierung"; +$lang['wishgendesc'] = "Zeige die Zeit, welche zur Generierung der Seite benötigt wird, am Ende der Seite."; +$lang['wishhicld'] = "User in höchestem Rang"; +$lang['wishhiclddesc'] = "Zeige User in der list_rankup.php, welche den höchsten Rang erreicht haben."; +$lang['wisupidle'] = "Idlezeit"; +$lang['wisupidledesc'] = "Ist diese Funktion aktiv, wird die 'ges. idle Zeit' eines Users von der 'ges. online Zeit' abgezogen. Anstelle der 'ges. online Zeit' wird somit die vorgenannte Differenz für Rangsteigerungen herangezogen."; +$lang['wisvconf'] = "speichern"; +$lang['wisvsuc'] = "Änderungen erfolgreich gesichert!"; +$lang['witime'] = "Zeitzone"; +$lang['witimedesc'] = "Wähle die Zeitzone, die für den Sever gilt."; +$lang['wits3dch'] = "Default Channel"; +$lang['wits3dchdesc'] = "Die channel-ID, mit der sich der Bot verbindet.

In diesem Channel wechselt der Bot nach dem Verbinden mit dem TeamSpeak Server."; +$lang['wits3host'] = "TS3 Hostadresse"; +$lang['wits3hostdesc'] = "TeamSpeak 3 Server Adresse
(IP oder DNS)"; +$lang['wits3sm'] = "Slowmode"; +$lang['wits3smdesc'] = "Mit dem Slowmode werden die Query-Anfragen an den TeamSpeak Server reduziert. Dies schützt vor einem Ban aufgrund von flooding.
TeamSpeak Query Befehle werden mit dieser Funktion verzögert abgeschickt.

!!! AUCH REDUZIERT ER DIE CPU USAGE !!!

Die Aktivierung ist nicht empfohlen, wenn nicht benötigt. Die Verzögerung (delay) erhöht die Laufzeit eines Durchgangs des Bots, dadurch wird er unpräziser."; +$lang['wits3qnm'] = "Botname"; +$lang['wits3qnm2'] = "2. Botname"; +$lang['wits3qnm2desc'] = "Ein zweiter Botname, falls der erste bereits genutzt wird."; +$lang['wits3qnmdesc'] = "Der Name, mit dem die Query-Verbindung augebaut werden soll.
Der Name kann frei gewählt werden."; +$lang['wits3querpw'] = "TS3 Query-Passwort"; +$lang['wits3querpwdesc'] = "TeamSpeak 3 Query Passwort
Passwort des Query Benutzers"; +$lang['wits3querusr'] = "TS3 Query-Benutzer"; +$lang['wits3querusrdesc'] = "TeamSpeak 3 Query Benutzername
Standard ist serveradmin
Natürlich kann auch ein gesonderter Query-Benutzer erstellt und genutzt werden.
Die benötigten Rechte sind hier aufgelistet:
http://ts-n.net/ranksystem.php"; +$lang['wits3query'] = "TS3 Query-Port"; +$lang['wits3querydesc'] = "TeamSpeak 3 Query Port
Standard ist 10011 (TCP)
andere Werte sollten in der 'ts3server.ini' zu finden sein."; +$lang['wits3voice'] = "TS3 Voice-Port"; +$lang['wits3voicedesc'] = "TeamSpeak 3 Voice Port
Standard ist 9987 (UDP)
Dieser Port wird zum Verbinden mit dem TS3 Client genutzt."; +$lang['witxco'] = "Textfarbe:"; +$lang['witxcodesc'] = "Lege eine Textfarbe fest.
(gültiger HTML Code; muss mit # beginnen)"; +$lang['wiupcheck'] = "Update-Prüfung"; +$lang['wiupcheckdesc'] = "Ist die Update-Prüfung aktiv, werden nachfolgend genannte User mit einer privaten Textnachricht informiert, sobald ein Update verfügbar ist."; +$lang['wiuptime'] = "Prüfungsintervall"; +$lang['wiuptimedesc'] = "Gib an alle wie viel Sekunden das Ranksystem prüfen soll, ob ein Update verfügbar ist.
Beachte, bei jeder Prüfung werden die hinterlegten User über ein verfügbares Update benachrichtigt. Ist kein hinterlegter User online, wird mit dem nächsten Intervall versucht zu benachrichtigen."; +$lang['wiupuid'] = "Empfänger"; +$lang['wiupuiddesc'] = "Eine Komma getrennte Liste von eindeutigen Client-IDs, welche via privater Textnachricht auf dem TeamSpeak über ein Update informiert werden sollen."; +$lang['wiversion'] = "(verwendete Version %s)"; +$lang['wivlang'] = "Sprache"; +$lang['wivlangdesc'] = "Sprache des Ranksystems

de - Deutsch
en - english
it - italiano
ru - русский"; +$lang['wiwnco'] = "Warntextfarbe:"; +$lang['wiwncodesc'] = "Lege eine Warntextfarbe fest.
(gültiger HTML Code; muss mit # beginnen)"; +?> \ No newline at end of file diff --git a/languages/core_en.php b/languages/core_en.php index 935beaa..00ce0de 100644 --- a/languages/core_en.php +++ b/languages/core_en.php @@ -1 +1,361 @@ - added to the Ranksystem now.";$lang['alrup']="You already updated your database. Please delete this file from your webspace!";$lang['changedbid']="User %s (unique Client-ID: %s) got a new TeamSpeak Client-database-ID (%s). Update the old Client-database-ID (%s) and reset collected times!";$lang['crawl']="Scan for connected user and count the activity...";$lang['clean']="Scan for clients, which have to delete...";$lang['cleanc']="clean clients";$lang['cleancdesc']="With this function the old clients in the Ranksystem get deleted.

To this end, the Ranksystem sychronized with the TeamSpeak database. Clients, which do not exist in TeamSpeak, will be deleted from the Ranksystem.

This function is only enabled when the 'Slowmode' is deactivated!


For automatic adjustment of the TeamSpeak database the ClientCleaner can be used:
http://ts-n.net/clientcleaner.php";$lang['cleandel']="There were %s clients deleted out of the Ranksystem database, cause they were no longer existing in the TeamSpeak database.";$lang['cleanno']="There were nothing to delete...";$lang['cleanp']="clean period";$lang['cleanpdesc']="Set a time that has to elapse before the 'clean clients' runs next.

Set a time in seconds.

Recommended is once a day, cause the client cleaning needs much time for bigger databases.";$lang['cleanrs']="Clients in the Ranksystem database: %s";$lang['cleants']="Clients found in the TeamSpeak database: %s (of %s)";$lang['days']="days";$lang['dbconerr']="Failed to connect to MySQL-Database: ";$lang['delcldgrpif']="Error while removing the knowledge for servergroups: %s";$lang['delcldgrpsc']="Knowledge about servergroups for %s User successfully removed.";$lang['delclientsif']="%s Clients deleted out of the Ranksystem database!";$lang['delclientssc']="%s Clients successfully deleted out of the Ranksystem database!";$lang['errlogin']="Username and/or password are incorrect! Try again...";$lang['error']="Error ";$lang['errremgrp']="Error while removing user with unique Client-ID %s out of the servergroup with servergroup-database-ID %s!";$lang['errremdb']="Error while removing user with unique Client-ID % out of the Ranksystem database!";$lang['errsel']="Error while choosing the selections with
selected client: %s
option 'delete clients': %s
option 'sum. online time': %s";$lang['errukwn']="An unknown error has occurred!";$lang['errupcount']="Error while renewing the summary online time of %s by user with the unique Client-ID %s";$lang['firstuse']="Seems to be the first run. Start logging the Userhistory...";$lang['highest']="highest rank reached";$lang['instdb']="Install database:";$lang['instdberr']="Error while creating the database: ";$lang['instdbsubm']="Create database";$lang['instdbsuc']="Database %s successfully created.";$lang['insttb']="Install Tables:";$lang['insttberr']="Error while creating table: ";$lang['insttbsuc']="Table %s successfully created.";$lang['isntwicfg']="Can't save the database configuration! Please edit the 'other/dbconfig.php' with a chmod 0777 and try again after.";$lang['isntwichm']="Please edit the 'other/dbconfig.php', and the folders 'avatars/', 'icons/' and 'logs/' with the needed permissions. Therefore edit the chmod to 0777. After it try again (reload the page).";$lang['isntwidb']="Enter your database settings:";$lang['isntwidberr']="Please check if you filled out all fields correctly!";$lang['isntwidbhost']="DB Hostaddress:";$lang['isntwidbhostdesc']="Database server address
(IP or DNS)";$lang['isntwidbmsg']="Database error: ";$lang['isntwidbname']="DB Name:";$lang['isntwidbnamedesc']="Name of database";$lang['isntwidbpass']="DB Password:";$lang['isntwidbpassdesc']="Password to access the database";$lang['isntwidbtype']="DB Type:";$lang['isntwidbtypedesc']="Database type

You have to install the needed PDO Driver.
For more informations have look at the requirements on http://ts-n.net/ranksystem.php";$lang['isntwidbusr']="DB User:";$lang['isntwidbusrdesc']="User to access the database";$lang['isntwidel']="Please delete the file 'install.php' and all 'update_x-xx.php' files from your webserver and open the %s to configure the Ranksystem!";$lang['isntwiusr']="User for the webinterface successfully created.";$lang['isntwiusrcr']="create access";$lang['isntwiusrdesc']="Enter a username and password for access the webinterface. With the webinterface you can configurate the ranksytem.";$lang['isntwiusrh']="Access - Webinterface";$lang['listacsg']="actual servergroup";$lang['listcldbid']="Client-database-ID";$lang['listexgrp']="Will not conside for the Ranksystem (servergroup exception).";$lang['listexuid']="Will not conside for the Ranksystem (client exception).";$lang['listip']="IP address";$lang['listnick']="Clientname";$lang['listnxsg']="next servergroup";$lang['listnxup']="next rank up";$lang['listrank']="rank";$lang['listseen']="last seen";$lang['listsuma']="sum. active time";$lang['listsumi']="sum. idle time";$lang['listsumo']="sum. online time";$lang['listtime']="%s day(s), %s hour(s), %s min., %s sec.";$lang['listuid']="unique Client-ID";$lang['new']="new";$lang['nocount']="User %s (unique Client-ID: %s; Client-database-ID %s) is a query-user or is several times online (only first connection counts) -> this will not count!";$lang['noentry']="No entries found..";$lang['pass']="Password: ";$lang['queryname']="First Botname already in use. Trying with second Botname...";$lang['sccrmcld']="User with unique Client-ID %s successfull removed from the Ranksystem database.";$lang['sccupcount']="User with the unique Client-ID %s successfull overwritten with a summary online time of %s.";$lang['setontime']="sum. online time";$lang['setontimedesc']="Enter a new summary online time, which should be set to the previous selected clients. With this the old summary online gets overwritten.

The entered summary online time will be considered for the rank up.";$lang['sgrpadd']="Grant servergroup %s to user %s (unique Client-ID: %s; Client-database-ID %s).";$lang['sgrprerr']="It happened a problem with the servergroup of the user %s (unique Client-ID: %s; Client-database-ID %s)!";$lang['sgrprm']="Removed servergroup %s from user %s (unique Client-ID: %s; Client-database-ID %s).";$lang['sitegen']="Site generated in %s seconds with %s clients.";$lang['sitegenl']="Site generated in %s seconds with %s clients (thereof %s displayed; %s affected by exception rules; %s in highest rank).";$lang['stix0001']="Server statistics";$lang['stix0002']="Total users";$lang['stix0003']="View details";$lang['stix0004']="Online time of all user / Total";$lang['stix0005']="View top of all time";$lang['stix0006']="View top of the month";$lang['stix0007']="View top of the week";$lang['stix0008']="Server usage";$lang['stix0009']="In the last 7 days";$lang['stix0010']="In the last 30 days";$lang['stix0011']="In the last 24 hours";$lang['stix0012']="select period";$lang['stix0013']="Last day";$lang['stix0014']="Last week";$lang['stix0015']="Last month";$lang['stix0016']="Active / inactive time (of all clients)";$lang['stix0017']="Versions (of all clients)";$lang['stix0018']="Nationalities (of all clients)";$lang['stix0019']="Platforms (of all clients)";$lang['stix0020']="Current statistics";$lang['stix0021']="Requested information";$lang['stix0022']="Result";$lang['stix0023']="Server status";$lang['stix0024']="Online";$lang['stix0025']="Offline";$lang['stix0026']="Clients (Online / Max)";$lang['stix0027']="Amount of channels";$lang['stix0028']="Average server ping";$lang['stix0029']="Total bytes received";$lang['stix0030']="Total bytes sent";$lang['stix0031']="Server uptime";$lang['stix0032']="before offline:";$lang['stix0033']="00 Days, 00 Hours, 00 Mins, 00 Secs";$lang['stix0034']="Average packet loss";$lang['stix0035']="Overall statistics";$lang['stix0036']="Server name";$lang['stix0037']="Server address (Host Address : Port)";$lang['stix0038']="Server password";$lang['stix0039']="No (Server is public)";$lang['stix0040']="Yes (Server Is private)";$lang['stix0041']="Server ID";$lang['stix0042']="Server platform";$lang['stix0043']="Server version";$lang['stix0044']="Server creation date (dd/mm/yyyy)";$lang['stix0045']="Report to server list";$lang['stix0046']="Activated";$lang['stix0047']="Not activated";$lang['stix0048']="not enough data yet...";$lang['stix0049']="Online time of all user / month";$lang['stix0050']="Online time of all user / week";$lang['stix0051']="TeamSpeak has failed, so no creation date...";$lang['stmy0001']="My statistics";$lang['stmy0002']="Rank";$lang['stmy0003']="Database ID:";$lang['stmy0004']="Unique ID:";$lang['stmy0005']="Total connections to the server:";$lang['stmy0006']="Start date for statistics:";$lang['stmy0007']="Total online time:";$lang['stmy0008']="Online time last 7 days:";$lang['stmy0009']="Online time last 30 days:";$lang['stmy0010']="Achievements completed:";$lang['stmy0011']="Time achievement progress";$lang['stmy0012']="Time: Legendary";$lang['stmy0013']="Because you have an online time of %s hours.";$lang['stmy0014']="Progress completed";$lang['stmy0015']="Time: Gold";$lang['stmy0016']="% Completed for Legendary";$lang['stmy0017']="Time: Silver";$lang['stmy0018']="% Completed for Gold";$lang['stmy0019']="Time: Bronze";$lang['stmy0020']="% Completed for Silver";$lang['stmy0021']="Time: Unranked";$lang['stmy0022']="% Completed for Bronze";$lang['stmy0023']="Connection achievement progress";$lang['stmy0024']="Connects: Legendary";$lang['stmy0025']="Because You connected %s times to the server.";$lang['stmy0026']="Connects: Gold";$lang['stmy0027']="Connects: Silver";$lang['stmy0028']="Connects: Bronze";$lang['stmy0029']="Connects: Unranked";$lang['stnv0001']="Server news";$lang['stnv0002']="Close";$lang['stnv0003']="Refresh client information";$lang['stnv0004']="Only use this refresh, when your TS3 information got changed, such as your TS3 username";$lang['stnv0005']="It only works, when you are connected to the TS3 server at the same time";$lang['stnv0006']="Refresh";$lang['stnv0007']="Battle area - Page content";$lang['stnv0008']="You can challenge other users in a battle between two users or two teams.";$lang['stnv0009']="While the battle is active the online time of the teams/users will be counted.";$lang['stnv0010']="When the battle ends the team/user with the highest online time wins.";$lang['stnv0011']="(The regular battling time is 48 hours)";$lang['stnv0012']="The winning team/user will recieve a price, which the user can use whenever the user wants.";$lang['stnv0013']="It will be displayed on the My statistics tab.";$lang['stnv0014']="(Could be online time boost(2x) for 8 hours, instant online time (4 hours), etc.";$lang['stnv0015']="These boosts can be used for example to climb in the top users of the week)";$lang['stnv0016']="Not available";$lang['stnv0017']="You are not connected to the TS3 Server, so it can't display any data for you.";$lang['stnv0018']="Please connect to the TS3 Server and then Refresh your Session by pressing the blue Refresh Button at the top-right corner.";$lang['stnv0019']="My statistics - Page content";$lang['stnv0020']="This page contains a overall summary of your personal statistics and activity on the server.";$lang['stnv0021']="The informations are collected since the beginning of the Ranksystem, they are not since the beginning of the TeamSpeak server.";$lang['stnv0022']="This page receives its values out of a database. So the values might be delayed a bit.";$lang['stnv0023']="The sum inside of the donut charts may differ to the amount of 'Total user'. The reason is that this data weren't collected with older versions of the Ranksystem.";$lang['stnv0024']="Ranksystem - Statistics";$lang['stnv0025']="Limit entries";$lang['stnv0026']="all";$lang['stnv0027']="The informations on this site could be outdated! It seems the Ranksystem is no more connected to the TeamSpeak.";$lang['stnv0028']="(Not connected to TS3!)";$lang['stnv0029']="List Rankup";$lang['stnv0030']="Ranksystem info";$lang['stnv0031']="DE - Deutsch";$lang['stnv0032']="EN - English";$lang['stnv0033']="RU - русский";$lang['stri0001']="Ranksystem information";$lang['stri0002']="What is the Ranksystem?";$lang['stri0003']="A TS3 Bot, which automatically grant ranks (servergroups) to user on a TeamSpeak 3 Server for online time or online activity. It also gathers informations and statistics about the user and displays the result on this site.";$lang['stri0004']="Who created the Ranksystem?";$lang['stri0005']="When the Ranksystem was Created?";$lang['stri0006']="First alpha release: 05/10/2014.";$lang['stri0007']="First beta release: 01/02/2015.";$lang['stri0008']="You can see the newest version on the Ranksystem Website.";$lang['stri0009']="How was the Ranksystem created?";$lang['stri0010']="The Ranksystem is coded in";$lang['stri0011']="It uses also the following libraries:";$lang['stri0012']="Special Thanks To:";$lang['stri0013']="sergey - for russian translation";$lang['stri0014']="Bejamin Frost - for initialisation the bootstrap design";$lang['sttw0001']="Top users";$lang['sttw0002']="Of the week";$lang['sttw0003']="With %s hours online time";$lang['sttw0004']="Top 10 compared";$lang['sttw0005']="Hours (Defines 100 %)";$lang['sttw0006']="%s hours (%s%)";$lang['sttw0007']="Top 10 Statistics";$lang['sttw0008']="Top 10 vs others in online time";$lang['sttw0009']="Top 10 vs others in active time";$lang['sttw0010']="Top 10 vs others in inactive time";$lang['sttw0011']="Top 10 (in hours)";$lang['sttw0012']="Other %s users (in hours)";$lang['sttm0001']="Of the month";$lang['stta0001']="Of all time";$lang['updb']="You only have to run this if you want to update the Ranksystem from an older version to %s!

Run this once time and delete the update_%s.php file after from your webserver.


Update Database:
";$lang['updel']="Please remove the following files from the root directory of the ranksystem, if they are still existing:
%s";$lang['upinf']="A new Version of the Ranksystem is available; Inform clients on server...";$lang['upmov']="Please move the \'%s\' into the subfolder \'%s\' and overwrite the existing one!";$lang['upmsg']="\nHey, a new version of the [B]Ranksystem[/B] is available!\n\ncurrent version: %s\n[B]new version: %s[/B]\n\nPlease check out our site for more informations [URL]http://ts-n.net/ranksystem.php[/URL].";$lang['upsucc']="Database update successfully executed.";$lang['upuser']="User %s (unique Client-ID: %s; Client-database-ID %s) gets a new count (sum. online time) of %s (thereof active %s).";$lang['upuserboost']="User %s (unique Client-ID: %s; Client-database-ID %s) gets a new count (sum. online time) of %s (thereof active %s) [BOOST %sx].";$lang['upusrerr']="The unique Client-ID %s couldn't reached on the TeamSpeak!";$lang['upusrinf']="User %s was successfully informed.";$lang['user']="Username: ";$lang['usermsgactive']="\nHey, you got a rank up, cause you reached an activity of %s days, %s hours, %s minutes and %s seconds.";$lang['usermsgonline']="\nHey, you got a rank up, cause you reached an online time of %s days, %s hours, %s minutes and %s seconds.";$lang['wiaction']="action";$lang['wibgco']="Background color:";$lang['wibgcodesc']="Define a background color.
(valid HTML Code; have to beginn with # )";$lang['wiboost']="boost";$lang['wiboostdesc']="Give an user on your TeamSpeak server a servergroup (have to be created manually), which you can declare here as boost group. Define also a factor which should be used (for example 2x) and a time, how long the boost should be rated.
The higher the factor, the faster an user reaches the next higher rank.
Is the time expired, the boost servergroup get automatically removed from the concerned user. The time starts running as soon as the user gets the servergroup.

servergroup ID => factor => time (in seconds)

Each entry have to separate from next with a comma.

Example:
12=>2=>6000,13=>3=>2500,14=>5=>600

On this an user in servergroup 12 get the factor 2 for the next 6000 seconds, an user in servergroup 13 get the factor 3 for 2500 seconds, and so on...";$lang['wichdbid']="Client-database-ID reset";$lang['wichdbiddesc']="Reset the online time of an user, if his TeamSpeak Client-database-ID changed.

Example:
If a clients gets removed from the TeamSpeak server, it gets a new Client-database-ID with the next connect to the server.";$lang['wiconferr']="There is an error in the configuration of the Ranksystem. Please go to the webinterface and correct the Core Settings. Especially check the config 'rank up'!";$lang['widaform']="Date format";$lang['widaformdesc']="Choose the showing date format.

Example:
%a days, %h hours, %i mins, %s secs";$lang['widbcfgsuc']="Database configurations saved successfully.";$lang['widbcfgerr']="Error by saving the database configurations! Connection failed or writeout error for 'other/dbconfig.php'";$lang['widelcld']="delete clients";$lang['widelcldgrp']="renew groups";$lang['widelcldgrpdesc']="The Ranksystem remember the given servergroups, so it don't need to give/check this with every run of the worker.php again.

With this function you can remove once time the knowledge of given servergroups. In effect the ranksystem try to give all clients (which are on the TS3 server online) the servergroup of the actual rank.
For each client, which gets the group or stay in group, the Ranksystem remember this like described at beginning.

This function can be helpful, when user are not in the servergroup, they should be for the defined online time.

Attention: Run this in a moment, where the next few minutes no rankups become due!!! The Ranksystem can't remove the old group, cause he can't remember ;-)";$lang['widelclddesc']="Delete the before selected clients out of the Ranksystem database.

With this deletion are the clients on the TeamSpeak Server untouched.";$lang['widelsg']="remove out of servergroups";$lang['widelsgdesc']="Choose if the clients should also be removed out of the last known servergroup, when you delete clients out of the Ranksystem database.

It will only considered servergroups, which concerned the Ranksystem";$lang['wideltime']="Deletiontime";$lang['wideltimedesc']="Clean old clients out of the Ranksystem database.
Entry a time in seconds which a client was not seen to delete it.

0 - deletes all clients out of the Ranksystem

The Userdatas on the TeamSpeak server are with this untouched!";$lang['wiexgrp']="servergroup exception";$lang['wiexgrpdesc']="A comma seperated list of servergroup-IDs, which should not conside for the Ranksystem.
User in at least one of this servergroups IDs will be ignored for the rank up.";$lang['wiexuid']="client exception";$lang['wiexuiddesc']="A comma seperated list of unique Client-IDs, which should not conside for the Ranksystem.
User in this list will be ignored for the rank up.";$lang['wigrptime']="rank up";$lang['wigrptimedesc']="Define here after which time a user should get automatically a predefined servergroup.

time (seconds)=>servergroup ID

Important for this is the online time of an user or if 'Idletime' is active, the active time.

Each entry have to separate from next with a comma.

The time must be entered cumulative

Example:
60=>9,120=>10,180=>11

On this a user get after 60 seconds the servergroup 9, in turn after 60 seconds the servergroup 10, and so on...";$lang['wihdco']="Headline color:";$lang['wihdcodesc']="Define a headline color.
(valid HTML Code; have to beginn with # )";$lang['wihl']="Webinterface - Ranksystem";$lang['wihladm']="admin list";$lang['wihlcfg']="Core settings";$lang['wihlclg']="Edit clients (global)";$lang['wihlcls']="Edit clients (selective)";$lang['wihldb']="Database settings";$lang['wihlsty']="Style settings";$lang['wihlts']="TeamSpeak settings";$lang['wihvco']="Hover color:";$lang['wihvcodesc']="Define a hover color.
(valid HTML Code; have to beginn with # )";$lang['wiifco']="Infotext color:";$lang['wiifcodesc']="Define a info-text color.
(valid HTML Code; have to beginn with # )";$lang['wilog']="Logpath";$lang['wilogdesc']="Path of the log file of the Ranksystem.

Example:
/var/logs/ranksystem/

Be sure, the webuser has the write-permissions to the logpath.";$lang['wilogout']="LogOut";$lang['wimsgusr']="Notification";$lang['wimsgusrdesc']="Inform an user with a private text message about his rank up.
Define the message in 'lang.php'
(usermsgonline or usermsgactive)";$lang['wiscco']="Successtext color:";$lang['wisccodesc']="Define a success-text color.
(valid HTML Code; have to beginn with # )";$lang['wiselcld']="select clients";$lang['wiselclddesc']="Select the clients by the last known username. For this you only have to start typing.
Multiple selections are comma separated, which does the system automatically.

With the selection you can choose with the next step an action.";$lang['wishcolas']="actual servergroup";$lang['wishcolasdesc']="Show column 'actual servergroup' in list_rankup.php";$lang['wishcolat']="active time";$lang['wishcolatdesc']="Show column 'sum. active time' in list_rankup.php";$lang['wishcolcld']="Client-name";$lang['wishcolclddesc']="Show column 'Client-name' in list_rankup.php";$lang['wishcoldbid']="database-ID";$lang['wishcoldbiddesc']="Show column 'Client-database-ID' in list_rankup.php";$lang['wishcolit']="idle time";$lang['wishcolitdesc']="Show column 'sum idle time' in list_rankup.php";$lang['wishcolls']="last seen";$lang['wishcollsdesc']="Show column 'last seen' in list_rankup.php";$lang['wishcolnx']="next rank up";$lang['wishcolnxdesc']="Show column 'next rank up' in list_rankup.php";$lang['wishcolot']="online time";$lang['wishcolotdesc']="Show column 'sum. online time' in list_rankup.php";$lang['wishcolrg']="rank";$lang['wishcolrgdesc']="Show column 'rank' in list_rankup.php";$lang['wishcolsg']="next servergroup";$lang['wishcolsgdesc']="Show column 'next servergroup' in list_rankup.php";$lang['wishcoluuid']="Client-ID";$lang['wishcoluuiddesc']="Show column 'unique Client-ID' in list_rankup.php";$lang['wishexcld']="excepted client";$lang['wishexclddesc']="Show clients in list_rankup.php,
which are excepted by his uniqueID.";$lang['wishexgrp']="excepted groups";$lang['wishexgrpdesc']="Show clients in list_rankup.php, which are in the list 'client exception' and shouldn't be conside for the Ranksystem.";$lang['wishgen']="Sitegen";$lang['wishgendesc']="Show the needed time for the generation of the site at the end of the site.";$lang['wishhicld']="Clients in highest Level";$lang['wishhiclddesc']="Show clients in list_rankup.php, which reached the highest level in the Ranksystem.";$lang['wisupidle']="Idletime";$lang['wisupidledesc']="If this function is active, the 'sum. idle time' will be substrate from the 'sum. online time'. Instead of the 'sum. online time', the previoused substration will consided for the rank up.";$lang['wisvconf']="save";$lang['wisvsuc']="Changes successfully saved!";$lang['witime']="Timezone";$lang['witimedesc']="Select the timezone the server is hosted.";$lang['wits3dch']="Default Channel";$lang['wits3dchdesc']="The channel-ID, the bot should connect with.

The Bot will join this channel after connecting to the TeamSpeak server.";$lang['wits3host']="TS3 Hostaddress";$lang['wits3hostdesc']="TeamSpeak 3 Server address
(IP oder DNS)";$lang['wits3sm']="Slowmode";$lang['wits3smdesc']="With the Slowmode you can reduce \"spam\" of query commands to the TeamSpeak server. This prevent bans in case of flood.
TeamSpeak Query commands get delayed with this function.

!!! ALSO IT REDUCE THE CPU USAGE !!!

The activation is not recommended, if not required. The delay increases the duration of the Bot, which makes it imprecisely.";$lang['wits3qnm']="Botname";$lang['wits3qnm2']="2nd Botname";$lang['wits3qnm2desc']="A fallback Botname, if the first one is already in use.";$lang['wits3qnmdesc']="The name, with this the query-connection will be established.
You can name it free.";$lang['wits3querpw']="TS3 Query-Password";$lang['wits3querpwdesc']="TeamSpeak 3 query password
Password for the query user.";$lang['wits3querusr']="TS3 Query-User";$lang['wits3querusrdesc']="TeamSpeak 3 query username
Default is serveradmin
Of course, you can also create an additional serverquery account only for the Ranksystem.
The needed permissions you find on:
http://ts-n.net/ranksystem.php";$lang['wits3query']="TS3 Query-Port";$lang['wits3querydesc']="TeamSpeak 3 query port
Default is 10011 (TCP)
If its not default, you should find it in your 'ts3server.ini'.";$lang['wits3voice']="TS3 Voice-Port";$lang['wits3voicedesc']="TeamSpeak 3 voice port
Default is 9987 (UDP)
This is the port, you uses also to connect with the TS3 Client.";$lang['witxco']="Text color:";$lang['witxcodesc']="Define a text color.
(valid HTML Code; have to beginn with # )";$lang['wiupcheck']="Update-Check";$lang['wiupcheckdesc']="If the Update-Check is enable, the listed user gets a notification with a private text message, once an update is available.";$lang['wiuptime']="Checkinterval";$lang['wiuptimedesc']="Enter here how much seconds have to gone till the Ranksystem should check for available updates.
Attention, for each check the listed user gets a notification. If no one of the listed users is online, the Ranksystem will try to notificate with the next interval.";$lang['wiupuid']="Recipient";$lang['wiupuiddesc']="A comma separate list of unique Client-IDs, which shoud be informed on the TeamSpeak via private message for available updates.";$lang['wiversion']="(current version %s)";$lang['wivlang']="Language";$lang['wivlangdesc']="Language for the Ranksystem

de - Deutsch
en - English
ru - русский";$lang['wiwnco']="Warntext color:";$lang['wiwncodesc']="Define a warntext color.
(valid HTML Code; have to beginn with # )";?> \ No newline at end of file + added to the Ranksystem now."; +$lang['alrup'] = "You already updated your database. Please delete this file from your webspace!"; +$lang['changedbid'] = "User %s (unique Client-ID: %s) got a new TeamSpeak Client-database-ID (%s). Update the old Client-database-ID (%s) and reset collected times!"; +$lang['crawl'] = "Scan for connected user and count the activity..."; +$lang['clean'] = "Scan for clients, which have to delete..."; +$lang['cleanc'] = "clean clients"; +$lang['cleancdesc'] = "With this function the old clients in the Ranksystem get deleted.

To this end, the Ranksystem sychronized with the TeamSpeak database. Clients, which do not exist in TeamSpeak, will be deleted from the Ranksystem.

This function is only enabled when the 'Slowmode' is deactivated!


For automatic adjustment of the TeamSpeak database the ClientCleaner can be used:
http://ts-n.net/clientcleaner.php"; +$lang['cleandel'] = "There were %s clients deleted out of the Ranksystem database, cause they were no longer existing in the TeamSpeak database."; +$lang['cleanno'] = "There were nothing to delete..."; +$lang['cleanp'] = "clean period"; +$lang['cleanpdesc'] = "Set a time that has to elapse before the 'clean clients' runs next.

Set a time in seconds.

Recommended is once a day, cause the client cleaning needs much time for bigger databases."; +$lang['cleanrs'] = "Clients in the Ranksystem database: %s"; +$lang['cleants'] = "Clients found in the TeamSpeak database: %s (of %s)"; +$lang['days'] = "days"; +$lang['dbconerr'] = "Failed to connect to MySQL-Database: "; +$lang['delcldgrpif'] = "Error while removing the knowledge for servergroups: %s"; +$lang['delcldgrpsc'] = "Knowledge about servergroups for %s User successfully removed."; +$lang['delclientsif'] = "%s Clients deleted out of the Ranksystem database!"; +$lang['delclientssc'] = "%s Clients successfully deleted out of the Ranksystem database!"; +$lang['errlogin'] = "Username and/or password are incorrect! Try again..."; +$lang['error'] = "Error "; +$lang['errremgrp'] = "Error while removing user with unique Client-ID %s out of the servergroup with servergroup-database-ID %s!"; +$lang['errremdb'] = "Error while removing user with unique Client-ID %s out of the Ranksystem database!"; +$lang['errsel'] = "Error while choosing the selections with
selected client: %s
option 'delete clients': %s
option 'sum. online time': %s"; +$lang['errukwn'] = "An unknown error has occurred!"; +$lang['errupcount'] = "Error while renewing the summary online time of %s by user with the unique Client-ID %s"; +$lang['firstuse'] = "Seems to be the first run. Start logging the Userhistory..."; +$lang['highest'] = "highest rank reached"; +$lang['instdb'] = "Install database:"; +$lang['instdberr'] = "Error while creating the database: "; +$lang['instdbsubm'] = "Create database"; +$lang['instdbsuc'] = "Database %s successfully created."; +$lang['insttb'] = "Install Tables:"; +$lang['insttberr'] = "Error while creating table: "; +$lang['insttbsuc'] = "Table %s successfully created."; +$lang['isntwicfg'] = "Can't save the database configuration! Please edit the 'other/dbconfig.php' with a chmod 0777 and try again after."; +$lang['isntwichm'] = "Please edit the 'other/dbconfig.php', and the folders 'avatars/', 'icons/' and 'logs/' with the needed permissions. Therefore edit the chmod to 0777. After it try again (reload the page)."; +$lang['isntwidb'] = "Enter your database settings:"; +$lang['isntwidberr'] = "Please check if you filled out all fields correctly!"; +$lang['isntwidbhost'] = "DB Hostaddress:"; +$lang['isntwidbhostdesc'] = "Database server address
(IP or DNS)"; +$lang['isntwidbmsg'] = "Database error: "; +$lang['isntwidbname'] = "DB Name:"; +$lang['isntwidbnamedesc'] = "Name of database"; +$lang['isntwidbpass'] = "DB Password:"; +$lang['isntwidbpassdesc'] = "Password to access the database"; +$lang['isntwidbtype'] = "DB Type:"; +$lang['isntwidbtypedesc'] = "Database type

You have to install the needed PDO Driver.
For more informations have look at the requirements on http://ts-n.net/ranksystem.php"; +$lang['isntwidbusr'] = "DB User:"; +$lang['isntwidbusrdesc'] = "User to access the database"; +$lang['isntwidel'] = "Please delete the file 'install.php' and all 'update_x-xx.php' files from your webserver and open the %s to configure the Ranksystem!"; +$lang['isntwiusr'] = "User for the webinterface successfully created."; +$lang['isntwiusrcr'] = "create access"; +$lang['isntwiusrdesc'] = "Enter a username and password for access the webinterface. With the webinterface you can configurate the ranksytem."; +$lang['isntwiusrh'] = "Access - Webinterface"; +$lang['listacsg'] = "actual servergroup"; +$lang['listcldbid'] = "Client-database-ID"; +$lang['listexgrp'] = "Will not conside for the Ranksystem (servergroup exception)."; +$lang['listexuid'] = "Will not conside for the Ranksystem (client exception)."; +$lang['listip'] = "IP address"; +$lang['listnick'] = "Clientname"; +$lang['listnxsg'] = "next servergroup"; +$lang['listnxup'] = "next rank up"; +$lang['listrank'] = "rank"; +$lang['listseen'] = "last seen"; +$lang['listsuma'] = "sum. active time"; +$lang['listsumi'] = "sum. idle time"; +$lang['listsumo'] = "sum. online time"; +$lang['listtime'] = "%s day(s), %s hour(s), %s min., %s sec."; +$lang['listuid'] = "unique Client-ID"; +$lang['new'] = "new"; +$lang['nocount'] = "User %s (unique Client-ID: %s; Client-database-ID %s) is a query-user or is several times online (only first connection counts) -> this will not count!"; +$lang['noentry'] = "No entries found.."; +$lang['pass'] = "Password: "; +$lang['queryname'] = "First Botname already in use. Trying with second Botname..."; +$lang['sccrmcld'] = "User with unique Client-ID %s successfull removed from the Ranksystem database."; +$lang['sccupcount'] = "User with the unique Client-ID %s successfull overwritten with a summary online time of %s."; +$lang['setontime'] = "sum. online time"; +$lang['setontimedesc'] = "Enter a new summary online time, which should be set to the previous selected clients. With this the old summary online gets overwritten.

The entered summary online time will be considered for the rank up."; +$lang['sgrpadd'] = "Grant servergroup %s to user %s (unique Client-ID: %s; Client-database-ID %s)."; +$lang['sgrprerr'] = "It happened a problem with the servergroup of the user %s (unique Client-ID: %s; Client-database-ID %s)!"; +$lang['sgrprm'] = "Removed servergroup %s from user %s (unique Client-ID: %s; Client-database-ID %s)."; +$lang['sitegen'] = "Site generated in %s seconds with %s clients."; +$lang['sitegenl'] = "Site generated in %s seconds with %s clients (thereof %s displayed; %s affected by exception rules; %s in highest rank)."; +$lang['stix0001'] = "Server statistics"; +$lang['stix0002'] = "Total users"; +$lang['stix0003'] = "View details"; +$lang['stix0004'] = "Online time of all user / Total"; +$lang['stix0005'] = "View top of all time"; +$lang['stix0006'] = "View top of the month"; +$lang['stix0007'] = "View top of the week"; +$lang['stix0008'] = "Server usage"; +$lang['stix0009'] = "In the last 7 days"; +$lang['stix0010'] = "In the last 30 days"; +$lang['stix0011'] = "In the last 24 hours"; +$lang['stix0012'] = "select period"; +$lang['stix0013'] = "Last day"; +$lang['stix0014'] = "Last week"; +$lang['stix0015'] = "Last month"; +$lang['stix0016'] = "Active / inactive time (of all clients)"; +$lang['stix0017'] = "Versions (of all clients)"; +$lang['stix0018'] = "Nationalities (of all clients)"; +$lang['stix0019'] = "Platforms (of all clients)"; +$lang['stix0020'] = "Current statistics"; +$lang['stix0021'] = "Requested information"; +$lang['stix0022'] = "Result"; +$lang['stix0023'] = "Server status"; +$lang['stix0024'] = "Online"; +$lang['stix0025'] = "Offline"; +$lang['stix0026'] = "Clients (Online / Max)"; +$lang['stix0027'] = "Amount of channels"; +$lang['stix0028'] = "Average server ping"; +$lang['stix0029'] = "Total bytes received"; +$lang['stix0030'] = "Total bytes sent"; +$lang['stix0031'] = "Server uptime"; +$lang['stix0032'] = "before offline:"; +$lang['stix0033'] = "00 Days, 00 Hours, 00 Mins, 00 Secs"; +$lang['stix0034'] = "Average packet loss"; +$lang['stix0035'] = "Overall statistics"; +$lang['stix0036'] = "Server name"; +$lang['stix0037'] = "Server address (Host Address : Port)"; +$lang['stix0038'] = "Server password"; +$lang['stix0039'] = "No (Server is public)"; +$lang['stix0040'] = "Yes (Server Is private)"; +$lang['stix0041'] = "Server ID"; +$lang['stix0042'] = "Server platform"; +$lang['stix0043'] = "Server version"; +$lang['stix0044'] = "Server creation date (dd/mm/yyyy)"; +$lang['stix0045'] = "Report to server list"; +$lang['stix0046'] = "Activated"; +$lang['stix0047'] = "Not activated"; +$lang['stix0048'] = "not enough data yet..."; +$lang['stix0049'] = "Online time of all user / month"; +$lang['stix0050'] = "Online time of all user / week"; +$lang['stix0051'] = "TeamSpeak has failed, so no creation date..."; +$lang['stmy0001'] = "My statistics"; +$lang['stmy0002'] = "Rank"; +$lang['stmy0003'] = "Database ID:"; +$lang['stmy0004'] = "Unique ID:"; +$lang['stmy0005'] = "Total connections to the server:"; +$lang['stmy0006'] = "Start date for statistics:"; +$lang['stmy0007'] = "Total online time:"; +$lang['stmy0008'] = "Online time last 7 days:"; +$lang['stmy0009'] = "Online time last 30 days:"; +$lang['stmy0010'] = "Achievements completed:"; +$lang['stmy0011'] = "Time achievement progress"; +$lang['stmy0012'] = "Time: Legendary"; +$lang['stmy0013'] = "Because you have an online time of %s hours."; +$lang['stmy0014'] = "Progress completed"; +$lang['stmy0015'] = "Time: Gold"; +$lang['stmy0016'] = "% Completed for Legendary"; +$lang['stmy0017'] = "Time: Silver"; +$lang['stmy0018'] = "% Completed for Gold"; +$lang['stmy0019'] = "Time: Bronze"; +$lang['stmy0020'] = "% Completed for Silver"; +$lang['stmy0021'] = "Time: Unranked"; +$lang['stmy0022'] = "% Completed for Bronze"; +$lang['stmy0023'] = "Connection achievement progress"; +$lang['stmy0024'] = "Connects: Legendary"; +$lang['stmy0025'] = "Because You connected %s times to the server."; +$lang['stmy0026'] = "Connects: Gold"; +$lang['stmy0027'] = "Connects: Silver"; +$lang['stmy0028'] = "Connects: Bronze"; +$lang['stmy0029'] = "Connects: Unranked"; +$lang['stmy0030'] = "Progress next servergroup"; +$lang['stnv0001'] = "Server news"; +$lang['stnv0002'] = "Close"; +$lang['stnv0003'] = "Refresh client information"; +$lang['stnv0004'] = "Only use this refresh, when your TS3 information got changed, such as your TS3 username"; +$lang['stnv0005'] = "It only works, when you are connected to the TS3 server at the same time"; +$lang['stnv0006'] = "Refresh"; +$lang['stnv0007'] = "Battle area - Page content"; +$lang['stnv0008'] = "You can challenge other users in a battle between two users or two teams."; +$lang['stnv0009'] = "While the battle is active the online time of the teams/users will be counted."; +$lang['stnv0010'] = "When the battle ends the team/user with the highest online time wins."; +$lang['stnv0011'] = "(The regular battling time is 48 hours)"; +$lang['stnv0012'] = "The winning team/user will recieve a price, which the user can use whenever the user wants."; +$lang['stnv0013'] = "It will be displayed on the My statistics tab."; +$lang['stnv0014'] = "(Could be online time boost(2x) for 8 hours, instant online time (4 hours), etc."; +$lang['stnv0015'] = "These boosts can be used for example to climb in the top users of the week."; +$lang['stnv0016'] = "Not available"; +$lang['stnv0017'] = "You are not connected to the TS3 Server, so it can't display any data for you."; +$lang['stnv0018'] = "Please connect to the TS3 Server and then Refresh your Session by pressing the blue Refresh Button at the top-right corner."; +$lang['stnv0019'] = "My statistics - Page content"; +$lang['stnv0020'] = "This page contains a overall summary of your personal statistics and activity on the server."; +$lang['stnv0021'] = "The informations are collected since the beginning of the Ranksystem, they are not since the beginning of the TeamSpeak server."; +$lang['stnv0022'] = "This page receives its values out of a database. So the values might be delayed a bit."; +$lang['stnv0023'] = "The sum inside of the donut charts may differ to the amount of 'Total user'. The reason is that this data weren't collected with older versions of the Ranksystem."; +$lang['stnv0024'] = "Ranksystem - Statistics"; +$lang['stnv0025'] = "Limit entries"; +$lang['stnv0026'] = "all"; +$lang['stnv0027'] = "The informations on this site could be outdated! It seems the Ranksystem is no more connected to the TeamSpeak."; +$lang['stnv0028'] = "(You are not connected to the TS3!)"; +$lang['stnv0029'] = "List Rankup"; +$lang['stnv0030'] = "Ranksystem info"; +$lang['stnv0031'] = "DE - Deutsch"; +$lang['stnv0032'] = "EN - english"; +$lang['stnv0033'] = "RU - русский"; +$lang['stnv0034'] = "IT - italiano"; +$lang['stri0001'] = "Ranksystem information"; +$lang['stri0002'] = "What is the Ranksystem?"; +$lang['stri0003'] = "A TS3 Bot, which automatically grant ranks (servergroups) to user on a TeamSpeak 3 Server for online time or online activity. It also gathers informations and statistics about the user and displays the result on this site."; +$lang['stri0004'] = "Who created the Ranksystem?"; +$lang['stri0005'] = "When the Ranksystem was Created?"; +$lang['stri0006'] = "First alpha release: 05/10/2014."; +$lang['stri0007'] = "First beta release: 01/02/2015."; +$lang['stri0008'] = "You can see the newest version on the Ranksystem Website."; +$lang['stri0009'] = "How was the Ranksystem created?"; +$lang['stri0010'] = "The Ranksystem is coded in"; +$lang['stri0011'] = "It uses also the following libraries:"; +$lang['stri0012'] = "Special Thanks To:"; +$lang['stri0013'] = "sergey - for russian translation"; +$lang['stri0014'] = "Bejamin Frost - for initialisation the bootstrap design"; +$lang['stri0015'] = "ZanK - for italian translation"; +$lang['sttw0001'] = "Top users"; +$lang['sttw0002'] = "Of the week"; +$lang['sttw0003'] = "With %s hours online time"; +$lang['sttw0004'] = "Top 10 compared"; +$lang['sttw0005'] = "Hours (Defines 100 %)"; +$lang['sttw0006'] = "%s hours (%s%)"; +$lang['sttw0007'] = "Top 10 Statistics"; +$lang['sttw0008'] = "Top 10 vs others in online time"; +$lang['sttw0009'] = "Top 10 vs others in active time"; +$lang['sttw0010'] = "Top 10 vs others in inactive time"; +$lang['sttw0011'] = "Top 10 (in hours)"; +$lang['sttw0012'] = "Other %s users (in hours)"; +$lang['sttw0013'] = "With %s hours active time"; +$lang['sttm0001'] = "Of the month"; +$lang['stta0001'] = "Of all time"; +$lang['updb'] = "You only have to run this if you want to update the Ranksystem from an older version to %s!

Run this once time and delete the update_%s.php file after from your webserver.


Update Database:
"; +$lang['updel'] = "Please remove the following files from the root directory of the ranksystem, if they are still existing:
%s"; +$lang['upinf'] = "A new Version of the Ranksystem is available; Inform clients on server..."; +$lang['upmov'] = "Please move the \'%s\' into the subfolder \'%s\' and overwrite the existing one!"; +$lang['upmsg'] = "\nHey, a new version of the [B]Ranksystem[/B] is available!\n\ncurrent version: %s\n[B]new version: %s[/B]\n\nPlease check out our site for more informations [URL]http://ts-n.net/ranksystem.php[/URL]."; +$lang['upsucc'] = "Database update successfully executed."; +$lang['upuser'] = "User %s (unique Client-ID: %s; Client-database-ID %s) gets a new count (sum. online time) of %s (thereof active %s)."; +$lang['upuserboost'] = "User %s (unique Client-ID: %s; Client-database-ID %s) gets a new count (sum. online time) of %s (thereof active %s) [BOOST %sx]."; +$lang['upusrerr'] = "The unique Client-ID %s couldn't reached on the TeamSpeak!"; +$lang['upusrinf'] = "User %s was successfully informed."; +$lang['user'] = "Username: "; +$lang['usermsgactive'] = "\nHey, you got a rank up, cause you reached an activity of %s days, %s hours, %s minutes and %s seconds."; +$lang['usermsgonline'] = "\nHey, you got a rank up, cause you reached an online time of %s days, %s hours, %s minutes and %s seconds."; +$lang['wiaction'] = "action"; +$lang['wibgco'] = "Background color:"; +$lang['wibgcodesc'] = "Define a background color.
(valid HTML Code; have to beginn with # )"; +$lang['wiboost'] = "boost"; +$lang['wiboostdesc'] = "Give an user on your TeamSpeak server a servergroup (have to be created manually), which you can declare here as boost group. Define also a factor which should be used (for example 2x) and a time, how long the boost should be rated.
The higher the factor, the faster an user reaches the next higher rank.
Is the time expired, the boost servergroup get automatically removed from the concerned user. The time starts running as soon as the user gets the servergroup.

servergroup ID => factor => time (in seconds)

Each entry have to separate from next with a comma.

Example:
12=>2=>6000,13=>3=>2500,14=>5=>600

On this an user in servergroup 12 get the factor 2 for the next 6000 seconds, an user in servergroup 13 get the factor 3 for 2500 seconds, and so on..."; +$lang['wichdbid'] = "Client-database-ID reset"; +$lang['wichdbiddesc'] = "Reset the online time of an user, if his TeamSpeak Client-database-ID changed.

Example:
If a clients gets removed from the TeamSpeak server, it gets a new Client-database-ID with the next connect to the server."; +$lang['wiconferr'] = "There is an error in the configuration of the Ranksystem. Please go to the webinterface and correct the Core Settings. Especially check the config 'rank up'!"; +$lang['widaform'] = "Date format"; +$lang['widaformdesc'] = "Choose the showing date format.

Example:
%a days, %h hours, %i mins, %s secs"; +$lang['widbcfgsuc'] = "Database configurations saved successfully."; +$lang['widbcfgerr'] = "Error by saving the database configurations! Connection failed or writeout error for 'other/dbconfig.php'"; +$lang['widelcld'] = "delete clients"; +$lang['widelcldgrp'] = "renew groups"; +$lang['widelcldgrpdesc'] = "The Ranksystem remember the given servergroups, so it don't need to give/check this with every run of the worker.php again.

With this function you can remove once time the knowledge of given servergroups. In effect the ranksystem try to give all clients (which are on the TS3 server online) the servergroup of the actual rank.
For each client, which gets the group or stay in group, the Ranksystem remember this like described at beginning.

This function can be helpful, when user are not in the servergroup, they should be for the defined online time.

Attention: Run this in a moment, where the next few minutes no rankups become due!!! The Ranksystem can't remove the old group, cause he can't remember ;-)"; +$lang['widelclddesc'] = "Delete the before selected clients out of the Ranksystem database.

With this deletion are the clients on the TeamSpeak Server untouched."; +$lang['widelsg'] = "remove out of servergroups"; +$lang['widelsgdesc'] = "Choose if the clients should also be removed out of the last known servergroup, when you delete clients out of the Ranksystem database.

It will only considered servergroups, which concerned the Ranksystem"; +$lang['wideltime'] = "Deletiontime"; +$lang['wideltimedesc'] = "Clean old clients out of the Ranksystem database.
Entry a time in seconds which a client was not seen to delete it.

0 - deletes all clients out of the Ranksystem

The Userdatas on the TeamSpeak server are with this untouched!"; +$lang['wiexgrp'] = "servergroup exception"; +$lang['wiexgrpdesc'] = "A comma seperated list of servergroup-IDs, which should not conside for the Ranksystem.
User in at least one of this servergroups IDs will be ignored for the rank up."; +$lang['wiexuid'] = "client exception"; +$lang['wiexuiddesc'] = "A comma seperated list of unique Client-IDs, which should not conside for the Ranksystem.
User in this list will be ignored for the rank up."; +$lang['wigrptime'] = "rank up"; +$lang['wigrptimedesc'] = "Define here after which time a user should get automatically a predefined servergroup.

time (seconds)=>servergroup ID

Important for this is the online time of an user or if 'Idletime' is active, the active time.

Each entry have to separate from next with a comma.

The time must be entered cumulative

Example:
60=>9,120=>10,180=>11

On this a user get after 60 seconds the servergroup 9, in turn after 60 seconds the servergroup 10, and so on..."; +$lang['wihdco'] = "Headline color:"; +$lang['wihdcodesc'] = "Define a headline color.
(valid HTML Code; have to beginn with # )"; +$lang['wihl'] = "Webinterface - Ranksystem"; +$lang['wihladm'] = "admin list"; +$lang['wihlcfg'] = "Core settings"; +$lang['wihlclg'] = "Edit clients (global)"; +$lang['wihlcls'] = "Edit clients (selective)"; +$lang['wihldb'] = "Database settings"; +$lang['wihlsty'] = "Style settings"; +$lang['wihlts'] = "TeamSpeak settings"; +$lang['wihvco'] = "Hover color:"; +$lang['wihvcodesc'] = "Define a hover color.
(valid HTML Code; have to beginn with # )"; +$lang['wiifco'] = "Infotext color:"; +$lang['wiifcodesc'] = "Define a info-text color.
(valid HTML Code; have to beginn with # )"; +$lang['wilog'] = "Logpath"; +$lang['wilogdesc'] = "Path of the log file of the Ranksystem.

Example:
/var/logs/ranksystem/

Be sure, the webuser has the write-permissions to the logpath."; +$lang['wilogout'] = "LogOut"; +$lang['wimsgusr'] = "Notification"; +$lang['wimsgusrdesc'] = "Inform an user with a private text message about his rank up.
Define the message in 'lang.php'
(usermsgonline or usermsgactive)"; +$lang['wiscco'] = "Successtext color:"; +$lang['wisccodesc'] = "Define a success-text color.
(valid HTML Code; have to beginn with # )"; +$lang['wiselcld'] = "select clients"; +$lang['wiselclddesc'] = "Select the clients by the last known username. For this you only have to start typing.
Multiple selections are comma separated, which does the system automatically.

With the selection you can choose with the next step an action."; +$lang['wishcolas'] = "actual servergroup"; +$lang['wishcolasdesc'] = "Show column 'actual servergroup' in list_rankup.php"; +$lang['wishcolat'] = "active time"; +$lang['wishcolatdesc'] = "Show column 'sum. active time' in list_rankup.php"; +$lang['wishcolcld'] = "Client-name"; +$lang['wishcolclddesc'] = "Show column 'Client-name' in list_rankup.php"; +$lang['wishcoldbid'] = "database-ID"; +$lang['wishcoldbiddesc'] = "Show column 'Client-database-ID' in list_rankup.php"; +$lang['wishcolit'] = "idle time"; +$lang['wishcolitdesc'] = "Show column 'sum idle time' in list_rankup.php"; +$lang['wishcolls'] = "last seen"; +$lang['wishcollsdesc'] = "Show column 'last seen' in list_rankup.php"; +$lang['wishcolnx'] = "next rank up"; +$lang['wishcolnxdesc'] = "Show column 'next rank up' in list_rankup.php"; +$lang['wishcolot'] = "online time"; +$lang['wishcolotdesc'] = "Show column 'sum. online time' in list_rankup.php"; +$lang['wishcolrg'] = "rank"; +$lang['wishcolrgdesc'] = "Show column 'rank' in list_rankup.php"; +$lang['wishcolsg'] = "next servergroup"; +$lang['wishcolsgdesc'] = "Show column 'next servergroup' in list_rankup.php"; +$lang['wishcoluuid'] = "Client-ID"; +$lang['wishcoluuiddesc'] = "Show column 'unique Client-ID' in list_rankup.php"; +$lang['wishexcld'] = "excepted client"; +$lang['wishexclddesc'] = "Show clients in list_rankup.php,
which are excepted by his uniqueID."; +$lang['wishexgrp'] = "excepted groups"; +$lang['wishexgrpdesc'] = "Show clients in list_rankup.php, which are in the list 'client exception' and shouldn't be conside for the Ranksystem."; +$lang['wishgen'] = "Sitegen"; +$lang['wishgendesc'] = "Show the needed time for the generation of the site at the end of the site."; +$lang['wishhicld'] = "Clients in highest Level"; +$lang['wishhiclddesc'] = "Show clients in list_rankup.php, which reached the highest level in the Ranksystem."; +$lang['wisupidle'] = "Idletime"; +$lang['wisupidledesc'] = "If this function is active, the 'sum. idle time' will be substrate from the 'sum. online time'. Instead of the 'sum. online time', the previoused substration will consided for the rank up."; +$lang['wisvconf'] = "save"; +$lang['wisvsuc'] = "Changes successfully saved!"; +$lang['witime'] = "Timezone"; +$lang['witimedesc'] = "Select the timezone the server is hosted."; +$lang['wits3dch'] = "Default Channel"; +$lang['wits3dchdesc'] = "The channel-ID, the bot should connect with.

The Bot will join this channel after connecting to the TeamSpeak server."; +$lang['wits3host'] = "TS3 Hostaddress"; +$lang['wits3hostdesc'] = "TeamSpeak 3 Server address
(IP oder DNS)"; +$lang['wits3sm'] = "Slowmode"; +$lang['wits3smdesc'] = "With the Slowmode you can reduce \"spam\" of query commands to the TeamSpeak server. This prevent bans in case of flood.
TeamSpeak Query commands get delayed with this function.

!!! ALSO IT REDUCE THE CPU USAGE !!!

The activation is not recommended, if not required. The delay increases the duration of the Bot, which makes it imprecisely."; +$lang['wits3qnm'] = "Botname"; +$lang['wits3qnm2'] = "2nd Botname"; +$lang['wits3qnm2desc'] = "A fallback Botname, if the first one is already in use."; +$lang['wits3qnmdesc'] = "The name, with this the query-connection will be established.
You can name it free."; +$lang['wits3querpw'] = "TS3 Query-Password"; +$lang['wits3querpwdesc'] = "TeamSpeak 3 query password
Password for the query user."; +$lang['wits3querusr'] = "TS3 Query-User"; +$lang['wits3querusrdesc'] = "TeamSpeak 3 query username
Default is serveradmin
Of course, you can also create an additional serverquery account only for the Ranksystem.
The needed permissions you find on:
http://ts-n.net/ranksystem.php"; +$lang['wits3query'] = "TS3 Query-Port"; +$lang['wits3querydesc'] = "TeamSpeak 3 query port
Default is 10011 (TCP)
If its not default, you should find it in your 'ts3server.ini'."; +$lang['wits3voice'] = "TS3 Voice-Port"; +$lang['wits3voicedesc'] = "TeamSpeak 3 voice port
Default is 9987 (UDP)
This is the port, you uses also to connect with the TS3 Client."; +$lang['witxco'] = "Text color:"; +$lang['witxcodesc'] = "Define a text color.
(valid HTML Code; have to beginn with # )"; +$lang['wiupcheck'] = "Update-Check"; +$lang['wiupcheckdesc'] = "If the Update-Check is enable, the listed user gets a notification with a private text message, once an update is available."; +$lang['wiuptime'] = "Checkinterval"; +$lang['wiuptimedesc'] = "Enter here how much seconds have to gone till the Ranksystem should check for available updates.
Attention, for each check the listed user gets a notification. If no one of the listed users is online, the Ranksystem will try to notificate with the next interval."; +$lang['wiupuid'] = "Recipient"; +$lang['wiupuiddesc'] = "A comma separate list of unique Client-IDs, which shoud be informed on the TeamSpeak via private message for available updates."; +$lang['wiversion'] = "(current version %s)"; +$lang['wivlang'] = "Language"; +$lang['wivlangdesc'] = "Language for the Ranksystem

de - Deutsch
en - english
it - italiano
ru - русский"; +$lang['wiwnco'] = "Warntext color:"; +$lang['wiwncodesc'] = "Define a warntext color.
(valid HTML Code; have to beginn with # )"; +?> diff --git a/languages/core_it.php b/languages/core_it.php new file mode 100644 index 0000000..f8789ef --- /dev/null +++ b/languages/core_it.php @@ -0,0 +1,361 @@ + L'utente è stato aggiunto al sistema."; +$lang['alrup'] = "Hai già aggiornato il database. Per favore cancella questo file dalla web-space!"; +$lang['changedbid'] = "L'utente %s (unique Client-ID: %s) ha ottenuto un nuovo database-ID (%s). Aggiorna il vecchio Client-database-ID (%s) e resetta il tempo raggiunto!"; +$lang['crawl'] = "Scansione degli utenti connessi e conteggio delle attività..."; +$lang['clean'] = "Scansione degli utenti che vanno eliminati..."; +$lang['cleanc'] = "Utenti eliminati con successo dal database"; +$lang['cleancdesc'] = "Con questa funzione i vecchi utenti nel database verranno eliminati.

Così da poter sincronizzare gli utenti del Ranksystem con il database di TeamSpeak. Gli utenti non presenti nel database di TeamSpeak verranno cancellati dal Ranksystem.

Questa funzione puo essere abilitata solo quando la modalità slowmode non è abilitata!


Per la correzione automatica del database di utenti TeamSpeak potrete usare \"Client Cleaner\" :
http://ts-n.net/clientcleaner.php"; +$lang['cleandel'] = "Sono stati cancellati %s utenti dal database del RankSystem perché non esistevano piu nel database di TeamSpeak."; +$lang['cleanno'] = "Non è stato rilevato nulla da cancellare..."; +$lang['cleanp'] = "tempo di pulitura del database"; +$lang['cleanpdesc'] = "Imposta il tempo che deve trascorrere alla prossima pulitura del database.

Imposta il tempo in secondi.

È consigliato eseguire la 'pulitura' del database almeno una volta al giorno, in quanto il tempo di 'pulitura' del database aumenta nel caso vi sia un database di grandi dimensioni."; +$lang['cleanrs'] = "Numero di utenti trovati nel database del Ranksystem: %s"; +$lang['cleants'] = "Numero di utenti trovati nel database di TeamSpeak: %s (of %s)"; +$lang['days'] = "giorni"; +$lang['dbconerr'] = "Connessione al Database MySQL fallita: "; +$lang['delcldgrpif'] = "Errore nella rimozione delle informazioni del servergroup: %s"; +$lang['delcldgrpsc'] = "Informazioni su servergroup per l'utente %s cancellate correttamente."; +$lang['delclientsif'] = "%s Utenti cancellati dal database del Ranksystem!"; +$lang['delclientssc'] = "%s Utenti correttamente cancellati dal database del Ranksystem!"; +$lang['errlogin'] = "Nome utente e/o password errati! Riprova..."; +$lang['error'] = "Errore "; +$lang['errremgrp'] = "Errore nella rimozione dell'utente: %s (Client-ID) Dal server Group con il servergroup-database-ID: %s!"; +$lang['errremdb'] = "Errore nella rimozione dell'utente: %s (Client-ID) dal database del RankSystem!"; +$lang['errsel'] = "Errore nella selezione degli
Utenti: %s
opzione 'cancella utenti': %s
opzione 'somma del tempo online': %s"; +$lang['errukwn'] = "È stato riscontrato un errore sconosciuto!"; +$lang['errupcount'] = "Errore nel rinnovo della somma del tempo online dell’utente %s con l’Id unico %s"; +$lang['firstuse'] = "Sembra che questa sia la prima volta che lanci l'applicazione. Inizio del log degli utenti..."; +$lang['highest'] = "È stato raggiunto il rank massimo"; +$lang['instdb'] = "Installa il database:"; +$lang['instdberr'] = "Errore nella creazione del database: "; +$lang['instdbsubm'] = "Crea il database"; +$lang['instdbsuc'] = "Il database %s è stato creato con successo."; +$lang['insttb'] = "Installazione delle tabelle del database:"; +$lang['insttberr'] = "Errore nella creazione delle tabelle del database: "; +$lang['insttbsuc'] = "Le Tabelle del database %s sono state create con successo."; +$lang['isntwicfg'] = "Impossibile salvare la configurazione del database! Modifica il file 'other/dbconfig.php' dandogli i permessi 0777 (chmod 777 nomefile) e riprova."; +$lang['isntwichm'] = "Per favore modifica il file 'other/dbconfig.php', e la cartella 'avatars/', 'icons/' and 'logs/' con i permessi necessari: Modificali quindi dandogli chmod 0777 (chmod 777 nomefile) e riprova (ricarica la pagina)."; +$lang['isntwidb'] = "Inserisci le informazioni del database:"; +$lang['isntwidberr'] = "Per favore controlla di aver inserito tutti i campi correttamente!"; +$lang['isntwidbhost'] = "Indirizzo host DB:"; +$lang['isntwidbhostdesc'] = "L'indirizzo del server su cui si trova il database (Se il database è in locale basterà inserire 127.0.0.1)
(IP o DNS)"; +$lang['isntwidbmsg'] = "Errore del Database: "; +$lang['isntwidbname'] = "Nome DB:"; +$lang['isntwidbnamedesc'] = "Nome del database"; +$lang['isntwidbpass'] = "Password DB:"; +$lang['isntwidbpassdesc'] = "La Password per accedere al database"; +$lang['isntwidbtype'] = "Tipo DB:"; +$lang['isntwidbtypedesc'] = "Il tipo di Database

Dovrai installare i driver PDO.
Per maggiori informazioni sui requisiti guarda sulla pagina http://ts-n.net/ranksystem.php"; +$lang['isntwidbusr'] = "Utente DB:"; +$lang['isntwidbusrdesc'] = "Nome dell'utente che ha l'accesso al database"; +$lang['isntwidel'] = "Per favore cancella il file 'install.php' e titti i file 'update_x-xx.php' dal tuo webserver e apri la %s per configurare il Ranksystem!"; +$lang['isntwiusr'] = "L'utente dell'interfaccia Web è stato creato con successo."; +$lang['isntwiusrcr'] = "Creazione dell'accesso"; +$lang['isntwiusrdesc'] = "Inserisci nome utente e password per l'accesso all'interfaccia web. Con l'interfaccia web tu potrai configurare il Ranksystem."; +$lang['isntwiusrh'] = "Accesso - Interfaccia Web"; +$lang['listacsg'] = "servergroup attuale"; +$lang['listcldbid'] = "Client-database-ID"; +$lang['listexgrp'] = "Non viene considerato dal Ranksystem (eccezione del servergroup)."; +$lang['listexuid'] = "Non viene considerato dal Ranksystem (eccezione dell'utente)."; +$lang['listip'] = "Indirizzo IP"; +$lang['listnick'] = "Nome Utente"; +$lang['listnxsg'] = "Prossimo servergroup"; +$lang['listnxup'] = "Prossimo Rank"; +$lang['listrank'] = "Rank"; +$lang['listseen'] = "Ultima volta online"; +$lang['listsuma'] = "Somma del tempo di attività"; +$lang['listsumi'] = "Somma del tempo in IDLE"; +$lang['listsumo'] = "Somma del tempo Online"; +$lang['listtime'] = "%s giorno(i), %s ora(e), %s min., %s sec."; +$lang['listuid'] = "unique Client-ID"; +$lang['new'] = "Nuovo"; +$lang['nocount'] = "L'utente %s (unique Client-ID: %s; Client-database-ID %s) è una query oppure effettua molte connessioni (conterà solo la prima connessione) -> Non verrà contato!"; +$lang['noentry'] = "Nessuna voce trovata.."; +$lang['pass'] = "Password: "; +$lang['queryname'] = "Il primo nome del bot è già in uso. Sto riprovando con il secondo..."; +$lang['sccrmcld'] = "L'utente con il Client-ID %s è stato correttamente cancellato dal database del ranksystem."; +$lang['sccupcount'] = "All'utente con il Client-ID %s è stato assegnato un tempo online di %s."; +$lang['setontime'] = "Somma tempo online"; +$lang['setontimedesc'] = "Inserisci il nuovo tempo online, che verrà impostato per gli utenti precedentemente selezionati. Il tempo online raccolto precedentemente verrà sovrascritto.

La somma del tempo online inserita verrà considerata per il rank."; +$lang['sgrpadd'] = "All'utente %s è stato assegnato il servergroup %s (Client-ID unico: %s; Client-database-ID %s)."; +$lang['sgrprerr'] = "C'è stato un problema con l'aggiunta del servergroup all'utente %s (unique Client-ID: %s; Client-database-ID %s)!"; +$lang['sgrprm'] = "All'utente %s è stato rimosso il servergroup %s (unique Client-ID: %s; Client-database-ID %s)."; +$lang['sitegen'] = "Sito generato in %s secondi con %s utenti."; +$lang['sitegenl'] = "Sito generato in %s secondi con %s utenti (di cui %s visualizzati; %s non considerati per le regole d'eccezione impostate; %s che hanno raggiunto il rank massimo)."; +$lang['stix0001'] = "Statistiche del server"; +$lang['stix0002'] = "Utenti totali"; +$lang['stix0003'] = "Vedi dettagli"; +$lang['stix0004'] = "Tempo online di tutti gli utenti / Totale"; +$lang['stix0005'] = "Vedi i migliori di sempre"; +$lang['stix0006'] = "Vedi i migliori del mese"; +$lang['stix0007'] = "Vedi i migliori della settimana"; +$lang['stix0008'] = "Utilizzo del server"; +$lang['stix0009'] = "Negli ultimi 7 giorni"; +$lang['stix0010'] = "Negli ultimi 30 giorni"; +$lang['stix0011'] = "Nelle ultime 24 ore"; +$lang['stix0012'] = "seleziona il periodo"; +$lang['stix0013'] = "Ultimo giorno"; +$lang['stix0014'] = "Ultima settimana"; +$lang['stix0015'] = "Ultimo mese"; +$lang['stix0016'] = "Tempo di attività/inattività (di tutti gli utenti)"; +$lang['stix0017'] = "Versioni (di tutti gli utenti)"; +$lang['stix0018'] = "Nazionalità (di tutti gli utenti)"; +$lang['stix0019'] = "Piattaforme (di tutti gli utenti)"; +$lang['stix0020'] = "Statistiche correnti"; +$lang['stix0021'] = "Informazioni richieste"; +$lang['stix0022'] = "Risultato"; +$lang['stix0023'] = "Stato del server"; +$lang['stix0024'] = "Online"; +$lang['stix0025'] = "Offline"; +$lang['stix0026'] = "Utenti (Online / Max)"; +$lang['stix0027'] = "Numero delle stanze"; +$lang['stix0028'] = "Ping medio del server"; +$lang['stix0029'] = "Totale byte ricevuti"; +$lang['stix0030'] = "Totale byte inviati"; +$lang['stix0031'] = "Tempo online del server"; +$lang['stix0032'] = "Prima di essere offline:"; +$lang['stix0033'] = "00 Giorni, 00 Ore, 00 Min, 00 Sec"; +$lang['stix0034'] = "Media Pacchetti persi"; +$lang['stix0035'] = "Statistiche complessive"; +$lang['stix0036'] = "Nome del server"; +$lang['stix0037'] = "Indirizzo del server (Indirizzo del server : Porta)"; +$lang['stix0038'] = "Password del server"; +$lang['stix0039'] = "No (Il server è pubblico)"; +$lang['stix0040'] = "Si (Il server è privato)"; +$lang['stix0041'] = "ID del server"; +$lang['stix0042'] = "Piattaforma del server"; +$lang['stix0043'] = "Versione del Server"; +$lang['stix0044'] = "Data di creazione del server (dd/mm/yyyy)"; +$lang['stix0045'] = "Inserito nella lista dei server"; +$lang['stix0046'] = "Attivato"; +$lang['stix0047'] = "Non attivato"; +$lang['stix0048'] = "Non vi sono ancora abbastanza informazioni..."; +$lang['stix0049'] = "Tempo online di tutti gli utenti / mese"; +$lang['stix0050'] = "Tempo online di tutti gli utenti / settimana"; +$lang['stix0051'] = "Il TeamSpeak non ha una data di creazione..."; +$lang['stmy0001'] = "Le mie statistiche"; +$lang['stmy0002'] = "Rank"; +$lang['stmy0003'] = "Database ID:"; +$lang['stmy0004'] = "ID unico:"; +$lang['stmy0005'] = "Connessioni totali al server:"; +$lang['stmy0006'] = "Data di inzio statistiche:"; +$lang['stmy0007'] = "Tempo totale online:"; +$lang['stmy0008'] = "Tempo online negli ultimi 7 giorni:"; +$lang['stmy0009'] = "Tempo online negli ultimi 30 giorni:"; +$lang['stmy0010'] = "Obbiettivi completati:"; +$lang['stmy0011'] = "Progresso del tempo raggiunto"; +$lang['stmy0012'] = "Tempo: Leggendario"; +$lang['stmy0013'] = "Perché hai raggiunto il tempo online di of %s ore."; +$lang['stmy0014'] = "Completato"; +$lang['stmy0015'] = "Tempo: Gold"; +$lang['stmy0016'] = "% Completata per il raggiungimento del livello 'Leggendario'"; +$lang['stmy0017'] = "Tempo: Silver"; +$lang['stmy0018'] = "% Completata per il raggiungimento del livello Gold"; +$lang['stmy0019'] = "Tempo: Bronze"; +$lang['stmy0020'] = "% Completata per il raggiungimento del livello Silver"; +$lang['stmy0021'] = "Tempo: Unranked"; +$lang['stmy0022'] = "% Completata per il raggiungimento del livello Bronze"; +$lang['stmy0023'] = "Progresso obbiettivo connessioni"; +$lang['stmy0024'] = "Connessioni: Legendary"; +$lang['stmy0025'] = "Perchè ti sei connesso %s volte al server."; +$lang['stmy0026'] = "Connessioni: Gold"; +$lang['stmy0027'] = "Connessioni: Silver"; +$lang['stmy0028'] = "Connessioni: Bronze"; +$lang['stmy0029'] = "Connessioni: Unranked"; +$lang['stmy0030'] = "Progresso prossimo servergroup"; +$lang['stnv0001'] = "News del server"; +$lang['stnv0002'] = "Chiudi"; +$lang['stnv0003'] = "Aggiorna le informazioni utente"; +$lang['stnv0004'] = "Aggiorna solamente quando vengono modificate le informazioni su TS3, come ad esempio un cambio del nome od un nuovo collegamento"; +$lang['stnv0005'] = "Funziona solamente se sei connesso al server TS3 in contemporaneo (devi avere TeamSpeak aperto ed essere collegato con la tua identità per vedere le tue statistiche)"; +$lang['stnv0006'] = "Aggiorna"; +$lang['stnv0007'] = "Area Battaglie"; +$lang['stnv0008'] = "Puoi sfidare gli altri utenti in una battaglia tra 2 utenti o 2 team."; +$lang['stnv0009'] = "Mentre la battaglia è attiva il tempo online dell'utente o del team sarà contato."; +$lang['stnv0010'] = "Quando la battaglia giungerà alla fine il team o l'utente col maggior tempo online vincerà."; +$lang['stnv0011'] = "(Regolarmente un combattimento dura 48 ore)"; +$lang['stnv0012'] = "Il tema o l'utente vincitore riceverà un boost, che l'utente potrà utilizzare quando vorrà."; +$lang['stnv0013'] = "Questo sarà mostrato nella pagina Le mie statistiche tab."; +$lang['stnv0014'] = "(Potrebbe essere un booster(2x) per 8 hours, o un aggiunta istantanea del tempo online (4 hours), etc."; +$lang['stnv0015'] = "Questi boost possono essere utilizzati ad esempio per scalare la classifica della settimana."; +$lang['stnv0016'] = "Non disponibile"; +$lang['stnv0017'] = "Non sei connesso al server TeamSpeak, perciò non potrai vedere le tue statistiche personali."; +$lang['stnv0018'] = "Per favore connettiti al server TeamSpeak e ricarica questa sessione premendo il pulsante blu in alto a destra."; +$lang['stnv0019'] = "Le mie statistiche - contenuto della pagina"; +$lang['stnv0020'] = "Questa pagina contiene un sommario generale delle tue statistiche personali e le attività nel server."; +$lang['stnv0021'] = "Queste informazioni sono state inserite dal primo avvio del Ranksystem e non dall'inizio del server TeamSpeak."; +$lang['stnv0022'] = "Questa pagina riceve i dati dal database. Perciò potrebbe avere un lieve ritardo nel ricevere le informazioni."; +$lang['stnv0023'] = "La somma contenuta nei grafici ad anello potrebbe differire dal numero degli ‘Utenti totali'. Il motivo è che quei dati non erano stati raccolti dalla versione precedente del Ranksystem."; +$lang['stnv0024'] = "Ranksystem - Statistiche"; +$lang['stnv0025'] = "Inserimenti limitati"; +$lang['stnv0026'] = "tutti"; +$lang['stnv0027'] = "Le informazioni su questo sito potrebbero NON essere aggiornate in quanto sembra che la query del Ranksystem non sia connessa a TeamSpeak."; +$lang['stnv0028'] = "(Non sei connesso al TS3!)"; +$lang['stnv0029'] = "Lista dei Rank"; +$lang['stnv0030'] = "Ranksystem info"; +$lang['stnv0031'] = "DE - Deutsch"; +$lang['stnv0032'] = "EN - english"; +$lang['stnv0033'] = "RU - русский"; +$lang['stnv0034'] = "IT - italiano"; +$lang['stri0001'] = "Informazioni sul Ranksystem"; +$lang['stri0002'] = "Che cos' è il ranksystem?"; +$lang['stri0003'] = "Un TS3 Bot, che automaticamente attribuisce i rank (servergroups) agli utenti su un TeamSpeak 3 per il tempo trascorso online o di attività online. Inoltre raccoglie info e statistiche sull’utente e mostra i risultati sul sito."; +$lang['stri0004'] = "Chi ha creato il Ranksystem?"; +$lang['stri0005'] = "Quando è stato creato?"; +$lang['stri0006'] = "Prima alpha: 05/10/2014."; +$lang['stri0007'] = "Prima Beta: 01/02/2015."; +$lang['stri0008'] = "Puoi trovare l'ultima versione del Ranksystem alla pagina Ranksystem Website."; +$lang['stri0009'] = "Com' è stato creato il RankSystem?"; +$lang['stri0010'] = "Che linguaggio è stato utilizzato"; +$lang['stri0011'] = "Utilizza inoltre le seguenti librerie:"; +$lang['stri0012'] = "Un ringraziamento speciale a:"; +$lang['stri0013'] = "sergey - for russian translation"; +$lang['stri0014'] = "Bejamin Frost - for per i primi bootstrap design"; +$lang['stri0015'] = "ZanK - for italian translation"; +$lang['sttw0001'] = "Top utenti"; +$lang['sttw0002'] = "Della settimana"; +$lang['sttw0003'] = "con %s ore di tempo online"; +$lang['sttw0004'] = "Top 10 a confronto"; +$lang['sttw0005'] = "Ore (Definisce il 100 %)"; +$lang['sttw0006'] = "%s ore (%s%)"; +$lang['sttw0007'] = "Top 10 Statistiche"; +$lang['sttw0008'] = "Top 10 vs Altri utenti in tempo online"; +$lang['sttw0009'] = "Top 10 vs Altri utenti in tempo di attività"; +$lang['sttw0010'] = "Top 10 vs Altri utenti in tempo di inattività"; +$lang['sttw0011'] = "Top 10 (in ore)"; +$lang['sttw0012'] = "Gli altri %s utenti (in ore)"; +$lang['sttw0013'] = "con %s ore di tempo attivo"; +$lang['sttm0001'] = "Del mese"; +$lang['stta0001'] = "Di sempre"; +$lang['updb'] = "Devi avviare questo file una sola volta per aggiornare il Ranksystem da una versione non aggiornate %s!

Dopo aver eseguito il file update_%s.php eliminalo dal tuo web server.


Database aggiornato:
"; +$lang['updel'] = "Per favore cancella i seguenti file dalla cartella principale del Ranksystem (se non sono già stati eliminati):
%s"; +$lang['upinf'] = "È stata trovato una versione piu recente del RankSystem (informazioni su come aggiornare qui: http://ts-n.net/ranksystem.php?artid=84#01id84); Informa gli utenti del server..."; +$lang['upmov'] = "Per favore sposta \'%s\' nella sottocartella \'%s\' e sovrascrivi quella esistente!"; +$lang['upmsg'] = "\nHey, Una nuova versione del [B]Ranksystem[/B] è disponibile!\n\nVersione corrente: %s\n[B]Nuova Versione: %s[/B]\n\nPer maggiori informazioni visita il nostro sito [URL]http://ts-n.net/ranksystem.php[/URL]."; +$lang['upsucc'] = "Aggiornamento del database eseguito con successo."; +$lang['upuser'] = "L'utente %s (unique Client-ID: %s; Client-database-ID %s) ha ottenuto un nuovo conteggio (somma del tempo online) di %s (tempo di attività (rispetto al nuovo conteggio): %s)."; +$lang['upuserboost'] = "L'utente %s (unique Client-ID: %s; Client-database-ID %s) ha ottenuto un nuovo conteggi (somma del tempo online) di %s (tempo di attività (rispetto al nuovo conteggio): %s) [BOOST %sx]."; +$lang['upusrerr'] = "Il Client-ID unico %s non è raggiungibile dal sistema TeamSpeak!"; +$lang['upusrinf'] = "L'utente %s è stato informato correttamente."; +$lang['user'] = "Nome Utente: "; +$lang['usermsgactive'] = "\nHey, Sei aumentato di livello in quanto hai raggiunto un tempo di attività di %s giorni, %s ore, %s minuti and %s secondi."; +$lang['usermsgonline'] = "\nHey, Sei aumentato di livello in quanto hai raggiunto un tempo online di %s giorni, %s ore, %s minuti and %s secondi."; +$lang['wiaction'] = "azione"; +$lang['wibgco'] = "Colore di sfondo:"; +$lang['wibgcodesc'] = "Imposta un colore di sfondo.
(utilizza un codice HTML valido, deve iniziare con #)"; +$lang['wiboost'] = "boost"; +$lang['wiboostdesc'] = "Dai all'utente sul TS3 un servergroup (che dovrà essere creato manualmente), con il quale potrai definire il Boost. Definisci anche il fattore di moltiplicazione (per esempio 2x) e il (per quanto il boost durerà).
Più alto è il fattore, più velocemente l'utente raggiungerà il rank successivo.
Uno volta che il tempo impostato finirà il servergroup verrà rimosso in automatico dal RankSystem.Il tempo parte non appena viene assegnato il servergroup all'utente.

servergroup ID => fattore (2,3) => tempo (in secondi)

Per separare ogni voce utilizza la virgola.

Esempio:
12=>2=>6000,13=>3=>2500,14=>5=>600

Nell'esempio il servergroup 12 per i successivi 6000 secondi gli verrà conteggiato il doppio del tempo online, al servergroup 13 verrà moltiplicato il tempo per 3 per 2500 secondi, e cosi via..."; +$lang['wichdbid'] = "Client-database-ID reset"; +$lang['wichdbiddesc'] = "Resetta il tempo online di un utente se il suo database-ID è cambiato.

Esempio:
Se un utente viene rimosso da TeamSpeak, gli viene assegnato un nuovo database-ID con la successiva connesione al server."; +$lang['wiconferr'] = "C'è un errore nella configurazione del RankSystem. Vai nell'interfaccia web i sistema le Impostazioni Principali. Specialmente la configurazione 'rank'!"; +$lang['widaform'] = "Formato data"; +$lang['widaformdesc'] = "scegli il formato della data.

Esempio:
%a Giorni, %h Ore, %i Min, %s Sec"; +$lang['widbcfgsuc'] = "Configurazione del database salvata con successo."; +$lang['widbcfgerr'] = "Errore nel salvataggio della configurazione del database! Connessione fallita o errore nella sovrascrittura del file 'other/dbconfig.php'"; +$lang['widelcld'] = "elimina utenti"; +$lang['widelcldgrp'] = "rinnova gruppi"; +$lang['widelcldgrpdesc'] = "Il Ranksystem memorizzerà il servergroup assegnato, così che non sia più necessario eseguire continuamente il worker.php.

Con questa funzione potrai rimuovere le informazioni salvate relative ad un servergroup. Il Ranksystem proverà a dare a tutti gli utenti connessi al TS3 il servergroup del loro rank.
Per ogni utente, che ottenga il servergroup o che sia su un servergroup, il Ranksystem lo memorizzerà come descritto all'inizio.

Questa funzione può essere molto utile, quando un utente non è in un servergroup, Gli può essere attribuito il tempo online.

Attenzione: Eseguilo solo quando sei sicuro che non vi sia un aumento di rank per l'utente! Altrimenti il Ranksystem non potrà rimuovere il precedente servergroup in quanto non è memorizzato ;-)"; +$lang['widelclddesc'] = "Cancella gli utenti precedentemente selezionati dal Ranksystem.

Ciò non modificherà lo stato degli utenti nel database di TeamSpeak."; +$lang['widelsg'] = "rimosso(i) dal servergroup"; +$lang['widelsgdesc'] = "Scegli se agli utenti venga rimosso anche l'ultimo servergroup conosciuto, quando cancelli gli utenti dal database del Ranksystem.

Considererà solamente i servergroup riguardanti il Ranksystem"; +$lang['wideltime'] = "Tempo di eliminazione"; +$lang['wideltimedesc'] = "Cancella i 'vecchi utenti' dal database del Ranksystem.
Inserisci il tempo dopo cui un utente che non si connette al TeamSpeak verrà eliminato.

0 - Cancellerà gli utenti dal Ranksystem

I dati degli utenti su TeamSpeak non verranno toccati!"; +$lang['wiexgrp'] = "Eccezione dei servergroup"; +$lang['wiexgrpdesc'] = "Lista dei servergroup ID che non verranno contati dal Ranksystem (separati da virgola. es. 9,10,11)
Gli utenti che avranno almeno uno di questi servergroup verranno ignorati."; +$lang['wiexuid'] = "Eccezione degli utenti"; +$lang['wiexuiddesc'] = "Lista degli utenti (ID unico) che non verranno contati dal Ranksystem (separati da virgola. es 5GFxciykQMojlrvugWti835Wdto=,YQf+7x/4LJ2Tw5cuQGItsVEn+S4=)
Questi utentiverranno ignorati."; +$lang['wigrptime'] = "rank"; +$lang['wigrptimedesc'] = "Definisci qui dopo quanto tempo un utente debba ottenere automaticamente un servergroup predefinito.

time (seconds)=>servergroup ID

Importante per questo è il tempo online di un utente o se \"Idletime\" è attivo, il tempo di attività.

Ogni voce deve essere separate dalla successive con una virgola. br>
Dovrà essere inserito il tempo cumulativo

Esempio:
60=>9,120=>10,180=>11

Su queste basi un utente ottiene il servergroup 9 dopo 60 secondi, a sua volta il 10 dopo altri 60 secondi e così via..."; +$lang['wihdco'] = "Colore titolo:"; +$lang['wihdcodesc'] = "Definisci un colore del titolo.
(Deve essere un codice HTML valido e deve iniziare con # )"; +$lang['wihl'] = "Webinterface - Ranksystem"; +$lang['wihladm'] = "lista utenti"; +$lang['wihlcfg'] = "Impostazioni Principali"; +$lang['wihlclg'] = "Modifica Utenti (globale)"; +$lang['wihlcls'] = "Modifica Utenti (selezionati)"; +$lang['wihldb'] = "Impostazioni Database"; +$lang['wihlsty'] = "Impostazioni Stile"; +$lang['wihlts'] = "Impostazioni Teamspeak"; +$lang['wihvco'] = "Colore al passaggio del mouse:"; +$lang['wihvcodesc'] = "Imposta colore al passaggio del mouse.
(Deve essere un codice HTML valido e deve iniziare con # )"; +$lang['wiifco'] = "Colore infotext:"; +$lang['wiifcodesc'] = "Imposta il colore del testo delle informazioni.
(Deve essere un codice HTML valido e deve iniziare con # )"; +$lang['wilog'] = "Path dei Log"; +$lang['wilogdesc'] = "La path dei lod del RankSystem.

Example:
/var/logs/ranksystem/

Assicurati che l'utente che hai assegnato (del web server) abbia i poteri per scrivere nella directory (oppure dai direttamente chmod 777 alla cartella log)."; +$lang['wilogout'] = "LogOut"; +$lang['wimsgusr'] = "Notifica"; +$lang['wimsgusrdesc'] = "Informa un utente con un messaggio privato testuale sul suo aumento di rank.
Stabilisci il messaggio in 'lang.php'
(usermsgonline o usermsgactive)"; +$lang['wiscco'] = "Colore di operazione avvenuta con successo"; +$lang['wisccodesc'] = "Definisci un success-text color.
(Deve essere un codice HTML valido e deve iniziare con # )"; +$lang['wiselcld'] = "Seleziona utenti"; +$lang['wiselclddesc'] = "seleziona i clients in base all’ultimo nickname noto. Per farlo devi solo scrivere.
Selezioni multiple vanno separate da una virgola, che il sistema fa automaticamente.

Con la selezione puoi scegliere un’azione con il prossimo passaggio."; +$lang['wishcolas'] = "Servergroup attuale"; +$lang['wishcolasdesc'] = "Show column 'actual servergroup' in list_rankup.php"; +$lang['wishcolat'] = "Tempo Attività"; +$lang['wishcolatdesc'] = "Show column 'sum. active time' in list_rankup.php"; +$lang['wishcolcld'] = "Nome Utente"; +$lang['wishcolclddesc'] = "Show column 'Client-name' in list_rankup.php"; +$lang['wishcoldbid'] = "ID del database"; +$lang['wishcoldbiddesc'] = "Show column 'Client-database-ID' in list_rankup.php"; +$lang['wishcolit'] = "tempo in IDLE"; +$lang['wishcolitdesc'] = "Show column 'sum idle time' in list_rankup.php"; +$lang['wishcolls'] = "Ultimo volta online"; +$lang['wishcollsdesc'] = "Show column 'last seen' in list_rankup.php"; +$lang['wishcolnx'] = "Prossimo Rank"; +$lang['wishcolnxdesc'] = "Show column 'next rank up' in list_rankup.php"; +$lang['wishcolot'] = "Tempo Online"; +$lang['wishcolotdesc'] = "Show column 'sum. online time' in list_rankup.php"; +$lang['wishcolrg'] = "rank"; +$lang['wishcolrgdesc'] = "Show column 'rank' in list_rankup.php"; +$lang['wishcolsg'] = "next servergroup"; +$lang['wishcolsgdesc'] = "Show column 'next servergroup' in list_rankup.php"; +$lang['wishcoluuid'] = "Client-ID"; +$lang['wishcoluuiddesc'] = "Show column 'unique Client-ID' in list_rankup.php"; +$lang['wishexcld'] = "excepted client"; +$lang['wishexclddesc'] = "Show clients in list_rankup.php,
which are excepted by his uniqueID."; +$lang['wishexgrp'] = "excepted groups"; +$lang['wishexgrpdesc'] = "Mostra i clients in list_rankup.php, che sono nella lista 'client exception' e non dovrebbero essere considerati per il Ranksystem."; +$lang['wishgen'] = "Sitegen"; +$lang['wishgendesc'] = "Mostra il tempo richiesto per la generazione del sito al fondo del sito."; +$lang['wishhicld'] = "Clients in highest Level"; +$lang['wishhiclddesc'] = "Mostra I clients in list_rankup.php, che hanno raggiunto il più elevato rank nel Ranksystem."; +$lang['wisupidle'] = "Idletime"; +$lang['wisupidledesc'] = "Se la funzione è attivata, la somma del tempo in IDLE verrà sottratta alla somma del tempo online. Il tempo ricavato verrà utilizzato per l'avanzamento di rank."; +$lang['wisvconf'] = "salva"; +$lang['wisvsuc'] = "Modifiche salvate con successo!"; +$lang['witime'] = "Timezone"; +$lang['witimedesc'] = "Select the timezone the server is hosted."; +$lang['wits3dch'] = "Canale di Default"; +$lang['wits3dchdesc'] = "Il channel-ID cui il bot deve connettersi.

Il Bot entrerà in questo canale appena entrato nel TeamSpeak server."; +$lang['wits3host'] = "Indirizzo TS3"; +$lang['wits3hostdesc'] = "Indirizzo del vostro server Teamspeak
(IP o DNS)"; +$lang['wits3sm'] = "Slowmode"; +$lang['wits3smdesc'] = "Con la modalità Slowmode potrai ridurre lo \"spam\" dei comandi query di TeamSpeak. E previene inoltre i ban per flood nel server Teamspeak.
I comandi della query arriveranno con un lieve ritardo in base al ritardo di risposta scelto.

!!! INOLTRE RIDURRA L'UTILIZZO DELLE RISORSE DEL SERVER !!!

Questa funzione non è consigliata, se non è richiesta. Il ritardo dei comandi del bot potrebbe causare imprecisione, sopratutto nell'utilizzo dei boost."; +$lang['wits3qnm'] = "Nome del Bot"; +$lang['wits3qnm2'] = "2° nome del Bot"; +$lang['wits3qnm2desc'] = "Un secondo nome in caso in cui il primo nome sia già in uso."; +$lang['wits3qnmdesc'] = "Il nome con il quale la query si conneterà al TS3.
Potrai dare il nome che preferisci.
Ricorda che sarà anche il nome con il quale gli utenti riceveranno i messaggi su Teamspeak."; +$lang['wits3querpw'] = "TS3 - Password della Query"; +$lang['wits3querpwdesc'] = "Password della query di Teamspeak (di norma viene creata al primo avvio di Teamspeak, guarda qui per modificarla: CHANGE QUERY PASSWORD
."; +$lang['wits3querusr'] = "TS3 - Utente della Query"; +$lang['wits3querusrdesc'] = "Il nome utente della Query scelta
Di default è serveradmin
Ma se preferisci potrai creare un ulteriore query solo per il Ranksystem.
Per vedere i permessi necessari alla Query guarda:
http://ts-n.net/ranksystem.php"; +$lang['wits3query'] = "TS3 - Porta della Query"; +$lang['wits3querydesc'] = "La porta per l'accesso delle query a Teamspeak
La porta di default è 10011 (TCP)
Se non è la porta di default e non sai che porta possa essere guarda all'interno del file 'ts3server.ini' nella directory principale del server Teamspeak dove troverai tutte le informazioni sul server."; +$lang['wits3voice'] = "TS3 - Voice-Port"; +$lang['wits3voicedesc'] = "La voice port del vostro Teamspeak
Di default è 9987 (UDP)
Questa è inoltre la porta con cui ti connetti al TS3."; +$lang['witxco'] = "Colore del testo:"; +$lang['witxcodesc'] = "Imposta un colore per il testo.
(Deve essere un codice HTML valido e deve iniziare con # )"; +$lang['wiupcheck'] = "Controlla aggiornamenti"; +$lang['wiupcheckdesc'] = "Se le funzione 'Controlla aggiornamenti', la lista di utenti inseriti (ID unico dell'utente) riceveranno una notifica su Teamspeak (come messaggio privato), quando sarà disponibile uin aggiornamento."; +$lang['wiuptime'] = "Intervallo di cotrollo aggiornamenti"; +$lang['wiuptimedesc'] = "Inserisci qui ogni quanti secondi il Ranksystem verificherà se vi sono aggiornamenti disponibili.
Attenzione, Ogni utente inserito riceverà la notifica di aggiornamento attraverso un messaggio privato su Temaspeak. Se nessuno degli utenti inseriti sarà online, Il Ranksystem proverà ad inviare il messaggio nell'intervallo di tempo successivo."; +$lang['wiupuid'] = "Recipiente"; +$lang['wiupuiddesc'] = "La lista di utenti (dovrà essere inserito l'ID unico dell'utente(i) es. YdicUS4yofeBEONN7J3FeLic8b4=,RiGqBf8hU1kbCV/vwfPL0rzAwZQ=), che verranno informati di eventuali aggiornamenti attraverso un messaggio privato su Teamspeak."; +$lang['wiversion'] = "(versione corrente %s)"; +$lang['wivlang'] = "Lingua"; +$lang['wivlangdesc'] = "Lingue disponibili per il Ranksystem

de - Deutsch
en - english
it - italiano
ru - Русский"; +$lang['wiwnco'] = "Colore messggio d'avviso:"; +$lang['wiwncodesc'] = "Definisci il colore del messaggio di avviso di aggiornamenti disponibili.
(Deve essere un codice HTML valido e deve iniziare con # )"; +?> \ No newline at end of file diff --git a/languages/core_ru.php b/languages/core_ru.php index 97898b6..d935aa4 100644 --- a/languages/core_ru.php +++ b/languages/core_ru.php @@ -1 +1,361 @@ - добавлен к Ранг Системе.";$lang['alrup']="Вы уже обновили свою базу данных. Пожалуйста, удалите этот файл из своего веб-сервера!";$lang['changedbid']="Пользователь %s (Уникальный ID клиента: %s) получил новый TeamSpeak Client-database-ID (%s). Обновление старой Client-database-ID (%s) и сброс collected times!";$lang['crawl']="Сканирование активности подключенных пользователей...";$lang['clean']="Сканирование пользователей, которых должен удалить...";$lang['cleanc']="чистка пользователей";$lang['cleancdesc']="С включением этой функцией старые пользователи в Ranksystem будут удалены.

С этой целью, Ranksystem синхронизируется с базой данных TeamSpeak. Пользователи, которых не существует в TeamSpeak, будут удалены из Ranksystem.

Эта функция работает когда 'Slowmode' дезактивирован!


Для автоматического регулирования базы данных может использоваться TeamSpeak ClientCleaner:
http://ts-n.net/clientcleaner.php";$lang['cleandel']="%s пользователя удаленны из базы данных Ranksystem, так как они больше не существуют в базе данных TeamSpeak.";$lang['cleanno']="Никого не было, чтобы было что удалить...";$lang['cleanp']="период отчистки";$lang['cleanpdesc']="Укажите время, которое должно пройти перед запуском 'чистка пользователей'.

Устанавливается в секундах.

Для больших баз данных рекомендуется использовать один раз в день.";$lang['cleanrs']="Пользователи в базе данных Ranksystem: %s";$lang['cleants']="Пользователи найдены в базе данных TeamSpeak: %s (at %s)";$lang['days']="days";$lang['dbconerr']="Ошибка подключения к базе данных MySQL: ";$lang['delcldgrpif']="Ошибка by removing the knowledge for servergroups: %s";$lang['delcldgrpsc']="Данные о сервер группах для пользователя %s успешно удалена.";$lang['delclientsif']="%s Клиент(ов) удалено из базы данных Ранг Системы!";$lang['delclientssc']="%s Клиент(ов) успешно удалено из базы данных Ранг Системы!";$lang['errlogin']="Логин и/или пароль не верны! Попробуйте снова...";$lang['error']="Ошибка ";$lang['errremgrp']="Ошибка удаления пользователя с уникальным идентификатором UID: %s из сервер группы SID: %s!";$lang['errremdb']="Ошибка удаления пользователя с уникальным идентификатором UID % из базы данных Ранг Системы!";$lang['errsel']="Error by choosing the selections with
selected client: %s
option 'delete clients': %s
option 'sum. online time': %s";$lang['errukwn']="Произошла неизвестная ошибка!";$lang['errupcount']="Ошибка подсчета суммарного времени подключения %s пользователя с UCI %s";$lang['firstuse']="Кажется это первый запуск. Начинаю вести Историю Пользователей...";$lang['highest']="высокий Ранг достигнут";$lang['instdb']="Установка Базы данных:";$lang['instdberr']="Ошибка создания базы данных: ";$lang['instdbsubm']="Создание Базы данных";$lang['instdbsuc']="База данных %s успешно создана.";$lang['insttb']="Установка Базы Данных:";$lang['insttberr']="Ошибка при установке таблиц: ";$lang['insttbsuc']="Таблица %s успешно создана.";$lang['isntwicfg']="Не получилось записать настройки базы данных! Пожалуйста установите права на запись 'other/dbconfig.php' chmod 0777 и попробуйте снова.";$lang['isntwichm']="Please edit the 'other/dbconfig.php', and the folders 'avatars/', 'icons/' and 'logs/' with the needed permissions. Therefore edit the chmod to 0777. After it try again (reload the page).";$lang['isntwidb']="Укажите настройки для подключения к базе данных:";$lang['isntwidberr']="Пожалуйста, проверьте, все ли поля были заполнены а так же корректность заполнения!";$lang['isntwidbhost']="Адрес Базы Данных:";$lang['isntwidbhostdesc']="Адрес сервера Базы Данных
(IP or DNS)";$lang['isntwidbmsg']="Ошибка Данных: ";$lang['isntwidbname']="Имя Базы Данных:";$lang['isntwidbnamedesc']="Название Базы Данных";$lang['isntwidbpass']="Пароль Базы Данных:";$lang['isntwidbpassdesc']="Пароль для подключения к базе данных";$lang['isntwidbtype']="Тип Базы Данных:";$lang['isntwidbtypedesc']="Тип Базы Данных

У вас должен быть установлен PDO Драйвер.
Для получения дополнительной информации см. http://ts-n.net/ranksystem.php";$lang['isntwidbusr']="Пользователь Базы Данных:";$lang['isntwidbusrdesc']="Пользователь с доступом к Базе Данных";$lang['isntwidel']="Пожалуйста удалите файл 'install.php' и файлы 'update_x-xx.php' с вашего Веб-Сервера и откройте %s для настройки Ранг Системы!";$lang['isntwiusr']="Пользователь Веб-Панели успешно создан.";$lang['isntwiusrcr']="создание доступа";$lang['isntwiusrdesc']="Введите имя пользователя и пароль для доступа в Веб-Панель. С помощью Веб-Панели вы сможете настроить ранг систему.";$lang['isntwiusrh']="Доступ - Веб-Панель";$lang['listacsg']="ток сервер группа";$lang['listcldbid']="ID клиента в базе данных";$lang['listexgrp']="Не учитывается Ранг Системой (исключения по сервергруппам).";$lang['listexuid']="Не учитывается Ранг Системой (исключения по клиентам).";$lang['listip']="IP адрес";$lang['listnick']="Ник";$lang['listnxsg']="Следующая сервер группа";$lang['listnxup']="Следующий Ранг через";$lang['listrank']="П\Н";$lang['listseen']="последняя активность";$lang['listsuma']="Сумм. время активности";$lang['listsumi']="Сумм. время простоя";$lang['listsumo']="Сумм. время подключения";$lang['listtime']="%s день(й), %s час(ов), %s мин., %s сек.";$lang['listuid']="Уникальный ID клиента";$lang['new']="новый";$lang['nocount']="Пользователь %s (Уникальный Клиент ID: %s; Клиент ID %s) это query-пользователь (постоянно первое подключение) -> не будет учитываться!";$lang['noentry']="Записей не найдено..";$lang['pass']="Пароль: ";$lang['queryname']="Первый Botname уже используется. Попробуйте вторым Botname...";$lang['sccrmcld']="Пользователь с уникальным ID %s успешно удален из базы данных Ранг Системы.";$lang['sccupcount']="Пользователь с уникальным ID %s успешно переписан с итоговым временем онлайн %s.";$lang['setontime']="сумм. время подключения";$lang['setontimedesc']="Укажите новое суммарное время подключения для выбранных клиентов. С этим изминением пользователь получит указанное время подключения.

Указанное время подключения будет учтено Ранг Системой.";$lang['sgrpadd']="Выдана сервер группа %s пользователю %s (Уникальный ID клиента: %s; ID в базе данных: %s).";$lang['sgrprerr']="Что то пошло не так, проблема с сервер группой пользователя %s (Уникальный ID клиента:: %s; ID в базе данных %s)!";$lang['sgrprm']="С пользователя %s (Уникальный ID клиента: %s; ID в базе данных: %s) удалена сервер-группа %s.";$lang['sitegen']="Страница генерирована за %s секунд. %s пользователей.";$lang['sitegenl']="Страница генерирована за %s секунд с %s пользователями ( %s пользователей показанно; %s игнорируются по правилам исключения; %s высокого ранга).";$lang['stix0001']="Server Statistics";$lang['stix0002']="Total Users";$lang['stix0003']="View Details";$lang['stix0004']="Online Time Of All User / Total";$lang['stix0005']="View Top Of All Time";$lang['stix0006']="View Top Of The Month";$lang['stix0007']="View Top Of The Week";$lang['stix0008']="Server Usage";$lang['stix0009']="In The Last 7 Days";$lang['stix0010']="In The Last 30 Days";$lang['stix0011']="In The Last 24 Hours";$lang['stix0012']="select period";$lang['stix0013']="Last Day";$lang['stix0014']="Last Week";$lang['stix0015']="Last Month";$lang['stix0016']="Active / Inactive Time (Of All Clients)";$lang['stix0017']="Versions (Of All Clients)";$lang['stix0018']="Nationalities (Of All Clients)";$lang['stix0019']="Platforms (Of All Clients)";$lang['stix0020']="Current Statistics";$lang['stix0021']="Requested Information";$lang['stix0022']="Result";$lang['stix0023']="Server Status";$lang['stix0024']="Online";$lang['stix0025']="Offline";$lang['stix0026']="Clients (Online / Max)";$lang['stix0027']="Amount Of Channels";$lang['stix0028']="Average Server Ping";$lang['stix0029']="Total Bytes Received";$lang['stix0030']="Total Bytes Sent";$lang['stix0031']="Server Uptime";$lang['stix0032']="before offline:";$lang['stix0033']="00 Days, 00 Hours, 00 Mins, 00 Secs";$lang['stix0034']="Average Packet Loss";$lang['stix0035']="Overall Statistics";$lang['stix0036']="Server Name";$lang['stix0037']="Server Address (Host Address : Port)";$lang['stix0038']="Server Password";$lang['stix0039']="No (Server is Public)";$lang['stix0040']="Yes (Server Is Private)";$lang['stix0041']="Server ID";$lang['stix0042']="Server Platform";$lang['stix0043']="Server Version";$lang['stix0044']="Server Creation Date (dd/mm/yyyy)";$lang['stix0045']="Report To Server List";$lang['stix0046']="Activated";$lang['stix0047']="Not Activated";$lang['stix0048']="not enough data yet...";$lang['stix0049']="Online Time Of All User / Last Month";$lang['stix0050']="Online Time Of All User / Last Week";$lang['stix0051']="TeamSpeak has failed, so no creation date...";$lang['stmy0001']="My Statistics";$lang['stmy0002']="Rank";$lang['stmy0003']="Database ID:";$lang['stmy0004']="Unique ID:";$lang['stmy0005']="Total Connections To The Server:";$lang['stmy0006']="Start Date For Statistics:";$lang['stmy0007']="Total Online Time:";$lang['stmy0008']="Online Time Last 7 Days:";$lang['stmy0009']="Online Time Last 30 Days:";$lang['stmy0010']="Achievements Completed:";$lang['stmy0011']="Time Achievement Progress";$lang['stmy0012']="Time: Legendary";$lang['stmy0013']="Because You Have A Online Time Of %s hours.";$lang['stmy0014']="Progress Completed";$lang['stmy0015']="Time: Gold";$lang['stmy0016']="% Completed For Legendary";$lang['stmy0017']="Time: Silver";$lang['stmy0018']="% Completed For Gold";$lang['stmy0019']="Time: Bronze";$lang['stmy0020']="% Completed For Silver";$lang['stmy0021']="Time: Unranked";$lang['stmy0022']="% Completed For Bronze";$lang['stmy0023']="Connection Achievement Progress";$lang['stmy0024']="Connects: Legendary";$lang['stmy0025']="Because You Connected %s Times To The Server.";$lang['stmy0026']="Connects: Gold";$lang['stmy0027']="Connects: Silver";$lang['stmy0028']="Connects: Bronze";$lang['stmy0029']="Connects: Unranked";$lang['stnv0001']="Server News";$lang['stnv0002']="Close";$lang['stnv0003']="Refresh Client Information";$lang['stnv0004']="Only use this Refresh, when your TS3 information got changed, such as your TS3 username";$lang['stnv0005']="It only works, when you are connected to the TS3 Server at the same time";$lang['stnv0006']="Refresh";$lang['stnv0007']="Battle Area - Page Content";$lang['stnv0008']="You can challenge other users in a battle between two users or two teams.";$lang['stnv0009']="While the battle is active the online time of the teams/users will be counted.";$lang['stnv0010']="When the battle ends the team/user with the highest online time wins.";$lang['stnv0011']="(The regular battling time is 48 hours)";$lang['stnv0012']="The winning team/user will recieve a price, which the user can use whenever the user wants.";$lang['stnv0013']="It will be displayed on the My Statistics tab.";$lang['stnv0014']="(Could be online time boost(2x) for 8 hours, instant online time (4 hours), etc.";$lang['stnv0015']="These boosts can be used for example to climb in the top users of the week)";$lang['stnv0016']="Not available";$lang['stnv0017']="You are not connected to the TS3 Server, so it cant display any data for you.";$lang['stnv0018']="Please connect to the TS3 Server and then Refresh your Session by pressing the blue Refresh Button at the top-right corner.";$lang['stnv0019']="My Statistics - Page Content";$lang['stnv0020']="This page contains a overall summary of your personal statistics and activity on the server.";$lang['stnv0021']="The informations are collected since the beginning of the Ranksystem, they are not since the beginning of the TeamSpeak server.";$lang['stnv0022']="This page receives its values out of a database. So the values might be delayed a bit.";$lang['stnv0023']="The sum inside of the donut charts may differ to the amount of 'Total user'. The reason is that this data weren't collected with older versions of the Ranksystem.";$lang['stnv0024']="Ranksystem - Statistics";$lang['stnv0025']="Limit entries";$lang['stnv0026']="all";$lang['stnv0027']="The Informations on this site could be outdated! It seems the Ranksystem is no more connected to the TeamSpeak.";$lang['stnv0028']="(Not Connected To TS3!)";$lang['stnv0029']="List Rankup";$lang['stnv0030']="Ranksystem Info";$lang['stnv0031']="DE - Deutsch";$lang['stnv0032']="EN - English";$lang['stnv0033']="RU - русский";$lang['stri0001']="Ranksystem Information";$lang['stri0002']="What Is The Ranksystem?";$lang['stri0003']="A TS3 Bot, which automatically grant ranks (servergroups) to user on a TeamSpeak 3 Server for online time or online activity. It also gathers informations and statistics about the user and displays the result on this site.";$lang['stri0004']="Who Created The Ranksystem?";$lang['stri0005']="When Did The Ranksystem Created?";$lang['stri0006']="First alpha release: 05/10/2014.";$lang['stri0007']="First beta release: 01/02/2015.";$lang['stri0008']="You can see the newest version on the Ranksystem Website.";$lang['stri0009']="How Did The Ranksystem Created?";$lang['stri0010']="The Ranksystem is coded in";$lang['stri0011']="It uses also the following libraries:";$lang['stri0012']="Special Thanks To:";$lang['stri0013']="sergey - for russian translation";$lang['stri0014']="Bejamin Frost - for initialisation the bootstrap design";$lang['sttw0001']="Top Users";$lang['sttw0002']="Of The Week";$lang['sttw0003']="With %s Hours Online Time";$lang['sttw0004']="Top 10 Compared";$lang['sttw0005']="Hours (Defines 100 %)";$lang['sttw0006']="%s Hours (%s%)";$lang['sttw0007']="Top 10 Statistics";$lang['sttw0008']="Top 10 Vs Others In Online Time";$lang['sttw0009']="Top 10 Vs Others In Active Time";$lang['sttw0010']="Top 10 Vs Others In Inactive Time";$lang['sttw0011']="Top 10 (in Hours)";$lang['sttw0012']="Other %s Users (in Hours)";$lang['sttm0001']="Of The Month";$lang['stta0001']="Of All Time";$lang['updb']="Запустите это, если вы хотите обновить Ranksystem с более старой версии до версии %s!

Запустите это один раз после чего удалите update_%s.php файлы с вашего вебсервера.


Обновление Базы данных:
";$lang['updel']="Пожалуйста, удалите следующие файлы из корня ranksystem, если они все еще существуют:
%s";$lang['upinf']="Доступна новая версия Ранг Системы; Сообщаю Клиентам на Сервере...";$lang['upmov']="Пожалуйста, переместите \'%s\' в подпапку \'%s\' и перепишите существующий!";$lang['upmsg']="\nЭй, доступна новая версия [B]Ранг Системы[/B]!\n\nтекущая версия: %s\n[B]новая версия: %s[/B]\n\nПожалуйста посетите наш сайт [URL]http://ts-n.net/ranksystem.php[/URL] для получения более подробной информации.";$lang['upsucc']="Обновление базы данных успешно выполнено.";$lang['upuser']="Пользователь %s (Уникальный ID клиента: %s; ID в базе данных: %s) получает новое количество (сумм. время подключения) из %s (thereof active %s).";$lang['upuserboost']="Пользователь %s (Уникальный ID клиента: %s; ID в базе данных: %s) получает новое количество (сумм. время подключения) из %s (thereof active %s) [BOOST %sx].";$lang['upusrerr']="Пользователь с уникальным ID %s не был найден (не правильно указан Уникальный ID или пользователь в настоящий момент не подключен к серверу Teamspeak)!";$lang['upusrinf']="Пользователь %s был успешно информирован.";$lang['user']="Логин: ";$lang['usermsgactive']="\nЭй, вы получили новый Ранг, так как были активны в течении %s дней, %s часов, %s минут и %s секунд.";$lang['usermsgonline']="\nЭй, вы получили новый Ранг, так как были онлайн в течении %s дней, %s часов, %s минут и %s секунд.";$lang['wiaction']="выполнить";$lang['wibgco']="Цвет фона:";$lang['wibgcodesc']="Укажите код цвета фона.
(только HTML код; должно начинаться с # )";$lang['wiboost']="повышение";$lang['wiboostdesc']="Give an user on your TeamSpeak server a servergroup (have to be created manually), which you can declare here as boost group. Define also a factor which should be used (for example 2x) and a time, how long the boost should be rated.
The higher the factor, the faster an user reaches the next higher rank.
Is the time expired, the boost servergroup get automatically removed from the concerned user. The time starts running as soon as the user gets the servergroup.

servergroup ID => factor => time (in seconds)

Each entry have to separate from next with a comma.

Example:
12=>2=>6000,13=>3=>2500,14=>5=>600

On this an user in servergroup 12 get the factor 2 for the next 6000 seconds, an user in servergroup 13 get the factor 3 for 2500 seconds, and so on...";$lang['wichdbid']="Client-database-ID reset";$lang['wichdbiddesc']="Сбрасывает время онлайн пользователя, если его ID в базы данных клиента TeamSpeak изменился.

Пример:
Если пользователь удален из БД сервера TeamSpeak, то, новый ID базы данных клиента будет записан со следующим подключением к серверу.";$lang['wiconferr']="Есть ошибка в конфигурации Ranksystem. Пожалуйста, зайдите в Веб Панель и проверте настройки раздела 'Настройка Ранг Системы'. Особенно проверьте 'Ранги'!";$lang['widaform']="Формат даты";$lang['widaformdesc']="Выберите формат показа даты.

Пример:
%a дней, %h часов, %i минут, %s секунд";$lang['widbcfgsuc']="Настройки Базы Данных успешно сохранены.";$lang['widbcfgerr']="Ошибка сохранения настроек базы данных! Ошибка подключения, проверте на правильность настроек 'other/dbconfig.php'";$lang['widelcld']="удаление пользователей";$lang['widelcldgrp']="renew groups";$lang['widelcldgrpdesc']="The Ranksystem remember the given servergroups, so it don't need to give/check this with every run of the worker.php again.

With this function you can remove once time the knowledge of given servergroups. In effect the ranksystem try to give all clients (which are on the TS3 server online) the servergroup of the actual rank.
For each client, which gets the group or stay in group, the Ranksystem remember this like described at beginning.

This function can be helpful, when user are not in the servergroup, they should be for the defined online time.

Attention: Run this in a moment, where the next few minutes no rankups become due!!! The Ranksystem can't remove the old group, cause he can't remember ;-)";$lang['widelclddesc']="Удаление выбранных клиентов из базы данных Ранг-Системы.

Клиент непосредственно на сервере Teamspeak не будет удален.";$lang['widelsg']="удаление из сервер групп";$lang['widelsgdesc']="Выберите, если клиенты должны также быть удалены из последней известной Сервер-группы, когда Вы удаляете клиентов из базы данных Ранг Системы.

Будет затронуты только те сервер группы, которые указанны в настройках Ранг Системы";$lang['wideltime']="Время удаления";$lang['wideltimedesc']="Отчистка базы данных Ранг Системы от старых клиентов.
Entry a time in seconds which a client was not seen to delete it.

0 - deletes all clients out of the Ranksystem

При этом база данных пользователей на сервере TeamSpeak затронута не будет!";$lang['wiexgrp']="Исключения сервер групп";$lang['wiexgrpdesc']="Укажите через запятую какие сервер группы будут игнорироваться Ранг Системой.
Если пользователь находится хоты бы в одной из этих групп то Ранг Система будет игнорировать его.";$lang['wiexuid']="Исключения CID";$lang['wiexuiddesc']="Укажите через запятую уникальные идентификаторы клиентов (Client-IDs), которых будет игнорировать Ранг Система.
Пользователи в этом списке будет проигнорированы Ранг Системой.";$lang['wigrptime']="Ранги";$lang['wigrptimedesc']="Укажите через какой промежуток времени будет выданная сервер группа.

Время (в секундах)=>номер сервер группы SID

Важным условием для этого, является учет времени онлайн пользователя или если включен учет 'Время простоя'.

Каждый параметр должен разделяться запятой.

Так же время должно быть указанно по 'нарастающей'

Пример:
60=>9,120=>10,180=>11

По истечению 60 секунд пользователь получает сервер группу под SID 9, по истечению еще 120 секунд пользователь получает сервер группу SID 10, и так далее...";$lang['wihdco']="Цвет заголовка:";$lang['wihdcodesc']="Укажите код цвета заголовка.
(только HTML код; должно начинаться с # )";$lang['wihl']="Веб Панель - Система Рангов";$lang['wihladm']="Лист Администратора";$lang['wihlcfg']="Настройка Ранг Системы";$lang['wihlclg']="Редактирование клиентов (глобальное)";$lang['wihlcls']="Редактирование клиентов (выборочное)";$lang['wihldb']="Настройки Базы Данных";$lang['wihlsty']="Настройки стиля";$lang['wihlts']="Настройка поключения к TeamSpeak";$lang['wihvco']="Цвет Hover:";$lang['wihvcodesc']="Укажите код цвета hover.
(только HTML код; должно начинаться с # )";$lang['wiifco']="Цвет Текста оповещения:";$lang['wiifcodesc']="Укажите код цвета Текста оповещения.
(только HTML код; должно начинаться с # )";$lang['wilogout']="Выход";$lang['wilog']="Logpath";$lang['wilogdesc']="Path of the log file of the Ranksystem.

Example:
/var/logs/ranksystem/

Be sure, the webuser has the write-permissions to the logpath.";$lang['wimsgusr']="Уведомление";$lang['wimsgusrdesc']="Сообщение пользователю о повышение ранга.
Отредактируйте сообщение в 'lang.php'
(usermsgonline или usermsgactive)";$lang['wiscco']="Цвет Successtext:";$lang['wisccodesc']="Укажите код цвета success-text.
(только HTML код; должно начинаться с # )";$lang['wiselcld']="Выбор клиентов";$lang['wiselclddesc']="Выберите клиентов последним известным именем пользователя. Для этого Вы только должны начать печатать.
Выбор нескольких пользователей - отделенная запятая, которая ставится системой автоматически.

With the selection you can choose with the next step an action.";$lang['wishcolas']="ток сервер группа";$lang['wishcolasdesc']="Показ колонки 'ток сервер группа' в list_rankup.php";$lang['wishcolat']="Время активности";$lang['wishcolatdesc']="Показ колонки 'суммарное время активности' в list_rankup.php";$lang['wishcolcld']="Ник клиента";$lang['wishcolclddesc']="Показ колонки 'Ник клиента' в list_rankup.php";$lang['wishcoldbid']="ID в Базе данных";$lang['wishcoldbiddesc']="Показ колонки 'ID в Базе данных' в list_rankup.php";$lang['wishcolit']="Время простоя";$lang['wishcolitdesc']="Показ колонки 'суммарное время простоя' в list_rankup.php";$lang['wishcolls']="Последний раз замечен";$lang['wishcollsdesc']="Показ колонки 'Последний раз замечен' в list_rankup.php";$lang['wishcolnx']="Следующий Ранг";$lang['wishcolnxdesc']="Показ колонки 'Следующий Ранг' в list_rankup.php";$lang['wishcolot']="Время подключения";$lang['wishcolotdesc']="Показ колонки 'суммарное время подключения' в list_rankup.php";$lang['wishcolrg']="П\Н";$lang['wishcolrgdesc']="Показ колонки 'Порядковый номер' в list_rankup.php";$lang['wishcolsg']="Следующая сервер группа";$lang['wishcolsgdesc']="Показ колонки 'следующая сервер группа' в list_rankup.php";$lang['wishcoluuid']="Client-ID";$lang['wishcoluuiddesc']="Показ колонки 'уникальный ID клиента' в list_rankup.php";$lang['wishexcld']="Пользователи исключения";$lang['wishexclddesc']="Показывать пользователий в list_rankup.php,
которые исключены по параметру uniqueID.";$lang['wishexgrp']="Группы исключения";$lang['wishexgrpdesc']="Показывать пользователий в list_rankup.php, которые находятся в списке 'исключение клиента' и не должы учитываться Системой Рангов.";$lang['wishgen']="Sitegen";$lang['wishgendesc']="Показывать время генерации списка в конце страницы.";$lang['wishhicld']="Пользователи с высоким рангом";$lang['wishhiclddesc']="Показывать пользователий в list_rankup.php, который достиг высшего уровня в Ranksystem.";$lang['wisupidle']="Время простоя";$lang['wisupidledesc']="Если эта функция активна, 'сумм. время простоя' будет основанием от 'сумм. время подключения'. Вместо 'сумм. время подключения', предыдущая вычитание будет рассматриваться на повышение Ранга.";$lang['wisvconf']="сохранить";$lang['wisvsuc']="Изменения успешно сохранены!";$lang['witime']="Timezone";$lang['witimedesc']="Select the timezone the server is hosted.";$lang['wits3dch']="Default Channel";$lang['wits3dchdesc']="The channel-ID, the bot should connect with.

The Bot will join this channel after connecting to the TeamSpeak server.";$lang['wits3host']="TS3 Hostaddress";$lang['wits3hostdesc']="Адрес TeamSpeak 3 Сервера
(IP или DNS)";$lang['wits3sm']="Замедленный режим";$lang['wits3smdesc']="With the Slowmode you can reduce \"spam\" of query commands to the TeamSpeak server. This prevent bans in case of flood.
TeamSpeak Query commands get delayed with this function.

!!! ALSO IT REDUCE THE CPU USAGE !!!

The activation is not recommended, if not required. The delay increases the duration of the Bot, which makes it imprecisely.";$lang['wits3qnm']="Botname";$lang['wits3qnm2']="2е Botname";$lang['wits3qnm2desc']="Это Botname, будет использоваться если первое уже занято.";$lang['wits3qnmdesc']="Имя, под которым будет сидеть Ранг система.
Убедитесь что оно не занято.";$lang['wits3querpw']="TS3 Query-Пароль";$lang['wits3querpwdesc']="TeamSpeak 3 query Пароль
Ваш пароль от query пользователя.";$lang['wits3querusr']="TS3 Query-Логин";$lang['wits3querusrdesc']="TeamSpeak 3 query Логин
По умолчанию: serveradmin
Конечно вы можете указать другой логин для Ranksystem.
Необходимые разрешения привилегий вы можете найти на:
http://ts-n.net/ranksystem.php";$lang['wits3query']="TS3 Query-Порт";$lang['wits3querydesc']="TeamSpeak 3 query Порт
По умолчанию: 10011 (TCP)
Если порт изменен, то укажите его согласно настройкам из 'ts3server.ini'.";$lang['wits3voice']="TS3 Voice-Порт";$lang['wits3voicedesc']="TeamSpeak 3 voice Порт
По умолчанию: 9987 (UDP)
Этот порт используется Teamspeak3 клиентом для подключения к серверу.";$lang['witxco']="Цвет текста:";$lang['witxcodesc']="Укажите код цвета текста.
(только HTML код; должно начинаться с # )";$lang['wiupcheck']="Проверка обновлений";$lang['wiupcheckdesc']="Если проверка обнолений включена, то пользователь получит приватное сообщение, когда обновление доступно.";$lang['wiuptime']="Интервал проверки";$lang['wiuptimedesc']="Введите здесь через сколько секунд Ранг Система должна проверить наличие обновлений.
Внимание, после каждой проверки перечисленные пользователь получает уведомление. Если ни один из перечисленных пользователей не онлайн, Система Рангов будет пытаться уведомить пользователей со следующего интервала сканирования.";$lang['wiupuid']="Получатель";$lang['wiupuiddesc']="Укажите через запятую уникальные ID клиентов, которые будут проинформированы о доступных обновлениях посредством приватного сообщения через TeamSpeak.";$lang['wiversion']="(текущая версия %s)";$lang['wivlang']="Язык";$lang['wivlangdesc']="Язык Ранг Системы

de - Немецкий
en - Английский
ru - Русский";$lang['wiwnco']="Цвет текста предупреждений:";$lang['wiwncodesc']="Укажите цвет текста предупреждения.
(только HTML код; должно начинаться с # )";?> \ No newline at end of file + добавлен к Ранг Системе."; +$lang['alrup'] = "Вы уже обновили свою базу данных. Пожалуйста, удалите этот файл из своего веб-сервера!"; +$lang['changedbid'] = "Пользователь %s (Уникальный ID клиента: %s) получил новый TeamSpeak Client-database-ID (%s). Обновление старой Client-database-ID (%s) и сброс collected times!"; +$lang['crawl'] = "Сканирование активности подключенных пользователей..."; +$lang['clean'] = "Сканирование пользователей, которых должен удалить..."; +$lang['cleanc'] = "чистка пользователей"; +$lang['cleancdesc'] = "С включением этой функцией старые пользователи в Ranksystem будут удалены.

С этой целью, Ranksystem синхронизируется с базой данных TeamSpeak. Пользователи, которых не существует в TeamSpeak, будут удалены из Ranksystem.

Эта функция работает когда 'Slowmode' дезактивирован!


Для автоматического регулирования базы данных может использоваться TeamSpeak ClientCleaner:
http://ts-n.net/clientcleaner.php"; +$lang['cleandel'] = "%s пользователя удаленны из базы данных Ranksystem, так как они больше не существуют в базе данных TeamSpeak."; +$lang['cleanno'] = "Никого не было, чтобы было что удалить..."; +$lang['cleanp'] = "период отчистки"; +$lang['cleanpdesc'] = "Укажите время, которое должно пройти перед запуском 'чистка пользователей'.

Устанавливается в секундах.

Для больших баз данных рекомендуется использовать один раз в день."; +$lang['cleanrs'] = "Пользователи в базе данных Ranksystem: %s"; +$lang['cleants'] = "Пользователи найдены в базе данных TeamSpeak: %s (at %s)"; +$lang['days'] = "days"; +$lang['dbconerr'] = "Ошибка подключения к базе данных MySQL: "; +$lang['delcldgrpif'] = "Ошибка by removing the knowledge for servergroups: %s"; +$lang['delcldgrpsc'] = "Данные о сервер группах для пользователя %s успешно удалена."; +$lang['delclientsif'] = "%s Клиент(ов) удалено из базы данных Ранг Системы!"; +$lang['delclientssc'] = "%s Клиент(ов) успешно удалено из базы данных Ранг Системы!"; +$lang['errlogin'] = "Логин и/или пароль не верны! Попробуйте снова..."; +$lang['error'] = "Ошибка "; +$lang['errremgrp'] = "Ошибка удаления пользователя с уникальным идентификатором UID: %s из сервер группы SID: %s!"; +$lang['errremdb'] = "Ошибка удаления пользователя с уникальным идентификатором UID %s из базы данных Ранг Системы!"; +$lang['errsel'] = "Error by choosing the selections with
selected client: %s
option 'delete clients': %s
option 'sum. online time': %s"; +$lang['errukwn'] = "Произошла неизвестная ошибка!"; +$lang['errupcount'] = "Ошибка подсчета суммарного времени подключения %s пользователя с UCI %s"; +$lang['firstuse'] = "Кажется это первый запуск. Начинаю вести Историю Пользователей..."; +$lang['highest'] = "высокий Ранг достигнут"; +$lang['instdb'] = "Установка Базы данных:"; +$lang['instdberr'] = "Ошибка создания базы данных: "; +$lang['instdbsubm'] = "Создание Базы данных"; +$lang['instdbsuc'] = "База данных %s успешно создана."; +$lang['insttb'] = "Установка Базы Данных:"; +$lang['insttberr'] = "Ошибка при установке таблиц: "; +$lang['insttbsuc'] = "Таблица %s успешно создана."; +$lang['isntwicfg'] = "Не получилось записать настройки базы данных! Пожалуйста установите права на запись 'other/dbconfig.php' chmod 0777 и попробуйте снова."; +$lang['isntwichm'] = "Please edit the 'other/dbconfig.php', and the folders 'avatars/', 'icons/' and 'logs/' with the needed permissions. Therefore edit the chmod to 0777. After it try again (reload the page)."; +$lang['isntwidb'] = "Укажите настройки для подключения к базе данных:"; +$lang['isntwidberr'] = "Пожалуйста, проверьте, все ли поля были заполнены а так же корректность заполнения!"; +$lang['isntwidbhost'] = "Адрес Базы Данных:"; +$lang['isntwidbhostdesc'] = "Адрес сервера Базы Данных
(IP or DNS)"; +$lang['isntwidbmsg'] = "Ошибка Данных: "; +$lang['isntwidbname'] = "Имя Базы Данных:"; +$lang['isntwidbnamedesc'] = "Название Базы Данных"; +$lang['isntwidbpass'] = "Пароль Базы Данных:"; +$lang['isntwidbpassdesc'] = "Пароль для подключения к базе данных"; +$lang['isntwidbtype'] = "Тип Базы Данных:"; +$lang['isntwidbtypedesc'] = "Тип Базы Данных

У вас должен быть установлен PDO Драйвер.
Для получения дополнительной информации см. http://ts-n.net/ranksystem.php"; +$lang['isntwidbusr'] = "Пользователь Базы Данных:"; +$lang['isntwidbusrdesc'] = "Пользователь с доступом к Базе Данных"; +$lang['isntwidel'] = "Пожалуйста удалите файл 'install.php' и файлы 'update_x-xx.php' с вашего Веб-Сервера и откройте %s для настройки Ранг Системы!"; +$lang['isntwiusr'] = "Пользователь Веб-Панели успешно создан."; +$lang['isntwiusrcr'] = "создание доступа"; +$lang['isntwiusrdesc'] = "Введите имя пользователя и пароль для доступа в Веб-Панель. С помощью Веб-Панели вы сможете настроить ранг систему."; +$lang['isntwiusrh'] = "Доступ - Веб-Панель"; +$lang['listacsg'] = "ток сервер группа"; +$lang['listcldbid'] = "ID клиента в базе данных"; +$lang['listexgrp'] = "Не учитывается Ранг Системой (исключения по сервергруппам)."; +$lang['listexuid'] = "Не учитывается Ранг Системой (исключения по клиентам)."; +$lang['listip'] = "IP адрес"; +$lang['listnick'] = "Ник"; +$lang['listnxsg'] = "Следующая сервер группа"; +$lang['listnxup'] = "Следующий Ранг через"; +$lang['listrank'] = "П\Н"; +$lang['listseen'] = "последняя активность"; +$lang['listsuma'] = "Сумм. время активности"; +$lang['listsumi'] = "Сумм. время простоя"; +$lang['listsumo'] = "Сумм. время подключения"; +$lang['listtime'] = "%s день(й), %s час(ов), %s мин., %s сек."; +$lang['listuid'] = "Уникальный ID клиента"; +$lang['new'] = "новый"; +$lang['nocount'] = "Пользователь %s (Уникальный Клиент ID: %s; Клиент ID %s) это query-пользователь (постоянно первое подключение) -> не будет учитываться!"; +$lang['noentry'] = "Записей не найдено.."; +$lang['pass'] = "Пароль: "; +$lang['queryname'] = "Первый Botname уже используется. Попробуйте вторым Botname..."; +$lang['sccrmcld'] = "Пользователь с уникальным ID %s успешно удален из базы данных Ранг Системы."; +$lang['sccupcount'] = "Пользователь с уникальным ID %s успешно переписан с итоговым временем онлайн %s."; +$lang['setontime'] = "сумм. время подключения"; +$lang['setontimedesc'] = "Укажите новое суммарное время подключения для выбранных клиентов. С этим изминением пользователь получит указанное время подключения.

Указанное время подключения будет учтено Ранг Системой."; +$lang['sgrpadd'] = "Выдана сервер группа %s пользователю %s (Уникальный ID клиента: %s; ID в базе данных: %s)."; +$lang['sgrprerr'] = "Что то пошло не так, проблема с сервер группой пользователя %s (Уникальный ID клиента:: %s; ID в базе данных %s)!"; +$lang['sgrprm'] = "С пользователя %s (Уникальный ID клиента: %s; ID в базе данных: %s) удалена сервер-группа %s."; +$lang['sitegen'] = "Страница генерирована за %s секунд. %s пользователей."; +$lang['sitegenl'] = "Страница генерирована за %s секунд с %s пользователями ( %s пользователей показанно; %s игнорируются по правилам исключения; %s высокого ранга)."; +$lang['stix0001'] = "Server Statistics"; +$lang['stix0002'] = "Total Users"; +$lang['stix0003'] = "View Details"; +$lang['stix0004'] = "Online Time Of All User / Total"; +$lang['stix0005'] = "View Top Of All Time"; +$lang['stix0006'] = "View Top Of The Month"; +$lang['stix0007'] = "View Top Of The Week"; +$lang['stix0008'] = "Server Usage"; +$lang['stix0009'] = "In The Last 7 Days"; +$lang['stix0010'] = "In The Last 30 Days"; +$lang['stix0011'] = "In The Last 24 Hours"; +$lang['stix0012'] = "select period"; +$lang['stix0013'] = "Last Day"; +$lang['stix0014'] = "Last Week"; +$lang['stix0015'] = "Last Month"; +$lang['stix0016'] = "Active / Inactive Time (Of All Clients)"; +$lang['stix0017'] = "Versions (Of All Clients)"; +$lang['stix0018'] = "Nationalities (Of All Clients)"; +$lang['stix0019'] = "Platforms (Of All Clients)"; +$lang['stix0020'] = "Current Statistics"; +$lang['stix0021'] = "Requested Information"; +$lang['stix0022'] = "Result"; +$lang['stix0023'] = "Server Status"; +$lang['stix0024'] = "Online"; +$lang['stix0025'] = "Offline"; +$lang['stix0026'] = "Clients (Online / Max)"; +$lang['stix0027'] = "Amount Of Channels"; +$lang['stix0028'] = "Average Server Ping"; +$lang['stix0029'] = "Total Bytes Received"; +$lang['stix0030'] = "Total Bytes Sent"; +$lang['stix0031'] = "Server Uptime"; +$lang['stix0032'] = "before offline:"; +$lang['stix0033'] = "00 Days, 00 Hours, 00 Mins, 00 Secs"; +$lang['stix0034'] = "Average Packet Loss"; +$lang['stix0035'] = "Overall Statistics"; +$lang['stix0036'] = "Server Name"; +$lang['stix0037'] = "Server Address (Host Address : Port)"; +$lang['stix0038'] = "Server Password"; +$lang['stix0039'] = "No (Server is Public)"; +$lang['stix0040'] = "Yes (Server Is Private)"; +$lang['stix0041'] = "Server ID"; +$lang['stix0042'] = "Server Platform"; +$lang['stix0043'] = "Server Version"; +$lang['stix0044'] = "Server Creation Date (dd/mm/yyyy)"; +$lang['stix0045'] = "Report To Server List"; +$lang['stix0046'] = "Activated"; +$lang['stix0047'] = "Not Activated"; +$lang['stix0048'] = "not enough data yet..."; +$lang['stix0049'] = "Online Time Of All User / Last Month"; +$lang['stix0050'] = "Online Time Of All User / Last Week"; +$lang['stix0051'] = "TeamSpeak has failed, so no creation date..."; +$lang['stmy0001'] = "My Statistics"; +$lang['stmy0002'] = "Rank"; +$lang['stmy0003'] = "Database ID:"; +$lang['stmy0004'] = "Unique ID:"; +$lang['stmy0005'] = "Total Connections To The Server:"; +$lang['stmy0006'] = "Start Date For Statistics:"; +$lang['stmy0007'] = "Total Online Time:"; +$lang['stmy0008'] = "Online Time Last 7 Days:"; +$lang['stmy0009'] = "Online Time Last 30 Days:"; +$lang['stmy0010'] = "Achievements Completed:"; +$lang['stmy0011'] = "Time Achievement Progress"; +$lang['stmy0012'] = "Time: Legendary"; +$lang['stmy0013'] = "Because You Have A Online Time Of %s hours."; +$lang['stmy0014'] = "Progress Completed"; +$lang['stmy0015'] = "Time: Gold"; +$lang['stmy0016'] = "% Completed For Legendary"; +$lang['stmy0017'] = "Time: Silver"; +$lang['stmy0018'] = "% Completed For Gold"; +$lang['stmy0019'] = "Time: Bronze"; +$lang['stmy0020'] = "% Completed For Silver"; +$lang['stmy0021'] = "Time: Unranked"; +$lang['stmy0022'] = "% Completed For Bronze"; +$lang['stmy0023'] = "Connection Achievement Progress"; +$lang['stmy0024'] = "Connects: Legendary"; +$lang['stmy0025'] = "Because You Connected %s Times To The Server."; +$lang['stmy0026'] = "Connects: Gold"; +$lang['stmy0027'] = "Connects: Silver"; +$lang['stmy0028'] = "Connects: Bronze"; +$lang['stmy0029'] = "Connects: Unranked"; +$lang['stmy0030'] = "Progress next servergroup"; +$lang['stnv0001'] = "Server News"; +$lang['stnv0002'] = "Close"; +$lang['stnv0003'] = "Refresh Client Information"; +$lang['stnv0004'] = "Only use this Refresh, when your TS3 information got changed, such as your TS3 username"; +$lang['stnv0005'] = "It only works, when you are connected to the TS3 Server at the same time"; +$lang['stnv0006'] = "Refresh"; +$lang['stnv0007'] = "Battle Area - Page Content"; +$lang['stnv0008'] = "You can challenge other users in a battle between two users or two teams."; +$lang['stnv0009'] = "While the battle is active the online time of the teams/users will be counted."; +$lang['stnv0010'] = "When the battle ends the team/user with the highest online time wins."; +$lang['stnv0011'] = "(The regular battling time is 48 hours)"; +$lang['stnv0012'] = "The winning team/user will recieve a price, which the user can use whenever the user wants."; +$lang['stnv0013'] = "It will be displayed on the My Statistics tab."; +$lang['stnv0014'] = "(Could be online time boost(2x) for 8 hours, instant online time (4 hours), etc."; +$lang['stnv0015'] = "These boosts can be used for example to climb in the top users of the week."; +$lang['stnv0016'] = "Not available"; +$lang['stnv0017'] = "You are not connected to the TS3 Server, so it cant display any data for you."; +$lang['stnv0018'] = "Please connect to the TS3 Server and then Refresh your Session by pressing the blue Refresh Button at the top-right corner."; +$lang['stnv0019'] = "My Statistics - Page Content"; +$lang['stnv0020'] = "This page contains a overall summary of your personal statistics and activity on the server."; +$lang['stnv0021'] = "The informations are collected since the beginning of the Ranksystem, they are not since the beginning of the TeamSpeak server."; +$lang['stnv0022'] = "This page receives its values out of a database. So the values might be delayed a bit."; +$lang['stnv0023'] = "The sum inside of the donut charts may differ to the amount of 'Total user'. The reason is that this data weren't collected with older versions of the Ranksystem."; +$lang['stnv0024'] = "Ranksystem - Statistics"; +$lang['stnv0025'] = "Limit entries"; +$lang['stnv0026'] = "all"; +$lang['stnv0027'] = "The Informations on this site could be outdated! It seems the Ranksystem is no more connected to the TeamSpeak."; +$lang['stnv0028'] = "(You are not connected to the TS3!)"; +$lang['stnv0029'] = "List Rankup"; +$lang['stnv0030'] = "Ranksystem Info"; +$lang['stnv0031'] = "DE - Deutsch"; +$lang['stnv0032'] = "EN - english"; +$lang['stnv0033'] = "RU - русский"; +$lang['stnv0034'] = "IT - italiano"; +$lang['stri0001'] = "Ranksystem Information"; +$lang['stri0002'] = "What Is The Ranksystem?"; +$lang['stri0003'] = "A TS3 Bot, which automatically grant ranks (servergroups) to user on a TeamSpeak 3 Server for online time or online activity. It also gathers informations and statistics about the user and displays the result on this site."; +$lang['stri0004'] = "Who Created The Ranksystem?"; +$lang['stri0005'] = "When Did The Ranksystem Created?"; +$lang['stri0006'] = "First alpha release: 05/10/2014."; +$lang['stri0007'] = "First beta release: 01/02/2015."; +$lang['stri0008'] = "You can see the newest version on the Ranksystem Website."; +$lang['stri0009'] = "How Did The Ranksystem Created?"; +$lang['stri0010'] = "The Ranksystem is coded in"; +$lang['stri0011'] = "It uses also the following libraries:"; +$lang['stri0012'] = "Special Thanks To:"; +$lang['stri0013'] = "sergey - for russian translation"; +$lang['stri0014'] = "Bejamin Frost - for initialisation the bootstrap design"; +$lang['stri0015'] = "ZanK - for italian translation"; +$lang['sttw0001'] = "Top Users"; +$lang['sttw0002'] = "Of The Week"; +$lang['sttw0003'] = "With %s Hours Online Time"; +$lang['sttw0004'] = "Top 10 Compared"; +$lang['sttw0005'] = "Hours (Defines 100 %)"; +$lang['sttw0006'] = "%s Hours (%s%)"; +$lang['sttw0007'] = "Top 10 Statistics"; +$lang['sttw0008'] = "Top 10 Vs Others In Online Time"; +$lang['sttw0009'] = "Top 10 Vs Others In Active Time"; +$lang['sttw0010'] = "Top 10 Vs Others In Inactive Time"; +$lang['sttw0011'] = "Top 10 (in Hours)"; +$lang['sttw0012'] = "Other %s Users (in Hours)"; +$lang['sttw0013'] = "With %s hours active time"; +$lang['sttm0001'] = "Of The Month"; +$lang['stta0001'] = "Of All Time"; +$lang['updb'] = "Запустите это, если вы хотите обновить Ranksystem с более старой версии до версии %s!

Запустите это один раз после чего удалите update_%s.php файлы с вашего вебсервера.


Обновление Базы данных:
"; +$lang['updel'] = "Пожалуйста, удалите следующие файлы из корня ranksystem, если они все еще существуют:
%s"; +$lang['upinf'] = "Доступна новая версия Ранг Системы; Сообщаю Клиентам на Сервере..."; +$lang['upmov'] = "Пожалуйста, переместите \'%s\' в подпапку \'%s\' и перепишите существующий!"; +$lang['upmsg'] = "\nЭй, доступна новая версия [B]Ранг Системы[/B]!\n\nтекущая версия: %s\n[B]новая версия: %s[/B]\n\nПожалуйста посетите наш сайт [URL]http://ts-n.net/ranksystem.php[/URL] для получения более подробной информации."; +$lang['upsucc'] = "Обновление базы данных успешно выполнено."; +$lang['upuser'] = "Пользователь %s (Уникальный ID клиента: %s; ID в базе данных: %s) получает новое количество (сумм. время подключения) из %s (thereof active %s)."; +$lang['upuserboost'] = "Пользователь %s (Уникальный ID клиента: %s; ID в базе данных: %s) получает новое количество (сумм. время подключения) из %s (thereof active %s) [BOOST %sx]."; +$lang['upusrerr'] = "Пользователь с уникальным ID %s не был найден (не правильно указан Уникальный ID или пользователь в настоящий момент не подключен к серверу Teamspeak)!"; +$lang['upusrinf'] = "Пользователь %s был успешно информирован."; +$lang['user'] = "Логин: "; +$lang['usermsgactive'] = "\nЭй, вы получили новый Ранг, так как были активны в течении %s дней, %s часов, %s минут и %s секунд."; +$lang['usermsgonline'] = "\nЭй, вы получили новый Ранг, так как были онлайн в течении %s дней, %s часов, %s минут и %s секунд."; +$lang['wiaction'] = "выполнить"; +$lang['wibgco'] = "Цвет фона:"; +$lang['wibgcodesc'] = "Укажите код цвета фона.
(только HTML код; должно начинаться с # )"; +$lang['wiboost'] = "повышение"; +$lang['wiboostdesc'] = "Give an user on your TeamSpeak server a servergroup (have to be created manually), which you can declare here as boost group. Define also a factor which should be used (for example 2x) and a time, how long the boost should be rated.
The higher the factor, the faster an user reaches the next higher rank.
Is the time expired, the boost servergroup get automatically removed from the concerned user. The time starts running as soon as the user gets the servergroup.

servergroup ID => factor => time (in seconds)

Each entry have to separate from next with a comma.

Example:
12=>2=>6000,13=>3=>2500,14=>5=>600

On this an user in servergroup 12 get the factor 2 for the next 6000 seconds, an user in servergroup 13 get the factor 3 for 2500 seconds, and so on..."; +$lang['wichdbid'] = "Client-database-ID reset"; +$lang['wichdbiddesc'] = "Сбрасывает время онлайн пользователя, если его ID в базы данных клиента TeamSpeak изменился.

Пример:
Если пользователь удален из БД сервера TeamSpeak, то, новый ID базы данных клиента будет записан со следующим подключением к серверу."; +$lang['wiconferr'] = "Есть ошибка в конфигурации Ranksystem. Пожалуйста, зайдите в Веб Панель и проверте настройки раздела 'Настройка Ранг Системы'. Особенно проверьте 'Ранги'!"; +$lang['widaform'] = "Формат даты"; +$lang['widaformdesc'] = "Выберите формат показа даты.

Пример:
%a дней, %h часов, %i минут, %s секунд"; +$lang['widbcfgsuc'] = "Настройки Базы Данных успешно сохранены."; +$lang['widbcfgerr'] = "Ошибка сохранения настроек базы данных! Ошибка подключения, проверте на правильность настроек 'other/dbconfig.php'"; +$lang['widelcld'] = "удаление пользователей"; +$lang['widelcldgrp'] = "renew groups"; +$lang['widelcldgrpdesc'] = "The Ranksystem remember the given servergroups, so it don't need to give/check this with every run of the worker.php again.

With this function you can remove once time the knowledge of given servergroups. In effect the ranksystem try to give all clients (which are on the TS3 server online) the servergroup of the actual rank.
For each client, which gets the group or stay in group, the Ranksystem remember this like described at beginning.

This function can be helpful, when user are not in the servergroup, they should be for the defined online time.

Attention: Run this in a moment, where the next few minutes no rankups become due!!! The Ranksystem can't remove the old group, cause he can't remember ;-)"; +$lang['widelclddesc'] = "Удаление выбранных клиентов из базы данных Ранг-Системы.

Клиент непосредственно на сервере Teamspeak не будет удален."; +$lang['widelsg'] = "удаление из сервер групп"; +$lang['widelsgdesc'] = "Выберите, если клиенты должны также быть удалены из последней известной Сервер-группы, когда Вы удаляете клиентов из базы данных Ранг Системы.

Будет затронуты только те сервер группы, которые указанны в настройках Ранг Системы"; +$lang['wideltime'] = "Время удаления"; +$lang['wideltimedesc'] = "Отчистка базы данных Ранг Системы от старых клиентов.
Entry a time in seconds which a client was not seen to delete it.

0 - deletes all clients out of the Ranksystem

При этом база данных пользователей на сервере TeamSpeak затронута не будет!"; +$lang['wiexgrp'] = "Исключения сервер групп"; +$lang['wiexgrpdesc'] = "Укажите через запятую какие сервер группы будут игнорироваться Ранг Системой.
Если пользователь находится хоты бы в одной из этих групп то Ранг Система будет игнорировать его."; +$lang['wiexuid'] = "Исключения CID"; +$lang['wiexuiddesc'] = "Укажите через запятую уникальные идентификаторы клиентов (Client-IDs), которых будет игнорировать Ранг Система.
Пользователи в этом списке будет проигнорированы Ранг Системой."; +$lang['wigrptime'] = "Ранги"; +$lang['wigrptimedesc'] = "Укажите через какой промежуток времени будет выданная сервер группа.

Время (в секундах)=>номер сервер группы SID

Важным условием для этого, является учет времени онлайн пользователя или если включен учет 'Время простоя'.

Каждый параметр должен разделяться запятой.

Так же время должно быть указанно по 'нарастающей'

Пример:
60=>9,120=>10,180=>11

По истечению 60 секунд пользователь получает сервер группу под SID 9, по истечению еще 120 секунд пользователь получает сервер группу SID 10, и так далее..."; +$lang['wihdco'] = "Цвет заголовка:"; +$lang['wihdcodesc'] = "Укажите код цвета заголовка.
(только HTML код; должно начинаться с # )"; +$lang['wihl'] = "Веб Панель - Система Рангов"; +$lang['wihladm'] = "Лист Администратора"; +$lang['wihlcfg'] = "Настройка Ранг Системы"; +$lang['wihlclg'] = "Редактирование клиентов (глобальное)"; +$lang['wihlcls'] = "Редактирование клиентов (выборочное)"; +$lang['wihldb'] = "Настройки Базы Данных"; +$lang['wihlsty'] = "Настройки стиля"; +$lang['wihlts'] = "Настройка поключения к TeamSpeak"; +$lang['wihvco'] = "Цвет Hover:"; +$lang['wihvcodesc'] = "Укажите код цвета hover.
(только HTML код; должно начинаться с # )"; +$lang['wiifco'] = "Цвет Текста оповещения:"; +$lang['wiifcodesc'] = "Укажите код цвета Текста оповещения.
(только HTML код; должно начинаться с # )"; +$lang['wilogout'] = "Выход"; +$lang['wilog'] = "Logpath"; +$lang['wilogdesc'] = "Path of the log file of the Ranksystem.

Example:
/var/logs/ranksystem/

Be sure, the webuser has the write-permissions to the logpath."; +$lang['wimsgusr'] = "Уведомление"; +$lang['wimsgusrdesc'] = "Сообщение пользователю о повышение ранга.
Отредактируйте сообщение в 'lang.php'
(usermsgonline или usermsgactive)"; +$lang['wiscco'] = "Цвет Successtext:"; +$lang['wisccodesc'] = "Укажите код цвета success-text.
(только HTML код; должно начинаться с # )"; +$lang['wiselcld'] = "Выбор клиентов"; +$lang['wiselclddesc'] = "Выберите клиентов последним известным именем пользователя. Для этого Вы только должны начать печатать.
Выбор нескольких пользователей - отделенная запятая, которая ставится системой автоматически.

With the selection you can choose with the next step an action."; +$lang['wishcolas'] = "ток сервер группа"; +$lang['wishcolasdesc'] = "Показ колонки 'ток сервер группа' в list_rankup.php"; +$lang['wishcolat'] = "Время активности"; +$lang['wishcolatdesc'] = "Показ колонки 'суммарное время активности' в list_rankup.php"; +$lang['wishcolcld'] = "Ник клиента"; +$lang['wishcolclddesc'] = "Показ колонки 'Ник клиента' в list_rankup.php"; +$lang['wishcoldbid'] = "ID в Базе данных"; +$lang['wishcoldbiddesc'] = "Показ колонки 'ID в Базе данных' в list_rankup.php"; +$lang['wishcolit'] = "Время простоя"; +$lang['wishcolitdesc'] = "Показ колонки 'суммарное время простоя' в list_rankup.php"; +$lang['wishcolls'] = "Последний раз замечен"; +$lang['wishcollsdesc'] = "Показ колонки 'Последний раз замечен' в list_rankup.php"; +$lang['wishcolnx'] = "Следующий Ранг"; +$lang['wishcolnxdesc'] = "Показ колонки 'Следующий Ранг' в list_rankup.php"; +$lang['wishcolot'] = "Время подключения"; +$lang['wishcolotdesc'] = "Показ колонки 'суммарное время подключения' в list_rankup.php"; +$lang['wishcolrg'] = "П\Н"; +$lang['wishcolrgdesc'] = "Показ колонки 'Порядковый номер' в list_rankup.php"; +$lang['wishcolsg'] = "Следующая сервер группа"; +$lang['wishcolsgdesc'] = "Показ колонки 'следующая сервер группа' в list_rankup.php"; +$lang['wishcoluuid'] = "Client-ID"; +$lang['wishcoluuiddesc'] = "Показ колонки 'уникальный ID клиента' в list_rankup.php"; +$lang['wishexcld'] = "Пользователи исключения"; +$lang['wishexclddesc'] = "Показывать пользователий в list_rankup.php,
которые исключены по параметру uniqueID."; +$lang['wishexgrp'] = "Группы исключения"; +$lang['wishexgrpdesc'] = "Показывать пользователий в list_rankup.php, которые находятся в списке 'исключение клиента' и не должы учитываться Системой Рангов."; +$lang['wishgen'] = "Sitegen"; +$lang['wishgendesc'] = "Показывать время генерации списка в конце страницы."; +$lang['wishhicld'] = "Пользователи с высоким рангом"; +$lang['wishhiclddesc'] = "Показывать пользователий в list_rankup.php, который достиг высшего уровня в Ranksystem."; +$lang['wisupidle'] = "Время простоя"; +$lang['wisupidledesc'] = "Если эта функция активна, 'сумм. время простоя' будет основанием от 'сумм. время подключения'. Вместо 'сумм. время подключения', предыдущая вычитание будет рассматриваться на повышение Ранга."; +$lang['wisvconf'] = "сохранить"; +$lang['wisvsuc'] = "Изменения успешно сохранены!"; +$lang['witime'] = "Timezone"; +$lang['witimedesc'] = "Select the timezone the server is hosted."; +$lang['wits3dch'] = "Default Channel"; +$lang['wits3dchdesc'] = "The channel-ID, the bot should connect with.

The Bot will join this channel after connecting to the TeamSpeak server."; +$lang['wits3host'] = "TS3 Hostaddress"; +$lang['wits3hostdesc'] = "Адрес TeamSpeak 3 Сервера
(IP или DNS)"; +$lang['wits3sm'] = "Замедленный режим"; +$lang['wits3smdesc'] = "With the Slowmode you can reduce \"spam\" of query commands to the TeamSpeak server. This prevent bans in case of flood.
TeamSpeak Query commands get delayed with this function.

!!! ALSO IT REDUCE THE CPU USAGE !!!

The activation is not recommended, if not required. The delay increases the duration of the Bot, which makes it imprecisely."; +$lang['wits3qnm'] = "Botname"; +$lang['wits3qnm2'] = "2е Botname"; +$lang['wits3qnm2desc'] = "Это Botname, будет использоваться если первое уже занято."; +$lang['wits3qnmdesc'] = "Имя, под которым будет сидеть Ранг система.
Убедитесь что оно не занято."; +$lang['wits3querpw'] = "TS3 Query-Пароль"; +$lang['wits3querpwdesc'] = "TeamSpeak 3 query Пароль
Ваш пароль от query пользователя."; +$lang['wits3querusr'] = "TS3 Query-Логин"; +$lang['wits3querusrdesc'] = "TeamSpeak 3 query Логин
По умолчанию: serveradmin
Конечно вы можете указать другой логин для Ranksystem.
Необходимые разрешения привилегий вы можете найти на:
http://ts-n.net/ranksystem.php"; +$lang['wits3query'] = "TS3 Query-Порт"; +$lang['wits3querydesc'] = "TeamSpeak 3 query Порт
По умолчанию: 10011 (TCP)
Если порт изменен, то укажите его согласно настройкам из 'ts3server.ini'."; +$lang['wits3voice'] = "TS3 Voice-Порт"; +$lang['wits3voicedesc'] = "TeamSpeak 3 voice Порт
По умолчанию: 9987 (UDP)
Этот порт используется Teamspeak3 клиентом для подключения к серверу."; +$lang['witxco'] = "Цвет текста:"; +$lang['witxcodesc'] = "Укажите код цвета текста.
(только HTML код; должно начинаться с # )"; +$lang['wiupcheck'] = "Проверка обновлений"; +$lang['wiupcheckdesc'] = "Если проверка обнолений включена, то пользователь получит приватное сообщение, когда обновление доступно."; +$lang['wiuptime'] = "Интервал проверки"; +$lang['wiuptimedesc'] = "Введите здесь через сколько секунд Ранг Система должна проверить наличие обновлений.
Внимание, после каждой проверки перечисленные пользователь получает уведомление. Если ни один из перечисленных пользователей не онлайн, Система Рангов будет пытаться уведомить пользователей со следующего интервала сканирования."; +$lang['wiupuid'] = "Получатель"; +$lang['wiupuiddesc'] = "Укажите через запятую уникальные ID клиентов, которые будут проинформированы о доступных обновлениях посредством приватного сообщения через TeamSpeak."; +$lang['wiversion'] = "(текущая версия %s)"; +$lang['wivlang'] = "Язык"; +$lang['wivlangdesc'] = "Язык Ранг Системы

de - Deutsch
en - english
it - italiano
ru - Русский"; +$lang['wiwnco'] = "Цвет текста предупреждений:"; +$lang['wiwncodesc'] = "Укажите цвет текста предупреждения.
(только HTML код; должно начинаться с # )"; +?> \ No newline at end of file diff --git a/languages/nations_en.php b/languages/nations_en.php index b1f332a..86be869 100644 --- a/languages/nations_en.php +++ b/languages/nations_en.php @@ -1 +1,250 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/languages/nations_it.php b/languages/nations_it.php new file mode 100644 index 0000000..652a996 --- /dev/null +++ b/languages/nations_it.php @@ -0,0 +1,250 @@ + \ No newline at end of file diff --git a/languages/nations_ru.php b/languages/nations_ru.php new file mode 100644 index 0000000..8edb3a2 --- /dev/null +++ b/languages/nations_ru.php @@ -0,0 +1,250 @@ + \ No newline at end of file diff --git a/other/config.php b/other/config.php index e2f36c1..1edd767 100644 --- a/other/config.php +++ b/other/config.php @@ -1 +1,135 @@ -'SET NAMES utf8',PDO::ATTR_PERSISTENT=>true);}else{$dboptions=array();}try{$mysqlcon=new PDO($dbserver,$db['user'],$db['pass'],$dboptions);}catch(PDOException $e){$sqlconerr="SQL Connection failed: ".$e->getMessage()."\n";echo $sqlconerr;exit;}if(($config=$mysqlcon->query("SELECT * FROM config"))===false){$bgcolor='#101010';$hdcolor='#909090';$txcolor='#707070';$hvcolor='#FFFFFF';$ifcolor='#3366CC';$wncolor='#CC0000';$sccolor='#008000';$showgen='1';}else{$config=$config->fetchAll();$ts['host']=$config[0]['tshost'];$ts['query']=$config[0]['tsquery'];$ts['voice']=$config[0]['tsvoice'];$ts['user']=$config[0]['tsuser'];$ts['pass']=$config[0]['tspass'];$webuser=$config[0]['webuser'];$webpass=$config[0]['webpass'];if(!isset($_GET["lang"])){if(isset($_SESSION['language'])){$language=$_SESSION['language'];}else{$language=$config[0]['language'];}}elseif($_GET["lang"]=="de"){$language="de";$_SESSION['language']="de";}elseif($_GET["lang"]=="ru"){$language="ru";$_SESSION['language']="ru";}else{$language="en";$_SESSION['language']="en";}$queryname=$config[0]['queryname'];$queryname2=$config[0]['queryname2'];$slowmode=$config[0]['slowmode'];if(empty($config[0]['grouptime'])){$grouptime=null;}else{$grouptimearr=explode(',',$config[0]['grouptime']);foreach($grouptimearr as $entry){list($key,$value)=explode('=>',$entry);$grouptime[$key]=$value;}}if(empty($config[0]['boost'])){$boostarr=null;}else{$boostexp=explode(',',$config[0]['boost']);foreach($boostexp as $entry){list($key,$value1,$value2)=explode('=>',$entry);$boostarr[$key]=array("group"=>$key,"factor"=>$value1,"time"=>$value2);}}$resetbydbchange=$config[0]['resetbydbchange'];$msgtouser=$config[0]['msgtouser'];$update=$config[0]['upcheck'];$uniqueid=explode(',',$config[0]['uniqueid']);$updateinfotime=$config[0]['updateinfotime'];$currvers=$config[0]['currvers'];$substridle=$config[0]['substridle'];$exceptuuid=explode(',',$config[0]['exceptuuid']);$exceptgroup=explode(',',$config[0]['exceptgroup']);$timeformat=$config[0]['dateformat'];$showexgrp=$config[0]['showexgrp'];$showexcld=$config[0]['showexcld'];$showhighest=$config[0]['showhighest'];$showcolrg=$config[0]['showcolrg'];$showcolcld=$config[0]['showcolcld'];$showcoluuid=$config[0]['showcoluuid'];$showcoldbid=$config[0]['showcoldbid'];$showcolls=$config[0]['showcolls'];$showcolot=$config[0]['showcolot'];$showcolit=$config[0]['showcolit'];$showcolat=$config[0]['showcolat'];$showcolas=$config[0]['showcolas'];$showcolnx=$config[0]['showcolnx'];$showcolsg=$config[0]['showcolsg'];$bgcolor=$config[0]['bgcolor'];$hdcolor=$config[0]['hdcolor'];$txcolor=$config[0]['txcolor'];$hvcolor=$config[0]['hvcolor'];$ifcolor=$config[0]['ifcolor'];$wncolor=$config[0]['wncolor'];$sccolor=$config[0]['sccolor'];$showgen=$config[0]['showgen'];$cleanclients=$config[0]['cleanclients'];$cleanperiod=$config[0]['cleanperiod'];$defchid=$config[0]['defchid'];$logpath=$config[0]['logpath'];if($config[0]['timezone']==NULL){$timezone="Europe/Berlin";}else{$timezone=$config[0]['timezone'];}date_default_timezone_set($timezone);}if(!isset($language)||$language=="en"){require_once(substr(dirname(__FILE__),0,-5).'languages/core_en.php');}elseif($language=="de"){require_once(substr(dirname(__FILE__),0,-5).'languages/core_de.php');}elseif($language=="ru"){require_once(substr(dirname(__FILE__),0,-5).'languages/core_ru.php');}?> \ No newline at end of file + 'SET NAMES utf8', + PDO::ATTR_PERSISTENT => true + ); +} else { + $dboptions = array(); +} + +try { + $mysqlcon = new PDO($dbserver, $db['user'], $db['pass'], $dboptions); +} catch (PDOException $e) { + $sqlconerr = "SQL Connection failed: ".$e->getMessage()."\n"; + echo $sqlconerr; + // open function mail here and try to ts3 msg (perhaps uuid out of text file; mysqlconf?) + exit; +} +if (($config = $mysqlcon->query("SELECT * FROM config")) === false) { + $bgcolor = '#101010'; + $hdcolor = '#909090'; + $txcolor = '#707070'; + $hvcolor = '#FFFFFF'; + $ifcolor = '#3366CC'; + $wncolor = '#CC0000'; + $sccolor = '#008000'; + $showgen = '1'; +} else { + $config = $config->fetchAll(); + $ts['host'] = $config[0]['tshost']; + $ts['query'] = $config[0]['tsquery']; + $ts['voice'] = $config[0]['tsvoice']; + $ts['user'] = $config[0]['tsuser']; + $ts['pass'] = $config[0]['tspass']; + $webuser = $config[0]['webuser']; + $webpass = $config[0]['webpass']; + if(!isset($_GET["lang"])) { + if(isset($_SESSION['language'])) { + $language = $_SESSION['language']; + } else { + $language = $config[0]['language']; + } + } elseif($_GET["lang"] == "de") { + $language = "de"; + $_SESSION['language'] = "de"; + } elseif($_GET["lang"] == "ru") { + $language = "ru"; + $_SESSION['language'] = "ru"; + } elseif($_GET["lang"] == "it") { + $language = "it"; + $_SESSION['language'] = "it"; + } else { + $language = "en"; + $_SESSION['language'] = "en"; + } + $queryname = $config[0]['queryname']; + $queryname2 = $config[0]['queryname2']; + $slowmode = $config[0]['slowmode']; + if(empty($config[0]['grouptime'])) { + $grouptime = null; + } else { + $grouptimearr = explode(',', $config[0]['grouptime']); + foreach ($grouptimearr as $entry) { + list($key, $value) = explode('=>', $entry); + $grouptime[$key] = $value; + } + } + if(empty($config[0]['boost'])) { + $boostarr = null; + } else { + $boostexp = explode(',', $config[0]['boost']); + foreach ($boostexp as $entry) { + list($key, $value1, $value2) = explode('=>', $entry); + $boostarr[$key] = array("group"=>$key,"factor"=>$value1,"time"=>$value2); + } + } + $resetbydbchange = $config[0]['resetbydbchange']; + $msgtouser = $config[0]['msgtouser']; + $update = $config[0]['upcheck']; + $uniqueid = explode(',', $config[0]['uniqueid']); + $updateinfotime = $config[0]['updateinfotime']; + $currvers = $config[0]['currvers']; + $substridle = $config[0]['substridle']; + $exceptuuid = explode(',', $config[0]['exceptuuid']); + $exceptgroup = explode(',', $config[0]['exceptgroup']); + $timeformat = $config[0]['dateformat']; + $showexgrp = $config[0]['showexgrp']; + $showexcld = $config[0]['showexcld']; + $showhighest = $config[0]['showhighest']; + $showcolrg = $config[0]['showcolrg']; + $showcolcld = $config[0]['showcolcld']; + $showcoluuid = $config[0]['showcoluuid']; + $showcoldbid = $config[0]['showcoldbid']; + $showcolls = $config[0]['showcolls']; + $showcolot = $config[0]['showcolot']; + $showcolit = $config[0]['showcolit']; + $showcolat = $config[0]['showcolat']; + $showcolas = $config[0]['showcolas']; + $showcolnx = $config[0]['showcolnx']; + $showcolsg = $config[0]['showcolsg']; + $bgcolor = $config[0]['bgcolor']; + $hdcolor = $config[0]['hdcolor']; + $txcolor = $config[0]['txcolor']; + $hvcolor = $config[0]['hvcolor']; + $ifcolor = $config[0]['ifcolor']; + $wncolor = $config[0]['wncolor']; + $sccolor = $config[0]['sccolor']; + $showgen = $config[0]['showgen']; + $cleanclients = $config[0]['cleanclients']; + $cleanperiod = $config[0]['cleanperiod']; + $defchid = $config[0]['defchid']; + $logpath = $config[0]['logpath']; + if ($config[0]['timezone'] == NULL) { + $timezone = "Europe/Berlin"; + } else { + $timezone = $config[0]['timezone']; + } + date_default_timezone_set($timezone); +} +if(!isset($language) || $language == "en") { + require_once(substr(dirname(__FILE__),0,-5).'languages/core_en.php'); +} elseif($language == "de") { + require_once(substr(dirname(__FILE__),0,-5).'languages/core_de.php'); +} elseif($language == "ru") { + require_once(substr(dirname(__FILE__),0,-5).'languages/core_ru.php'); +} elseif($language == "it") { + require_once(substr(dirname(__FILE__),0,-5).'languages/core_it.php'); +} +?> \ No newline at end of file diff --git a/other/webinterface_list.php b/other/webinterface_list.php index 21ec730..baefba9 100644 --- a/other/webinterface_list.php +++ b/other/webinterface_list.php @@ -1,13 +1,17 @@ -query("SELECT * FROM config");$configs=$configs->fetch(PDO::FETCH_ASSOC);echo ' - - - - +query("SELECT * FROM config"); +$configs = $configs->fetch(PDO::FETCH_ASSOC); + +echo '
',$lang['wilogout'],'
',$lang['wihl'],'
',sprintf($lang['wiversion'],$configs['currvers']),'
',$alert,'
+ + + +
', $lang['wilogout'], '
', $lang['wihl'], '
', sprintf($lang['wiversion'], $configs['currvers']), '
', $alert, '
-
 
- ',$lang['wihlts'],' + ', $lang['wihlts'], '
 
- ',$lang['wihldb'],' + ', $lang['wihldb'], '
 
- ',$lang['wihlcfg'],' + ', $lang['wihlcfg'], '
 
- ',$lang['wihlsty'],' + ', $lang['wihlsty'], '
 
 
- ',$lang['wihladm'],' + ', $lang['wihladm'], '
 
- ',$lang['wihlcls'],' + ', $lang['wihlcls'], '
 
- ',$lang['wihlclg'],' + ', $lang['wihlclg'], '
';?> \ No newline at end of file +'; +?> \ No newline at end of file diff --git a/stats/index.php b/stats/index.php index 5f5edaf..c0bcb84 100644 --- a/stats/index.php +++ b/stats/index.php @@ -1 +1,465 @@ -query("SELECT * FROM $dbname.stats_server");$sql_res=$sql->fetchAll();$server_usage_sql=$mysqlcon->query("SELECT * FROM $dbname.server_usage ORDER BY(timestamp) DESC LIMIT 0, 47");$server_usage_sql_res=$server_usage_sql->fetchAll();if(isset($_GET['usage'])){if($_GET["usage"]=='week'){$usage='week';}elseif($_GET["usage"]=='month'){$usage='month';}else{$usage='day';}}else{$usage='day';}require_once('nav.php');?>
'.$lang['days'].'';?>
'.$lang['days'].'';?>
'.$lang['days'].'';?>

 

 

 

 

'.$lang['stix0024'].'';}else{echo ''.$lang['stix0025'].'';}?>
'.$lang['stix0032'].' '.(new DateTime("@0"))->diff($serveruptime)->format($timeformat).')';}else{echo $lang['stix0033'];}?>

servericon';}else{echo $sql_res[0]['server_name'];}?>
'.$lang['stix0046'].'';}else{echo $lang['stix0047'];}?>
\ No newline at end of file +query("SELECT * FROM $dbname.stats_server"); +$sql_res = $sql->fetchAll(); + +$server_usage_sql = $mysqlcon->query("SELECT * FROM $dbname.server_usage ORDER BY(timestamp) DESC LIMIT 0, 47"); +$server_usage_sql_res = $server_usage_sql->fetchAll(); + +if(isset($_GET['usage'])) { + if ($_GET["usage"] == 'week') { + $usage = 'week'; + } elseif ($_GET["usage"] == 'month') { + $usage = 'month'; + } elseif ($_GET["usage"] == 'year') { + $usage = 'year'; + } else { + $usage = 'day'; + } +} else { + $usage = 'day'; +} +require_once('nav.php'); +?> +
+ +
+ + +
+
+

+ + + + +

+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+ +
+
+
'.$lang['days'].'';?>
+
+
+
+
+ + + +
+
+
+
+
+
+
+ +
+
+
'.$lang['days'].'';?>
+
+
+
+
+ + + +
+
+
+
+
+
+
+ +
+
+
'.$lang['days'].'';?>
+
+
+
+
+ + + +
+
+
+ +
+
+
+
+
+
+

  

+
+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+

 

+
+
+
+
+
+
+
+
+
+

 

+
+
+
+
+
+
+
+
+
+

 

+
+
+
+
+
+
+
+
+
+

 

+
+
+
+
+
+
+
+ +
+
+

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
'.$lang['stix0024'].''; } else { echo ''.$lang['stix0025'].''; } ?>
'.$lang['stix0032'].' '.(new DateTime("@0"))->diff($serveruptime)->format($timeformat).')'; } else { echo $lang['stix0033']; } ?>
+
+
+
+

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
servericon'; } else { echo $sql_res[0]['server_name']; } ?>
+
'.$lang['stix0046'].''; } else { echo $lang['stix0047']; } ?>
+
+
+
+
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/stats/info.php b/stats/info.php index 4cc1462..b475768 100644 --- a/stats/info.php +++ b/stats/info.php @@ -1 +1,84 @@ -


The Ranksystem was coded by Newcomer1989 Copyright © 2009-2016 TeamSpeak Sponsoring TS-N.NET. All rights reserved.



PHP - Copyright © 2001-2016 the PHP Group


jQuery v2.2.0 - Copyright © 2016 The jQuery Foundation

jQuery Autocomplete plugin 1.1 - Copyright © 2009 Jörn Zaefferer

Font Awesome 4.2.0 - Copyright © davegandy

flag-icon-css - Copyright © 2016 lipis

Ajax Queue Plugin - Copyright © 2013 Corey Frang

TeamSpeak 3 PHP Framework 1.1.23 - Copyright © 2010 Planet TeamSpeak

Bootstrap 3.3.6 - Copyright © 2011-2016 Twitter, Inc.

morris.js - Copyright © 2013 Olly Smith

Raphaël 2.1.4 - JavaScript Vector Library - Copyright © 2008-2012 Dmitry Baranovskiy

SB Admin Bootstrap Admin Template - Copyright © 2013-2016 Blackrock Digital LLC.



\ No newline at end of file + +
+ +
+ + +
+
+

+ +

+
+
+
+
+

+

+
+
+
+
+
+

+

The Ranksystem was coded by Newcomer1989 Copyright © 2009-2016 TeamSpeak Sponsoring TS-N.NET. All rights reserved.

+
+
+
+
+
+

+

+

+

+
+
+
+
+
+

+

+

PHP - Copyright © 2001-2016 the PHP Group


+

+

jQuery v2.2.0 - Copyright © 2016 The jQuery Foundation

+

jQuery Autocomplete plugin 1.1 - Copyright © 2009 Jörn Zaefferer

+

Font Awesome 4.2.0 - Copyright © davegandy

+

flag-icon-css - Copyright © 2016 lipis

+

Ajax Queue Plugin - Copyright © 2013 Corey Frang

+

TeamSpeak 3 PHP Framework 1.1.23 - Copyright © 2010 Planet TeamSpeak

+

Bootstrap 3.3.6 - Copyright © 2011-2016 Twitter, Inc.

+

morris.js - Copyright © 2013 Olly Smith

+

Raphaël 2.1.4 - JavaScript Vector Library - Copyright © 2008-2012 Dmitry Baranovskiy

+

SB Admin Bootstrap Admin Template - Copyright © 2013-2016 Blackrock Digital LLC.

+
+
+
+
+
+

+

+

+

+
+
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/stats/list_rankup.php b/stats/list_rankup.php index fd6f39f..422c485 100644 --- a/stats/list_rankup.php +++ b/stats/list_rankup.php @@ -1 +1,452 @@ -query("SELECT * FROM $dbname.user $searchmysql");$sumentries=$dbdata_full->rowCount();if(!isset($_GET["user"])){$user_pro_seite=50;}elseif($_GET['user']=="all"){$user_pro_seite=$sumentries;}else{$user_pro_seite=$_GET["user"];}$start=$seite * $user_pro_seite - $user_pro_seite;if($keysort=='active'&&$keyorder=='asc'){$dbdata=$mysqlcon->query("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user $searchmysql ORDER BY (count - idle) LIMIT $start, $user_pro_seite");}elseif($keysort=='active'&&$keyorder=='desc'){$dbdata=$mysqlcon->query("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user $searchmysql ORDER BY (idle - count) LIMIT $start, $user_pro_seite");}else{$dbdata=$mysqlcon->query("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user $searchmysql ORDER BY $keysort $keyorder LIMIT $start, $user_pro_seite");}$seiten_anzahl_gerundet=ceil($sumentries / $user_pro_seite);function pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$language,$getstring){?> fetchAll();foreach($uuids as $uuid){$sqlhis[$uuid['uuid']]=array("cldbid"=>$uuid['cldbid'],"rank"=>$uuid['rank'],"count"=>$uuid['count'],"name"=>$uuid['name'],"idle"=>$uuid['idle'],"cldgroup"=>$uuid['cldgroup'],"online"=>$uuid['online'],"nextup"=>$uuid['nextup'],"lastseen"=>$uuid['lastseen'],"ip"=>$uuid['ip'],"grpid"=>$uuid['grpid']);$uidarr[]=$uuid['uuid'];$countentries=$countentries + 1;}if(!$dbdata=$mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='calc_user_lastscan'")){$err_msg=''.$mysqlcon->errorCode().'
';}$lastscan=$dbdata->fetchAll();$scantime=$lastscan[0]['timestamp'];$livetime=time()- $scantime;$dbgroups=$mysqlcon->query("SELECT * FROM $dbname.groups");$servergroups=$dbgroups->fetchAll(PDO::FETCH_ASSOC);foreach($servergroups as $servergroup){$sqlhisgroup[$servergroup['sgid']]=$servergroup['sgidname'];if(file_exists('../icons/'.$servergroup['sgid'].'.png')){$sqlhisgroup_file[$servergroup['sgid']]=true;}else{$sqlhisgroup_file[$servergroup['sgid']]=false;}}if($adminlogin==1){switch($keyorder){case "asc":$keyorder2="desc&admin=true";break;case "desc":$keyorder2="asc&admin=true";}}else{switch($keyorder){case "asc":$keyorder2="desc";break;case "desc":$keyorder2="asc";}}?>
',$lang['listrank'],'';if($showcolcld==1||$adminlogin==1)echo($keysort=='name')?'':'';if($showcoluuid==1||$adminlogin==1)echo '';if($showcoldbid==1||$adminlogin==1)echo '';if($adminlogin==1)echo '';if($showcolls==1||$adminlogin==1)echo '';if($showcolot==1||$adminlogin==1)echo '';if($showcolit==1||$adminlogin==1)echo '';if($showcolat==1||$adminlogin==1)echo '';if($showcolas==1||$adminlogin==1)echo '';if($showcolnx==1||$adminlogin==1)echo($keysort=='nextup')?'':'';if($showcolsg==1||$adminlogin==1)echo '';echo '';ksort($grouptime);$countgrp=count($grouptime);if($countentries>0){$countrank=($seite-1)*$user_pro_seite;$exceptgrp=0;$exceptcld=0;$highest=0;$countallsum=0;foreach($uidarr as $uid){$cldgroup=$sqlhis[$uid]['cldgroup'];$lastseen=$sqlhis[$uid]['lastseen'];$count=$sqlhis[$uid]['count'];$idle=$sqlhis[$uid]['idle'];$status=$sqlhis[$uid]['online'];$nextup=$sqlhis[$uid]['nextup'];$sgroups=explode(",",$cldgroup);$active=$count - $idle;if($substridle==1){$activetime=$count - $idle;}else{$activetime=$count;}$grpcount=0;$countallsum++;foreach($grouptime as $time=>$groupid){$grpcount++;if(array_intersect($sgroups,$exceptgroup)&&$showexgrp!=1&&$adminlogin!=1){$exceptgrp++;break;}if(in_array($uid,$exceptuuid)&&$showexcld!=1&&$adminlogin!=1){$exceptcld++;break;}if($activetime<$time||$grpcount==$countgrp&&$nextup==0&&$showhighest==1||$grpcount==$countgrp&&$nextup==0&&$adminlogin==1){if($nextup==0&&$grpcount==$countgrp){$neededtime=0;}elseif($status==1){$neededtime=$time - $activetime - $livetime;}else{$neededtime=$time - $activetime;}echo '';if($showcolrg==1||$adminlogin==1){$countrank++;echo '';}if($adminlogin==1){echo '';}elseif($showcolcld==1){echo '';}if($adminlogin==1){echo '';}elseif($showcoluuid==1){echo '';}if($showcoldbid==1||$adminlogin==1)echo '';if($adminlogin==1)echo '';if($showcolls==1||$adminlogin==1){echo '';}if($showcolot==1||$adminlogin==1){echo '';}elseif($sqlhisgroup_file[$sqlhis[$uid]['grpid']]===true){echo '';}else{echo '';}}if($showcolnx==1||$adminlogin==1){echo '';}elseif(!in_array($uid,$exceptuuid)&&!array_intersect($sgroups,$exceptgroup)){$timecount=0;echo $timecount,'';}elseif(in_array($uid,$exceptuuid)){echo $lang['listexuid'],'';}elseif(array_intersect($sgroups,$exceptgroup)){echo $lang['listexgrp'],'';}else{echo $lang['errukwn'],'';}}if($showcolsg==1||$adminlogin==1){if($grpcount==$countgrp&&$nextup==0&&$showhighest==1||$grpcount==$countgrp&&$nextup==0&&$adminlogin==1){echo '';$highest++;}elseif($sqlhisgroup_file[$groupid]===true){echo '';}else{echo '';}}echo '';break;}elseif($grpcount==$countgrp&&$nextup==0){$highest++;}}}}else{echo '';}echo '
'.$lang['listnick'].''.$lang['listnick'].'',$lang['listuid'],'',$lang['listcldbid'],'',$lang['listip'],'',$lang['listseen'],'',$lang['listsumo'],'',$lang['listsumi'],'',$lang['listsuma'],'',$lang['listacsg'],''.$lang['listnxup'].''.$lang['listnxup'].'',$lang['listnxsg'],'
',$sqlhis[$uid]['rank'],'',$sqlhis[$uid]['name'],'',$sqlhis[$uid]['name'],'',$uid,'',$uid,'',$sqlhis[$uid]['cldbid'],'',long2ip($sqlhis[$uid]['ip']),'',date('Y-m-d H:i:s',$lastseen);echo '';$dtF=new DateTime("@0");$dtT=new DateTime("@$count");$timecount=$dtF->diff($dtT)->format($timeformat);echo $timecount;}if($showcolit==1||$adminlogin==1){echo '';$dtF=new DateTime("@0");$dtT=new DateTime("@$idle");$timecount=$dtF->diff($dtT)->format($timeformat);echo $timecount;}if($showcolat==1||$adminlogin==1){echo '';$dtF=new DateTime("@0");$dtT=new DateTime("@$active");$timecount=$dtF->diff($dtT)->format($timeformat);echo $timecount;}if($showcolas==1||$adminlogin==1){$usergroupid=$sqlhis[$uid]['grpid'];if($sqlhis[$uid]['grpid']==0){echo 'groupicon  ',$sqlhisgroup[$usergroupid],'',$sqlhisgroup[$usergroupid],'';$dtF=new DateTime("@0");$dtT=new DateTime("@$neededtime");$timecount=$dtF->diff($dtT)->format($timeformat);if(!in_array($uid,$exceptuuid)&&!array_intersect($sgroups,$exceptgroup)&&$neededtime>0){echo $timecount,'',$lang['highest'],'groupicon  ',$sqlhisgroup[$groupid],'',$sqlhisgroup[$groupid],'
',$lang['noentry'],'
';if($user_pro_seite!="all"){pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$language,$getstring);}if($showgen==1||$adminlogin==1){$except=$exceptgrp + $exceptcld;$notvisible=0;if($showexgrp!=1){$notvisible=$exceptgrp;}if($showexcld!=1){$notvisible=$notvisible + $exceptcld;}if($showhighest!=1){$notvisible=$notvisible + $highest;}$displayed=$countallsum - $notvisible;$buildtime=microtime(true)- $starttime;?>
\ No newline at end of file +prepare("SELECT COUNT(*) FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter"); + $dbdata_full->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); + $dbdata_full->execute(); +} else { + $getstring = ''; + $dbdata_full = $mysqlcon->query("SELECT COUNT(*) FROM $dbname.user"); +} +if(!isset($_GET["seite"])) { + $seite = 1; +} else { + $seite = preg_replace('/\D/', '', $_GET["seite"]); +} +$adminlogin = 0; + +$keysort = ''; +$keyorder = ''; +if (isset($_GET['sort'])) { + $keysort = strip_tags(htmlspecialchars($_GET['sort'])); +} +if ($keysort != 'name' && $keysort != 'uuid' && $keysort != 'cldbid' && $keysort != 'rank' && $keysort != 'lastseen' && $keysort != 'count' && $keysort != 'idle' && $keysort != 'active') { + $keysort = 'nextup'; +} +if (isset($_GET['order'])) { + $keyorder = strip_tags(htmlspecialchars($_GET['order'])); +} +$keyorder = ($keyorder == 'desc' ? 'desc' : 'asc'); +if (isset($_GET['admin'])) { + if($_GET['admin'] == "true" && isset($_SESSION['username'])) { + $adminlogin = 1; + } +} +require_once('nav.php'); + +$countentries = 0; +$sumentries = $dbdata_full->fetch(PDO::FETCH_NUM); + +if(!isset($_GET["user"])) { + $user_pro_seite = 50; +} elseif($_GET['user'] == "all") { + $user_pro_seite = $sumentries[0]; +} else { + $user_pro_seite = preg_replace('/\D/', '', $_GET["user"]); +} + +$start = $seite * $user_pro_seite - $user_pro_seite; + +if ($keysort == 'active' && $keyorder == 'asc') { + $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter ORDER BY (count - idle) LIMIT :start, :userproseite"); + $dbdata->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); + $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); + $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); + $dbdata->execute(); +} elseif ($keysort == 'active' && $keyorder == 'desc') { + $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter ORDER BY (idle - count) LIMIT :start, :userproseite"); + $dbdata->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); + $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); + $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); + $dbdata->execute(); +} elseif ($searchstring == '') { + $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE 1=1$filter ORDER BY $keysort $keyorder LIMIT :start, :userproseite"); + $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); + $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); + $dbdata->execute(); +} else { + $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter ORDER BY $keysort $keyorder LIMIT :start, :userproseite"); + $dbdata->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); + $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); + $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); + $dbdata->execute(); +} + +$seiten_anzahl_gerundet = ceil($sumentries[0] / $user_pro_seite); + +function pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$getstring) { + ?> + + fetchAll(); + +foreach($uuids as $uuid) { + $sqlhis[$uuid['uuid']] = array( + "cldbid" => $uuid['cldbid'], + "rank" => $uuid['rank'], + "count" => $uuid['count'], + "name" => $uuid['name'], + "idle" => $uuid['idle'], + "cldgroup" => $uuid['cldgroup'], + "online" => $uuid['online'], + "nextup" => $uuid['nextup'], + "lastseen" => $uuid['lastseen'], + "ip" => $uuid['ip'], + "grpid" => $uuid['grpid'] + ); + $uidarr[] = $uuid['uuid']; + $countentries = $countentries + 1; +} +if(!$dbdata = $mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='calc_user_lastscan'")) { + $err_msg = ''.$mysqlcon->errorCode().'
'; +} + +$lastscan = $dbdata->fetchAll(); +$scantime = $lastscan[0]['timestamp']; +$livetime = time() - $scantime; +$dbgroups = $mysqlcon->query("SELECT * FROM $dbname.groups"); +$servergroups = $dbgroups->fetchAll(PDO::FETCH_ASSOC); +foreach($servergroups as $servergroup) { + $sqlhisgroup[$servergroup['sgid']] = $servergroup['sgidname']; + if(file_exists('../icons/'.$servergroup['sgid'].'.png')) { + $sqlhisgroup_file[$servergroup['sgid']] = true; + } else { + $sqlhisgroup_file[$servergroup['sgid']] = false; + } +} +if($adminlogin == 1) { + switch ($keyorder) { + case "asc": + $keyorder2 = "desc&admin=true"; + break; + case "desc": + $keyorder2 = "asc&admin=true"; + } +} else { + switch ($keyorder) { + case "asc": + $keyorder2 = "desc"; + break; + case "desc": + $keyorder2 = "asc"; + } +} +?> +
+ +
+ +
+ + + + ' , $lang['listrank'] , ''; + if ($showcolcld == 1 || $adminlogin == 1) + echo ($keysort == 'name') ? '' : ''; + if ($showcoluuid == 1 || $adminlogin == 1) + echo ''; + if ($showcoldbid == 1 || $adminlogin == 1) + echo ''; + if ($adminlogin == 1) + echo ''; + if ($showcolls == 1 || $adminlogin == 1) + echo ''; + if ($showcolot == 1 || $adminlogin == 1) + echo ''; + if ($showcolit == 1 || $adminlogin == 1) + echo ''; + if ($showcolat == 1 || $adminlogin == 1) + echo ''; + if ($showcolas == 1 || $adminlogin == 1) + echo ''; + if ($showcolnx == 1 || $adminlogin == 1) + echo ($keysort == 'nextup') ? '' : ''; + if ($showcolsg == 1 || $adminlogin == 1) + echo ''; + echo ''; + ksort($grouptime); + $countgrp = count($grouptime); + if ($countentries > 0) { + $countrank=($seite-1)*$user_pro_seite; + $exceptgrp=0; + $exceptcld=0; + $highest=0; + $countallsum=0; + foreach ($uidarr as $uid) { + $cldgroup = $sqlhis[$uid]['cldgroup']; + $lastseen = $sqlhis[$uid]['lastseen']; + $count = $sqlhis[$uid]['count']; + $idle = $sqlhis[$uid]['idle']; + $status = $sqlhis[$uid]['online']; + $nextup = $sqlhis[$uid]['nextup']; + $sgroups = explode(",", $cldgroup); + $active = $count - $idle; + if ($substridle == 1) { + $activetime = $count - $idle; + } else { + $activetime = $count; + } + $grpcount=0; + $countallsum++; + foreach ($grouptime as $time => $groupid) { + $grpcount++; + if (array_intersect($sgroups, $exceptgroup) && $showexgrp != 1 && $adminlogin != 1) { + $exceptgrp++; + break; + } + if (in_array($uid, $exceptuuid) && $showexcld != 1 && $adminlogin != 1) { + $exceptcld++; + break; + } + if ($activetime < $time || $grpcount == $countgrp && $nextup == 0 && $showhighest == 1 || $grpcount == $countgrp && $nextup == 0 && $adminlogin == 1) { + if($nextup == 0 && $grpcount == $countgrp) { + $neededtime = 0; + } elseif ($status == 1) { + $neededtime = $time - $activetime - $livetime; + } else { + $neededtime = $time - $activetime; + } + echo ''; + if ($showcolrg == 1 || $adminlogin == 1) { + $countrank++; + echo ''; + } + if ($adminlogin == 1) { + echo ''; + } elseif ($showcolcld == 1) { + echo ''; + } + if ($adminlogin == 1) { + echo ''; + } elseif ($showcoluuid == 1) { + echo ''; + } + if ($showcoldbid == 1 || $adminlogin == 1) + echo ''; + if ($adminlogin == 1) + echo ''; + if ($showcolls == 1 || $adminlogin == 1) { + if ($status == 1) { + echo ''; + } else { + echo ''; + } + } + if ($showcolot == 1 || $adminlogin == 1) { + echo ''; + } elseif ($sqlhisgroup_file[$sqlhis[$uid]['grpid']]===true) { + echo ''; + } else { + echo ''; + } + } + if ($showcolnx == 1 || $adminlogin == 1) { + echo ''; + } elseif (!in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { + $timecount = 0; + echo $timecount , ''; + } elseif (in_array($uid, $exceptuuid)) { + echo $lang['listexuid'] , ''; + } elseif (array_intersect($sgroups, $exceptgroup)) { + echo $lang['listexgrp'] , ''; + } else { + echo $lang['errukwn'], ''; + } + } + if ($showcolsg == 1 || $adminlogin == 1) { + if ($grpcount == $countgrp && $nextup == 0 && $showhighest == 1 || $grpcount == $countgrp && $nextup == 0 && $adminlogin == 1) { + echo ''; + $highest++; + } elseif ($sqlhisgroup_file[$groupid]===true) { + echo ''; + } else { + echo ''; + } + } + echo ''; + break; + } elseif ($grpcount == $countgrp && $nextup == 0) { + $highest++; + } + } + } + } else { + echo ''; + } + echo '
' . $lang['listnick'] . '' . $lang['listnick'] . '' , $lang['listuid'] , '' , $lang['listcldbid'] , '' , $lang['listip'] , '' , $lang['listseen'] , '' , $lang['listsumo'] , '' , $lang['listsumi'] , '' , $lang['listsuma'] , '' , $lang['listacsg'] , '' . $lang['listnxup'] . '' . $lang['listnxup'] . '' , $lang['listnxsg'] , '
' , $sqlhis[$uid]['rank'] , '' , $sqlhis[$uid]['name'] , '' , $sqlhis[$uid]['name'] , '' , $uid , '' , $uid , '' , $sqlhis[$uid]['cldbid'] , '' , long2ip($sqlhis[$uid]['ip']) , '' , date('Y-m-d H:i:s',$lastseen), '' , date('Y-m-d H:i:s',$lastseen), ''; + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$count"); + $timecount = $dtF->diff($dtT)->format($timeformat); + echo $timecount; + } + if ($showcolit == 1 || $adminlogin == 1) { + echo ''; + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$idle"); + $timecount = $dtF->diff($dtT)->format($timeformat); + echo $timecount; + } + if ($showcolat == 1 || $adminlogin == 1) { + echo ''; + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$active"); + $timecount = $dtF->diff($dtT)->format($timeformat); + echo $timecount; + } + if ($showcolas == 1 || $adminlogin == 1) { + $usergroupid = $sqlhis[$uid]['grpid']; + if ($sqlhis[$uid]['grpid'] == 0) { + echo 'groupicon  ' , $sqlhisgroup[$usergroupid] , '' , $sqlhisgroup[$usergroupid] , ''; + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$neededtime"); + $timecount = $dtF->diff($dtT)->format($timeformat); + if (!in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup) && $neededtime > 0) { + echo $timecount , '',$lang['highest'],'groupicon  ' , $sqlhisgroup[$groupid] , '' , $sqlhisgroup[$groupid] , '
' , $lang['noentry'] , '
'; + if($user_pro_seite != "all") { + pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$getstring); + } + if ($showgen == 1 || $adminlogin == 1) { + $except = $exceptgrp + $exceptcld; + $notvisible = 0; + if ($showexgrp != 1) { $notvisible = $exceptgrp; } + if ($showexcld != 1) { $notvisible = $notvisible + $exceptcld; } + if ($showhighest != 1) { $notvisible = $notvisible + $highest; } + $displayed = $countallsum - $notvisible; + $buildtime = microtime(true) - $starttime; + ?> + + +
+ + +
+ + + + + + + + \ No newline at end of file diff --git a/stats/my_stats.php b/stats/my_stats.php index 77c5155..59b89e2 100644 --- a/stats/my_stats.php +++ b/stats/my_stats.php @@ -1 +1,358 @@ -query("SELECT * FROM $dbname.user $searchmysql");$dbdata_fetched=$dbdata->fetchAll();$count_hours=round($dbdata_fetched[0]['count']/3600);$stats_user=$mysqlcon->query("SELECT * FROM $dbname.stats_user WHERE uuid='$getstring'");$stats_user=$stats_user->fetchAll();if(isset($stats_user[0]['count_week']))$count_week=$stats_user[0]['count_week'];else $count_week=0;$dtF=new DateTime("@0");$dtT=new DateTime("@$count_week");$count_week=$dtF->diff($dtT)->format($timeformat);if(isset($stats_user[0]['count_month']))$count_month=$stats_user[0]['count_month'];else $count_month=0;$dtF=new DateTime("@0");$dtT=new DateTime("@$count_month");$count_month=$dtF->diff($dtT)->format($timeformat);if(isset($dbdata_fetched[0]['count']))$count_total=$dbdata_fetched[0]['count'];else $count_total=0;$dtF=new DateTime("@0");$dtT=new DateTime("@$count_total");$count_total=$dtF->diff($dtT)->format($timeformat);$time_for_bronze=50;$time_for_silver=100;$time_for_gold=250;$time_for_legendary=500;$connects_for_bronze=50;$connects_for_silver=100;$connects_for_gold=250;$connects_for_legendary=500;$achievements_done=0;if($count_hours>=$time_for_legendary){$achievements_done=$achievements_done + 4;}elseif($count_hours>=$time_for_gold){$achievements_done=$achievements_done + 3;}elseif($count_hours>=$time_for_silver){$achievements_done=$achievements_done + 2;}else{$achievements_done=$achievements_done + 1;}if($_SESSION['tsconnections']>=$connects_for_legendary){$achievements_done=$achievements_done + 4;}elseif($_SESSION['tsconnections']>=$connects_for_gold){$achievements_done=$achievements_done + 3;}elseif($_SESSION['tsconnections']>=$connects_for_silver){$achievements_done=$achievements_done + 2;}else{$achievements_done=$achievements_done + 1;}function get_percentage($max_value,$value){return(round(($value/$max_value)*100));}require_once('nav.php');?>
';}else{echo '';}?>

=$time_for_legendary){?>
=$time_for_gold){?>
=$time_for_silver){?>
=$time_for_bronze){?>

=$connects_for_legendary){?>
=$connects_for_gold){?>
=$connects_for_silver){?>
=$connects_for_bronze){?>
\ No newline at end of file +query("SELECT * FROM $dbname.user $searchmysql"); +$dbdata_fetched = $dbdata->fetchAll(); +$count_hours = round($dbdata_fetched[0]['count']/3600); +$idle_hours = round($dbdata_fetched[0]['idle']/3600); +$except = $dbdata_fetched[0]['except']; + +if ($substridle == 1) { + $activetime = $dbdata_fetched[0]['count'] - $dbdata_fetched[0]['idle']; +} else { + $activetime = $dbdata_fetched[0]['count']; +} + +krsort($grouptime); + +foreach ($grouptime as $time => $groupid) { + $grpcount++; + $actualgrp = $time; + if ($activetime > $time) { + break; + } else { + $nextup = $time - $activetime; + $nextgrp = $time; + } +} +if($actualgrp==$nextgrp) { + $actualgrp = 0; +} +if($activetime>$nextgrp) { + $percentage_rankup = 100; +} else { + $takedtime = $activetime - $actualgrp; + $neededtime = $nextgrp - $actualgrp; + $percentage_rankup = round($takedtime/$neededtime*100); +} + +$stats_user = $mysqlcon->query("SELECT * FROM $dbname.stats_user WHERE uuid='$getstring'"); +$stats_user = $stats_user->fetchAll(); + +if (isset($stats_user[0]['count_week'])) $count_week = $stats_user[0]['count_week']; else $count_week = 0; +$dtF = new DateTime("@0"); $dtT = new DateTime("@$count_week"); $count_week = $dtF->diff($dtT)->format($timeformat); +if (isset($stats_user[0]['count_month'])) $count_month = $stats_user[0]['count_month']; else $count_month = 0; +$dtF = new DateTime("@0"); $dtT = new DateTime("@$count_month"); $count_month = $dtF->diff($dtT)->format($timeformat); +if (isset($dbdata_fetched[0]['count'])) $count_total = $dbdata_fetched[0]['count']; else $count_total = 0; +$dtF = new DateTime("@0"); $dtT = new DateTime("@$count_total"); $count_total = $dtF->diff($dtT)->format($timeformat); + +$time_for_bronze = 50; +$time_for_silver = 100; +$time_for_gold = 250; +$time_for_legendary = 500; + +$connects_for_bronze = 50; +$connects_for_silver = 100; +$connects_for_gold = 250; +$connects_for_legendary = 500; + +$achievements_done = 0; + +if($count_hours >= $time_for_legendary) { + $achievements_done = $achievements_done + 4; +} elseif($count_hours >= $time_for_gold) { + $achievements_done = $achievements_done + 3; +} elseif($count_hours >= $time_for_silver) { + $achievements_done = $achievements_done + 2; +} else { + $achievements_done = $achievements_done + 1; +} +if($_SESSION['tsconnections'] >= $connects_for_legendary) { + $achievements_done = $achievements_done + 4; +} elseif($_SESSION['tsconnections'] >= $connects_for_gold) { + $achievements_done = $achievements_done + 3; +} elseif($_SESSION['tsconnections'] >= $connects_for_silver) { + $achievements_done = $achievements_done + 2; +} else { + $achievements_done = $achievements_done + 1; +} + +function get_percentage($max_value, $value) { + return (round(($value/$max_value)*100)); +} +require_once('nav.php'); +?> +
+ +
+ + +
+
+

+ + + + +

+
+
+
+
+
+
+
+
+
+
+
+
+ '; + } else { + echo ''; + } + ?> +
+
+
+ +
+
+ +
+

+
+
+ +
+
+
+ +
+

+ = $time_for_legendary) { ?> +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ = $time_for_gold) { ?> +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ = $time_for_silver) { ?> +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ = $time_for_bronze) { ?> +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+

+ = $connects_for_legendary) { ?> +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ = $connects_for_gold) { ?> +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ = $connects_for_silver) { ?> +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ = $connects_for_bronze) { ?> +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+ + +
+ + + + + + \ No newline at end of file diff --git a/stats/nav.php b/stats/nav.php index 7ceedec..3bba053 100644 --- a/stats/nav.php +++ b/stats/nav.php @@ -1 +1,263 @@ ->TS-N.NET Ranksystem
';break;case 1:echo '
';break;case 2:echo '
';break;case 3:echo '
';break;}echo '',$msg,'
';}?> \ No newline at end of file + + + + + + + + + + TS-N.NET Ranksystem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +'; break; + case 1: echo '
'; break; + case 2: echo '
'; break; + case 3: echo '
'; break; + } + echo '',$msg,'
'; +} +?> \ No newline at end of file diff --git a/stats/top_all.php b/stats/top_all.php index 130f21b..e1ff670 100644 --- a/stats/top_all.php +++ b/stats/top_all.php @@ -1 +1,393 @@ -query("SELECT uuid,name,count,idle,cldgroup,online FROM $dbname.user ORDER BY (count - idle) DESC");}else{$dbdata=$mysqlcon->query("SELECT uuid,name,count,idle,cldgroup,online FROM $dbname.user ORDER BY count DESC");}$sumentries=$dbdata->rowCount()- 10;$db_arr=$dbdata->fetchAll();$count10=0;$top10_sum=0;$top10_idle_sum=0;foreach($db_arr as $client){$sgroups=explode(",",$client['cldgroup']);if(!in_array($client['uuid'],$exceptuuid)&&!array_intersect($sgroups,$exceptgroup)){if($count10==10)break;if($substridle==1){$hours=$client['count'] - $client['idle'];}else{$hours=$client['count'];}$top10_sum=round(($client['count']/3600))+ $top10_sum;$top10_idle_sum=round(($client['idle']/3600))+ $top10_idle_sum;$client_data[$count10]=array('name'=>$client['name'],'count'=>$hours,'online'=>$client['online']);$count10++;}}for($count10=$count10;$count10<=10;$count10++){$client_data[$count10]=array('name'=>"unkown",'count'=>"0",'online'=>"0");}$all_sum_data=$mysqlcon->query("SELECT SUM(count) FROM $dbname.user");$all_sum_data_res=$all_sum_data->fetchAll();$others_sum=round(($all_sum_data_res[0][0]/3600))- $top10_sum;$all_idle_sum_data=$mysqlcon->query("SELECT SUM(idle) FROM $dbname.user");$all_idle_sum_data_res=$all_idle_sum_data->fetchAll();$others_idle_sum=round(($all_idle_sum_data_res[0][0]/3600))- $top10_idle_sum;function get_percentage($max_value,$value){return(round(($value/$max_value)*100));}require_once('nav.php');?>

#1st

>

#2nd

>

#3rd

>
#4th
>
#5th
>
#6th
>

#7th
>

#8th
>

#9th
>

#10th
>

#1 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#2 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#3 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#4 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#5 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#6 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#7 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#8 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#9 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#10 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

 

 

 

\ No newline at end of file +query("SELECT uuid,name,count,idle,cldgroup,online FROM $dbname.user ORDER BY (count - idle) DESC"); + $texttime = $lang['sttw0013']; +} else { + $dbdata = $mysqlcon->query("SELECT uuid,name,count,idle,cldgroup,online FROM $dbname.user ORDER BY count DESC"); + $texttime = $lang['sttw0003']; +} +$sumentries = $dbdata->rowCount() - 10; +$db_arr = $dbdata->fetchAll(); +$count10 = 0; +$top10_sum = 0; +$top10_idle_sum = 0; + + +foreach ($db_arr as $client) { + $sgroups = explode(",", $client['cldgroup']); + if (!in_array($client['uuid'], $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { + if ($count10 == 10) break; + if ($substridle == 1) { + $hours = $client['count'] - $client['idle']; + } else { + $hours = $client['count']; + } + $top10_sum = round(($client['count']/3600)) + $top10_sum; + $top10_idle_sum = round(($client['idle']/3600)) + $top10_idle_sum; + $client_data[$count10] = array( + 'name' => $client['name'], + 'count' => $hours, + 'online' => $client['online'] + ); + $count10++; + } +} + +for($count10 = $count10; $count10 <= 10; $count10++) { + $client_data[$count10] = array( + 'name' => "unkown", + 'count' => "0", + 'online' => "0" + ); +} + +$all_sum_data = $mysqlcon->query("SELECT SUM(count) FROM $dbname.user"); +$all_sum_data_res = $all_sum_data->fetchAll(); +$others_sum = round(($all_sum_data_res[0][0]/3600)) - $top10_sum; + +$all_idle_sum_data = $mysqlcon->query("SELECT SUM(idle) FROM $dbname.user"); +$all_idle_sum_data_res = $all_idle_sum_data->fetchAll(); +$others_idle_sum = round(($all_idle_sum_data_res[0][0]/3600)) - $top10_idle_sum; + +function get_percentage($max_value, $value) { + return (round(($value/$max_value)*100)); +} +require_once('nav.php'); +?> +
+ +
+ + +
+
+

+ + +

+
+
+ +
+
+
+
+
+
+

#1st

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+

#2nd

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+

#3rd

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #4th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ #5th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ #6th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #7th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #8th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #9th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #10th +
+
+
>
+
+
+
+
+
+
+
+ +
+
+

+

#1 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#2 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#3 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#4 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#5 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#6 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#7 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#8 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#9 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#10 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+
+
+
+
+

+
+
+
+

 

+
+
+
+
+
+
+
+ +
+
+

 

+
+
+
+
+
+
+
+ +
+
+

 

+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/stats/top_month.php b/stats/top_month.php index 4e0cbd7..18c7f19 100644 --- a/stats/top_month.php +++ b/stats/top_month.php @@ -1 +1,392 @@ -query("SELECT s.uuid,s.count_month,s.idle_month,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY (s.count_month - s.idle_month) DESC");}else{$dbdata=$mysqlcon->query("SELECT s.uuid,s.count_month,s.idle_month,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY s.count_month DESC");}$sumentries=$dbdata->rowCount()- 10;$db_arr=$dbdata->fetchAll();$count10=0;$top10_sum=0;$top10_idle_sum=0;foreach($db_arr as $client){$sgroups=explode(",",$client['cldgroup']);if(!in_array($client['uuid'],$exceptuuid)&&!array_intersect($sgroups,$exceptgroup)){if($count10==10)break;if($substridle==1){$hours=$client['count_month'] - $client['idle_month'];}else{$hours=$client['count_month'];}$top10_sum=round(($client['count_month']/3600))+ $top10_sum;$top10_idle_sum=round(($client['idle_month']/3600))+ $top10_idle_sum;$client_data[$count10]=array('name'=>$client['name'],'count'=>$hours,'online'=>$client['online']);$count10++;}}for($count10=$count10;$count10<=10;$count10++){$client_data[$count10]=array('name'=>"unkown",'count'=>"0",'online'=>"0");}$all_sum_data=$mysqlcon->query("SELECT SUM(count_month) FROM $dbname.stats_user");$all_sum_data_res=$all_sum_data->fetchAll();$others_sum=round(($all_sum_data_res[0][0]/3600))- $top10_sum;$all_idle_sum_data=$mysqlcon->query("SELECT SUM(idle_month) FROM $dbname.stats_user");$all_idle_sum_data_res=$all_idle_sum_data->fetchAll();$others_idle_sum=round(($all_idle_sum_data_res[0][0]/3600))- $top10_idle_sum;function get_percentage($max_value,$value){return(round(($value/$max_value)*100));}require_once('nav.php');?>

#1st

>

#2nd

>

#3rd

>
#4th
>
#5th
>
#6th
>

#7th
>

#8th
>

#9th
>

#10th
>

#1 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#2 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#3 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#4 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#5 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#6 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#7 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#8 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#9 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#10 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

 

 

 

< \ No newline at end of file +query("SELECT s.uuid,s.count_month,s.idle_month,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY (s.count_month - s.idle_month) DESC"); + $texttime = $lang['sttw0013']; +} else { + $dbdata = $mysqlcon->query("SELECT s.uuid,s.count_month,s.idle_month,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY s.count_month DESC"); + $texttime = $lang['sttw0003']; +} +$sumentries = $dbdata->rowCount() - 10; +$db_arr = $dbdata->fetchAll(); +$count10 = 0; +$top10_sum = 0; +$top10_idle_sum = 0; + + +foreach ($db_arr as $client) { + $sgroups = explode(",", $client['cldgroup']); + if (!in_array($client['uuid'], $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { + if ($count10 == 10) break; + if ($substridle == 1) { + $hours = $client['count_month'] - $client['idle_month']; + } else { + $hours = $client['count_month']; + } + $top10_sum = round(($client['count_month']/3600)) + $top10_sum; + $top10_idle_sum = round(($client['idle_month']/3600)) + $top10_idle_sum; + $client_data[$count10] = array( + 'name' => $client['name'], + 'count' => $hours, + 'online' => $client['online'] + ); + $count10++; + } +} + +for($count10 = $count10; $count10 <= 10; $count10++) { + $client_data[$count10] = array( + 'name' => "unkown", + 'count' => "0", + 'online' => "0" + ); +} + +$all_sum_data = $mysqlcon->query("SELECT SUM(count_month) FROM $dbname.stats_user"); +$all_sum_data_res = $all_sum_data->fetchAll(); +$others_sum = round(($all_sum_data_res[0][0]/3600)) - $top10_sum; + +$all_idle_sum_data = $mysqlcon->query("SELECT SUM(idle_month) FROM $dbname.stats_user"); +$all_idle_sum_data_res = $all_idle_sum_data->fetchAll(); +$others_idle_sum = round(($all_idle_sum_data_res[0][0]/3600)) - $top10_idle_sum; + +function get_percentage($max_value, $value) { + return (round(($value/$max_value)*100)); +} +require_once('nav.php'); +?> +
+ +
+ + +
+
+

+ + +

+
+
+ +
+
+
+
+
+
+

#1st

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+

#2nd

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+

#3rd

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #4th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ #5th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ #6th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #7th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #8th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #9th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #10th +
+
+
>
+
+
+
+
+
+
+
+ +
+
+

+

#1 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#2 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#3 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#4 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#5 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#6 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#7 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#8 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#9 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#10 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+
+
+
+
+

+
+
+
+

 

+
+
+
+
+
+
+
+ +
+
+

 

+
+
+
+
+
+
+
+ +
+
+

 

+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + + + < + + \ No newline at end of file diff --git a/stats/top_week.php b/stats/top_week.php index 212655b..d7972d7 100644 --- a/stats/top_week.php +++ b/stats/top_week.php @@ -1 +1,393 @@ -query("SELECT s.uuid,s.count_week,s.idle_week,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY (s.count_week - s.idle_week) DESC");}else{$dbdata=$mysqlcon->query("SELECT s.uuid,s.count_week,s.idle_week,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY s.count_week DESC");}$sumentries=$dbdata->rowCount()- 10;$db_arr=$dbdata->fetchAll();$count10=0;$top10_sum=0;$top10_idle_sum=0;foreach($db_arr as $client){$sgroups=explode(",",$client['cldgroup']);if(!in_array($client['uuid'],$exceptuuid)&&!array_intersect($sgroups,$exceptgroup)){if($count10==10)break;if($substridle==1){$hours=$client['count_week'] - $client['idle_week'];}else{$hours=$client['count_week'];}$top10_sum=round(($client['count_week']/3600))+ $top10_sum;$top10_idle_sum=round(($client['idle_week']/3600))+ $top10_idle_sum;$client_data[$count10]=array('name'=>$client['name'],'count'=>$hours,'online'=>$client['online']);$count10++;}}for($count10=$count10;$count10<=10;$count10++){$client_data[$count10]=array('name'=>"unkown",'count'=>"0",'online'=>"0");}$all_sum_data=$mysqlcon->query("SELECT SUM(count_week) FROM $dbname.stats_user");$all_sum_data_res=$all_sum_data->fetchAll();$others_sum=round(($all_sum_data_res[0][0]/3600))- $top10_sum;$all_idle_sum_data=$mysqlcon->query("SELECT SUM(idle_week) FROM $dbname.stats_user");$all_idle_sum_data_res=$all_idle_sum_data->fetchAll();$others_idle_sum=round(($all_idle_sum_data_res[0][0]/3600))- $top10_idle_sum;function get_percentage($max_value,$value){return(round(($value/$max_value)*100));}require_once('nav.php');?>

#1st

>

#2nd

>

#3rd

>
#4th
>
#5th
>
#6th
>

#7th
>

#8th
>

#9th
>

#10th
>

#1 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#2 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#3 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#4 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#5 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#6 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#7 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#8 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#9 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

#10 '.$lang['stix0024'].')':' (Status: '.$lang['stix0025'].')'?>

 

 

 

\ No newline at end of file +query("SELECT s.uuid,s.count_week,s.idle_week,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY (s.count_week - s.idle_week) DESC"); + $texttime = $lang['sttw0013']; +} else { + $dbdata = $mysqlcon->query("SELECT s.uuid,s.count_week,s.idle_week,u.name,u.online,u.cldgroup FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY s.count_week DESC"); + $texttime = $lang['sttw0003']; +} +$sumentries = $dbdata->rowCount() - 10; +$db_arr = $dbdata->fetchAll(); +$count10 = 0; +$top10_sum = 0; +$top10_idle_sum = 0; + + +foreach ($db_arr as $client) { + $sgroups = explode(",", $client['cldgroup']); + if (!in_array($client['uuid'], $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { + if ($count10 == 10) break; + if ($substridle == 1) { + $hours = $client['count_week'] - $client['idle_week']; + } else { + $hours = $client['count_week']; + } + $top10_sum = round(($client['count_week']/3600)) + $top10_sum; + $top10_idle_sum = round(($client['idle_week']/3600)) + $top10_idle_sum; + $client_data[$count10] = array( + 'name' => $client['name'], + 'count' => $hours, + 'online' => $client['online'] + ); + $count10++; + } +} + +for($count10 = $count10; $count10 <= 10; $count10++) { + $client_data[$count10] = array( + 'name' => "unkown", + 'count' => "0", + 'online' => "0" + ); +} + +$all_sum_data = $mysqlcon->query("SELECT SUM(count_week) FROM $dbname.stats_user"); +$all_sum_data_res = $all_sum_data->fetchAll(); +$others_sum = round(($all_sum_data_res[0][0]/3600)) - $top10_sum; + +$all_idle_sum_data = $mysqlcon->query("SELECT SUM(idle_week) FROM $dbname.stats_user"); +$all_idle_sum_data_res = $all_idle_sum_data->fetchAll(); +$others_idle_sum = round(($all_idle_sum_data_res[0][0]/3600)) - $top10_idle_sum; + +function get_percentage($max_value, $value) { + return (round(($value/$max_value)*100)); +} +require_once('nav.php'); +?> +
+ +
+ + +
+
+

+ + +

+
+
+ +
+
+
+
+
+
+

#1st

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+

#2nd

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+

#3rd

+

+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #4th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ #5th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ #6th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #7th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #8th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #9th +
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #10th +
+
+
>
+
+
+
+
+
+
+
+ +
+
+

+

#1 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#2 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#3 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#4 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#5 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#6 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#7 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#8 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#9 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+

#10 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

+
+
+
+
+
+
+
+
+

+
+
+
+

 

+
+
+
+
+
+
+
+ +
+
+

 

+
+
+
+
+
+
+
+ +
+
+

 

+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/webinterface.php b/webinterface.php index 1049b18..65ea283 100644 --- a/webinterface.php +++ b/webinterface.php @@ -1,7 +1,346 @@ - TS-N.NET Ranksystem - Webinterface ';$starttime=microtime(true);require_once('other/config.php');$alert=" ";if(isset($_POST['changeclients'])){$selectedclients=$_POST['selectedclients'];echo $selectedclients;echo '
';$selecteduuids=$_POST['selecteduuids'];echo $selecteduuids;}if(isset($_POST['updatets'])){$tshost=$_POST['tshost'];$tsquery=$_POST['tsquery'];$tsvoice=$_POST['tsvoice'];$tsuser=$_POST['tsuser'];$tspass=$_POST['tspass'];$queryname=$_POST['queryname'];$queryname2=$_POST['queryname2'];$defchid=$_POST['defchid'];$timezone=$_POST['timezone'];$slowmode=$_POST['slowmode'];if($mysqlcon->exec("UPDATE $dbname.config set tshost='$tshost',tsquery='$tsquery',tsvoice='$tsvoice',tsuser='$tsuser',tspass='$tspass',queryname='$queryname',queryname2='$queryname2',slowmode='$slowmode',defchid='$defchid',timezone='$timezone'")===false){$alert=''.$mysqlcon->errorCode().'
';}else{exec("php ".__DIR__."/worker.php restart");$alert=''.$lang['wisvsuc'].'';}require_once('other/webinterface_list.php');}if(isset($_POST['updatecore'])){$grouptime=$_POST['grouptime'];if(isset($_POST['resetbydbchange']))$resetbydbchange=1;else $resetbydbchange=0;if(isset($_POST['msgtouser']))$msgtouser=1;else $msgtouser=0;if(isset($_POST['cleanclients']))$cleanclients=1;else $cleanclients=0;if(isset($_POST['upcheck']))$upcheck=1;else $upcheck=0;$cleanperiod=$_POST['cleanperiod'];$uniqueid=$_POST['uniqueid'];$boost=$_POST['boost'];$updateinfotime=$_POST['updateinfotime'];$logpath=addslashes($_POST['logpath']);if(isset($_POST['substridle']))$substridle=1;else $substridle=0;$exceptuuid=$_POST['exceptuuid'];$exceptgroup=$_POST['exceptgroup'];if($mysqlcon->exec("UPDATE $dbname.config set grouptime='$grouptime',resetbydbchange='$resetbydbchange',msgtouser='$msgtouser',cleanclients='$cleanclients',cleanperiod='$cleanperiod',upcheck='$upcheck',uniqueid='$uniqueid',updateinfotime='$updateinfotime',substridle='$substridle',exceptuuid='$exceptuuid',exceptgroup='$exceptgroup',boost='$boost',logpath='$logpath'")===false){$alert=''.$mysqlcon->errorCode().'
';}else{exec("php ".__DIR__."/worker.php restart");$alert=''.$lang['wisvsuc'].'';}require_once('other/webinterface_list.php');}if(isset($_POST['updatestyle'])){$language=$_POST['languagedb'];$dateformat=$_POST['dateformat'];if(isset($_POST['showexgrp']))$showexgrp=1;else $showexgrp=0;if(isset($_POST['showexcld']))$showexcld=1;else $showexcld=0;if(isset($_POST['showhighest']))$showhighest=1;else $showhighest=0;if(isset($_POST['showcolrg']))$showcolrg=1;else $showcolrg=0;if(isset($_POST['showcolcld']))$showcolcld=1;else $showcolcld=0;if(isset($_POST['showcoluuid']))$showcoluuid=1;else $showcoluuid=0;if(isset($_POST['showcoldbid']))$showcoldbid=1;else $showcoldbid=0;if(isset($_POST['showcolls']))$showcolls=1;else $showcolls=0;if(isset($_POST['showcolot']))$showcolot=1;else $showcolot=0;if(isset($_POST['showcolit']))$showcolit=1;else $showcolit=0;if(isset($_POST['showcolat']))$showcolat=1;else $showcolat=0;if(isset($_POST['showcolas']))$showcolas=1;else $showcolas=0;if(isset($_POST['showcolnx']))$showcolnx=1;else $showcolnx=0;if(isset($_POST['showcolsg']))$showcolsg=1;else $showcolsg=0;$bgcolor=$_POST['bgcolor'];$hdcolor=$_POST['hdcolor'];$txcolor=$_POST['txcolor'];$hvcolor=$_POST['hvcolor'];$ifcolor=$_POST['ifcolor'];$wncolor=$_POST['wncolor'];$sccolor=$_POST['sccolor'];if(isset($_POST['showgen']))$showgen=1;else $showgen=0;include('lang.php');if($mysqlcon->exec("UPDATE $dbname.config set language='$language',dateformat='$dateformat',showexgrp='$showexgrp',showexcld='$showexcld',showhighest='$showhighest',showcolrg='$showcolrg',showcolcld='$showcolcld',showcoluuid='$showcoluuid',showcoldbid='$showcoldbid',showcolls='$showcolls',showcolot='$showcolot',showcolit='$showcolit',showcolat='$showcolat',showcolas='$showcolas',showcolnx='$showcolnx',showcolsg='$showcolsg',bgcolor='$bgcolor',hdcolor='$hdcolor',txcolor='$txcolor',hvcolor='$hvcolor',ifcolor='$ifcolor',wncolor='$wncolor',sccolor='$sccolor',showgen='$showgen'")===false){$alert=''.$mysqlcon->errorCode().'
';}else{$alert=''.$lang['wisvsuc'].'';}require_once('other/webinterface_list.php');}if(isset($_POST['selectivclients'])){$seluuid=$_POST['selecteduuids'];$uuidarr=explode(',',$seluuid);$counttime=$_POST['counttime'];if(isset($_POST['delclients'])&&$seluuid!=''&&$counttime==0){require_once('ts3_lib/TeamSpeak3.php');$ts3_VirtualServer=TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']);try{$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname));}catch(Exception $e){try{$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname2));}catch(Exception $e){echo $lang['error'],$e->getCode(),': ',$e->getMessage();}}foreach($uuidarr as $uuid){if(isset($_POST['delsrvgrp'])){$dbremsgrp=$mysqlcon->query("SELECT cldbid,grpid from $dbname.user where uuid='$uuid'");while($remsgrp=$dbremsgrp->fetch(PDO::FETCH_ASSOC)){if($remsgrp['grpid']!=0){try{$ts3_VirtualServer->serverGroupClientDel($remsgrp['grpid'],$remsgrp['cldbid']);}catch(Exception $e){$alert=$alert.''.sprintf($lang['errremgrp'],$uuid,$remsgrp['grpid']).$e->getCode().': '.$e->getMessage().'
';}}}}if($mysqlcon->exec("DELETE FROM $dbname.user WHERE uuid='$uuid'")===false){$alert=$alert.''.sprintf($lang['errremdb'],$uuid).$mysqlcon->errorCode().'
';}else{$alert=$alert.''.sprintf($lang['sccrmcld'],$uuid).'
';}}}elseif($_POST['delclients']==""&&$seluuid!=''&&$counttime!=0){$dtF=new DateTime("@0");$dtT=new DateTime("@$counttime");$timecount=$dtF->diff($dtT)->format($timeformat);foreach($uuidarr as $uuid){if($mysqlcon->exec("UPDATE $dbname.user SET count='$counttime' WHERE uuid='$uuid'")===false){$alert=$alert.''.sprintf($lang['errupcount'],$timecount,$uuid).$mysqlcon->errorCode().'
';}else{$alert=$alert.''.sprintf($lang['sccupcount'],$uuid,$timecount).'
';}}}else{echo $_POST['delclients'];$alert=''.sprintf($lang['errsel'],$seluuid,$_POST['delclients'],$counttime).'';}require_once('other/webinterface_list.php');}if(isset($_POST['globalclients'])){if(isset($_POST['delcldgrps'])){$selectbefore=$mysqlcon->query("SELECT * FROM $dbname.user WHERE grpid!='0'");$before=$selectbefore->rowCount();if($mysqlcon->exec("UPDATE $dbname.user SET grpid='0'")&&$selectbefore->rowCount()!=0){$alert=''.sprintf($lang['delcldgrpsc'],$before).'';}elseif($selectbefore->rowCount()==0){$alert=''.sprintf($lang['delcldgrpsc'],$before).'';}else{$alert=''.sprintf($lang['delcldgrpif'],$selectbefore->errorCode()).'';}}else{$selectbefore=$mysqlcon->query("SELECT * FROM $dbname.user");$before=$selectbefore->rowCount();$cleantime=time()- $_POST['cleantime'];if(isset($_POST['delsrvgrp'])){require_once('ts3_lib/TeamSpeak3.php');$ts3_VirtualServer=TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']);try{$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname));}catch(Exception $e){try{$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname2));}catch(Exception $e){echo $lang['error'],$e->getCode(),': ',$e->getMessage();}}$dbremsgrp=$mysqlcon->query("SELECT cldbid,grpid from $dbname.user where lastseen<'$cleantime'");$dbremsgrp=$dbremsgrp->fetchAll();foreach($dbremsgrp as $remsgrp){if($remsgrp['grpid']!=0){$ts3_VirtualServer->serverGroupClientDel($remsgrp['grpid'],$remsgrp['cldbid']);}}}if($_POST['cleantime']<1){$dbcount=$mysqlcon->exec("DELETE from $dbname.user");}else{$dbcount=$mysqlcon->exec("DELETE from $dbname.user where lastseen<'$cleantime'");}$selectafter=$mysqlcon->query("SELECT * from $dbname.user");$after=$selectafter->rowCount();$countdel=$before - $after;if($countdel==0){$alert=''.sprintf($lang['delclientsif'],$countdel).'';}else{$alert=''.sprintf($lang['delclientssc'],$countdel).'';}}require_once('other/webinterface_list.php');}if(isset($_POST['updatetdbsettings'])){$newconfig=' + + + + TS-N.NET Ranksystem - Webinterface + + + + + + +'; +$starttime = microtime(true); +require_once('other/config.php'); +$alert = " "; +if (isset($_POST['changeclients'])) { + $selectedclients = $_POST['selectedclients']; + echo $selectedclients; + echo '
'; + $selecteduuids = $_POST['selecteduuids']; + echo $selecteduuids; +} +if (isset($_POST['updatets'])) { + $tshost = $_POST['tshost']; + $tsquery = $_POST['tsquery']; + $tsvoice = $_POST['tsvoice']; + $tsuser = $_POST['tsuser']; + $tspass = $_POST['tspass']; + $queryname = $_POST['queryname']; + $queryname2 = $_POST['queryname2']; + $defchid = $_POST['defchid']; + $timezone = $_POST['timezone']; + $slowmode = $_POST['slowmode']; + if ($mysqlcon->exec("UPDATE $dbname.config set tshost='$tshost',tsquery='$tsquery',tsvoice='$tsvoice',tsuser='$tsuser',tspass='$tspass',queryname='$queryname',queryname2='$queryname2',slowmode='$slowmode',defchid='$defchid',timezone='$timezone'") === false) { + $alert = '' . $mysqlcon->errorCode() . '
'; + } else { + if (substr(php_uname(), 0, 7) == "Windows") { + $WshShell = new COM("WScript.Shell"); + $oExec = $WshShell->Run("cmd /C php ".__DIR__."\worker.php restart", 0, false); + } else { + exec("php ".__DIR__."/worker.php restart"); + } + $alert = '' . $lang['wisvsuc'] . ''; + } + require_once('other/webinterface_list.php'); +} +if (isset($_POST['updatecore'])) { + $grouptime = $_POST['grouptime']; + if (isset($_POST['resetbydbchange'])) $resetbydbchange = 1; else $resetbydbchange = 0; + if (isset($_POST['msgtouser'])) $msgtouser = 1; else $msgtouser = 0; + if (isset($_POST['cleanclients'])) $cleanclients = 1; else $cleanclients = 0; + if (isset($_POST['upcheck'])) $upcheck = 1; else $upcheck = 0; + $cleanperiod = $_POST['cleanperiod']; + $uniqueid = $_POST['uniqueid']; + $boost = $_POST['boost']; + $updateinfotime = $_POST['updateinfotime']; + $logpath = addslashes($_POST['logpath']); + if (isset($_POST['substridle'])) $substridle = 1; else $substridle = 0; + $exceptuuid = $_POST['exceptuuid']; + $exceptgroup = $_POST['exceptgroup']; + if ($mysqlcon->exec("UPDATE $dbname.config set grouptime='$grouptime',resetbydbchange='$resetbydbchange',msgtouser='$msgtouser',cleanclients='$cleanclients',cleanperiod='$cleanperiod',upcheck='$upcheck',uniqueid='$uniqueid',updateinfotime='$updateinfotime',substridle='$substridle',exceptuuid='$exceptuuid',exceptgroup='$exceptgroup',boost='$boost',logpath='$logpath'") === false) { + $alert = '' . $mysqlcon->errorCode() . '
'; + } else { + if (substr(php_uname(), 0, 7) == "Windows") { + $WshShell = new COM("WScript.Shell"); + $oExec = $WshShell->Run("cmd /C php ".__DIR__."\worker.php restart", 0, false); + } else { + exec("php ".__DIR__."/worker.php restart"); + } + $alert = '' . $lang['wisvsuc'] . ''; + } + require_once('other/webinterface_list.php'); +} +if (isset($_POST['updatestyle'])) { + $language = $_POST['languagedb']; + $dateformat = $_POST['dateformat']; + if (isset($_POST['showexgrp'])) $showexgrp = 1; else $showexgrp = 0; + if (isset($_POST['showexcld'])) $showexcld = 1; else $showexcld = 0; + if (isset($_POST['showhighest'])) $showhighest = 1; else $showhighest = 0; + if (isset($_POST['showcolrg'])) $showcolrg = 1; else $showcolrg = 0; + if (isset($_POST['showcolcld'])) $showcolcld = 1; else $showcolcld = 0; + if (isset($_POST['showcoluuid'])) $showcoluuid = 1; else $showcoluuid = 0; + if (isset($_POST['showcoldbid'])) $showcoldbid = 1; else $showcoldbid = 0; + if (isset($_POST['showcolls'])) $showcolls = 1; else $showcolls = 0; + if (isset($_POST['showcolot'])) $showcolot = 1; else $showcolot = 0; + if (isset($_POST['showcolit'])) $showcolit = 1; else $showcolit = 0; + if (isset($_POST['showcolat'])) $showcolat = 1; else $showcolat = 0; + if (isset($_POST['showcolas'])) $showcolas = 1; else $showcolas = 0; + if (isset($_POST['showcolnx'])) $showcolnx = 1; else $showcolnx = 0; + if (isset($_POST['showcolsg'])) $showcolsg = 1; else $showcolsg = 0; + $bgcolor = $_POST['bgcolor']; + $hdcolor = $_POST['hdcolor']; + $txcolor = $_POST['txcolor']; + $hvcolor = $_POST['hvcolor']; + $ifcolor = $_POST['ifcolor']; + $wncolor = $_POST['wncolor']; + $sccolor = $_POST['sccolor']; + if (isset($_POST['showgen'])) $showgen = 1; else $showgen = 0; + include('lang.php'); + if ($mysqlcon->exec("UPDATE $dbname.config set language='$language',dateformat='$dateformat',showexgrp='$showexgrp',showexcld='$showexcld',showhighest='$showhighest',showcolrg='$showcolrg',showcolcld='$showcolcld',showcoluuid='$showcoluuid',showcoldbid='$showcoldbid',showcolls='$showcolls',showcolot='$showcolot',showcolit='$showcolit',showcolat='$showcolat',showcolas='$showcolas',showcolnx='$showcolnx',showcolsg='$showcolsg',bgcolor='$bgcolor',hdcolor='$hdcolor',txcolor='$txcolor',hvcolor='$hvcolor',ifcolor='$ifcolor',wncolor='$wncolor',sccolor='$sccolor',showgen='$showgen'") === false) { + $alert = '' . $mysqlcon->errorCode() . '
'; + } else { + $alert = '' . $lang['wisvsuc'] . ''; + } + require_once('other/webinterface_list.php'); +} +if (isset($_POST['selectivclients'])) { + $seluuid = $_POST['selecteduuids']; + $uuidarr = explode(',', $seluuid); + $counttime = $_POST['counttime']; + if (isset($_POST['delclients']) && $seluuid != '' && $counttime == 0) { + require_once('ts3_lib/TeamSpeak3.php'); + $ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $ts['user'] . ":" . $ts['pass'] . "@" . $ts['host'] . ":" . $ts['query'] . "/?server_port=" . $ts['voice']); + try { + $ts3_VirtualServer->selfUpdate(array( + 'client_nickname' => $queryname + )); + } + catch (Exception $e) { + try { + $ts3_VirtualServer->selfUpdate(array( + 'client_nickname' => $queryname2 + )); + } + catch (Exception $e) { + echo $lang['error'], $e->getCode(), ': ', $e->getMessage(); + } + } + foreach ($uuidarr as $uuid) { + if (isset($_POST['delsrvgrp'])) { + $dbremsgrp = $mysqlcon->query("SELECT cldbid,grpid from $dbname.user where uuid='$uuid'"); + while ($remsgrp = $dbremsgrp->fetch(PDO::FETCH_ASSOC)) { + if ($remsgrp['grpid'] != 0) { + try { + $ts3_VirtualServer->serverGroupClientDel($remsgrp['grpid'], $remsgrp['cldbid']); + } + catch (Exception $e) { + $alert = $alert . '' . sprintf($lang['errremgrp'], $uuid, $remsgrp['grpid']) . $e->getCode() . ': ' . $e->getMessage() . '
'; + } + } + } + } + if ($mysqlcon->exec("DELETE FROM $dbname.user WHERE uuid='$uuid'") === false) { + $alert = $alert . '' . sprintf($lang['errremdb'], $uuid) . $mysqlcon->errorCode() . '
'; + } else { + $alert = $alert . '' . sprintf($lang['sccrmcld'], $uuid) . '
'; + } + } + } elseif ($_POST['delclients'] == "" && $seluuid != '' && $counttime != 0) { + $dtF = new DateTime("@0"); + $dtT = new DateTime("@$counttime"); + $timecount = $dtF->diff($dtT)->format($timeformat); + foreach ($uuidarr as $uuid) { + if ($mysqlcon->exec("UPDATE $dbname.user SET count='$counttime' WHERE uuid='$uuid'") === false) { + $alert = $alert . '' . sprintf($lang['errupcount'], $timecount, $uuid) . $mysqlcon->errorCode() . '
'; + } else { + $alert = $alert . '' . sprintf($lang['sccupcount'], $uuid, $timecount) . '
'; + } + } + } else { + echo $_POST['delclients']; + $alert = '' . sprintf($lang['errsel'], $seluuid, $_POST['delclients'], $counttime) . ''; + } + require_once('other/webinterface_list.php'); +} +if (isset($_POST['globalclients'])) { + if(isset($_POST['delcldgrps'])) { + $selectbefore = $mysqlcon->query("SELECT * FROM $dbname.user WHERE grpid!='0'"); + $before = $selectbefore->rowCount(); + if($mysqlcon->exec("UPDATE $dbname.user SET grpid='0'") && $selectbefore->rowCount() != 0) { + $alert = '' . sprintf($lang['delcldgrpsc'], $before) . ''; + } elseif($selectbefore->rowCount() == 0) { + $alert = '' . sprintf($lang['delcldgrpsc'], $before) . ''; + } else { + $alert = '' . sprintf($lang['delcldgrpif'], $selectbefore->errorCode()) . ''; + } + } else { + $selectbefore = $mysqlcon->query("SELECT * FROM $dbname.user"); + $before = $selectbefore->rowCount(); + $cleantime = time() - $_POST['cleantime']; + if (isset($_POST['delsrvgrp'])) { + require_once('ts3_lib/TeamSpeak3.php'); + $ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $ts['user'] . ":" . $ts['pass'] . "@" . $ts['host'] . ":" . $ts['query'] . "/?server_port=" . $ts['voice']); + try { + $ts3_VirtualServer->selfUpdate(array( + 'client_nickname' => $queryname + )); + } + catch (Exception $e) { + try { + $ts3_VirtualServer->selfUpdate(array( + 'client_nickname' => $queryname2 + )); + } + catch (Exception $e) { + echo $lang['error'], $e->getCode(), ': ', $e->getMessage(); + } + } + $dbremsgrp = $mysqlcon->query("SELECT cldbid,grpid from $dbname.user where lastseen<'$cleantime'"); + $dbremsgrp = $dbremsgrp->fetchAll(); + foreach ($dbremsgrp as $remsgrp) { + if ($remsgrp['grpid'] != 0) { + $ts3_VirtualServer->serverGroupClientDel($remsgrp['grpid'], $remsgrp['cldbid']); + } + } + } + if ($_POST['cleantime'] < 1) { + $dbcount = $mysqlcon->exec("DELETE from $dbname.user"); + } else { + $dbcount = $mysqlcon->exec("DELETE from $dbname.user where lastseen<'$cleantime'"); + } + $selectafter = $mysqlcon->query("SELECT * from $dbname.user"); + $after = $selectafter->rowCount(); + $countdel = $before - $after; + if ($countdel == 0) { + $alert = '' . sprintf($lang['delclientsif'], $countdel) . ''; + } else { + $alert = '' . sprintf($lang['delclientssc'], $countdel) . ''; + } + } + require_once('other/webinterface_list.php'); +} +if (isset($_POST['updatetdbsettings'])) { +$newconfig='';$dbserver=$_POST['dbtype'].':host='.$_POST['dbhost'].';dbname='.$_POST['dbname'];try{$mysqlcon=new PDO($dbserver,$_POST['dbuser'],$_POST['dbpass']);$handle=fopen('./other/dbconfig.php','w');if(!fwrite($handle,$newconfig)){$alert=''.sprintf($lang['widbcfgerr']).'';}else{exec("php ".__DIR__."/worker.php restart");$alert=''.sprintf($lang['widbcfgsuc']).'';}fclose($handle);}catch(PDOException $e){$alert=''.sprintf($lang['widbcfgerr']).'';}require_once('other/webinterface_list.php');}if(file_exists('install.php')||file_exists('update_0-02.php')||file_exists('update_0-10.php')){echo sprintf($lang['isntwidel'],"webinterface.php");}else{if(isset($_GET['logout'])=="true"){session_destroy();header("location:webinterface.php");}elseif(isset($_POST['abschicken'])||isset($_SESSION['username'])){if(isset($_SESSION['username'])||($_POST['username']==$webuser&&$_POST['password']==$webpass)){$_SESSION['username']=$webuser;set_error_handler(function(){});$newversion=file_get_contents('http://ts-n.net/ranksystem/version');restore_error_handler();if(substr($newversion,0,4)!=substr($currvers,0,4)&&$newversion!=''){$alert='Update available!';}require_once('other/webinterface_list.php');}else{$showerrlogin=1;require_once('other/webinterface_login.php');}}else{session_destroy();require_once('other/webinterface_login.php');}}?> \ No newline at end of file +?>'; + $dbserver = $_POST['dbtype'].':host='.$_POST['dbhost'].';dbname='.$_POST['dbname']; + try { + $mysqlcon = new PDO($dbserver, $_POST['dbuser'], $_POST['dbpass']); + $handle=fopen('./other/dbconfig.php','w'); + if(!fwrite($handle,$newconfig)) + { + $alert = '' . sprintf($lang['widbcfgerr']) . ''; + } else { + if (substr(php_uname(), 0, 7) == "Windows") { + $WshShell = new COM("WScript.Shell"); + $oExec = $WshShell->Run("cmd /C php ".__DIR__."\worker.php restart", 0, false); + } else { + exec("php ".__DIR__."/worker.php restart"); + } + $alert = '' . sprintf($lang['widbcfgsuc']) . ''; + } + fclose($handle); + } catch (PDOException $e) { + $alert = '' . sprintf($lang['widbcfgerr']) . ''; + } + require_once('other/webinterface_list.php'); +} +if (file_exists('install.php') || file_exists('update_0-02.php') || file_exists('update_0-10.php')) { + echo sprintf($lang['isntwidel'], "webinterface.php"); +} else { + if (isset($_GET['logout']) == "true") { + session_destroy(); + header("location:webinterface.php"); + } elseif (isset($_POST['abschicken']) || isset($_SESSION['username'])) { + if (isset($_SESSION['username']) || ($_POST['username'] == $webuser && $_POST['password'] == $webpass)) { + $_SESSION['username'] = $webuser; + set_error_handler(function() { }); + $newversion = file_get_contents('http://ts-n.net/ranksystem/version'); + restore_error_handler(); + if (substr($newversion, 0, 4) != substr($currvers, 0, 4) && $newversion != '') { + $alert = 'Update available!'; + } + require_once('other/webinterface_list.php'); + } else { + $showerrlogin = 1; + require_once('other/webinterface_login.php'); + } + } else { + session_destroy(); + require_once('other/webinterface_login.php'); + } +} +?> \ No newline at end of file diff --git a/worker.php b/worker.php index 8e3d0d0..03e08ab 100644 --- a/worker.php +++ b/worker.php @@ -1 +1,201 @@ -nul",$result);if(isset($result[1])&&is_numeric($result[1])){return TRUE;}else {return FALSE;}}else {if(file_exists($GLOBALS['pidfile'])){preg_match_all('!\d+!',file_get_contents($GLOBALS['pidfile']),$pid);exec("wmic process where 'Name='php.exe' and processid='".$pid[0][0]."'' get processid",$result);if(isset($result[1])&&is_numeric($result[1])){return TRUE;}else {return FALSE;}}else {return FALSE;}}}else {if(!empty($pid)){$check_pid="ps ".$pid;$result=shell_exec($check_pid);if(count(preg_split("/\n/",$result))>2){return TRUE;}else {return FALSE;}}else {if(file_exists($GLOBALS['pidfile'])){$check_pid="ps ".file_get_contents($GLOBALS['pidfile']);$result=shell_exec($check_pid);if(count(preg_split("/\n/",$result))>2){return TRUE;}else {return FALSE;}}else {return FALSE;}}}}function start(){if(substr(php_uname(),0,7)=="Windows"){if(checkProcess()==FALSE){echo "Starting the Ranksystem Bot.";$cmd="php ".dirname(__FILE__)."\jobs\bot.php >> ".$GLOBALS['logfile'];pclose(popen("start /B ".$cmd,"r"));exec("wmic process where 'Name='php.exe' and commandline LIKE '%jobs\\\\bot.php%'' get processid",$pid);if(isset($pid[1])&&is_numeric($pid[1])){exec("echo ".$pid[1]." > ".$GLOBALS['pidfile']);echo " [OK]\n";}else {echo " [Failed]\n";}}else {echo "The Ranksystem is already running.\n";}$GLOBALS['exec']=TRUE;}else {if(checkProcess()==FALSE){echo "Starting the Ranksystem Bot.";exec("php ".dirname(__FILE__)."/jobs/bot.php >> ".$GLOBALS['logfile']." 2>&1 & echo $! > ".$GLOBALS['pidfile']);if(checkProcess()==FALSE){echo " [Failed]\n";}else {echo " [OK]\n";}}else {echo "The Ranksystem is already running.\n";}$GLOBALS['exec']=TRUE;}}function stop(){if(substr(php_uname(),0,7)=="Windows"){if(checkProcess()==TRUE){echo "Stopping the Ranksystem Bot.\n";preg_match_all('!\d+!',file_get_contents($GLOBALS['pidfile']),$pid);exec("del /F ".$GLOBALS['pidfile']);echo "Wait until Bot is down";$count_check=0;while(checkProcess($pid[0][0])==TRUE){sleep(1);echo ".";$count_check++;if($count_check>10){exec("taskkill /F /PID ".$pid[0][0]);break;}}if(checkProcess($pid[0][0])==TRUE){echo " [Failed]\n";}else {echo " [OK]\n";}}else {echo "The Ranksystem seems not running.\n";}$GLOBALS['exec']=TRUE;}else {if(checkProcess()==TRUE){echo "Stopping the Ranksystem Bot.\n";$pid=file_get_contents($GLOBALS['pidfile']);exec("rm -f ".$GLOBALS['pidfile']);echo "Wait until Bot is down";$count_check=0;while(checkProcess($pid)==TRUE){sleep(1);echo ".";$count_check++;if($count_check>10){exec("kill -9 ".$pid);break;}}if(checkProcess($pid)==TRUE){echo " [Failed]\n";}else {echo " [OK]\n";}}else {echo "The Ranksystem seems not running.\n";}$GLOBALS['exec']=TRUE;}}function check(){if(substr(php_uname(),0,7)=="Windows"){if(checkProcess()==FALSE){if(file_exists($GLOBALS['pidfile'])){exec("del /F ".$GLOBALS['pidfile']);}start();}$GLOBALS['exec']=TRUE;}else {if(checkProcess()==FALSE){if(file_exists($GLOBALS['pidfile'])){exec("rm -f ".$GLOBALS['pidfile']);}start();}$GLOBALS['exec']=TRUE;}}function restart(){stop();start();$GLOBALS['exec']=TRUE;}function status(){if(checkProcess()==FALSE){echo "The Ranksystem does not seem to run.\n";}else {echo "The Ranksystem seems to be running.\n";}$GLOBALS['exec']=TRUE;}function help(){echo " Usage: php worker.php {start|stop|restart|check|status}\n\n","\t* start \t\t [start Ranksystem Bot]\n","\t* stop \t\t [stop Ranksystem Bot]\n","\t* restart \t\t [restart Ranksystem Bot]\n","\t* check \t\t [check Ranksystem Bot is running; if not, start it; no output if all is ok]\n","\t* status \t\t [output status Ranksystem Bot]\n";$GLOBALS['exec']=TRUE;}if(isset($_SERVER['argv'][1])==0){help();}else {$cmd=$_SERVER['argv'][1];if($cmd=='start')start();if($cmd=='stop')stop();if($cmd=='restart')restart();if($cmd=='check')check();if($cmd=='status')status();if($cmd=='help')help();if($GLOBALS['exec']==FALSE)echo " Error parameter '$cmd' not valid. Type \"php worker.php help\" to get a list of valid parameter.\n";}?> \ No newline at end of file +nul", $result); + if(isset($result[1]) && is_numeric($result[1])) { + return TRUE; + } else { + return FALSE; + } + } else { + if (file_exists($GLOBALS['pidfile'])) { + preg_match_all('!\d+!', file_get_contents($GLOBALS['pidfile']), $pid); + exec("wmic process where 'Name='php.exe' and processid='".$pid[0][0]."'' get processid", $result); + if(isset($result[1]) && is_numeric($result[1])) { + return TRUE; + } else { + return FALSE; + } + } else { + return FALSE; + } + } + } else { + if(!empty($pid)) { + $check_pid = "ps ".$pid; + $result = shell_exec($check_pid); + if (count(preg_split("/\n/", $result)) > 2) { + return TRUE; + } else { + return FALSE; + } + } else { + if (file_exists($GLOBALS['pidfile'])) { + $check_pid = "ps ".file_get_contents($GLOBALS['pidfile']); + $result = shell_exec($check_pid); + if (count(preg_split("/\n/", $result)) > 2) { + return TRUE; + } else { + return FALSE; + } + } else { + return FALSE; + } + } + } +} + +function start() { + if (substr(php_uname(), 0, 7) == "Windows") { + if (checkProcess() == FALSE) { + echo "Starting the Ranksystem Bot."; + $WshShell = new COM("WScript.Shell"); + $oExec = $WshShell->Run("cmd /C php ".__DIR__."\jobs\bot.php >/dev/null 2>&1", 0, false); + exec("wmic process where 'Name='php.exe' and commandline LIKE '%jobs\\\\bot.php%'' get processid", $pid); + if(isset($pid[1]) && is_numeric($pid[1])) { + exec("echo ".$pid[1]." > ".$GLOBALS['pidfile']); + echo " [OK]\n"; + } else { + echo " [Failed]\n"; + } + } else { + echo "The Ranksystem is already running.\n"; + } + $GLOBALS['exec'] = TRUE; + } else { + if (checkProcess() == FALSE) { + echo "Starting the Ranksystem Bot."; + exec("php ".dirname(__FILE__)."/jobs/bot.php >/dev/null 2>&1 & echo $! > ".$GLOBALS['pidfile']); + if (checkProcess() == FALSE) { + echo " [Failed]\n"; + } else { + echo " [OK]\n"; + } + } else { + echo "The Ranksystem is already running.\n"; + } + $GLOBALS['exec'] = TRUE; + } +} + +function stop() { + if (substr(php_uname(), 0, 7) == "Windows") { + if (checkProcess() == TRUE) { + echo "Stopping the Ranksystem Bot.\n"; + preg_match_all('!\d+!', file_get_contents($GLOBALS['pidfile']), $pid); + exec("del /F ".$GLOBALS['pidfile']); + echo "Wait until Bot is down"; + $count_check=0; + while (checkProcess($pid[0][0]) == TRUE) { + sleep(1); + echo "."; + $count_check ++; + if($count_check > 10) { + exec("taskkill /F /PID ".$pid[0][0]); + break; + } + } + if (checkProcess($pid[0][0]) == TRUE) { + echo " [Failed]\n"; + } else { + echo " [OK]\n"; + } + } else { + echo "The Ranksystem seems not running.\n"; + } + $GLOBALS['exec'] = TRUE; + } else { + if (checkProcess() == TRUE) { + echo "Stopping the Ranksystem Bot.\n"; + $pid = file_get_contents($GLOBALS['pidfile']); + exec("rm -f ".$GLOBALS['pidfile']); + echo "Wait until Bot is down"; + $count_check=0; + while (checkProcess($pid) == TRUE) { + sleep(1); + echo "."; + $count_check ++; + if($count_check > 10) { + exec("kill -9 ".$pid); + break; + } + } + if (checkProcess($pid) == TRUE) { + echo " [Failed]\n"; + } else { + echo " [OK]\n"; + } + } else { + echo "The Ranksystem seems not running.\n"; + } + $GLOBALS['exec'] = TRUE; + } +} + +function check() { + if (substr(php_uname(), 0, 7) == "Windows") { + if (checkProcess() == FALSE) { + if (file_exists($GLOBALS['pidfile'])) { + exec("del /F ".$GLOBALS['pidfile']); + } + start(); + } + $GLOBALS['exec'] = TRUE; + } else { + if (checkProcess() == FALSE) { + if (file_exists($GLOBALS['pidfile'])) { + exec("rm -f ".$GLOBALS['pidfile']); + } + start(); + } + $GLOBALS['exec'] = TRUE; + } +} + +function restart() { + stop(); + start(); + $GLOBALS['exec'] = TRUE; +} + +function status() { + if (checkProcess() == FALSE) { + echo "The Ranksystem does not seem to run.\n"; + } else { + echo "The Ranksystem seems to be running.\n"; + } + $GLOBALS['exec'] = TRUE; +} + +function help() { + echo " Usage: php worker.php {start|stop|restart|check|status}\n\n", + "\t* start \t\t [start Ranksystem Bot]\n", + "\t* stop \t\t [stop Ranksystem Bot]\n", + "\t* restart \t\t [restart Ranksystem Bot]\n", + "\t* check \t\t [check Ranksystem Bot is running; if not, start it; no output if all is ok]\n", + "\t* status \t\t [output status Ranksystem Bot]\n"; + $GLOBALS['exec'] = TRUE; +} + +if (isset($_SERVER['argv'][1]) == 0) { + help(); +} else { + $cmd = $_SERVER['argv'][1]; + if ($cmd == 'start') start(); + if ($cmd == 'stop') stop(); + if ($cmd == 'restart') restart(); + if ($cmd == 'check') check(); + if ($cmd == 'status') status(); + if ($cmd == 'help') help(); + + if ($GLOBALS['exec'] == FALSE) echo " Error parameter '$cmd' not valid. Type \"php worker.php help\" to get a list of valid parameter.\n"; +} +?> \ No newline at end of file