commit 4bc486fd92d58c4c58043dd1d97b358a81ebd935 Author: FliesentischKing Date: Thu Oct 6 22:04:13 2022 +0200 mirror diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..dfea936 --- /dev/null +++ b/.htaccess @@ -0,0 +1,9 @@ +RewriteEngine on + +#not a real file or directory +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^([^\.]*|search/.*)$ index.php?s=$1 + +RewriteCond %{HTTP_HOST} !^www\.4ducky\.com$ +RewriteRule ^ http://www.4ducky.com%{REQUEST_URI} [R=301] \ No newline at end of file diff --git a/.htpasswd b/.htpasswd new file mode 100644 index 0000000..cffc42e --- /dev/null +++ b/.htpasswd @@ -0,0 +1 @@ +feel:$apr1$N7rXkvNc$v1Jq9zi5sSZNU5LTimL3d. \ No newline at end of file diff --git a/ajax_getdata.php b/ajax_getdata.php new file mode 100644 index 0000000..0290c51 --- /dev/null +++ b/ajax_getdata.php @@ -0,0 +1,341 @@ + $b) { $aa = $b; $b = $a; $a = $aa; $q = "away"; } else { $q = "ago"; } + $value = $b-$a; + if ($value == 1) return "1 second $q"; + if ($value < 60) return "$value seconds $q"; + $value /= 60; + if (round($value) == 1) return "1 minute $q"; + if ($value < 60) return round($value) . " minutes $q"; + $value /= 60; + if (round($value) == 1) return "1 hour $q"; + if ($value < 24) return round($value) . " hours $q"; + $value /= 24; + if (round($value) == 1) if ($q == "ago") return "yesterday"; else return "tomorrow"; + if ($value < 31) return round($value) . " days $q"; + $value /= 31; + if (round($value) == 1) return "1 month $q"; + if ($value < 12) return round($value) . " months $q"; + $value /= 12; + if (round($value) == 1) return "1 year $q"; + return round($value) . " years $q"; + } + + + +if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) { + + +$libpath = 'lib'; +include( $libpath.'/config.php' ); +include( $libpath.'/db.php' ); +include( $libpath.'/users.php' ); + + +if((empty($_COOKIE[Config::$sessionCookie]) && !empty($_COOKIE[Config::$rememberCookie]))) { + if( Config::$vbbIntegration['enabled'] ) { include( 'lib/class.forumops.php' ); } +} + +$user = new User(); +$messages = array(); +$LoginState = $user->login(); + +if ( $_POST["q"] == "lastcomments"){ + + $comments = DB::query("SELECT +c.created, i.keyword,c.id,u.name,u.avatar,c.content +FROM pl_comments c +LEFT JOIN pl_users u ON c.userId = u.id +RIGHT JOIN pl_images i ON c.imageId = i.id +WHERE c.c_like=0 ORDER BY c.created DESC +LIMIT 30"); + + foreach (array_keys($comments) as $c) { + $blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id); + $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); + $lower = strtolower($comments[$c]["name"]); + + if (!in_array($lower,$blockeduser)){ +?> + +
+ + "> +
+ " /> +
+
+ : +
+
+
+ + + + parse( + htmlspecialchars($comments[$i]['content'])) + ); + } + + foreach( $comments as $c ) { + + $commentimg = DB::getRow("SELECT * FROM pl_commentuploads WHERE c_id=:1",$c['id']); + + if (count($commentimg) != 0){ + $min = 'style="min-height:86px;"'; + }else{ + $min = ''; + } + $cst = ""; + if ($c["color"] != "000000"){ + $cst = 'style="color:#'.$c["color"].'"'; + } + + $blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id); + $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); + $lower = strtolower($c['name']); + + + if((int)$c["c_like"] ==1 && $likeCount ==0){ ?> + +
+
♥
+ + + " href=""> +
+ + +
blockedComment blocked () + ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; +if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= +"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!d(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(g)&&f.css({zIndex:'150000000'});"se"==g&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=d(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=d(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}d(this.handles[i])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){d(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){d(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){d(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(d(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +e=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(e.is(".ui-draggable")||/absolute/.test(e.css("position")))e.css({position:"absolute",top:c.top,left:c.left});d.browser.opera&&/relative/.test(e.css("position"))&&e.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var g=m(this.helper.css("top"));if(a.containment){c+=d(a.containment).scrollLeft()||0;g+=d(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:g};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:c,top:g};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",a=="auto"?this.axis+"-resize":a);e.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,e=this._change[this.axis];if(!e)return false;c=e.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&d.ui.hasScroll(e[0],"left")?0:c.sizeDiff.height; +g={width:c.size.width-(g?0:c.sizeDiff.width),height:c.size.height-e};e=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var f=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(d.extend(g,{top:f,left:e}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", +b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,e=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(e=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(e=="nw"){b.top= +a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,e=k(b.width)&&a.maxWidth&&a.maxWidthb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(f)b.width=a.minWidth;if(h)b.height=a.minHeight;if(e)b.width=a.maxWidth;if(g)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, +l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(f&&l)b.left=i-a.minWidth;if(e&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(g&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=d.browser.msie&&d.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ +a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return d.extend(this._change.n.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){d.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.extend(d.ui.resizable, +{version:"1.8.2"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var b=d(this).data("resizable").options,a=function(c){d(c).each(function(){d(this).data("resizable-alsoresize",{width:parseInt(d(this).width(),10),height:parseInt(d(this).height(),10),left:parseInt(d(this).css("left"),10),top:parseInt(d(this).css("top"),10)})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else d.each(b.alsoResize,function(c){a(c)}); +else a(b.alsoResize)},resize:function(){var b=d(this).data("resizable"),a=b.options,c=b.originalSize,e=b.originalPosition,g={height:b.size.height-c.height||0,width:b.size.width-c.width||0,top:b.position.top-e.top||0,left:b.position.left-e.left||0},f=function(h,i){d(h).each(function(){var j=d(this),l=d(this).data("resizable-alsoresize"),p={};d.each((i&&i.length?i:["width","height","top","left"])||["width","height","top","left"],function(n,o){if((n=(l[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(/relative/.test(j.css("position"))&& +d.browser.opera){b._revertToRelativePosition=true;j.css({position:"absolute",top:"auto",left:"auto"})}j.css(p)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?d.each(a.alsoResize,function(h,i){f(h,i)}):f(a.alsoResize)},stop:function(){var b=d(this).data("resizable");if(b._revertToRelativePosition&&d.browser.opera){b._revertToRelativePosition=false;el.css({position:"relative"})}d(this).removeData("resizable-alsoresize-start")}});d.ui.plugin.add("resizable","animate",{stop:function(b){var a= +d(this).data("resizable"),c=a.options,e=a._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName),f=g&&d.ui.hasScroll(e[0],"left")?0:a.sizeDiff.height;g={width:a.size.width-(g?0:a.sizeDiff.width),height:a.size.height-f};f=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(d.extend(g,h&&f?{top:h,left:f}:{}),{duration:c.animateDuration,easing:c.animateEasing, +step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};e&&e.length&&d(e[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof d?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= +d(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var e=d(a),g=[];d(["Top","Right","Left","Bottom"]).each(function(i,j){g[i]=m(e.css("padding"+j))});b.containerOffset=e.offset();b.containerPosition=e.position();b.containerSize={height:e.innerHeight()-g[3],width:e.innerWidth()-g[1]};c=b.containerOffset; +var f=b.containerSize.height,h=b.containerSize.width;h=d.ui.hasScroll(a,"left")?a.scrollWidth:h;f=d.ui.hasScroll(a)?a.scrollHeight:f;b.parentData={element:a,left:c.left,top:c.top,width:h,height:f}}}},resize:function(b){var a=d(this).data("resizable"),c=a.options,e=a.containerOffset,g=a.position;b=a._aspectRatio||b.shiftKey;var f={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))f=e;if(g.left<(a._helper?e.left:0)){a.size.width+=a._helper?a.position.left-e.left: +a.position.left-f.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?e.left:0}if(g.top<(a._helper?e.top:0)){a.size.height+=a._helper?a.position.top-e.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?e.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-f.left:a.offset.left-f.left)+a.sizeDiff.width);e=Math.abs((a._helper?a.offset.top-f.top:a.offset.top- +e.top)+a.sizeDiff.height);g=a.containerElement.get(0)==a.element.parent().get(0);f=/relative|absolute/.test(a.containerElement.css("position"));if(g&&f)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(e+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-e;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=d(this).data("resizable"),a=b.options,c=b.containerOffset,e=b.containerPosition, +g=b.containerElement,f=d(b.helper),h=f.offset(),i=f.outerWidth()-b.sizeDiff.width;f=f.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f});b._helper&&!a.animate&&/static/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f})}});d.ui.plugin.add("resizable","ghost",{start:function(){var b=d(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, +display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=d(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=d(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var b= +d(this).data("resizable"),a=b.options,c=b.size,e=b.originalSize,g=b.originalPosition,f=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-e.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-e.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a}else if(/^(ne)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}else{if(/^(sw)$/.test(f)){b.size.width=e.width+h;b.size.height= +e.height+a}else{b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}b.position.left=g.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Effects 1.8.2 + * + * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f){function k(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return l.transparent;return l[f.trim(c).toLowerCase()]}function q(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return k(b)}function m(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function n(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in r||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function s(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function j(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(f.isFunction(b)){d=b;b=null}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=q(b.elem,a);b.end=k(b.end);b.colorInit= +true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189, +183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255, +165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},o=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=n(m.call(this)),p,t=e.attr("className");f.each(o,function(u, +i){c[i]&&e[i+"Class"](c[i])});p=n(m.call(this));e.attr("className",t);e.animate(s(h,p),a,b,function(){f.each(o,function(u,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a? +f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===undefined?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.2",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"}); +c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c|| +typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this, +arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c, +a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+ +b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2, +10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)* +a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h=0)&&c(h,!i)}});a(function(){var h=document.body,g=h.appendChild(g=document.createElement("div"));a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart"in g;h.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(h,g,i){h=a.ui[h].prototype;for(var b in i){h.plugins[b]=h.plugins[b]||[];h.plugins[b].push([g,i[b]])}},call:function(h,g,i){if((g=h.plugins[g])&& +h.element[0].parentNode)for(var b=0;b0)return true;h[g]=1;i=h[g]>0;h[g]=0;return i},isOverAxis:function(h,g,i){return h>g&&h=9)&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= +false;c.target==this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",true);this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(d){var c= +this.options;if(this.helper||c.disabled||a(d.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(d);if(!this.handle)return false;if(c.iframeFix)a(c.iframeFix===true?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(d){var c=this.options; +this.helper=this._createHelper(d);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); +this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,d);return true}, +_mouseDrag:function(d,c){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",d,c)===false){this._mouseUp({});return false}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);return false},_mouseStop:function(d){var c= +false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,d);if(this.dropped){c=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var e=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, +10),function(){e._trigger("stop",d)!==false&&e._clear()})}else this._trigger("stop",d)!==false&&this._clear();return false},_mouseUp:function(d){this.options.iframeFix===true&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,d);return a.ui.mouse.prototype._mouseUp.call(this,d)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(d){var c=!this.options.handle|| +!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target)c=true});return c},_createHelper:function(d){var c=this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&& +d.css("position","absolute");return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string")d=d.split(" ");if(a.isArray(d))d={left:+d[0],top:+d[1]||0};if("left"in d)this.offset.click.left=d.left+this.margins.left;if("right"in d)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if("top"in d)this.offset.click.top=d.top+this.margins.top;if("bottom"in d)this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= +this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)d={top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"), +10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), +10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[d.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,d.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, +(d.containment=="document"?0:a(window).scrollLeft())+a(d.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d.containment=="document"?0:a(window).scrollTop())+(a(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)&&d.containment.constructor!=Array){d=a(d.containment);var c=d[0];if(c){d.offset();var e=a(c).css("overflow")!= +"hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"), +10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=d}}else if(d.containment.constructor==Array)this.containment=d.containment},_convertPositionTo:function(d,c){if(!c)c=this.position;d=d=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);return{top:c.top+ +this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())*d)}},_generatePosition:function(d){var c=this.options,e=this.cssPosition=="absolute"&& +!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName),g=d.pageX,i=d.pageY;if(this.originalPosition){var b;if(this.containment){if(this.relative_container){b=this.relative_container.offset();b=[this.containment[0]+b.left,this.containment[1]+b.top,this.containment[2]+b.left,this.containment[3]+b.top]}else b=this.containment;if(d.pageX-this.offset.click.leftb[2])g=b[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>b[3])i=b[3]+this.offset.click.top}if(c.grid){i=c.grid[1]?this.originalPageY+Math.round((i-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;i=b?!(i-this.offset.click.topb[3])?i:!(i-this.offset.click.topb[2])?g:!(g-this.offset.click.left=0;l--){var o=e.snapElements[l].left,n=o+e.snapElements[l].width,k=e.snapElements[l].top,m=k+e.snapElements[l].height;if(o-g=l&&i<=o||b>=l&&b<=o||io)&&(h>= +f&&h<=j||g>=f&&g<=j||hj);default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(d,c){var e=a.ui.ddmanager.droppables[d.options.scope]||[],h=c?c.type:null,g=(d.currentItem||d.element).find(":data(droppable)").andSelf(),i=0;a:for(;i').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=h.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var g=this.handles.split(",");this.handles={};for(var i=0;i');/sw|se|ne|nw/.test(b)&&f.css({zIndex:++h.zIndex});"se"==b&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[b]=".ui-resizable-"+b;this.element.append(f)}}this._renderAxis=function(j){j=j||this.element;for(var l in this.handles){if(this.handles[l].constructor== +String)this.handles[l]=a(this.handles[l],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=a(this.handles[l],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(l)?o.outerHeight():o.outerWidth();o=["padding",/ne|nw|n/.test(l)?"Top":/se|sw|s/.test(l)?"Bottom":/^e$/.test(l)?"Right":"Left"].join("");j.css(o,n);this._proportionallyResize()}a(this.handles[l])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!e.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=j&&j[1]?j[1]:"se"}});if(h.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").hover(function(){if(!h.disabled){a(this).removeClass("ui-resizable-autohide");e._handles.show()}},function(){if(!h.disabled)if(!e.resizing){a(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); +var e=function(g){a(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var h=this.element;h.after(this.originalElement.css({position:h.css("position"),width:h.outerWidth(),height:h.outerHeight(),top:h.css("top"),left:h.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(e){var h= +false;for(var g in this.handles)if(a(this.handles[g])[0]==e.target)h=true;return!this.options.disabled&&h},_mouseStart:function(e){var h=this.options,g=this.element.position(),i=this.element;this.resizing=true;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};if(i.is(".ui-draggable")||/absolute/.test(i.css("position")))i.css({position:"absolute",top:g.top,left:g.left});a.browser.opera&&/relative/.test(i.css("position"))&&i.css({position:"relative",top:"auto",left:"auto"}); +this._renderProxy();g=d(this.helper.css("left"));var b=d(this.helper.css("top"));if(h.containment){g+=a(h.containment).scrollLeft()||0;b+=a(h.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:g,top:b};this.size=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:g,top:b};this.sizeDiff= +{width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof h.aspectRatio=="number"?h.aspectRatio:this.originalSize.width/this.originalSize.height||1;h=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",h=="auto"?this.axis+"-resize":h);i.addClass("ui-resizable-resizing");this._propagate("start",e);return true},_mouseDrag:function(e){var h=this.helper,g=this.originalMousePosition,i=this._change[this.axis]; +if(!i)return false;g=i.apply(this,[e,e.pageX-g.left||0,e.pageY-g.top||0]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)g=this._updateRatio(g,e);g=this._respectSize(g,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(g);this._trigger("resize",e,this.ui());return false}, +_mouseStop:function(e){this.resizing=false;var h=this.options,g=this;if(this._helper){var i=this._proportionallyResizeElements,b=i.length&&/textarea/i.test(i[0].nodeName);i=b&&a.ui.hasScroll(i[0],"left")?0:g.sizeDiff.height;b=b?0:g.sizeDiff.width;b={width:g.helper.width()-b,height:g.helper.height()-i};i=parseInt(g.element.css("left"),10)+(g.position.left-g.originalPosition.left)||null;var f=parseInt(g.element.css("top"),10)+(g.position.top-g.originalPosition.top)||null;h.animate||this.element.css(a.extend(b, +{top:f,left:i}));g.helper.height(g.size.height);g.helper.width(g.size.width);this._helper&&!h.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",e);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(e){var h=this.options,g,i,b;h={minWidth:c(h.minWidth)?h.minWidth:0,maxWidth:c(h.maxWidth)?h.maxWidth:Infinity,minHeight:c(h.minHeight)?h.minHeight:0,maxHeight:c(h.maxHeight)?h.maxHeight: +Infinity};if(this._aspectRatio||e){e=h.minHeight*this.aspectRatio;i=h.minWidth/this.aspectRatio;g=h.maxHeight*this.aspectRatio;b=h.maxWidth/this.aspectRatio;if(e>h.minWidth)h.minWidth=e;if(i>h.minHeight)h.minHeight=i;if(ge.width,j=c(e.height)&&h.minHeight&&h.minHeight>e.height;if(f)e.width=h.minWidth;if(j)e.height=h.minHeight;if(i)e.width=h.maxWidth;if(b)e.height=h.maxHeight;var l=this.originalPosition.left+this.originalSize.width,o=this.position.top+this.size.height,n=/sw|nw|w/.test(g);g=/nw|ne|n/.test(g);if(f&&n)e.left=l-h.minWidth;if(i&&n)e.left=l-h.maxWidth;if(j&&g)e.top=o-h.minHeight;if(b&&g)e.top=o-h.maxHeight;if((h=!e.width&&!e.height)&&!e.left&&e.top)e.top=null;else if(h&&!e.top&&e.left)e.left= +null;return e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,h=0;h');var h=a.browser.msie&&a.browser.version<7,g=h?1:0;h=h?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ +h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,h){return{width:this.originalSize.width+h}},w:function(e,h){return{left:this.originalPosition.left+h,width:this.originalSize.width-h}},n:function(e,h,g){return{top:this.originalPosition.top+g,height:this.originalSize.height-g}},s:function(e,h,g){return{height:this.originalSize.height+ +g}},se:function(e,h,g){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,h,g]))},sw:function(e,h,g){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,h,g]))},ne:function(e,h,g){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,h,g]))},nw:function(e,h,g){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,h,g]))}},_propagate:function(e,h){a.ui.plugin.call(this,e,[h,this.ui()]); +e!="resize"&&this._trigger(e,h,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,{version:"1.8.16"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var e=a(this).data("resizable").options,h=function(g){a(g).each(function(){var i=a(this);i.data("resizable-alsoresize",{width:parseInt(i.width(), +10),height:parseInt(i.height(),10),left:parseInt(i.css("left"),10),top:parseInt(i.css("top"),10),position:i.css("position")})})};if(typeof e.alsoResize=="object"&&!e.alsoResize.parentNode)if(e.alsoResize.length){e.alsoResize=e.alsoResize[0];h(e.alsoResize)}else a.each(e.alsoResize,function(g){h(g)});else h(e.alsoResize)},resize:function(e,h){var g=a(this).data("resizable");e=g.options;var i=g.originalSize,b=g.originalPosition,f={height:g.size.height-i.height||0,width:g.size.width-i.width||0,top:g.position.top- +b.top||0,left:g.position.left-b.left||0},j=function(l,o){a(l).each(function(){var n=a(this),k=a(this).data("resizable-alsoresize"),m={},p=o&&o.length?o:n.parents(h.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(p,function(q,s){if((q=(k[s]||0)+(f[s]||0))&&q>=0)m[s]=q||null});if(a.browser.opera&&/relative/.test(n.css("position"))){g._revertToRelativePosition=true;n.css({position:"absolute",top:"auto",left:"auto"})}n.css(m)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType? +a.each(e.alsoResize,function(l,o){j(l,o)}):j(e.alsoResize)},stop:function(){var e=a(this).data("resizable"),h=e.options,g=function(i){a(i).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};if(e._revertToRelativePosition){e._revertToRelativePosition=false;typeof h.alsoResize=="object"&&!h.alsoResize.nodeType?a.each(h.alsoResize,function(i){g(i)}):g(h.alsoResize)}a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(e){var h= +a(this).data("resizable"),g=h.options,i=h._proportionallyResizeElements,b=i.length&&/textarea/i.test(i[0].nodeName),f=b&&a.ui.hasScroll(i[0],"left")?0:h.sizeDiff.height;b={width:h.size.width-(b?0:h.sizeDiff.width),height:h.size.height-f};f=parseInt(h.element.css("left"),10)+(h.position.left-h.originalPosition.left)||null;var j=parseInt(h.element.css("top"),10)+(h.position.top-h.originalPosition.top)||null;h.element.animate(a.extend(b,j&&f?{top:j,left:f}:{}),{duration:g.animateDuration,easing:g.animateEasing, +step:function(){var l={width:parseInt(h.element.css("width"),10),height:parseInt(h.element.css("height"),10),top:parseInt(h.element.css("top"),10),left:parseInt(h.element.css("left"),10)};i&&i.length&&a(i[0]).css({width:l.width,height:l.height});h._updateCache(l);h._propagate("resize",e)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var e=a(this).data("resizable"),h=e.element,g=e.options.containment;if(h=g instanceof a?g.get(0):/parent/.test(g)?h.parent().get(0):g){e.containerElement= +a(h);if(/document/.test(g)||g==document){e.containerOffset={left:0,top:0};e.containerPosition={left:0,top:0};e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{var i=a(h),b=[];a(["Top","Right","Left","Bottom"]).each(function(l,o){b[l]=d(i.css("padding"+o))});e.containerOffset=i.offset();e.containerPosition=i.position();e.containerSize={height:i.innerHeight()-b[3],width:i.innerWidth()-b[1]};g=e.containerOffset; +var f=e.containerSize.height,j=e.containerSize.width;j=a.ui.hasScroll(h,"left")?h.scrollWidth:j;f=a.ui.hasScroll(h)?h.scrollHeight:f;e.parentData={element:h,left:g.left,top:g.top,width:j,height:f}}}},resize:function(e){var h=a(this).data("resizable"),g=h.options,i=h.containerOffset,b=h.position;e=h._aspectRatio||e.shiftKey;var f={top:0,left:0},j=h.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))f=i;if(b.left<(h._helper?i.left:0)){h.size.width+=h._helper?h.position.left-i.left: +h.position.left-f.left;if(e)h.size.height=h.size.width/g.aspectRatio;h.position.left=g.helper?i.left:0}if(b.top<(h._helper?i.top:0)){h.size.height+=h._helper?h.position.top-i.top:h.position.top;if(e)h.size.width=h.size.height*g.aspectRatio;h.position.top=h._helper?i.top:0}h.offset.left=h.parentData.left+h.position.left;h.offset.top=h.parentData.top+h.position.top;g=Math.abs((h._helper?h.offset.left-f.left:h.offset.left-f.left)+h.sizeDiff.width);i=Math.abs((h._helper?h.offset.top-f.top:h.offset.top- +i.top)+h.sizeDiff.height);b=h.containerElement.get(0)==h.element.parent().get(0);f=/relative|absolute/.test(h.containerElement.css("position"));if(b&&f)g-=h.parentData.left;if(g+h.size.width>=h.parentData.width){h.size.width=h.parentData.width-g;if(e)h.size.height=h.size.width/h.aspectRatio}if(i+h.size.height>=h.parentData.height){h.size.height=h.parentData.height-i;if(e)h.size.width=h.size.height*h.aspectRatio}},stop:function(){var e=a(this).data("resizable"),h=e.options,g=e.containerOffset,i=e.containerPosition, +b=e.containerElement,f=a(e.helper),j=f.offset(),l=f.outerWidth()-e.sizeDiff.width;f=f.outerHeight()-e.sizeDiff.height;e._helper&&!h.animate&&/relative/.test(b.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:l,height:f});e._helper&&!h.animate&&/static/.test(b.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:l,height:f})}});a.ui.plugin.add("resizable","ghost",{start:function(){var e=a(this).data("resizable"),h=e.options,g=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25, +display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");e.ghost.appendTo(e.helper)},resize:function(){var e=a(this).data("resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=a(this).data("resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var e= +a(this).data("resizable"),h=e.options,g=e.size,i=e.originalSize,b=e.originalPosition,f=e.axis;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var j=Math.round((g.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1);h=Math.round((g.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(f)){e.size.width=i.width+j;e.size.height=i.height+h}else if(/^(ne)$/.test(f)){e.size.width=i.width+j;e.size.height=i.height+h;e.position.top=b.top-h}else{if(/^(sw)$/.test(f)){e.size.width=i.width+j;e.size.height= +i.height+h}else{e.size.width=i.width+j;e.size.height=i.height+h;e.position.top=b.top-h}e.position.left=b.left-j}}});var d=function(e){return parseInt(e,10)||0},c=function(e){return!isNaN(parseInt(e,10))}})(jQuery); +(function(a){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var d=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(d.options.filter,d.element[0]);c.each(function(){var e=a(this),h=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:h.left,top:h.top,right:h.left+e.outerWidth(),bottom:h.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"), +selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(d){var c=this;this.opos=[d.pageX, +d.pageY];if(!this.options.disabled){var e=this.options;this.selectees=a(e.filter,this.element[0]);this._trigger("start",d);a(e.appendTo).append(this.helper);this.helper.css({left:d.clientX,top:d.clientY,width:0,height:0});e.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var h=a.data(this,"selectable-item");h.startselected=true;if(!d.metaKey){h.$element.removeClass("ui-selected");h.selected=false;h.$element.addClass("ui-unselecting");h.unselecting=true;c._trigger("unselecting", +d,{unselecting:h.element})}});a(d.target).parents().andSelf().each(function(){var h=a.data(this,"selectable-item");if(h){var g=!d.metaKey||!h.$element.hasClass("ui-selected");h.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");h.unselecting=!g;h.selecting=g;(h.selected=g)?c._trigger("selecting",d,{selecting:h.element}):c._trigger("unselecting",d,{unselecting:h.element});return false}})}},_mouseDrag:function(d){var c=this;this.dragged=true;if(!this.options.disabled){var e= +this.options,h=this.opos[0],g=this.opos[1],i=d.pageX,b=d.pageY;if(h>i){var f=i;i=h;h=f}if(g>b){f=b;b=g;g=f}this.helper.css({left:h,top:g,width:i-h,height:b-g});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!(!j||j.element==c.element[0])){var l=false;if(e.tolerance=="touch")l=!(j.left>i||j.rightb||j.bottomh&&j.rightg&&j.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var d=this.options;this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?d.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--)this.items[d].item.removeData("sortable-item");return this},_setOption:function(d,c){if(d=== +"disabled"){this.options[d]=c;this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(d,c){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(d);var e=null,h=this;a(d.target).parents().each(function(){if(a.data(this,"sortable-item")==h){e=a(this);return false}});if(a.data(d.target,"sortable-item")==h)e=a(d.target);if(!e)return false;if(this.options.handle&& +!c){var g=false;a(this.options.handle,e).find("*").andSelf().each(function(){if(this==d.target)g=true});if(!g)return false}this.currentItem=e;this._removeCurrentsFromItems();return true},_mouseStart:function(d,c,e){c=this.options;var h=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(d);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, +left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; +this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();c.containment&&this._setContainment();if(c.cursor){if(a("body").css("cursor"))this._storedCursor=a("body").css("cursor");a("body").css("cursor",c.cursor)}if(c.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",c.opacity)}if(c.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",c.zIndex)}if(this.scrollParent[0]!= +document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",d,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!e)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",d,h._uiHash(this));if(a.ui.ddmanager)a.ui.ddmanager.current=this;a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(d); +return true},_mouseDrag:function(d){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var c=this.options,e=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-d.pageY=0;c--){e=this.items[c];var h=e.item[0],g=this._intersectsWithPointer(e);if(g)if(h!=this.currentItem[0]&&this.placeholder[g==1?"next":"prev"]()[0]!=h&&!a.ui.contains(this.placeholder[0],h)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0], +h):true)){this.direction=g==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e))this._rearrange(d,e);else break;this._trigger("change",d,this._uiHash());break}}this._contactContainers(d);a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);this._trigger("sort",d,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,c){if(d){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,d);if(this.options.revert){var e=this;c=e.placeholder.offset(); +e.reverting=true;a(this.helper).animate({left:c.left-this.offset.parent.left-e.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-e.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){e._clear(d)})}else this._clear(d,c);return false}},cancel:function(){var d=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): +this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,d._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,d._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();a.extend(this,{helper:null, +dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(d){var c=this._getItemsAsjQuery(d&&d.connected),e=[];d=d||{};a(c).each(function(){var h=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||/(.+)[-=_](.+)/);if(h)e.push((d.key||h[1]+"[]")+"="+(d.key&&d.expression?h[1]:h[2]))});!e.length&&d.key&&e.push(d.key+"=");return e.join("&")}, +toArray:function(d){var c=this._getItemsAsjQuery(d&&d.connected),e=[];d=d||{};c.each(function(){e.push(a(d.item||this).attr(d.attribute||"id")||"")});return e},_intersectsWith:function(d){var c=this.positionAbs.left,e=c+this.helperProportions.width,h=this.positionAbs.top,g=h+this.helperProportions.height,i=d.left,b=i+d.width,f=d.top,j=f+d.height,l=this.offset.click.top,o=this.offset.click.left;l=h+l>f&&h+li&&c+od[this.floating?"width":"height"]?l:i0?"down":"up")},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left")},refresh:function(d){this._refreshItems(d);this.refreshPositions();return this},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(d){var c=[],e=[],h=this._connectWith(); +if(h&&d)for(d=h.length-1;d>=0;d--)for(var g=a(h[d]),i=g.length-1;i>=0;i--){var b=a.data(g[i],"sortable");if(b&&b!=this&&!b.options.disabled)e.push([a.isFunction(b.options.items)?b.options.items.call(b.element):a(b.options.items,b.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),b])}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), +this]);for(d=e.length-1;d>=0;d--)e[d][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var d=this.currentItem.find(":data(sortable-item)"),c=0;c=0;g--)for(var i=a(h[g]),b=i.length-1;b>=0;b--){var f=a.data(i[b],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element[0],d,{item:this.currentItem}):a(f.options.items,f.element),f]);this.containers.push(f)}}for(g=e.length-1;g>=0;g--){d=e[g][1];h=e[g][0];b=0;for(i=h.length;b=0;c--){var e=this.items[c];if(!(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0])){var h=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!d){e.width=h.outerWidth();e.height=h.outerHeight()}h=h.offset();e.left=h.left;e.top=h.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c= +this.containers.length-1;c>=0;c--){h=this.containers[c].element.offset();this.containers[c].containerCache.left=h.left;this.containers[c].containerCache.top=h.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(d){var c=d||this,e=c.options;if(!e.placeholder||e.placeholder.constructor==String){var h=e.placeholder;e.placeholder={element:function(){var g= +a(document.createElement(c.currentItem[0].nodeName)).addClass(h||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!h)g.style.visibility="hidden";return g},update:function(g,i){if(!(h&&!e.forcePlaceholderSize)){i.height()||i.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10));i.width()||i.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")|| +0,10))}}}}c.placeholder=a(e.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);e.placeholder.update(c,c.placeholder)},_contactContainers:function(d){for(var c=null,e=null,h=this.containers.length-1;h>=0;h--)if(!a.ui.contains(this.currentItem[0],this.containers[h].element[0]))if(this._intersectsWith(this.containers[h].containerCache)){if(!(c&&a.ui.contains(this.containers[h].element[0],c.element[0]))){c=this.containers[h];e=h}}else if(this.containers[h].containerCache.over){this.containers[h]._trigger("out", +d,this._uiHash(this));this.containers[h].containerCache.over=0}if(c)if(this.containers.length===1){this.containers[e]._trigger("over",d,this._uiHash(this));this.containers[e].containerCache.over=1}else if(this.currentContainer!=this.containers[e]){c=1E4;h=null;for(var g=this.positionAbs[this.containers[e].floating?"left":"top"],i=this.items.length-1;i>=0;i--)if(a.ui.contains(this.containers[e].element[0],this.items[i].item[0])){var b=this.items[i][this.containers[e].floating?"left":"top"];if(Math.abs(b- +g)this.containment[2])g=this.containment[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])i=this.containment[3]+this.offset.click.top}if(c.grid){i=this.originalPageY+Math.round((i- +this.originalPageY)/c.grid[1])*c.grid[1];i=this.containment?!(i-this.offset.click.topthis.containment[3])?i:!(i-this.offset.click.topthis.containment[2])?g:!(g-this.offset.click.left=0;h--)if(a.ui.contains(this.containers[h].element[0],this.currentItem[0])&&!c){e.push(function(g){return function(i){g._trigger("receive",i,this._uiHash(this))}}.call(this,this.containers[h]));e.push(function(g){return function(i){g._trigger("update",i,this._uiHash(this))}}.call(this,this.containers[h]))}}for(h=this.containers.length-1;h>=0;h--){c||e.push(function(g){return function(i){g._trigger("deactivate",i,this._uiHash(this))}}.call(this, +this.containers[h]));if(this.containers[h].containerCache.over){e.push(function(g){return function(i){g._trigger("out",i,this._uiHash(this))}}.call(this,this.containers[h]));this.containers[h].containerCache.over=0}}this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop", +d,this._uiHash());for(h=0;h").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), +p=document.activeElement;n.wrap(m);if(n[0]===p||a.contains(n[0],p))a(p).focus();m=n.parent();if(n.css("position")=="static"){m.css({position:"relative"});n.css({position:"relative"})}else{a.extend(k,{position:n.css("position"),zIndex:n.css("z-index")});a.each(["top","left","bottom","right"],function(q,s){k[s]=n.css(s);if(isNaN(parseInt(k[s],10)))k[s]="auto"});n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return m.css(k).show()},removeWrapper:function(n){var k,m=document.activeElement; +if(n.parent().is(".ui-effects-wrapper")){k=n.parent().replaceWith(n);if(n[0]===m||a.contains(n[0],m))a(m).focus();return k}return n},setTransition:function(n,k,m,p){p=p||{};a.each(k,function(q,s){unit=n.cssUnit(s);if(unit[0]>0)p[s]=unit[0]*m+unit[1]});return p}});a.fn.extend({effect:function(n){var k=b.apply(this,arguments),m={options:k[1],duration:k[2],callback:k[3]};k=m.options.mode;var p=a.effects[n];if(a.fx.off||!p)return k?this[k](m.duration,m.callback):this.each(function(){m.callback&&m.callback.call(this)}); +return p.call(this,m)},_show:a.fn.show,show:function(n){if(f(n))return this._show.apply(this,arguments);else{var k=b.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:a.fn.hide,hide:function(n){if(f(n))return this._hide.apply(this,arguments);else{var k=b.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:a.fn.toggle,toggle:function(n){if(f(n)||typeof n==="boolean"||a.isFunction(n))return this.__toggle.apply(this,arguments);else{var k=b.apply(this, +arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(n){var k=this.css(n),m=[];a.each(["em","px","%","pt"],function(p,q){if(k.indexOf(q)>0)m=[parseFloat(k),q]});return m}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(n,k,m,p,q){return a.easing[a.easing.def](n,k,m,p,q)},easeInQuad:function(n,k,m,p,q){return p*(k/=q)*k+m},easeOutQuad:function(n,k,m,p,q){return-p*(k/=q)*(k-2)+m},easeInOutQuad:function(n,k,m,p,q){if((k/=q/2)<1)return p/ +2*k*k+m;return-p/2*(--k*(k-2)-1)+m},easeInCubic:function(n,k,m,p,q){return p*(k/=q)*k*k+m},easeOutCubic:function(n,k,m,p,q){return p*((k=k/q-1)*k*k+1)+m},easeInOutCubic:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k+m;return p/2*((k-=2)*k*k+2)+m},easeInQuart:function(n,k,m,p,q){return p*(k/=q)*k*k*k+m},easeOutQuart:function(n,k,m,p,q){return-p*((k=k/q-1)*k*k*k-1)+m},easeInOutQuart:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k*k+m;return-p/2*((k-=2)*k*k*k-2)+m},easeInQuint:function(n,k,m, +p,q){return p*(k/=q)*k*k*k*k+m},easeOutQuint:function(n,k,m,p,q){return p*((k=k/q-1)*k*k*k*k+1)+m},easeInOutQuint:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k*k*k+m;return p/2*((k-=2)*k*k*k*k+2)+m},easeInSine:function(n,k,m,p,q){return-p*Math.cos(k/q*(Math.PI/2))+p+m},easeOutSine:function(n,k,m,p,q){return p*Math.sin(k/q*(Math.PI/2))+m},easeInOutSine:function(n,k,m,p,q){return-p/2*(Math.cos(Math.PI*k/q)-1)+m},easeInExpo:function(n,k,m,p,q){return k==0?m:p*Math.pow(2,10*(k/q-1))+m},easeOutExpo:function(n, +k,m,p,q){return k==q?m+p:p*(-Math.pow(2,-10*k/q)+1)+m},easeInOutExpo:function(n,k,m,p,q){if(k==0)return m;if(k==q)return m+p;if((k/=q/2)<1)return p/2*Math.pow(2,10*(k-1))+m;return p/2*(-Math.pow(2,-10*--k)+2)+m},easeInCirc:function(n,k,m,p,q){return-p*(Math.sqrt(1-(k/=q)*k)-1)+m},easeOutCirc:function(n,k,m,p,q){return p*Math.sqrt(1-(k=k/q-1)*k)+m},easeInOutCirc:function(n,k,m,p,q){if((k/=q/2)<1)return-p/2*(Math.sqrt(1-k*k)-1)+m;return p/2*(Math.sqrt(1-(k-=2)*k)+1)+m},easeInElastic:function(n,k,m, +p,q){n=1.70158;var s=0,r=p;if(k==0)return m;if((k/=q)==1)return m+p;s||(s=q*0.3);if(r").css({position:"absolute",visibility:"visible",left:-j*(i/e),top:-f*(b/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:i/e,height:b/c,left:g.left+j*(i/e)+(d.options.mode=="show"?(j-Math.floor(e/2))*(i/e):0),top:g.top+f*(b/c)+(d.options.mode=="show"?(f-Math.floor(c/2))*(b/c):0),opacity:d.options.mode=="show"?0:1}).animate({left:g.left+j*(i/e)+(d.options.mode=="show"?0:(j-Math.floor(e/2))*(i/e)),top:g.top+ +f*(b/c)+(d.options.mode=="show"?0:(f-Math.floor(c/2))*(b/c)),opacity:d.options.mode=="show"?1:0},d.duration||500);setTimeout(function(){d.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();d.callback&&d.callback.apply(h[0]);h.dequeue();a("div.ui-effects-explode").remove()},d.duration||500)})}})(jQuery); +(function(a){a.effects.fade=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"hide");c.animate({opacity:e},{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +(function(a){a.effects.fold=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.size||15,i=!!d.options.horizFirst,b=d.duration?d.duration/2:a.fx.speeds._default/2;a.effects.save(c,e);c.show();var f=a.effects.createWrapper(c).css({overflow:"hidden"}),j=h=="show"!=i,l=j?["width","height"]:["height","width"];j=j?[f.width(),f.height()]:[f.height(),f.width()];var o=/([0-9]+)%/.exec(g);if(o)g=parseInt(o[1], +10)/100*j[h=="hide"?0:1];if(h=="show")f.css(i?{height:0,width:g}:{height:g,width:0});i={};o={};i[l[0]]=h=="show"?j[0]:g;o[l[1]]=h=="show"?j[1]:0;f.animate(i,b,d.options.easing).animate(o,b,d.options.easing,function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery); +(function(a){a.effects.highlight=function(d){return this.queue(function(){var c=a(this),e=["backgroundImage","backgroundColor","opacity"],h=a.effects.setMode(c,d.options.mode||"show"),g={backgroundColor:c.css("backgroundColor")};if(h=="hide")g.opacity=0;a.effects.save(c,e);c.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(g,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);h=="show"&&!a.support.opacity&& +this.style.removeAttribute("filter");d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +(function(a){a.effects.pulsate=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"show");times=(d.options.times||5)*2-1;duration=d.duration?d.duration/2:a.fx.speeds._default/2;isVisible=c.is(":visible");animateTo=0;if(!isVisible){c.css("opacity",0).show();animateTo=1}if(e=="hide"&&isVisible||e=="show"&&!isVisible)times--;for(e=0;e').appendTo(document.body).addClass(d.options.className).css({top:h.top,left:h.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(e,d.duration,d.options.easing,function(){g.remove();d.callback&&d.callback.apply(c[0],arguments); +c.dequeue()})})}})(jQuery); +(function(a){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var d=this,c=d.options;d.running=0;d.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");d.headers= +d.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")});d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(c.navigation){var e=d.element.find("a").filter(c.navigationFilter).eq(0);if(e.length){var h=e.closest(".ui-accordion-header");d.active=h.length?h:e.closest(".ui-accordion-content").prev()}}d.active=d._findActive(d.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");d.active.next().addClass("ui-accordion-content-active");d._createIcons();d.resize();d.element.attr("role","tablist");d.headers.attr("role","tab").bind("keydown.accordion", +function(g){return d._keydown(g)}).next().attr("role","tabpanel");d.headers.not(d.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();d.active.length?d.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):d.headers.eq(0).attr("tabIndex",0);a.browser.safari||d.headers.find("a").attr("tabIndex",-1);c.event&&d.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(g){d._clickHandler.call(d,g,this);g.preventDefault()})},_createIcons:function(){var d= +this.options;if(d.icons){a("").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var d=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(d.autoHeight||d.fillHeight)c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(d,c){a.Widget.prototype._setOption.apply(this,arguments);d=="active"&&this.activate(c);if(d=="icons"){this._destroyIcons(); +c&&this._createIcons()}if(d=="disabled")this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(d){if(!(this.options.disabled||d.altKey||d.ctrlKey)){var c=a.ui.keyCode,e=this.headers.length,h=this.headers.index(d.target),g=false;switch(d.keyCode){case c.RIGHT:case c.DOWN:g=this.headers[(h+1)%e];break;case c.LEFT:case c.UP:g=this.headers[(h-1+e)%e];break;case c.SPACE:case c.ENTER:this._clickHandler({target:d.target},d.target); +d.preventDefault()}if(g){a(d.target).attr("tabIndex",-1);a(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var d=this.options,c;if(d.fillSpace){if(a.browser.msie){var e=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height();a.browser.msie&&this.element.parent().css("overflow",e);this.headers.each(function(){c-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+ +a(this).height()))}).css("overflow","auto")}else if(d.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c)}return this},activate:function(d){this.options.active=d;d=this._findActive(d)[0];this._clickHandler({target:d},d);return this},_findActive:function(d){return d?typeof d==="number"?this.headers.filter(":eq("+d+")"):this.headers.not(this.headers.not(d)):d===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(d,c){var e=this.options; +if(!e.disabled)if(d.target){d=a(d.currentTarget||c);c=d[0]===this.active[0];e.active=e.collapsible&&c?false:this.headers.index(d);if(!(this.running||!e.collapsible&&c)){var h=this.active;f=d.next();i=this.active.next();b={options:e,newHeader:c&&e.collapsible?a([]):d,oldHeader:this.active,newContent:c&&e.collapsible?a([]):f,oldContent:i};var g=this.headers.index(this.active[0])>this.headers.index(d[0]);this.active=c?a([]):d;this._toggle(f,i,b,c,g);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header); +if(!c){d.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(e.icons.header).addClass(e.icons.headerSelected);d.next().addClass("ui-accordion-content-active")}}}else if(e.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);this.active.next().addClass("ui-accordion-content-active");var i=this.active.next(), +b={options:e,newHeader:a([]),oldHeader:e.active,newContent:a([]),oldContent:i},f=this.active=a([]);this._toggle(f,i,b)}},_toggle:function(d,c,e,h,g){var i=this,b=i.options;i.toShow=d;i.toHide=c;i.data=e;var f=function(){if(i)return i._completed.apply(i,arguments)};i._trigger("changestart",null,i.data);i.running=c.size()===0?d.size():c.size();if(b.animated){e={};e=b.collapsible&&h?{toShow:a([]),toHide:c,complete:f,down:g,autoHeight:b.autoHeight||b.fillSpace}:{toShow:d,toHide:c,complete:f,down:g,autoHeight:b.autoHeight|| +b.fillSpace};if(!b.proxied)b.proxied=b.animated;if(!b.proxiedDuration)b.proxiedDuration=b.duration;b.animated=a.isFunction(b.proxied)?b.proxied(e):b.proxied;b.duration=a.isFunction(b.proxiedDuration)?b.proxiedDuration(e):b.proxiedDuration;h=a.ui.accordion.animations;var j=b.duration,l=b.animated;if(l&&!h[l]&&!a.easing[l])l="slide";h[l]||(h[l]=function(o){this.slide(o,{easing:l,duration:j||700})});h[l](e)}else{if(b.collapsible&&h)d.toggle();else{c.hide();d.show()}f(true)}c.prev().attr({"aria-expanded":"false", +"aria-selected":"false",tabIndex:-1}).blur();d.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(d){this.running=d?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});a.extend(a.ui.accordion,{version:"1.8.16", +animations:{slide:function(d,c){d=a.extend({easing:"swing",duration:300},d,c);if(d.toHide.size())if(d.toShow.size()){var e=d.toShow.css("overflow"),h=0,g={},i={},b;c=d.toShow;b=c[0].style.width;c.width(parseInt(c.parent().width(),10)-parseInt(c.css("paddingLeft"),10)-parseInt(c.css("paddingRight"),10)-(parseInt(c.css("borderLeftWidth"),10)||0)-(parseInt(c.css("borderRightWidth"),10)||0));a.each(["height","paddingTop","paddingBottom"],function(f,j){i[j]="hide";f=(""+a.css(d.toShow[0],j)).match(/^([\d+-.]+)(.*)$/); +g[j]={value:f[1],unit:f[2]||"px"}});d.toShow.css({height:0,overflow:"hidden"}).show();d.toHide.filter(":hidden").each(d.complete).end().filter(":visible").animate(i,{step:function(f,j){if(j.prop=="height")h=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);d.toShow[0].style[j.prop]=h*g[j.prop].value+g[j.prop].unit},duration:d.duration,easing:d.easing,complete:function(){d.autoHeight||d.toShow.css("height","");d.toShow.css({width:b,overflow:e});d.complete()}})}else d.toHide.animate({height:"hide", +paddingTop:"hide",paddingBottom:"hide"},d);else d.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},d)},bounceslide:function(d){this.slide(d,{easing:d.down?"easeOutBounce":"swing",duration:d.down?1E3:200})}}})})(jQuery); +(function(a){var d=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var c=this,e=this.element[0].ownerDocument,h;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(g){if(!(c.options.disabled||c.element.propAttr("readOnly"))){h= +false;var i=a.ui.keyCode;switch(g.keyCode){case i.PAGE_UP:c._move("previousPage",g);break;case i.PAGE_DOWN:c._move("nextPage",g);break;case i.UP:c._move("previous",g);g.preventDefault();break;case i.DOWN:c._move("next",g);g.preventDefault();break;case i.ENTER:case i.NUMPAD_ENTER:if(c.menu.active){h=true;g.preventDefault()}case i.TAB:if(!c.menu.active)return;c.menu.select(g);break;case i.ESCAPE:c.element.val(c.term);c.close(g);break;default:clearTimeout(c.searching);c.searching=setTimeout(function(){if(c.term!= +c.element.val()){c.selectedItem=null;c.search(null,g)}},c.options.delay);break}}}).bind("keypress.autocomplete",function(g){if(h){h=false;g.preventDefault()}}).bind("focus.autocomplete",function(){if(!c.options.disabled){c.selectedItem=null;c.previous=c.element.val()}}).bind("blur.autocomplete",function(g){if(!c.options.disabled){clearTimeout(c.searching);c.closing=setTimeout(function(){c.close(g);c._change(g)},150)}});this._initSource();this.response=function(){return c._response.apply(c,arguments)}; +this.menu=a("
    ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",e)[0]).mousedown(function(g){var i=c.menu.element[0];a(g.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(b){b.target!==c.element[0]&&b.target!==i&&!a.ui.contains(i,b.target)&&c.close()})},1);setTimeout(function(){clearTimeout(c.closing)},13)}).menu({focus:function(g,i){i=i.item.data("item.autocomplete");false!==c._trigger("focus",g,{item:i})&&/^key/.test(g.originalEvent.type)&& +c.element.val(i.value)},selected:function(g,i){var b=i.item.data("item.autocomplete"),f=c.previous;if(c.element[0]!==e.activeElement){c.element.focus();c.previous=f;setTimeout(function(){c.previous=f;c.selectedItem=b},1)}false!==c._trigger("select",g,{item:b})&&c.element.val(b.value);c.term=c.element.val();c.close(g);c.selectedItem=b},blur:function(){c.menu.element.is(":visible")&&c.element.val()!==c.term&&c.element.val(c.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); +a.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();a.Widget.prototype.destroy.call(this)},_setOption:function(c,e){a.Widget.prototype._setOption.apply(this,arguments);c==="source"&&this._initSource();if(c==="appendTo")this.menu.element.appendTo(a(e||"body",this.element[0].ownerDocument)[0]);c==="disabled"&& +e&&this.xhr&&this.xhr.abort()},_initSource:function(){var c=this,e,h;if(a.isArray(this.options.source)){e=this.options.source;this.source=function(g,i){i(a.ui.autocomplete.filter(e,g.term))}}else if(typeof this.options.source==="string"){h=this.options.source;this.source=function(g,i){c.xhr&&c.xhr.abort();c.xhr=a.ajax({url:h,data:g,dataType:"json",autocompleteRequest:++d,success:function(b){this.autocompleteRequest===d&&i(b)},error:function(){this.autocompleteRequest===d&&i([])}})}}else this.source= +this.options.source},search:function(c,e){c=c!=null?c:this.element.val();this.term=this.element.val();if(c.length").data("item.autocomplete",e).append(a("").text(e.label)).appendTo(c)},_move:function(c,e){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate()}else this.menu[c](e);else this.search(null,e)},widget:function(){return this.menu.element}});a.extend(a.ui.autocomplete,{escapeRegex:function(c){return c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, +"\\$&")},filter:function(c,e){var h=new RegExp(a.ui.autocomplete.escapeRegex(e),"i");return a.grep(c,function(g){return h.test(g.label||g.value||g)})}})})(jQuery); +(function(a){a.widget("ui.menu",{_create:function(){var d=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(a(c.target).closest(".ui-menu-item a").length){c.preventDefault();d.select(c)}});this.refresh()},refresh:function(){var d=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(c){d.activate(c,a(this).parent())}).mouseleave(function(){d.deactivate()})},activate:function(d,c){this.deactivate();if(this.hasScroll()){var e=c.offset().top-this.element.offset().top,h=this.element.scrollTop(),g=this.element.height();if(e<0)this.element.scrollTop(h+e);else e>=g&&this.element.scrollTop(h+e-g+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",d,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); +this._trigger("blur");this.active=null}},next:function(d){this.move("next",".ui-menu-item:first",d)},previous:function(d){this.move("prev",".ui-menu-item:last",d)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(d,c,e){if(this.active){d=this.active[d+"All"](".ui-menu-item").eq(0);d.length?this.activate(e,d):this.activate(e,this.element.children(c))}else this.activate(e, +this.element.children(c))},nextPage:function(d){if(this.hasScroll())if(!this.active||this.last())this.activate(d,this.element.children(".ui-menu-item:first"));else{var c=this.active.offset().top,e=this.element.height(),h=this.element.children(".ui-menu-item").filter(function(){var g=a(this).offset().top-c-e+a(this).height();return g<10&&g>-10});h.length||(h=this.element.children(".ui-menu-item:last"));this.activate(d,h)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active|| +this.last()?":first":":last"))},previousPage:function(d){if(this.hasScroll())if(!this.active||this.first())this.activate(d,this.element.children(".ui-menu-item:last"));else{var c=this.active.offset().top,e=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var h=a(this).offset().top-c+e-a(this).height();return h<10&&h>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(d,result)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active|| +this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),j=this.options.icons,l=j.primary&&j.secondary,o=[];if(j.primary||j.secondary){if(this.options.text)o.push("ui-button-text-icon"+(l?"s":j.primary?"-primary":"-secondary"));j.primary&&b.prepend("");j.secondary&&b.append("");if(!this.options.text){o.push(l?"ui-button-icons-only": +"ui-button-icon-only");this.hasTitle||b.attr("title",f)}}else o.push("ui-button-text-only");b.addClass(o.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,f){b==="disabled"&&this.buttons.button("option",b,f);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")=== +"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(b?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); +a.Widget.prototype.destroy.call(this)}})})(jQuery); +(function(a,d){function c(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= +"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", +"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", +minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};a.extend(this._defaults,this.regional[""]);this.dpDiv=e(a('
    '))}function e(b){return b.bind("mouseout", +function(f){f=a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");f.length&&f.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(f){f=a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(a.datepicker._isDisabledDatepicker(i.inline?b.parent()[0]:i.input[0])||!f.length)){f.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); +f.addClass("ui-state-hover");f.hasClass("ui-datepicker-prev")&&f.addClass("ui-datepicker-prev-hover");f.hasClass("ui-datepicker-next")&&f.addClass("ui-datepicker-next-hover")}})}function h(b,f){a.extend(b,f);for(var j in f)if(f[j]==null||f[j]==d)b[j]=f[j];return b}a.extend(a.ui,{datepicker:{version:"1.8.16"}});var g=(new Date).getTime(),i;a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, +setDefaults:function(b){h(this._defaults,b||{});return this},_attachDatepicker:function(b,f){var j=null;for(var l in this._defaults){var o=b.getAttribute("date:"+l);if(o){j=j||{};try{j[l]=eval(o)}catch(n){j[l]=o}}}l=b.nodeName.toLowerCase();o=l=="div"||l=="span";if(!b.id){this.uuid+=1;b.id="dp"+this.uuid}var k=this._newInst(a(b),o);k.settings=a.extend({},f||{},j||{});if(l=="input")this._connectDatepicker(b,k);else o&&this._inlineDatepicker(b,k)},_newInst:function(b,f){return{id:b[0].id.replace(/([^A-Za-z0-9_-])/g, +"\\\\$1"),input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:f,dpDiv:!f?this.dpDiv:e(a('
    '))}},_connectDatepicker:function(b,f){var j=a(b);f.append=a([]);f.trigger=a([]);if(!j.hasClass(this.markerClassName)){this._attachments(j,f);j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", +function(l,o,n){f.settings[o]=n}).bind("getData.datepicker",function(l,o){return this._get(f,o)});this._autoSize(f);a.data(b,"datepicker",f);f.settings.disabled&&this._disableDatepicker(b)}},_attachments:function(b,f){var j=this._get(f,"appendText"),l=this._get(f,"isRTL");f.append&&f.append.remove();if(j){f.append=a(''+j+"");b[l?"before":"after"](f.append)}b.unbind("focus",this._showDatepicker);f.trigger&&f.trigger.remove();j=this._get(f,"showOn");if(j== +"focus"||j=="both")b.focus(this._showDatepicker);if(j=="button"||j=="both"){j=this._get(f,"buttonText");var o=this._get(f,"buttonImage");f.trigger=a(this._get(f,"buttonImageOnly")?a("").addClass(this._triggerClass).attr({src:o,alt:j,title:j}):a('').addClass(this._triggerClass).html(o==""?j:a("").attr({src:o,alt:j,title:j})));b[l?"before":"after"](f.trigger);f.trigger.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==b[0]?a.datepicker._hideDatepicker(): +a.datepicker._showDatepicker(b[0]);return false})}},_autoSize:function(b){if(this._get(b,"autoSize")&&!b.inline){var f=new Date(2009,11,20),j=this._get(b,"dateFormat");if(j.match(/[DM]/)){var l=function(o){for(var n=0,k=0,m=0;mn){n=o[m].length;k=m}return k};f.setMonth(l(this._get(b,j.match(/MM/)?"monthNames":"monthNamesShort")));f.setDate(l(this._get(b,j.match(/DD/)?"dayNames":"dayNamesShort"))+20-f.getDay())}b.input.attr("size",this._formatDate(b,f).length)}},_inlineDatepicker:function(b, +f){var j=a(b);if(!j.hasClass(this.markerClassName)){j.addClass(this.markerClassName).append(f.dpDiv).bind("setData.datepicker",function(l,o,n){f.settings[o]=n}).bind("getData.datepicker",function(l,o){return this._get(f,o)});a.data(b,"datepicker",f);this._setDate(f,this._getDefaultDate(f),true);this._updateDatepicker(f);this._updateAlternate(f);f.settings.disabled&&this._disableDatepicker(b);f.dpDiv.css("display","block")}},_dialogDatepicker:function(b,f,j,l,o){b=this._dialogInst;if(!b){this.uuid+= +1;this._dialogInput=a('');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);b=this._dialogInst=this._newInst(this._dialogInput,false);b.settings={};a.data(this._dialogInput[0],"datepicker",b)}h(b.settings,l||{});f=f&&f.constructor==Date?this._formatDate(b,f):f;this._dialogInput.val(f);this._pos=o?o.length?o:[o.pageX,o.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ +2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");b.settings.onSelect=j;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",b);return this},_destroyDatepicker:function(b){var f= +a(b),j=a.data(b,"datepicker");if(f.hasClass(this.markerClassName)){var l=b.nodeName.toLowerCase();a.removeData(b,"datepicker");if(l=="input"){j.append.remove();j.trigger.remove();f.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(l=="div"||l=="span")f.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(b){var f=a(b),j=a.data(b,"datepicker");if(f.hasClass(this.markerClassName)){var l= +b.nodeName.toLowerCase();if(l=="input"){b.disabled=false;j.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(l=="div"||l=="span"){f=f.children("."+this._inlineClass);f.children().removeClass("ui-state-disabled");f.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=a.map(this._disabledInputs,function(o){return o==b?null:o})}},_disableDatepicker:function(b){var f=a(b),j=a.data(b, +"datepicker");if(f.hasClass(this.markerClassName)){var l=b.nodeName.toLowerCase();if(l=="input"){b.disabled=true;j.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(l=="div"||l=="span"){f=f.children("."+this._inlineClass);f.children().addClass("ui-state-disabled");f.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=a.map(this._disabledInputs,function(o){return o== +b?null:o});this._disabledInputs[this._disabledInputs.length]=b}},_isDisabledDatepicker:function(b){if(!b)return false;for(var f=0;f-1}},_doKeyUp:function(b){b=a.datepicker._getInst(b.target);if(b.input.val()!=b.lastVal)try{if(a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,a.datepicker._getFormatConfig(b))){a.datepicker._setDateFromField(b);a.datepicker._updateAlternate(b);a.datepicker._updateDatepicker(b)}}catch(f){a.datepicker.log(f)}return true},_showDatepicker:function(b){b=b.target||b;if(b.nodeName.toLowerCase()!="input")b=a("input", +b.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(b)||a.datepicker._lastInput==b)){var f=a.datepicker._getInst(b);if(a.datepicker._curInst&&a.datepicker._curInst!=f){a.datepicker._datepickerShowing&&a.datepicker._triggerOnClose(a.datepicker._curInst);a.datepicker._curInst.dpDiv.stop(true,true)}var j=a.datepicker._get(f,"beforeShow");j=j?j.apply(b,[b,f]):{};if(j!==false){h(f.settings,j);f.lastVal=null;a.datepicker._lastInput=b;a.datepicker._setDateFromField(f);if(a.datepicker._inDialog)b.value= +"";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(b);a.datepicker._pos[1]+=b.offsetHeight}var l=false;a(b).parents().each(function(){l|=a(this).css("position")=="fixed";return!l});if(l&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}j={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;f.dpDiv.empty();f.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(f); +j=a.datepicker._checkOffset(f,j,l);f.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":l?"fixed":"absolute",display:"none",left:j.left+"px",top:j.top+"px"});if(!f.inline){j=a.datepicker._get(f,"showAnim");var o=a.datepicker._get(f,"duration"),n=function(){var k=f.dpDiv.find("iframe.ui-datepicker-cover");if(k.length){var m=a.datepicker._getBorders(f.dpDiv);k.css({left:-m[0],top:-m[1],width:f.dpDiv.outerWidth(),height:f.dpDiv.outerHeight()})}};f.dpDiv.zIndex(a(b).zIndex()+1);a.datepicker._datepickerShowing= +true;a.effects&&a.effects[j]?f.dpDiv.show(j,a.datepicker._get(f,"showOptions"),o,n):f.dpDiv[j||"show"](j?o:null,n);if(!j||!o)n();f.input.is(":visible")&&!f.input.is(":disabled")&&f.input.focus();a.datepicker._curInst=f}}}},_updateDatepicker:function(b){this.maxRows=4;var f=a.datepicker._getBorders(b.dpDiv);i=b;b.dpDiv.empty().append(this._generateHTML(b));var j=b.dpDiv.find("iframe.ui-datepicker-cover");j.length&&j.css({left:-f[0],top:-f[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()}); +b.dpDiv.find("."+this._dayOverClass+" a").mouseover();f=this._getNumberOfMonths(b);j=f[1];b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");j>1&&b.dpDiv.addClass("ui-datepicker-multi-"+j).css("width",17*j+"em");b.dpDiv[(f[0]!=1||f[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");b.dpDiv[(this._get(b,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");b==a.datepicker._curInst&&a.datepicker._datepickerShowing&&b.input&&b.input.is(":visible")&& +!b.input.is(":disabled")&&b.input[0]!=document.activeElement&&b.input.focus();if(b.yearshtml){var l=b.yearshtml;setTimeout(function(){l===b.yearshtml&&b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml);l=b.yearshtml=null},0)}},_getBorders:function(b){var f=function(j){return{thin:1,medium:2,thick:3}[j]||j};return[parseFloat(f(b.css("border-left-width"))),parseFloat(f(b.css("border-top-width")))]},_checkOffset:function(b,f,j){var l=b.dpDiv.outerWidth(),o=b.dpDiv.outerHeight(), +n=b.input?b.input.outerWidth():0,k=b.input?b.input.outerHeight():0,m=document.documentElement.clientWidth+a(document).scrollLeft(),p=document.documentElement.clientHeight+a(document).scrollTop();f.left-=this._get(b,"isRTL")?l-n:0;f.left-=j&&f.left==b.input.offset().left?a(document).scrollLeft():0;f.top-=j&&f.top==b.input.offset().top+k?a(document).scrollTop():0;f.left-=Math.min(f.left,f.left+l>m&&m>l?Math.abs(f.left+l-m):0);f.top-=Math.min(f.top,f.top+o>p&&p>o?Math.abs(o+k):0);return f},_findPos:function(b){for(var f= +this._get(this._getInst(b),"isRTL");b&&(b.type=="hidden"||b.nodeType!=1||a.expr.filters.hidden(b));)b=b[f?"previousSibling":"nextSibling"];b=a(b).offset();return[b.left,b.top]},_triggerOnClose:function(b){var f=this._get(b,"onClose");if(f)f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b])},_hideDatepicker:function(b){var f=this._curInst;if(!(!f||b&&f!=a.data(b,"datepicker")))if(this._datepickerShowing){b=this._get(f,"showAnim");var j=this._get(f,"duration"),l=function(){a.datepicker._tidyDialog(f); +this._curInst=null};a.effects&&a.effects[b]?f.dpDiv.hide(b,a.datepicker._get(f,"showOptions"),j,l):f.dpDiv[b=="slideDown"?"slideUp":b=="fadeIn"?"fadeOut":"hide"](b?j:null,l);b||l();a.datepicker._triggerOnClose(f);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(b){b.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(b){if(a.datepicker._curInst){b=a(b.target);b[0].id!=a.datepicker._mainDivId&&b.parents("#"+a.datepicker._mainDivId).length==0&&!b.hasClass(a.datepicker.markerClassName)&&!b.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)&&a.datepicker._hideDatepicker()}},_adjustDate:function(b,f,j){b=a(b);var l=this._getInst(b[0]);if(!this._isDisabledDatepicker(b[0])){this._adjustInstDate(l,f+(j=="M"?this._get(l,"showCurrentAtPos"): +0),j);this._updateDatepicker(l)}},_gotoToday:function(b){b=a(b);var f=this._getInst(b[0]);if(this._get(f,"gotoCurrent")&&f.currentDay){f.selectedDay=f.currentDay;f.drawMonth=f.selectedMonth=f.currentMonth;f.drawYear=f.selectedYear=f.currentYear}else{var j=new Date;f.selectedDay=j.getDate();f.drawMonth=f.selectedMonth=j.getMonth();f.drawYear=f.selectedYear=j.getFullYear()}this._notifyChange(f);this._adjustDate(b)},_selectMonthYear:function(b,f,j){b=a(b);var l=this._getInst(b[0]);l["selected"+(j=="M"? +"Month":"Year")]=l["draw"+(j=="M"?"Month":"Year")]=parseInt(f.options[f.selectedIndex].value,10);this._notifyChange(l);this._adjustDate(b)},_selectDay:function(b,f,j,l){var o=a(b);if(!(a(l).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0]))){o=this._getInst(o[0]);o.selectedDay=o.currentDay=a("a",l).html();o.selectedMonth=o.currentMonth=f;o.selectedYear=o.currentYear=j;this._selectDate(b,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear))}},_clearDate:function(b){b=a(b); +this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(b,f){b=this._getInst(a(b)[0]);f=f!=null?f:this._formatDate(b);b.input&&b.input.val(f);this._updateAlternate(b);var j=this._get(b,"onSelect");if(j)j.apply(b.input?b.input[0]:null,[f,b]);else b.input&&b.input.trigger("change");if(b.inline)this._updateDatepicker(b);else{this._hideDatepicker();this._lastInput=b.input[0];typeof b.input[0]!="object"&&b.input.focus();this._lastInput=null}},_updateAlternate:function(b){var f=this._get(b,"altField"); +if(f){var j=this._get(b,"altFormat")||this._get(b,"dateFormat"),l=this._getDate(b),o=this.formatDate(j,l,this._getFormatConfig(b));a(f).each(function(){a(this).val(o)})}},noWeekends:function(b){b=b.getDay();return[b>0&&b<6,""]},iso8601Week:function(b){b=new Date(b.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var f=b.getTime();b.setMonth(0);b.setDate(1);return Math.floor(Math.round((f-b)/864E5)/7)+1},parseDate:function(b,f,j){if(b==null||f==null)throw"Invalid arguments";f=typeof f=="object"? +f.toString():f+"";if(f=="")return null;var l=(j?j.shortYearCutoff:null)||this._defaults.shortYearCutoff;l=typeof l!="string"?l:(new Date).getFullYear()%100+parseInt(l,10);for(var o=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,n=(j?j.dayNames:null)||this._defaults.dayNames,k=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort,m=(j?j.monthNames:null)||this._defaults.monthNames,p=j=-1,q=-1,s=-1,r=false,u=function(z){(z=H+1-1){p=1;q=s;do{l=this._getDaysInMonth(j,p-1);if(q<=l)break;p++;q-=l}while(1)}C=this._daylightSavingAdjust(new Date(j,p-1,q));if(C.getFullYear()!=j||C.getMonth()+1!=p||C.getDate()!=q)throw"Invalid date";return C},ATOM:"yy-mm-dd", +COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(b,f,j){if(!f)return"";var l=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,o=(j?j.dayNames:null)||this._defaults.dayNames,n=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames: +null)||this._defaults.monthNames;var k=function(u){(u=r+1 +12?b.getHours()+2:0);return b},_setDate:function(b,f,j){var l=!f,o=b.selectedMonth,n=b.selectedYear;f=this._restrictMinMax(b,this._determineDate(b,f,new Date));b.selectedDay=b.currentDay=f.getDate();b.drawMonth=b.selectedMonth=b.currentMonth=f.getMonth();b.drawYear=b.selectedYear=b.currentYear=f.getFullYear();if((o!=b.selectedMonth||n!=b.selectedYear)&&!j)this._notifyChange(b);this._adjustInstDate(b);if(b.input)b.input.val(l?"":this._formatDate(b))},_getDate:function(b){return!b.currentYear||b.input&& +b.input.val()==""?null:this._daylightSavingAdjust(new Date(b.currentYear,b.currentMonth,b.currentDay))},_generateHTML:function(b){var f=new Date;f=this._daylightSavingAdjust(new Date(f.getFullYear(),f.getMonth(),f.getDate()));var j=this._get(b,"isRTL"),l=this._get(b,"showButtonPanel"),o=this._get(b,"hideIfNoPrevNext"),n=this._get(b,"navigationAsDateFormat"),k=this._getNumberOfMonths(b),m=this._get(b,"showCurrentAtPos"),p=this._get(b,"stepMonths"),q=k[0]!=1||k[1]!=1,s=this._daylightSavingAdjust(!b.currentDay? +new Date(9999,9,9):new Date(b.currentYear,b.currentMonth,b.currentDay)),r=this._getMinMaxDate(b,"min"),u=this._getMinMaxDate(b,"max");m=b.drawMonth-m;var v=b.drawYear;if(m<0){m+=12;v--}if(u){var w=this._daylightSavingAdjust(new Date(u.getFullYear(),u.getMonth()-k[0]*k[1]+1,u.getDate()));for(w=r&&ww;){m--;if(m<0){m=11;v--}}}b.drawMonth=m;b.drawYear=v;w=this._get(b,"prevText");w=!n?w:this.formatDate(w,this._daylightSavingAdjust(new Date(v,m-p,1)),this._getFormatConfig(b)); +w=this._canAdjustMonth(b,-1,v,m)?''+w+"":o?"":''+w+"";var x=this._get(b,"nextText");x=!n?x:this.formatDate(x,this._daylightSavingAdjust(new Date(v, +m+p,1)),this._getFormatConfig(b));o=this._canAdjustMonth(b,+1,v,m)?''+x+"":o?"":''+x+"";p=this._get(b,"currentText");x=this._get(b,"gotoCurrent")&& +b.currentDay?s:f;p=!n?p:this.formatDate(p,x,this._getFormatConfig(b));n=!b.inline?'":"";l=l?'
    '+(j?n:"")+(this._isInRange(b,x)?'":"")+(j?"":n)+"
    ":"";n=parseInt(this._get(b,"firstDay"),10);n=isNaN(n)?0:n;p=this._get(b,"showWeek");x=this._get(b,"dayNames");this._get(b,"dayNamesShort");var y=this._get(b,"dayNamesMin"),H=this._get(b,"monthNames"),C=this._get(b,"monthNamesShort"),z=this._get(b,"beforeShowDay"),I=this._get(b,"showOtherMonths"),N=this._get(b,"selectOtherMonths");this._get(b,"calculateWeek");for(var J=this._getDefaultDate(b),D="",E=0;E1)switch(L){case 0:F+=" ui-datepicker-group-first";B=" ui-corner-"+(j?"right":"left");break;case k[1]-1:F+=" ui-datepicker-group-last";B=" ui-corner-"+(j?"left":"right");break;default:F+=" ui-datepicker-group-middle";B="";break}F+='">'}F+='
    '+(/all|left/.test(B)&& +E==0?j?o:w:"")+(/all|right/.test(B)&&E==0?j?w:o:"")+this._generateMonthYearHeader(b,m,v,r,u,E>0||L>0,H,C)+'
    ';var G=p?'":"";for(B=0;B<7;B++){var A=(B+n)%7;G+="=5?' class="ui-datepicker-week-end"':"")+'>'+y[A]+""}F+=G+"";G=this._getDaysInMonth(v,m);if(v==b.selectedYear&&m==b.selectedMonth)b.selectedDay=Math.min(b.selectedDay, +G);B=(this._getFirstDayOfMonth(v,m)-n+7)%7;G=Math.ceil((B+G)/7);this.maxRows=G=q?this.maxRows>G?this.maxRows:G:G;A=this._daylightSavingAdjust(new Date(v,m,1-B));for(var R=0;R";var S=!p?"":'";for(B=0;B<7;B++){var M=z?z.apply(b.input?b.input[0]:null,[A]):[true,""],K=A.getMonth()!=m,O=K&&!N||!M[0]||r&&Au;S+='";A.setDate(A.getDate()+1);A=this._daylightSavingAdjust(A)}F+=S+""}m++;if(m>11){m=0;v++}F+="
    '+this._get(b,"weekHeader")+"
    '+this._get(b,"calculateWeek")(A)+""+(K&&!I?" ":O?''+ +A.getDate()+"":''+A.getDate()+"")+"
    "+(q?""+(k[0]>0&&L==k[1]-1?'
    ':""):"");P+=F}D+=P}D+=l+(a.browser.msie&&parseInt(a.browser.version,10)<7&&!b.inline?'': +"");b._keyEvent=false;return D},_generateMonthYearHeader:function(b,f,j,l,o,n,k,m){var p=this._get(b,"changeMonth"),q=this._get(b,"changeYear"),s=this._get(b,"showMonthAfterYear"),r='
    ',u="";if(n||!p)u+=''+k[f]+"";else{k=l&&l.getFullYear()==j;var v=o&&o.getFullYear()==j;u+='"}s||(r+=u+(n||!(p&&q)?" ":""));if(!b.yearshtml){b.yearshtml="";if(n||!q)r+=''+j+"";else{m=this._get(b,"yearRange").split(":");var x=(new Date).getFullYear();k=function(y){y=y.match(/c[+-].*/)?j+parseInt(y.substring(1),10):y.match(/[+-].*/)?x+parseInt(y,10):parseInt(y,10);return isNaN(y)?x:y};f=k(m[0]);m=Math.max(f,k(m[1]||""));f=l?Math.max(f, +l.getFullYear()):f;m=o?Math.min(m,o.getFullYear()):m;for(b.yearshtml+='";r+=b.yearshtml;b.yearshtml=null}}r+=this._get(b,"yearSuffix");if(s)r+=(n||!(p&&q)?" ":"")+u;r+="
    ";return r},_adjustInstDate:function(b,f,j){var l=b.drawYear+(j=="Y"?f:0),o=b.drawMonth+ +(j=="M"?f:0);f=Math.min(b.selectedDay,this._getDaysInMonth(l,o))+(j=="D"?f:0);l=this._restrictMinMax(b,this._daylightSavingAdjust(new Date(l,o,f)));b.selectedDay=l.getDate();b.drawMonth=b.selectedMonth=l.getMonth();b.drawYear=b.selectedYear=l.getFullYear();if(j=="M"||j=="Y")this._notifyChange(b)},_restrictMinMax:function(b,f){var j=this._getMinMaxDate(b,"min");b=this._getMinMaxDate(b,"max");f=j&&fb?b:f},_notifyChange:function(b){var f=this._get(b,"onChangeMonthYear");if(f)f.apply(b.input? +b.input[0]:null,[b.selectedYear,b.selectedMonth+1,b])},_getNumberOfMonths:function(b){b=this._get(b,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(b,f){return this._determineDate(b,this._get(b,f+"Date"),null)},_getDaysInMonth:function(b,f){return 32-this._daylightSavingAdjust(new Date(b,f,32)).getDate()},_getFirstDayOfMonth:function(b,f){return(new Date(b,f,1)).getDay()},_canAdjustMonth:function(b,f,j,l){var o=this._getNumberOfMonths(b);j=this._daylightSavingAdjust(new Date(j, +l+(f<0?f:o[0]*o[1]),1));f<0&&j.setDate(this._getDaysInMonth(j.getFullYear(),j.getMonth()));return this._isInRange(b,j)},_isInRange:function(b,f){var j=this._getMinMaxDate(b,"min");b=this._getMinMaxDate(b,"max");return(!j||f.getTime()>=j.getTime())&&(!b||f.getTime()<=b.getTime())},_getFormatConfig:function(b){var f=this._get(b,"shortYearCutoff");f=typeof f!="string"?f:(new Date).getFullYear()%100+parseInt(f,10);return{shortYearCutoff:f,dayNamesShort:this._get(b,"dayNamesShort"),dayNames:this._get(b, +"dayNames"),monthNamesShort:this._get(b,"monthNamesShort"),monthNames:this._get(b,"monthNames")}},_formatDate:function(b,f,j,l){if(!f){b.currentDay=b.selectedDay;b.currentMonth=b.selectedMonth;b.currentYear=b.selectedYear}f=f?typeof f=="object"?f:this._daylightSavingAdjust(new Date(l,j,f)):this._daylightSavingAdjust(new Date(b.currentYear,b.currentMonth,b.currentDay));return this.formatDate(this._get(b,"dateFormat"),f,this._getFormatConfig(b))}});a.fn.datepicker=function(b){if(!this.length)return this; +if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv);a.datepicker.initialized=true}var f=Array.prototype.slice.call(arguments,1);if(typeof b=="string"&&(b=="isDisabled"||b=="getDate"||b=="widget"))return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(f));if(b=="option"&&arguments.length==2&&typeof arguments[1]=="string")return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(f));return this.each(function(){typeof b== +"string"?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this].concat(f)):a.datepicker._attachDatepicker(this,b)})};a.datepicker=new c;a.datepicker.initialized=false;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.16";window["DP_jQuery_"+g]=a})(jQuery); +(function(a,d){var c={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},e={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},h=a.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};a.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, +position:{my:"center",at:"center",collision:"fit",using:function(g){var i=a(this).css(g).offset().top;i<0&&a(this).css("top",g.top-i)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var g=this,i=g.options,b=i.title||" ",f=a.ui.dialog.getTitleId(g.element),j=(g.uiDialog=a("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ +i.dialogClass).css({zIndex:i.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){if(i.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===a.ui.keyCode.ESCAPE){g.close(n);n.preventDefault()}}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(n){g.moveToTop(false,n)});g.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j);var l=(g.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j), +o=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){o.addClass("ui-state-hover")},function(){o.removeClass("ui-state-hover")}).focus(function(){o.addClass("ui-state-focus")}).blur(function(){o.removeClass("ui-state-focus")}).click(function(n){g.close(n);return false}).appendTo(l);(g.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(o);a("").addClass("ui-dialog-title").attr("id", +f).html(b).prependTo(l);if(a.isFunction(i.beforeclose)&&!a.isFunction(i.beforeClose))i.beforeClose=i.beforeclose;l.find("*").add(l).disableSelection();i.draggable&&a.fn.draggable&&g._makeDraggable();i.resizable&&a.fn.resizable&&g._makeResizable();g._createButtons(i.buttons);g._isOpen=false;a.fn.bgiframe&&j.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var g=this;g.overlay&&g.overlay.destroy();g.uiDialog.hide();g.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); +g.uiDialog.remove();g.originalTitle&&g.element.attr("title",g.originalTitle);return g},widget:function(){return this.uiDialog},close:function(g){var i=this,b,f;if(false!==i._trigger("beforeClose",g)){i.overlay&&i.overlay.destroy();i.uiDialog.unbind("keypress.ui-dialog");i._isOpen=false;if(i.options.hide)i.uiDialog.hide(i.options.hide,function(){i._trigger("close",g)});else{i.uiDialog.hide();i._trigger("close",g)}a.ui.dialog.overlay.resize();if(i.options.modal){b=0;a(".ui-dialog").each(function(){if(this!== +i.uiDialog[0]){f=a(this).css("z-index");isNaN(f)||(b=Math.max(b,f))}});a.ui.dialog.maxZ=b}return i}},isOpen:function(){return this._isOpen},moveToTop:function(g,i){var b=this,f=b.options;if(f.modal&&!g||!f.stack&&!f.modal)return b._trigger("focus",i);if(f.zIndex>a.ui.dialog.maxZ)a.ui.dialog.maxZ=f.zIndex;if(b.overlay){a.ui.dialog.maxZ+=1;b.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)}g={scrollTop:b.element.scrollTop(),scrollLeft:b.element.scrollLeft()};a.ui.dialog.maxZ+=1; +b.uiDialog.css("z-index",a.ui.dialog.maxZ);b.element.attr(g);b._trigger("focus",i);return b},open:function(){if(!this._isOpen){var g=this,i=g.options,b=g.uiDialog;g.overlay=i.modal?new a.ui.dialog.overlay(g):null;g._size();g._position(i.position);b.show(i.show);g.moveToTop(true);i.modal&&b.bind("keypress.ui-dialog",function(f){if(f.keyCode===a.ui.keyCode.TAB){var j=a(":tabbable",this),l=j.filter(":first");j=j.filter(":last");if(f.target===j[0]&&!f.shiftKey){l.focus(1);return false}else if(f.target=== +l[0]&&f.shiftKey){j.focus(1);return false}}});a(g.element.find(":tabbable").get().concat(b.find(".ui-dialog-buttonpane :tabbable").get().concat(b.get()))).eq(0).focus();g._isOpen=true;g._trigger("open");return g}},_createButtons:function(g){var i=this,b=false,f=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),j=a("
    ").addClass("ui-dialog-buttonset").appendTo(f);i.uiDialog.find(".ui-dialog-buttonpane").remove();typeof g==="object"&&g!==null&&a.each(g, +function(){return!(b=true)});if(b){a.each(g,function(l,o){o=a.isFunction(o)?{click:o,text:l}:o;var n=a('').click(function(){o.click.apply(i.element[0],arguments)}).appendTo(j);a.each(o,function(k,m){if(k!=="click")k in h?n[k](m):n.attr(k,m)});a.fn.button&&n.button()});f.appendTo(i.uiDialog)}},_makeDraggable:function(){function g(l){return{position:l.position,offset:l.offset}}var i=this,b=i.options,f=a(document),j;i.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", +handle:".ui-dialog-titlebar",containment:"document",start:function(l,o){j=b.height==="auto"?"auto":a(this).height();a(this).height(a(this).height()).addClass("ui-dialog-dragging");i._trigger("dragStart",l,g(o))},drag:function(l,o){i._trigger("drag",l,g(o))},stop:function(l,o){b.position=[o.position.left-f.scrollLeft(),o.position.top-f.scrollTop()];a(this).removeClass("ui-dialog-dragging").height(j);i._trigger("dragStop",l,g(o));a.ui.dialog.overlay.resize()}})},_makeResizable:function(g){function i(l){return{originalPosition:l.originalPosition, +originalSize:l.originalSize,position:l.position,size:l.size}}g=g===d?this.options.resizable:g;var b=this,f=b.options,j=b.uiDialog.css("position");g=typeof g==="string"?g:"n,e,s,w,se,sw,ne,nw";b.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:b.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:b._minHeight(),handles:g,start:function(l,o){a(this).addClass("ui-dialog-resizing");b._trigger("resizeStart",l,i(o))},resize:function(l,o){b._trigger("resize", +l,i(o))},stop:function(l,o){a(this).removeClass("ui-dialog-resizing");f.height=a(this).height();f.width=a(this).width();b._trigger("resizeStop",l,i(o));a.ui.dialog.overlay.resize()}}).css("position",j).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;return g.height==="auto"?g.minHeight:Math.min(g.minHeight,g.height)},_position:function(g){var i=[],b=[0,0],f;if(g){if(typeof g==="string"||typeof g==="object"&&"0"in g){i=g.split?g.split(" "): +[g[0],g[1]];if(i.length===1)i[1]=i[0];a.each(["left","top"],function(j,l){if(+i[j]===i[j]){b[j]=i[j];i[j]=l}});g={my:i.join(" "),at:i.join(" "),offset:b.join(" ")}}g=a.extend({},a.ui.dialog.prototype.options.position,g)}else g=a.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},g));f||this.uiDialog.hide()},_setOptions:function(g){var i=this,b={},f=false;a.each(g,function(j,l){i._setOption(j,l); +if(j in c)f=true;if(j in e)b[j]=l});f&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",b)},_setOption:function(g,i){var b=this,f=b.uiDialog;switch(g){case "beforeclose":g="beforeClose";break;case "buttons":b._createButtons(i);break;case "closeText":b.uiDialogTitlebarCloseText.text(""+i);break;case "dialogClass":f.removeClass(b.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+i);break;case "disabled":i?f.addClass("ui-dialog-disabled"): +f.removeClass("ui-dialog-disabled");break;case "draggable":var j=f.is(":data(draggable)");j&&!i&&f.draggable("destroy");!j&&i&&b._makeDraggable();break;case "position":b._position(i);break;case "resizable":(j=f.is(":data(resizable)"))&&!i&&f.resizable("destroy");j&&typeof i==="string"&&f.resizable("option","handles",i);!j&&i!==false&&b._makeResizable(i);break;case "title":a(".ui-dialog-title",b.uiDialogTitlebar).html(""+(i||" "));break}a.Widget.prototype._setOption.apply(b,arguments)},_size:function(){var g= +this.options,i,b,f=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(g.minWidth>g.width)g.width=g.minWidth;i=this.uiDialog.css({height:"auto",width:g.width}).height();b=Math.max(0,g.minHeight-i);if(g.height==="auto")if(a.support.minHeight)this.element.css({minHeight:b,height:"auto"});else{this.uiDialog.show();g=this.element.css("height","auto").height();f||this.uiDialog.hide();this.element.height(Math.max(g,b))}else this.element.height(Math.max(g.height- +i,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});a.extend(a.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(g){g=g.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(g){this.$el=a.ui.dialog.overlay.create(g)}});a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "), +create:function(g){if(this.instances.length===0){setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&i.bgiframe();this.instances.push(i);return i},destroy:function(g){var i=a.inArray(g,this.instances);i!=-1&&this.oldInstances.push(this.instances.splice(i,1)[0]);this.instances.length===0&&a([document,window]).unbind(".dialog-overlay");g.remove();var b=0;a.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var g,i;if(a.browser.msie&& +a.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);i=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g0?g.left-b:Math.max(g.left-i.collisionPosition.left,g.left)},top:function(g,i){var b=a(window);b=i.collisionPosition.top+i.collisionHeight-b.height()-b.scrollTop();g.top=b>0?g.top-b:Math.max(g.top-i.collisionPosition.top,g.top)}},flip:{left:function(g,i){if(i.at[0]!=="center"){var b=a(window);b=i.collisionPosition.left+i.collisionWidth-b.width()-b.scrollLeft();var f=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,j=i.at[0]==="left"?i.targetWidth:-i.targetWidth,l=-2*i.offset[0];g.left+= +i.collisionPosition.left<0?f+j+l:b>0?f+j+l:0}},top:function(g,i){if(i.at[1]!=="center"){var b=a(window);b=i.collisionPosition.top+i.collisionHeight-b.height()-b.scrollTop();var f=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,j=i.at[1]==="top"?i.targetHeight:-i.targetHeight,l=-2*i.offset[1];g.top+=i.collisionPosition.top<0?f+j+l:b>0?f+j+l:0}}}};if(!a.offset.setOffset){a.offset.setOffset=function(g,i){if(/static/.test(a.curCSS(g,"position")))g.style.position="relative";var b=a(g), +f=b.offset(),j=parseInt(a.curCSS(g,"top",true),10)||0,l=parseInt(a.curCSS(g,"left",true),10)||0;f={top:i.top-f.top+j,left:i.left-f.left+l};"using"in i?i.using.call(g,f):b.css(f)};a.fn.offset=function(g){var i=this[0];if(!i||!i.ownerDocument)return null;if(g)return this.each(function(){a.offset.setOffset(this,g)});return h.call(this)}}})(jQuery); +(function(a,d){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=a("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();a.Widget.prototype.destroy.apply(this,arguments)},value:function(c){if(c===d)return this._value();this._setOption("value",c);return this},_setOption:function(c,e){if(c==="value"){this.options.value=e;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number")c=0;return Math.min(this.options.max,Math.max(this.min,c))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var c=this.value(),e=this._percentage();if(this.oldValue!==c){this.oldValue=c;this._trigger("change")}this.valueDiv.toggle(c>this.min).toggleClass("ui-corner-right",c===this.options.max).width(e.toFixed(0)+"%");this.element.attr("aria-valuenow",c)}});a.extend(a.ui.progressbar,{version:"1.8.16"})})(jQuery); +(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var d=this,c=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),h=c.values&&c.values.length||1,g=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+ +this.orientation+" ui-widget ui-widget-content ui-corner-all"+(c.disabled?" ui-slider-disabled ui-disabled":""));this.range=a([]);if(c.range){if(c.range===true){if(!c.values)c.values=[this._valueMin(),this._valueMin()];if(c.values.length&&c.values.length!==2)c.values=[c.values[0],c.values[0]]}this.range=a("
    ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(c.range==="min"||c.range==="max"?" ui-slider-range-"+c.range:""))}for(var i=e.length;i"); +this.handles=e.add(a(g.join("")).appendTo(d.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(c.disabled)a(this).blur();else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle", +b)});this.handles.keydown(function(b){var f=true,j=a(this).data("index.ui-slider-handle"),l,o,n;if(!d.options.disabled){switch(b.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!d._keySliding){d._keySliding=true;a(this).addClass("ui-state-active");l=d._start(b,j);if(l===false)return}break}n=d.options.step;l=d.options.values&&d.options.values.length? +(o=d.values(j)):(o=d.value());switch(b.keyCode){case a.ui.keyCode.HOME:o=d._valueMin();break;case a.ui.keyCode.END:o=d._valueMax();break;case a.ui.keyCode.PAGE_UP:o=d._trimAlignValue(l+(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:o=d._trimAlignValue(l-(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(l===d._valueMax())return;o=d._trimAlignValue(l+n);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(l===d._valueMin())return;o=d._trimAlignValue(l- +n);break}d._slide(b,j,o);return f}}).keyup(function(b){var f=a(this).data("index.ui-slider-handle");if(d._keySliding){d._keySliding=false;d._stop(b,f);d._change(b,f);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); +return this},_mouseCapture:function(d){var c=this.options,e,h,g,i,b;if(c.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();e=this._normValueFromMouse({x:d.pageX,y:d.pageY});h=this._valueMax()-this._valueMin()+1;i=this;this.handles.each(function(f){var j=Math.abs(e-i.values(f));if(h>j){h=j;g=a(this);b=f}});if(c.range===true&&this.values(1)===c.min){b+=1;g=a(this.handles[b])}if(this._start(d,b)===false)return false; +this._mouseSliding=true;i._handleIndex=b;g.addClass("ui-state-active").focus();c=g.offset();this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-c.left-g.width()/2,top:d.pageY-c.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(d,b,e);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(d){var c= +this._normValueFromMouse({x:d.pageX,y:d.pageY});this._slide(d,this._handleIndex,c);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c;if(this.orientation==="horizontal"){c= +this.elementSize.width;d=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;d=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}c=d/c;if(c>1)c=1;if(c<0)c=0;if(this.orientation==="vertical")c=1-c;d=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*d)},_start:function(d,c){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c); +e.values=this.values()}return this._trigger("start",d,e)},_slide:function(d,c,e){var h;if(this.options.values&&this.options.values.length){h=this.values(c?0:1);if(this.options.values.length===2&&this.options.range===true&&(c===0&&e>h||c===1&&e1){this.options.values[d]=this._trimAlignValue(c);this._refreshValue();this._change(null,d)}else if(arguments.length)if(a.isArray(arguments[0])){e=this.options.values;h=arguments[0];for(g=0;g=this._valueMax())return this._valueMax();var c=this.options.step>0?this.options.step:1,e=(d-this._valueMin())%c;d=d-e;if(Math.abs(e)*2>=c)d+=e>0?c:-c;return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var d= +this.options.range,c=this.options,e=this,h=!this._animateOff?c.animate:false,g,i={},b,f,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(o){g=(e.values(o)-e._valueMin())/(e._valueMax()-e._valueMin())*100;i[e.orientation==="horizontal"?"left":"bottom"]=g+"%";a(this).stop(1,1)[h?"animate":"css"](i,c.animate);if(e.options.range===true)if(e.orientation==="horizontal"){if(o===0)e.range.stop(1,1)[h?"animate":"css"]({left:g+"%"},c.animate);if(o===1)e.range[h?"animate":"css"]({width:g- +b+"%"},{queue:false,duration:c.animate})}else{if(o===0)e.range.stop(1,1)[h?"animate":"css"]({bottom:g+"%"},c.animate);if(o===1)e.range[h?"animate":"css"]({height:g-b+"%"},{queue:false,duration:c.animate})}b=g});else{f=this.value();j=this._valueMin();l=this._valueMax();g=l!==j?(f-j)/(l-j)*100:0;i[e.orientation==="horizontal"?"left":"bottom"]=g+"%";this.handle.stop(1,1)[h?"animate":"css"](i,c.animate);if(d==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[h?"animate":"css"]({width:g+"%"}, +c.animate);if(d==="max"&&this.orientation==="horizontal")this.range[h?"animate":"css"]({width:100-g+"%"},{queue:false,duration:c.animate});if(d==="min"&&this.orientation==="vertical")this.range.stop(1,1)[h?"animate":"css"]({height:g+"%"},c.animate);if(d==="max"&&this.orientation==="vertical")this.range[h?"animate":"css"]({height:100-g+"%"},{queue:false,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.16"})})(jQuery); +(function(a,d){function c(){return++h}function e(){return++g}var h=0,g=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(i,b){if(i=="selected")this.options.collapsible&& +b==this.options.selected||this.select(b);else{this.options[i]=b;this._tabify()}},_tabId:function(i){return i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+c()},_sanitizeSelector:function(i){return i.replace(/:/g,"\\:")},_cookie:function(){var i=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+e());return a.cookie.apply(null,[i].concat(a.makeArray(arguments)))},_ui:function(i,b){return{tab:i,panel:b,index:this.anchors.index(i)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var i= +a(this);i.html(i.data("label.tabs")).removeData("label.tabs")})},_tabify:function(i){function b(r,u){r.css("display","");!a.support.opacity&&u.opacity&&r[0].style.removeAttribute("filter")}var f=this,j=this.options,l=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=a(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);this.anchors.each(function(r,u){var v=a(u).attr("href"),w=v.split("#")[0],x;if(w&&(w===location.toString().split("#")[0]|| +(x=a("base")[0])&&w===x.href)){v=u.hash;u.href=v}if(l.test(v))f.panels=f.panels.add(f.element.find(f._sanitizeSelector(v)));else if(v&&v!=="#"){a.data(u,"href.tabs",v);a.data(u,"load.tabs",v.replace(/#.*$/,""));v=f._tabId(u);u.href="#"+v;u=f.element.find("#"+v);if(!u.length){u=a(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(f.panels[r-1]||f.list);u.data("destroy.tabs",true)}f.panels=f.panels.add(u)}else j.disabled.push(r)});if(i){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===d){location.hash&&this.anchors.each(function(r,u){if(u.hash==location.hash){j.selected=r;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(f._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=a.unique(j.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(r){return f.lis.index(r)}))).sort();a.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(a.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(j.selected>=0&&this.anchors.length){f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");f.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[j.selected],f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash))[0]))});this.load(j.selected)}a(window).bind("unload",function(){f.lis.add(f.anchors).unbind(".tabs");f.lis=f.anchors=f.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);i=0;for(var o;o=this.lis[i];i++)a(o)[a.inArray(i,j.disabled)!=-1&&!a(o).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var n=function(r,u){u.is(":not(.ui-state-disabled)")&&u.addClass("ui-state-"+r)},k=function(r,u){u.removeClass("ui-state-"+ +r)};this.lis.bind("mouseover.tabs",function(){n("hover",a(this))});this.lis.bind("mouseout.tabs",function(){k("hover",a(this))});this.anchors.bind("focus.tabs",function(){n("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){k("focus",a(this).closest("li"))})}var m,p;if(j.fx)if(a.isArray(j.fx)){m=j.fx[0];p=j.fx[1]}else m=p=j.fx;var q=p?function(r,u){a(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.hide().removeClass("ui-tabs-hide").animate(p,p.duration||"normal", +function(){b(u,p);f._trigger("show",null,f._ui(r,u[0]))})}:function(r,u){a(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.removeClass("ui-tabs-hide");f._trigger("show",null,f._ui(r,u[0]))},s=m?function(r,u){u.animate(m,m.duration||"normal",function(){f.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");b(u,m);f.element.dequeue("tabs")})}:function(r,u){f.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");f.element.dequeue("tabs")}; +this.anchors.bind(j.event+".tabs",function(){var r=this,u=a(r).closest("li"),v=f.panels.filter(":not(.ui-tabs-hide)"),w=f.element.find(f._sanitizeSelector(r.hash));if(u.hasClass("ui-tabs-selected")&&!j.collapsible||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||f.panels.filter(":animated").length||f._trigger("select",null,f._ui(this,w[0]))===false){this.blur();return false}j.selected=f.anchors.index(this);f.abort();if(j.collapsible)if(u.hasClass("ui-tabs-selected")){j.selected= +-1;j.cookie&&f._cookie(j.selected,j.cookie);f.element.queue("tabs",function(){s(r,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&f._cookie(j.selected,j.cookie);f.element.queue("tabs",function(){q(r,w)});f.load(f.anchors.index(this));this.blur();return false}j.cookie&&f._cookie(j.selected,j.cookie);if(w.length){v.length&&f.element.queue("tabs",function(){s(r,v)});f.element.queue("tabs",function(){q(r,w)});f.load(f.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +a.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(i){if(typeof i=="string")i=this.anchors.index(this.anchors.filter("[href$="+i+"]"));return i},destroy:function(){var i=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var b= +a.data(this,"href.tabs");if(b)this.href=b;var f=a(this).unbind(".tabs");a.each(["href","load","cache"],function(j,l){f.removeData(l+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});i.cookie&&this._cookie(null,i.cookie);return this},add:function(i, +b,f){if(f===d)f=this.anchors.length;var j=this,l=this.options;b=a(l.tabTemplate.replace(/#\{href\}/g,i).replace(/#\{label\}/g,b));i=!i.indexOf("#")?i.replace("#",""):this._tabId(a("a",b)[0]);b.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var o=j.element.find("#"+i);o.length||(o=a(l.panelTemplate).attr("id",i).data("destroy.tabs",true));o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(f>=this.lis.length){b.appendTo(this.list);o.appendTo(this.list[0].parentNode)}else{b.insertBefore(this.lis[f]); +o.insertBefore(this.panels[f])}l.disabled=a.map(l.disabled,function(n){return n>=f?++n:n});this._tabify();if(this.anchors.length==1){l.selected=0;b.addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[f],this.panels[f]));return this},remove:function(i){i=this._getIndex(i);var b=this.options,f=this.lis.eq(i).remove(),j=this.panels.eq(i).remove(); +if(f.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(i+(i+1=i?--l:l});this._tabify();this._trigger("remove",null,this._ui(f.find("a")[0],j[0]));return this},enable:function(i){i=this._getIndex(i);var b=this.options;if(a.inArray(i,b.disabled)!=-1){this.lis.eq(i).removeClass("ui-state-disabled");b.disabled=a.grep(b.disabled,function(f){return f!=i});this._trigger("enable",null, +this._ui(this.anchors[i],this.panels[i]));return this}},disable:function(i){i=this._getIndex(i);var b=this.options;if(i!=b.selected){this.lis.eq(i).addClass("ui-state-disabled");b.disabled.push(i);b.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[i],this.panels[i]))}return this},select:function(i){i=this._getIndex(i);if(i==-1)if(this.options.collapsible&&this.options.selected!=-1)i=this.options.selected;else return this;this.anchors.eq(i).trigger(this.options.event+".tabs");return this}, +load:function(i){i=this._getIndex(i);var b=this,f=this.options,j=this.anchors.eq(i)[0],l=a.data(j,"load.tabs");this.abort();if(!l||this.element.queue("tabs").length!==0&&a.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(i).addClass("ui-state-processing");if(f.spinner){var o=a("span",j);o.data("label.tabs",o.html()).html(f.spinner)}this.xhr=a.ajax(a.extend({},f.ajaxOptions,{url:l,success:function(n,k){b.element.find(b._sanitizeSelector(j.hash)).html(n);b._cleanup();f.cache&&a.data(j, +"cache.tabs",true);b._trigger("load",null,b._ui(b.anchors[i],b.panels[i]));try{f.ajaxOptions.success(n,k)}catch(m){}},error:function(n,k){b._cleanup();b._trigger("load",null,b._ui(b.anchors[i],b.panels[i]));try{f.ajaxOptions.error(n,k,i,j)}catch(m){}}}));b.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(i,b){this.anchors.eq(i).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.16"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(i,b){var f=this,j=this.options,l=f._rotate||(f._rotate=function(o){clearTimeout(f.rotation);f.rotation=setTimeout(function(){var n=j.selected;f.select(++n").get(0).files !== undefined; +feature.formdata = window.FormData !== undefined; + +/** + * ajaxSubmit() provides a mechanism for immediately submitting + * an HTML form using AJAX. + */ +$.fn.ajaxSubmit = function(options) { + /*jshint scripturl:true */ + + // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) + if (!this.length) { + log('ajaxSubmit: skipping submit process - no element selected'); + return this; + } + + var method, action, url, $form = this; + + if (typeof options == 'function') { + options = { success: options }; + } + + method = this.attr('method'); + action = this.attr('action'); + url = (typeof action === 'string') ? $.trim(action) : ''; + url = url || window.location.href || ''; + if (url) { + // clean url (don't include hash vaue) + url = (url.match(/^([^#]+)/)||[])[1]; + } + + options = $.extend(true, { + url: url, + success: $.ajaxSettings.success, + type: method || 'GET', + iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' + }, options); + + // hook for manipulating the form data before it is extracted; + // convenient for use with rich editors like tinyMCE or FCKEditor + var veto = {}; + this.trigger('form-pre-serialize', [this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); + return this; + } + + // provide opportunity to alter form data before it is serialized + if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSerialize callback'); + return this; + } + + var traditional = options.traditional; + if ( traditional === undefined ) { + traditional = $.ajaxSettings.traditional; + } + + var elements = []; + var qx, a = this.formToArray(options.semantic, elements); + if (options.data) { + options.extraData = options.data; + qx = $.param(options.data, traditional); + } + + // give pre-submit callback an opportunity to abort the submit + if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSubmit callback'); + return this; + } + + // fire vetoable 'validate' event + this.trigger('form-submit-validate', [a, this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); + return this; + } + + var q = $.param(a, traditional); + if (qx) { + q = ( q ? (q + '&' + qx) : qx ); + } + if (options.type.toUpperCase() == 'GET') { + options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; + options.data = null; // data is null for 'get' + } + else { + options.data = q; // data is the query string for 'post' + } + + var callbacks = []; + if (options.resetForm) { + callbacks.push(function() { $form.resetForm(); }); + } + if (options.clearForm) { + callbacks.push(function() { $form.clearForm(options.includeHidden); }); + } + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) { + var oldSuccess = options.success || function(){}; + callbacks.push(function(data) { + var fn = options.replaceTarget ? 'replaceWith' : 'html'; + $(options.target)[fn](data).each(oldSuccess, arguments); + }); + } + else if (options.success) { + callbacks.push(options.success); + } + + options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg + var context = options.context || options; // jQuery 1.4+ supports scope context + for (var i=0, max=callbacks.length; i < max; i++) { + callbacks[i].apply(context, [data, status, xhr || $form, $form]); + } + }; + + // are there files to upload? + var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113) + var hasFileInputs = fileInputs.length > 0; + var mp = 'multipart/form-data'; + var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); + + var fileAPI = feature.fileapi && feature.formdata; + log("fileAPI :" + fileAPI); + var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; + + // options.iframe allows user to force iframe mode + // 06-NOV-09: now defaulting to iframe mode if file input is detected + if (options.iframe !== false && (options.iframe || shouldUseFrame)) { + // hack to fix Safari hang (thanks to Tim Molendijk for this) + // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d + if (options.closeKeepAlive) { + $.get(options.closeKeepAlive, function() { + fileUploadIframe(a); + }); + } + else { + fileUploadIframe(a); + } + } + else if ((hasFileInputs || multipart) && fileAPI) { + fileUploadXhr(a); + } + else { + $.ajax(options); + } + + // clear element array + for (var k=0; k < elements.length; k++) + elements[k] = null; + + // fire 'notify' event + this.trigger('form-submit-notify', [this, options]); + return this; + + // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) + function fileUploadXhr(a) { + var formdata = new FormData(); + + for (var i=0; i < a.length; i++) { + formdata.append(a[i].name, a[i].value); + } + + if (options.extraData) { + for (var p in options.extraData) + if (options.extraData.hasOwnProperty(p)) + formdata.append(p, options.extraData[p]); + } + + options.data = null; + + var s = $.extend(true, {}, $.ajaxSettings, options, { + contentType: false, + processData: false, + cache: false, + type: 'POST' + }); + + if (options.uploadProgress) { + // workaround because jqXHR does not expose upload property + s.xhr = function() { + var xhr = jQuery.ajaxSettings.xhr(); + if (xhr.upload) { + xhr.upload.onprogress = function(event) { + var percent = 0; + var position = event.loaded || event.position; /*event.position is deprecated*/ + var total = event.total; + if (event.lengthComputable) { + percent = Math.ceil(position / total * 100); + } + options.uploadProgress(event, position, total, percent); + }; + } + return xhr; + }; + } + + s.data = null; + var beforeSend = s.beforeSend; + s.beforeSend = function(xhr, o) { + o.data = formdata; + if(beforeSend) + beforeSend.call(o, xhr, options); + }; + $.ajax(s); + } + + // private function for handling file uploads (hat tip to YAHOO!) + function fileUploadIframe(a) { + var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; + var useProp = !!$.fn.prop; + + if ($(':input[name=submit],:input[id=submit]', form).length) { + // if there is an input with a name or id of 'submit' then we won't be + // able to invoke the submit fn on the form (at least not x-browser) + alert('Error: Form elements must not have name or id of "submit".'); + return; + } + + if (a) { + // ensure that every serialized input is still enabled + for (i=0; i < elements.length; i++) { + el = $(elements[i]); + if ( useProp ) + el.prop('disabled', false); + else + el.removeAttr('disabled'); + } + } + + s = $.extend(true, {}, $.ajaxSettings, options); + s.context = s.context || s; + id = 'jqFormIO' + (new Date().getTime()); + if (s.iframeTarget) { + $io = $(s.iframeTarget); + n = $io.attr('name'); + if (!n) + $io.attr('name', id); + else + id = n; + } + else { + $io = $('').css(b.extend(this.o.iframeCss, +{display:"none",opacity:0,position:"fixed",height:h[0],width:h[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);this.d.overlay=b("
    ").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?j[0]:0,width:this.o.modal?j[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("
    ").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend({position:this.o.fixed? +"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("
    ").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions(); +this.d.data.appendTo(this.d.wrap);(m||n)&&this.fixIE()},bindEvents:function(){var a=this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});l.bind("keydown.simplemodal",function(b){a.o.modal&&9===b.keyCode?a.watchTab(b):a.o.close&&a.o.escClose&&27===b.keyCode&&(b.preventDefault(),a.close())});k.bind("resize.simplemodal orientationchange.simplemodal", +function(){a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();m||n?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:h[0],width:h[1]}),a.d.overlay.css({height:j[0],width:j[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");l.unbind("keydown.simplemodal");k.unbind(".simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay, +"fixed"===this.d.container.css("position")?this.d.container:null],function(b,f){if(f){var g=f[0].style;g.position="absolute";if(2>b)g.removeExpression("height"),g.removeExpression("width"),g.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var c,e;a&&a.constructor=== +Array?(c=a[0]?"number"===typeof a[0]?a[0].toString():a[0].replace(/px/,""):f.css("top").replace(/px/,""),c=-1===c.indexOf("%")?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(e="number"===typeof a[1]? +a[1].toString():a[1].replace(/px/,""),e=-1===e.indexOf("%")?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(c='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"', +e='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');g.removeExpression("top");g.removeExpression("left");g.setExpression("top",c);g.setExpression("left",e)}}})},focus:function(a){var d=this,a=a&&-1!==b.inArray(a,["first","last"])?a:"first",f=b(":input:enabled:visible:"+a,d.d.wrap);setTimeout(function(){0c?c:dc?c:this.o.minHeight&&"auto"!==i&&fe?e:ae?e:this.o.minWidth&&"auto"!==c&&gd||g>a?"auto":"visible"});this.o.autoPosition&&this.setPosition()},setPosition:function(){var a,b;a=h[0]/2-this.d.container.outerHeight(!0)/2;b=h[1]/2-this.d.container.outerWidth(!0)/2;var f="fixed"!==this.d.container.css("position")?k.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(a=f+(this.o.position[0]||a),b=this.o.position[1]|| +b):a=f+a;this.d.container.css({left:b,top:a})},watchTab:function(a){if(0", { + id: 'lightboxOverlay' + }).after($('
    ', { + id: 'lightbox' + }).append($('
    ', { + "class": 'lb-outerContainer' + }).append($('
    ', { + "class": 'lb-container' + }).append($('', { + "class": 'lb-image' + }), $('
    ', { + "class": 'lb-nav' + }).append($('', { + "class": 'lb-prev' + }), $('', { + "class": 'lb-next' + })), $('
    ', { + "class": 'lb-loader' + }).append($('', { + "class": 'lb-cancel' + }).append($('', { + src: this.options.fileLoadingImage + }))))), $('
    ', { + "class": 'lb-dataContainer' + }).append($('
    ', { + "class": 'lb-data' + }).append($('
    ', { + "class": 'lb-details' + }).append($('', { + "class": 'lb-caption' + }), $('', { + "class": 'lb-number' + })), $('
    ', { + "class": 'lb-closeContainer' + }).append($('', { + "class": 'lb-close' + }).append($('', { + src: this.options.fileCloseImage + }))))))).appendTo($('body')); + $('#lightboxOverlay').hide().on('click', function(e) { + _this.end(); + return false; + }); + $lightbox = $('#lightbox'); + $lightbox.hide().on('click', function(e) { + if ($(e.target).attr('id') === 'lightbox') _this.end(); + return false; + }); + $lightbox.find('.lb-outerContainer').on('click', function(e) { + if ($(e.target).attr('id') === 'lightbox') _this.end(); + return false; + }); + $lightbox.find('.lb-prev').on('click', function(e) { + _this.changeImage(_this.currentImageIndex - 1); + return false; + }); + $lightbox.find('.lb-next').on('click', function(e) { + _this.changeImage(_this.currentImageIndex + 1); + return false; + }); + $lightbox.find('.lb-loader, .lb-close').on('click', function(e) { + _this.end(); + return false; + }); + }; + + Lightbox.prototype.start = function($link) { + var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref; + $(window).on("resize", this.sizeOverlay); + $('select, object, embed').css({ + visibility: "hidden" + }); + $('#lightboxOverlay').width($(document).width()).height($(document).height()).fadeIn(this.options.fadeDuration); + this.album = []; + imageNumber = 0; + if ($link.attr('rel') === 'lightbox') { + this.album.push({ + link: $link.attr('href'), + title: $link.attr('title') + }); + } else { + _ref = $($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]'); + for (i = 0, _len = _ref.length; i < _len; i++) { + a = _ref[i]; + this.album.push({ + link: $(a).attr('href'), + title: $(a).attr('title') + }); + if ($(a).attr('href') === $link.attr('href')) imageNumber = i; + } + } + $window = $(window); + top = $window.scrollTop() + $window.height() / 10; + left = $window.scrollLeft(); + $lightbox = $('#lightbox'); + $lightbox.css({ + top: top + 'px', + left: left + 'px' + }).fadeIn(this.options.fadeDuration); + this.changeImage(imageNumber); + }; + + Lightbox.prototype.changeImage = function(imageNumber) { + var $image, $lightbox, preloader, + _this = this; + this.disableKeyboardNav(); + $lightbox = $('#lightbox'); + $image = $lightbox.find('.lb-image'); + this.sizeOverlay(); + $('#lightboxOverlay').fadeIn(this.options.fadeDuration); + $('.loader').fadeIn('slow'); + $lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); + $lightbox.find('.lb-outerContainer').addClass('animating'); + preloader = new Image; + preloader.onload = function() { + $image.attr('src', _this.album[imageNumber].link); + $image.width = preloader.width; + $image.height = preloader.height; + return _this.sizeContainer(preloader.width, preloader.height); + }; + preloader.src = this.album[imageNumber].link; + this.currentImageIndex = imageNumber; + }; + + Lightbox.prototype.sizeOverlay = function() { + return $('#lightboxOverlay').width($(document).width()).height($(document).height()); + }; + + Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) { + var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth, + _this = this; + $lightbox = $('#lightbox'); + $outerContainer = $lightbox.find('.lb-outerContainer'); + oldWidth = $outerContainer.outerWidth(); + oldHeight = $outerContainer.outerHeight(); + $container = $lightbox.find('.lb-container'); + containerTopPadding = parseInt($container.css('padding-top'), 10); + containerRightPadding = parseInt($container.css('padding-right'), 10); + containerBottomPadding = parseInt($container.css('padding-bottom'), 10); + containerLeftPadding = parseInt($container.css('padding-left'), 10); + newWidth = imageWidth + containerLeftPadding + containerRightPadding; + newHeight = imageHeight + containerTopPadding + containerBottomPadding; + if (newWidth !== oldWidth && newHeight !== oldHeight) { + $outerContainer.animate({ + width: newWidth, + height: newHeight + }, this.options.resizeDuration, 'swing'); + } else if (newWidth !== oldWidth) { + $outerContainer.animate({ + width: newWidth + }, this.options.resizeDuration, 'swing'); + } else if (newHeight !== oldHeight) { + $outerContainer.animate({ + height: newHeight + }, this.options.resizeDuration, 'swing'); + } + setTimeout(function() { + $lightbox.find('.lb-dataContainer').width(newWidth); + $lightbox.find('.lb-prevLink').height(newHeight); + $lightbox.find('.lb-nextLink').height(newHeight); + _this.showImage(); + }, this.options.resizeDuration); + }; + + Lightbox.prototype.showImage = function() { + var $lightbox; + $lightbox = $('#lightbox'); + $lightbox.find('.lb-loader').hide(); + $lightbox.find('.lb-image').fadeIn('slow'); + this.updateNav(); + this.updateDetails(); + this.preloadNeighboringImages(); + this.enableKeyboardNav(); + }; + + Lightbox.prototype.updateNav = function() { + var $lightbox; + $lightbox = $('#lightbox'); + $lightbox.find('.lb-nav').show(); + if (this.currentImageIndex > 0) $lightbox.find('.lb-prev').show(); + if (this.currentImageIndex < this.album.length - 1) { + $lightbox.find('.lb-next').show(); + } + }; + + Lightbox.prototype.updateDetails = function() { + var $lightbox, + _this = this; + $lightbox = $('#lightbox'); + if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") { + $lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast'); + } + if (this.album.length > 1) { + $lightbox.find('.lb-number').html(this.options.labelImage + ' ' + (this.currentImageIndex + 1) + ' ' + this.options.labelOf + ' ' + this.album.length).fadeIn('fast'); + } else { + $lightbox.find('.lb-number').hide(); + } + $lightbox.find('.lb-outerContainer').removeClass('animating'); + $lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function() { + return _this.sizeOverlay(); + }); + }; + + Lightbox.prototype.preloadNeighboringImages = function() { + var preloadNext, preloadPrev; + if (this.album.length > this.currentImageIndex + 1) { + preloadNext = new Image; + preloadNext.src = this.album[this.currentImageIndex + 1].link; + } + if (this.currentImageIndex > 0) { + preloadPrev = new Image; + preloadPrev.src = this.album[this.currentImageIndex - 1].link; + } + }; + + Lightbox.prototype.enableKeyboardNav = function() { + $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this)); + }; + + Lightbox.prototype.disableKeyboardNav = function() { + $(document).off('.keyboard'); + }; + + Lightbox.prototype.keyboardAction = function(event) { + var KEYCODE_ESC, KEYCODE_LEFTARROW, KEYCODE_RIGHTARROW, key, keycode; + KEYCODE_ESC = 27; + KEYCODE_LEFTARROW = 37; + KEYCODE_RIGHTARROW = 39; + keycode = event.keyCode; + key = String.fromCharCode(keycode).toLowerCase(); + if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) { + this.end(); + } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) { + if (this.currentImageIndex !== 0) { + this.changeImage(this.currentImageIndex - 1); + } + } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) { + if (this.currentImageIndex !== this.album.length - 1) { + this.changeImage(this.currentImageIndex + 1); + } + } + }; + + Lightbox.prototype.end = function() { + this.disableKeyboardNav(); + $(window).off("resize", this.sizeOverlay); + $('#lightbox').fadeOut(this.options.fadeDuration); + $('#lightboxOverlay').fadeOut(this.options.fadeDuration); + return $('select, object, embed').css({ + visibility: "visible" + }); + }; + + return Lightbox; + + })(); + + $(function() { + var lightbox, options; + options = new LightboxOptions; + return lightbox = new Lightbox(options); + }); + +}).call(this); diff --git a/js/slimScroll.min.js b/js/slimScroll.min.js new file mode 100644 index 0000000..001b37e --- /dev/null +++ b/js/slimScroll.min.js @@ -0,0 +1,13 @@ +/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Version: 0.6.0 + * + */ +(function(d){jQuery.fn.extend({slimScroll:function(p){var a=ops=d.extend({wheelStep:20,width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:"0.2",railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,scroll:0},p);this.each(function(){function i(a,d,e){var f=a;d&&(f=parseInt(c.css("top"))+a*C/100*c.outerHeight(),d=b.outerHeight()- +c.outerHeight(),f=Math.min(Math.max(f,0),d),c.css({top:f+"px"}));g=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());f=g*(b[0].scrollHeight-b.outerHeight());e&&(f=a,a=f/b[0].scrollHeight*b.outerHeight(),c.css({top:a+"px"}));b.scrollTop(f);q();j()}function w(){r=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),p);c.css({height:r+"px"})}function q(){w();clearTimeout(x);g==~~g&&(l=D,y!=g&&b.trigger("slimscroll",0==~~g?"top":"bottom"));y=g;r>=b.outerHeight()?l=!0:(c.stop(!0,!0).fadeIn("fast"), +z&&h.stop(!0,!0).fadeIn("fast"))}function j(){m||(x=setTimeout(function(){if((!E||!n)&&!s&&!t)c.fadeOut("slow"),h.fadeOut("slow")},1E3))}var n,s,t,x,r,g,y,p=30,l=!1,C=parseInt(a.wheelStep),k=a.width,A=a.height,e=a.size,F=a.color,G=a.position,B=a.distance,u=a.start,H=a.opacity,E=a.disableFadeOut,m=a.alwaysVisible,z=a.railVisible,I=a.railColor,J=a.railOpacity,D=a.allowPageScroll,o=a.scroll,b=d(this);if(b.parent().hasClass("slimScrollDiv"))o&&(c=b.parent().find(".slimScrollBar"),h=b.parent().find(".slimScrollRail"), +i(b.scrollTop()+parseInt(o),!1,!0));else{o=d("
    ").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:k,height:A});b.css({overflow:"hidden",width:k,height:A});var h=d("
    ").addClass(a.railClass).css({width:e,height:"100%",position:"absolute",top:0,display:m&&z?"block":"none","border-radius":e,background:I,opacity:J,zIndex:90}),c=d("
    ").addClass(a.barClass).css({background:F,width:e,position:"absolute",top:0,opacity:H,display:m?"block":"none","border-radius":e, +BorderRadius:e,MozBorderRadius:e,WebkitBorderRadius:e,zIndex:99}),k="right"==G?{right:B}:{left:B};h.css(k);c.css(k);b.wrap(o);b.parent().append(c);b.parent().append(h);c.draggable({axis:"y",containment:"parent",start:function(){t=!0},stop:function(){t=!1;j()},drag:function(){i(0,d(this).position().top,!1)}});h.hover(function(){q()},function(){j()});c.hover(function(){s=!0},function(){s=!1});b.hover(function(){n=!0;q();j()},function(){n=!1;j()});var v=function(a){if(n){var a=a||window.event,b=0;a.wheelDelta&& +(b=-a.wheelDelta/120);a.detail&&(b=a.detail/3);i(b,!0);a.preventDefault&&!l&&a.preventDefault();l||(a.returnValue=!1)}};(function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)})();w();"bottom"==u?(c.css({top:b.outerHeight()-c.outerHeight()}),i(0,!0)):"object"==typeof u&&(i(d(u).position().top,null,!0),m||c.hide())}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery); \ No newline at end of file diff --git a/json.php b/json.php new file mode 100644 index 0000000..ef357e4 --- /dev/null +++ b/json.php @@ -0,0 +1,304 @@ +login(); + +require_once( 'lib/cache.php' ); +$cache = new Cache( Config::$cache['path'], '' ); + +if( isset($_GET['addTags']) && $user->id && strlen(trim($_POST['tags'])) >= 3 ) { + $i = DB::getRow( 'SELECT id, tags, keyword FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] ); + if( !empty( $i ) ) { + if($user->admin) { + $tags = trim($_POST['tags']); + } else { + $tags = trim(trim($i['tags'])." ".trim($_POST['tags'])); + } + DB::updateRow( TABLE_IMAGES, + array('id' => $i['id']), + array( 'tags' => $tags ) + ); + + $score = strlen(trim($_POST['tags'])) * Config::$tagScorePerChar; + $user->increaseScore( min($score, Config::$tagScoreMax) ); + $cache->clear( $i['keyword'] ); + + echo '{"id":"'.$i['id'].'","tags":"'.addslashes(htmlspecialchars($tags)).'"}'; + exit(0); + } +} + +if( isset($_GET['quickTag']) && $user->id ) { + if( !empty($_POST['id']) ) { + + // remove lock + DB::updateRow( TABLE_TAGLOG, + array( 'id' => $_POST['logId'], 'userId' => $user->id ), + array( 'locked' => 0 ) + ); + + if( strlen(trim($_POST['tags'])) >= 3 ) { + $i = DB::getRow( 'SELECT id, tags, keyword FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] ); + if( !empty( $i ) ) { + $tags = trim(trim($i['tags'])." ".trim($_POST['tags'])); + DB::updateRow( TABLE_IMAGES, + array('id' => $i['id']), + array( 'tags' => $tags ) + ); + } + $score = strlen(trim($_POST['tags'])) * Config::$tagScorePerChar; + $user->increaseScore( min($score, Config::$tagScoreMax) ); + $cache->clear( $i['keyword'] ); + } + } + + $i = DB::getRow( + 'SELECT i.id, i.keyword, i.tags, i.image, UNIX_TIMESTAMP(i.logged) AS loggedTS + FROM '.TABLE_IMAGES.' i + LEFT JOIN '.TABLE_TAGLOG.' t + ON t.imageId = i.id AND ( + ( + t.userId = :1 AND + t.tagged > NOW() - INTERVAL 24 HOUR + ) OR ( + t.locked = 1 AND + t.tagged > NOW() - INTERVAL 5 MINUTE + ) + ) + WHERE t.id IS NULL + ORDER BY LENGTH(i.tags), i.logged DESC + LIMIT 1', + $user->id + ); + if( !empty( $i ) ) { + DB::insertRow( TABLE_TAGLOG, + array( + 'tagged' => date( 'Y.m.d H:i:s' ), + 'userId' => $user->id, + 'imageId' => $i['id'], + 'locked' => 1 + ) + ); + $logId = DB::insertId(); + $link = Config::$absolutePath.'all/view/'.$i['keyword']; + $image = + Config::$absolutePath + .Config::$images['imagePath'] + .date('Y/m/', $i['loggedTS']) + .$i['image']; + + echo '{"id":"'.$i['id'].'","tags":"'.addslashes(htmlspecialchars($i['tags'])).'"' + .',"link":"'.$link.'","image":"'.$image.'","logId":"'.$logId.'"}'; + exit(0); + } +} + +else if( isset($_GET['delete']) && $user->id && $user->admin ) { + + + $i = DB::getRow( 'SELECT * FROM pl_images WHERE id=:1', $_POST['id'] ); + if ($i["hash"] != "x") { + DB::insertRow("pl_bannedimages",array("hash"=>$i["hash"])); + } + if( !empty($i) ) { + + $cmts = DB::query("SELECT * FROM pl_comments WHERE imageId=:1",$_POST['id']); + + foreach (array_keys($cmts) as $k){ + + + $commentimg = DB::getRow( 'SELECT * FROM pl_commentuploads WHERE c_id=:1', $cmts[$k]["id"] ); + if ($commentimg){ + if(file_exists($commentimg["image_link"])){ + unlink($commentimg["image_link"]); + } + if(file_exists($commentimg["thumb_link"])){ + unlink($commentimg["thumb_link"]); + } + if(file_exists(str_replace("64x64","28x28",$commentimg["thumb_link"]))){ + unlink(str_replace("64x64","128x128",$commentimg["thumb_link"])); + } + if(file_exists(str_replace("64x64","192x192",$commentimg["thumb_link"]))){ + unlink(str_replace("64x64","192x192",$commentimg["thumb_link"])); + } + } + DB::query( 'DELETE FROM '.TABLE_COMMENTS.' WHERE id = :1', $cmts[$k]["id"] ); + + + } + + + + DB::query( 'DELETE FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] ); + DB::query( 'DELETE FROM '.TABLE_IMAGECOLORS.' WHERE imageId = :1', $_POST['id'] ); + DB::query( 'DELETE FROM '.TABLE_COMMENTS.' WHERE imageId = :1', $_POST['id'] ); + DB::query( 'DELETE FROM pl_abuse WHERE imageid = :1', $_POST['id'] ); + DB::query( 'DELETE FROM pl_unread WHERE imageid = :1', $_POST['id'] ); + + foreach( Config::$gridView['classes'] as $c ) { + unlink( + Config::$images['thumbPath'] . + str_replace( '-', '/', substr( $i['logged'], 0, 7 ) ).'/'. + $c['dir'].'/'. + $i['thumb'] + ); + } + + unlink( + Config::$images['imagePath'] . + str_replace( '-', '/', substr( $i['logged'], 0, 7 ) ).'/'. + $i['image'] + ); + + DB::query( + 'UPDATE '.TABLE_USERS.' SET images = images -1, score = score - :2 + WHERE id = :1', + $i['user'], Config::$postScore + ); + $cache->clear(); + } + echo "{}"; +} + +else if( isset($_GET['deleteComment']) && $user->id && $user->admin ) { + DB::query( 'DELETE FROM '.TABLE_COMMENTS.' WHERE id = :1', $_POST['id'] ); + $commentimg = DB::getRow( 'SELECT * FROM pl_commentuploads WHERE c_id=:1', $_POST['id'] ); + if ($commentimg){ + if(file_exists($commentimg["image_link"])){ + unlink($commentimg["image_link"]); + } + if(file_exists($commentimg["thumb_link"])){ + unlink($commentimg["thumb_link"]); + } + if(file_exists(str_replace("64x64","28x28",$commentimg["thumb_link"]))){ + unlink(str_replace("64x64","128x128",$commentimg["thumb_link"])); + } + if(file_exists(str_replace("64x64","192x192",$commentimg["thumb_link"]))){ + unlink(str_replace("64x64","192x192",$commentimg["thumb_link"])); + } + } + //$cache->clear(); + echo "{}"; +} +else if( isset($_GET['banUser']) && $user->id && $user->admin ) { + + DB::query( 'INSERT INTO pl_banned (id,reason) VALUES (:1,:2)', $_POST['id'],$_POST['rsn']); + //$cache->clear(); + echo "user banned, ".$_POST['id']; + +}else if( isset($_GET['TimeUser']) && $user->id && $user->admin ) { + + DB::updateRow("pl_users",array("id"=>$_POST['id']),array("spamblocked"=>1,"spam_reason"=>$_POST['rsn'],"time"=>$_POST['time'])); + //$cache->clear(); + + +}else if( isset($_GET['fame']) && $user->id && $user->admin ) { + + DB::updateRow("pl_images",array("id"=>$_POST['id']),array("fame"=>1)); + //$cache->clear(); + echo "{}"; + +}else if( isset($_GET['CloseThread']) && $user->id && $user->admin ) { + + DB::updateRow("pl_images",array("id"=>$_POST['id']),array("comment"=>1)); + //$cache->clear(); + echo "{}"; + +}else if( isset($_GET['addfav']) && $user->id) { + + + $imginfo = DB::getRow("SELECT * FROM pl_images WHERE id=:1",$_POST['id']); + + $countfav = DB::getRow("SELECT COUNT( * ) AS c FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$_POST['id']); + if ((int)$countfav["c"] > 0){ + DB::query("DELETE FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$_POST['id']); + DB::query("DELETE FROM pl_comments WHERE userId=:1 and imageId =:2",$user->id,$_POST['id']); + + $url = Config::$absolutePath.$imginfo["keyword"]."/removefav"; + + header('Location:"'.$url.'"'); + }else{ + DB::insertRow("pl_fav",array("imageId"=>$_POST['id'],"user"=>$user->id)); + + $datenow = date( 'Y.m.d H:i:s' ); + DB::insertRow( "pl_comments", array( + 'imageId' => $_POST['id'], + 'userId' => $user->id, + 'created' => $datenow, + 'content' => "i like", + 'c_like' =>1)); + + $url = Config::$absolutePath.$imginfo["keyword"]."/addfav"; + + header('Location:"'.$url.'"'); + } + //$cache->clear(); + echo "{}"; + +}else if( isset($_GET['rate']) ) { + // score is in valid range / not float? + if( in_array( $_POST['score'], array(1,2,3,4,5) ) ) { + + // check if this ip has allready rated this quote + list(, $ip) = unpack('l',pack('l',ip2long($_SERVER['REMOTE_ADDR']))); + $r = DB::getRow( 'SELECT ip FROM '.TABLE_IPLOCK.' + WHERE ip = :1 AND imageId = :2', + $ip, $_POST['id'] + ); + + // not rated? + if( empty( $r ) ) { + // insert ip + DB::insertRow( TABLE_IPLOCK, + array( + 'ip' => $ip, + 'imageId' => $_POST['id'], + 'ts' => time() + ) + ); + + // update score + DB::query( 'UPDATE '.TABLE_IMAGES.' SET + score = ( score * votes + :1 ) / ( votes + 1 ), + votes = votes + 1 + WHERE id = :2', + $_POST['score'], $_POST['id'] + ); + + $user->increaseScore( Config::$votingScore ); + + if( rand(1, Config::$cache['clearEvery']) == 1 ) { + $cache->clear(); + } + else { + $i = DB::getRow( 'SELECT keyword FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] ); + $cache->clear( $i['keyword'] ); + } + } + } + + // delete all ips older than IP_LOCK_TIME + DB::query( 'DELETE FROM '.TABLE_IPLOCK.' WHERE ts < :1', time() - Config::$ipLockTime ); + + // return JSON Data + header( 'Content-Type', 'text/plain' ); + $r = DB::getRow( 'SELECT id, score, votes FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] ); + echo '{"id":"'.$r['id'].'","score":"'.number_format($r['score'],1).'","votes":"'.($r['votes']).'"}'; + exit(0); +} + +echo "{}"; + + +function full_url() +{ + $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; + $protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s; + $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); + return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']; +} + +?> \ No newline at end of file diff --git a/lib/api.php b/lib/api.php new file mode 100644 index 0000000..3528f2d --- /dev/null +++ b/lib/api.php @@ -0,0 +1,649 @@ + array( + 'json', 'xml', 'csv', 'yaml' + ) + ); + + /** + * Rules to check the route + * + * @var array + * @access private + */ + private $_rules = array( + 'alpha_numeric', 'numeric' + ); + + /** + * Select result for api + * + * @var array + */ + private $_result = array(); + + /** + * Let the magic start ;) + * + * @param resource $db + * @access public + */ + public function __construct($db) { + + $this->_db = $db; + } + + /** + * Register new namespace + * + * @param type $namespace + * @todo Set defaults to array + * @access public + * @return Api + */ + public function register($namespace) { + + if( ! isset($this->_namespaces[$namespace]) ) { + $this->_namespaces[$namespace] = array( + 'key' => false, + 'sort' => false, + 'request' => false, + 'limit' => false, + 'cache' => false, + 'conditions' => false + ); + + $this->_current_namaspace = $namespace; + } else { + $this->_error('Namespace already exists.'); + } + + return $this; + } + + /** + * + * @param string $message + * @access private + * @todo output + * @return Api + */ + private function _error($message) { + header("Content-Type: application/json"); + + die(json_encode($message)); + } + + /** + * Set table name + * + * @param string $table + * @return Api + */ + public function setTable($table) { + + if( is_string($table) ) { + $this->_namespaces[$this->_current_namaspace]['table'] = $table; + } else { + $this->_error('Table name musst be a string.'); + } + + return $this; + } + + /** + * Set output type + * + * @access public + * @param array|string $output + * @return Api + */ + public function setOutput($output) { + + if( is_array($output) ) { + foreach($output as $o) { + if( ! in_array($o, $this->_options['output_types']) ) { + $this->_error('Output as '.$o.' is not supported.'); + } + } + + $this->_namespaces[$this->_current_namaspace]['output'] = $output; + } else { + + if( ! in_array($output, $this->_options['output_types']) ) { + $this->_error('Output as '.$output.' is not supported.'); + } + + $this->_namespaces[$this->_current_namaspace]['output'] = $output; + } + + return $this; + } + + /** + * Set if unique key is required (false = default) + * + * @access public + * @param boolean $key + * @return Api + */ + public function setKey($key) { + + if( is_bool($key) ) { + $this->_namespaces[$this->_current_namaspace]['key'] = $key; + } + + return $this; + } + + /** + * Set request limit per hour. (false = default) + * + * @access public + * @param integer $limit + * @return Api + */ + public function setLimit($limit) { + + if( is_integer($limit) ) { + $this->_namespaces[$this->_current_namaspace]['limit'] = $limit; + } + + return $this; + } + + // Limit output + public function setRequest($request) { + + if( is_integer($request) ) { + $this->_namespaces[$this->_current_namaspace]['request'] = $request; + } + + return $this; + } + + + // Sort output + public function setSort($sort) { + + if( is_string($sort) ) { + $this->_namespaces[$this->_current_namaspace]['sort'] = $sort; + } + + return $this; + } + + /** + * Activate cache + * + * @param integer $time + * @param string $folder + * @return Api + */ + public function setCache($time, $folder) { + + if( ! is_dir($folder) ) { + $this->_error('Cache folder musst be a folder.'); + } + + if( ! is_integer($time) ) { + $this->_error('Cache time musst be integer.'); + } + + $this->_namespaces[$this->_current_namaspace]['cache'] = array( + 'folder' => $folder, + 'time' => $time + ); + + return $this; + } + + /** + * Set columns which should be displayed + * + * @param array $columns + * @return Api + */ + public function setColumns($columns) { + + if( is_array($columns) ) { + $this->_namespaces[$this->_current_namaspace]['columns'] = $columns; + } else { + $this->_error('Columns musst be given as array.'); + } + + return $this; + } + + /** + * Set conditions for data + * + * @param array $conditions + * @return Api + */ + public function setWhere($conditions) { + + if( is_array($conditions) ) { + $this->_namespaces[$this->_current_namaspace]['conditions'] = $conditions; + } else { + $this->_error('Where conditions musst be given as array.'); + } + + return $this; + } + + /** + * Output data + * + * @access public + * @param arra $route + */ + public function render($route) { + if( ! isset($route['namespace']) || ! isset($this->_namespaces[$route['namespace']]) || strlen($route['namespace']) == 0 ) { + $this->_error('No namespace found.'); + } + + $this->_render_namepsace = $route['namespace']; + + // secure input + foreach($route as $key => $value) { + $route[strip_tags($key)] = strip_tags($value); + } + + $this->_route_data = $route; + + // check if connection is working + if( ! mysql_ping($this->_db) ) { + $this->_error('Database connection is not working.'); + } + + // check if request limit is reached + if( ! $this->_check_key() ) { + $this->_error('Soory, but your api key is not valid.'); + } + + // check if request limit is reached + if( ! $this->_check_request() ) { + $this->_error('Soory, you reached the maximum request limit per hour ('.$this->_namespaces[$this->_render_namepsace]['limit'].').'); + } + + // get data from mysql table + if( ! $this->_create() ) { + $this->_error('Soory, but the system was not able to generate data.'); + } + } + + /** + * Check if the user key is valid + * + * @access private + * @return boolean + */ + private function _check_key() { + if( $this->_namespaces[$this->_render_namepsace]['key'] == true ) { + $result = mysql_query('SELECT id FROM api_keys WHERE hash = "'.mysql_real_escape_string($this->_route_data['key']).'"', $this->_db) or die(mysql_error()); + + if( mysql_num_rows($result) == false ) { + return false; + } else { + return true; + } + } else { + return true; + } + } + + /** + * Check if request limit is reached + * + * @access prviate + * @return boolean + */ + private function _check_request() { + + if( $this->_namespaces[$this->_render_namepsace]['limit'] != false ) { + // check request limit + + // delete old requests + if( $this->_namespaces[$this->_render_namepsace]['key'] == true ) { + // request limit with key + + // delete old requests + mysql_query('DELETE FROM api_requests WHERE hash = "'.mysql_real_escape_string($this->_route_data['key']).'" AND ((UNIX_TIMESTAMP() - time) > 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error()); + + // count stored requests + $result = mysql_query('SELECT COUNT(time) AS requests FROM api_requests WHERE hash = "'.mysql_real_escape_string($this->_route_data['key']).'" AND ((UNIX_TIMESTAMP() - time) < 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error()); + + $total_requests = mysql_fetch_array($result); + + if( $total_requests['requests'] >= $this->_namespaces[$this->_render_namepsace]['limit'] ) { + // request limit reached + return false; + } else { + + // insert new request + mysql_query('INSERT INTO api_requests (namespace, hash, ip, time) VALUES("'.$this->_render_namepsace.'", "'.mysql_real_escape_string($this->_route_data['key']).'", "'.$_SERVER['REMOTE_ADDR'].'", "'.time().'")', $this->_db) or die(mysql_error()); + + return true; + } + + } else { + // request limit without key + + // delete old requests + mysql_query('DELETE FROM api_requests WHERE ((UNIX_TIMESTAMP() - time) > 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error()); + + // count stored requests + $result = mysql_query('SELECT COUNT(time) AS requests FROM api_requests WHERE ((UNIX_TIMESTAMP() - time) < 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error()); + + $total_requests = mysql_fetch_array($result); + + if( $total_requests['requests'] >= $this->_namespaces[$this->_render_namepsace]['limit'] ) { + // request limit reached + return false; + } else { + + // insert new request + mysql_query('INSERT INTO api_requests (namespace, ip, time) VALUES("'.$this->_render_namepsace.'", "'.$_SERVER['REMOTE_ADDR'].'", "'.time().'")', $this->_db) or die(mysql_error()); + + return true; + } + } + } else { + // no limit is set + return true; + } + } + + /** + * Array to json + * + * @access private + * @return json + */ + private function _write_json() { + + header("Content-Type: application/json"); + + return json_encode($this->_result); + } + + /** + * Array to xml + * + * @access private + * @return string + */ + private function _write_xml() { + + header("Content-Type: application/xml"); + + $xml = "\n"; + + $xml .= ""; + + foreach($this->_result as $key => $value) { + $xml .= "<{$this->_render_namepsace}>\n"; + + foreach($value as $k => $d) { + $xml .= "<{$k}>{$d}\n"; + } + + $xml .= "_render_namepsace}>\n"; + } + + $xml .= ""; + + return $xml; + } + + /** + * Array to csv + * + * @access private + * @return string + */ + private function _write_csv() { + $lines = array(); + + foreach ($this->_result as $key => $value) { + + $lines[] = implode(';', array_filter($value, function($var) { + return $var; + })); + + } + + return implode("\n", $lines); + } + + /** + * Array to yaml + * + * @access private + * @return string + */ + private function _write_yaml() { + $yaml = "---\n"; + + $yaml .= "{$this->_render_namepsace}: \n"; + + foreach($this->_result as $key => $value) { + $yaml .= "-"; + $count = 0; + + foreach($value as $k => $d) { + if( $count != 0 ) { + $yaml .= " "; + } + + $yaml .= " {$k}: {$d} \n"; + $count++; + } + } + + return $yaml; + } + + /** + * Gets data from database + * + * @access private + */ + private function _get() { + + foreach($this->_namespaces[$this->_render_namepsace]['columns'] as $c) { + $columns .= $c.', '; + } + + $sql = 'SELECT '.substr($columns, 0, -2).' FROM ' . + $this->_namespaces[$this->_render_namepsace]['table']; + + if( $this->_namespaces[$this->_render_namepsace]['conditions'] != false ) { + $sql .= ' WHERE '; + + foreach($this->_namespaces[$this->_render_namepsace]['conditions'] as $where => $data) { + + if( ! isset($this->_route_data[$data['route']]) ) { + $this->_error('Route '.$data['route'].' is required.'); + } + + // validate + if( isset($data['rule']) ) { + if( ! in_array($data['rule'], $this->_rules) ) { + $this->_error('Rule '.$data['rule'].' is not avaiable.'); + } + + $rule = '_'.$data['rule']; + + if( ! $this->$rule($this->_route_data[$data['route']]) ) { + $this->_error('Wrong route format.'); + } + } + + $sql .= $where.' = "'.mysql_real_escape_string($this->_route_data[$data['route']]).'"'; + + if( isset($data['connect']) ) { + $sql .= ' '.$data['connect']; + } + } + } + + if( $this->_namespaces[$this->_render_namepsace]['sort'] != false ) { + $sql .= ' ORDER BY ' . $this->_namespaces[$this->_render_namepsace]['sort']; + } + + if( $this->_namespaces[$this->_render_namepsace]['request'] != false ) { + $sql .= ' LIMIT ' . $this->_namespaces[$this->_render_namepsace]['request']; + } + + $result = mysql_query($sql, $this->_db) or die(mysql_error()); + + if( mysql_num_rows($result) == false ) { + $this->_error('No results found.'); + } + + // write data to a nice array + for($i = 0; $i < mysql_num_rows($result); $i++) + { + $dump[$i] = mysql_fetch_array($result, MYSQL_ASSOC); + } + + $this->_result = $dump; + } + + private function _alpha_numeric($validate) { + if( ctype_alnum($validate) ) { + return true; + } else { + return false; + } + } + + private function _numeric($validate) { + if( ctype_digit($validate) ) { + return true; + } else { + return false; + } + } + + + private function _create() { + + + if( $this->_namespaces[$this->_render_namepsace]['cache'] == false ) { + + $this->_get(); + + } else { + // cache is turned on + if( $this->_namespaces[$this->_render_namepsace]['key'] == false ) { + // key musst truned off + + $file = $this->_namespaces[$this->_render_namepsace]['cache']['folder'].sha1($this->_render_namepsace).'.txt'; + + if( ! file_exists($file) || (time() - filemtime($file) > $this->_namespaces[$this->_render_namepsace]['cache']['time']) ) { + + // write to cache and delete old file + @unlink($file); + + $f = fopen($file, 'w'); + + $this->_get(); + + $cache = new stdClass; + $cache->result = $this->_result; + + fwrite($f, serialize($cache)); + + fclose($f); + } + + // read from cache + $data = unserialize(file_get_contents($file)); + + $this->_result = $data->result; + + + } else { + $this->_namespaces[$this->_render_namepsace]['cache'] = false; + + $this->_create(); + } + } + + $type_function = '_write_'; + + if( is_array($this->_namespaces[$this->_render_namepsace]['output']) ) { + if( isset($this->_route_data['output']) ) { + $type_function .= $this->_route_data['output']; + } else { + $type_function .= $this->_namespaces[$this->_render_namepsace]['output'][0]; + } + } else { + $type_function .= $this->_namespaces[$this->_render_namepsace]['output']; + } + + + die($this->$type_function()); + + } +} +?> diff --git a/lib/bbcode.class.php b/lib/bbcode.class.php new file mode 100644 index 0000000..c24c3b1 --- /dev/null +++ b/lib/bbcode.class.php @@ -0,0 +1,106 @@ +assign('\[b\](.*)\[/b\]', '$1'); + $this->assign('\[i\](.*)\[/i\]', '$1'); + $this->assign('\[u\](.*)\[/u\]', '$1'); + $this->assign('\[quote\](?s)(.*)\[/quote\]', '$1'); + $this->assign('\[img\](.*)\[/img\]', '"
    "', true); + $this->assign('\[youtube\](.*)\[/youtube\]', '$this->handleYoutubeBBcode(\'\\1\')', true); + $this->assign('\[xxx\](.*)\[/xxx\]', '$this->handlePornBBcode(\'\\1\')', true); + $this->assign('\[link\](.*)\[/link\]', '$this->handleLinkBBcode(\'\\1\')', true); + $this->assign('\[spoiler\](?s)(.*)\[/spoiler\]', '$1'); + } + + public function parse($content) { + if(!count($this->bbcodes)) return $content; + + foreach($this->bbcodes as $bbcode) { + while(preg_match('~' . $bbcode['find'] . '~U', $content)) { + if(isset($bbcode['eval'])) + $content = preg_replace('~' . $bbcode['find'] . '~Ue', $bbcode['eval'], $content); + else $content = preg_replace('~' . $bbcode['find'] . '~U', $bbcode['replace'], $content); + } + } + return $content; + } + + public function assign($find, $replace, $eval = false) { + $pattern = array('find' => $find); + $pattern[(($eval === true) ? 'eval' : 'replace')] = $replace; + $this->bbcodes[] = $pattern; + } + + protected function handleYoutubeBBcode($url) { + + if(preg_match("/youtube/i",$url)) { + $stack = array(); + preg_match('/v=([A-z0-9=\-]+?)(&.*)?$/i', $url, $stack); + if(empty($stack[1])) return ''; + $watch = $stack[1]; //\w kann nur a-zA-Z0-9_. sein, kein risiko + } else { + $watch = preg_replace('~\W+~', '', $url); + if(empty($watch)) return ''; + } + + return "[youtube]"; + } + + protected function handlePornBBcode($url) { + + if(preg_match("/xvideo/i",$url)) { + $source = "http://flashservice.xvideos.com/embedframe/"; + preg_match_all("/.*?(\d+)/is", $url, $matches); + $watch=$matches[1][0]; + } + /*else if(preg_match("/pornhub/i",$url)){ + $source = "http://www.pornhub.com/embed/"; + preg_match_all("/.*?(\d+)/is", $url, $matches); + $watch=$matches[1][0]; + }*/ + else{ + if(empty($watch)) return ''; + } + + return "[xxx]"; + } + + protected function handleLinkBBcode($text) { + if (!empty($text)){ + if (preg_match("/is.gd/i", $text)) { + $text = preg_replace('#(?]+)#i', "$text",$text); + return($text); + } + else { + $link = $text; + $text = preg_replace('#(?]+)#i', "$link",$text); + return($text); + } + } + else{ + return("Link-Fail"); + } + } +} + +/* +function short($url){ + $res = ""; + $handle = @fopen("http://is.gd/api.php?longurl=".urlencode($url), "rb"); + if($handle){ + while (!feof($handle)) { + $res .= fgets($handle,2000); + } + fclose($handle); + } + else{ + throw new Exception("Link kann nicht gekürzt werden!"); + } + return $res; +}*/ +?> \ No newline at end of file diff --git a/lib/cache.php b/lib/cache.php new file mode 100644 index 0000000..6a18c08 --- /dev/null +++ b/lib/cache.php @@ -0,0 +1,72 @@ +path = $path; + $this->fileName = $this->path . strtr( $pageName, '?&', '--' ) . '.html'; + + if( $_SERVER['REQUEST_METHOD'] != 'GET' ) { + $this->enabled = false; + } + } + + public function disable() { + $this->enabled = false; + } + + public function forceEnable() { + $this->enabled = true; + } + + public function lookup() { + if( $this->enabled && file_exists($this->fileName) ) { + $fp = fopen($this->fileName, 'rb'); + fpassthru($fp); + fclose($fp); + exit(); + } + } + + public function capture() { + if( $this->enabled ) { + ob_start(); + $this->captured = true; + } + } + + public function clear( $pattern = '' ) { + require_once( 'lib/filesystem.php' ); + if( empty($pattern) && !empty($this->path) ) { + Filesystem::rmdirr( $this->path, true ); + } else { + $files = glob( $this->path . 'all/view/' . strtr( $pattern, '?&', '--' ) . '.html' ); + foreach( $files as $f ) { + unlink( $f ); + } + $files = glob( $this->path . 'user/*/view/' . strtr( $pattern, '?&', '--' ) . '.html' ); + foreach( $files as $f ) { + unlink( $f ); + } + } + } + + public function write() { + if( $this->captured ) { + require_once( 'lib/filesystem.php' ); + Filesystem::mkdirr( dirname($this->fileName) ); + file_put_contents( $this->fileName, ob_get_contents() ); + } + } +} + +?> \ No newline at end of file diff --git a/lib/class.forumops.php b/lib/class.forumops.php new file mode 100644 index 0000000..501e1bc --- /dev/null +++ b/lib/class.forumops.php @@ -0,0 +1,323 @@ + $userdata['name'] ); + if (isset($userdata['email'])) + $vbuser['email'] = $userdata['email']; + if (isset($userdata['pass'])) + $vbuser['password'] = $userdata['pass']; + + return $vbuser; +} + + +define('REGISTERED_USERGROUP', 2); // typical default for registered users +define('PERMANENT_COOKIE', false); // false=session cookies (recommended) + +define('THIS_SCRIPT', __FILE__); +$cwd = getcwd(); +chdir(FORUMPATH); +require_once('./includes/init.php'); // includes class_core.php +require_once('./includes/class_dm.php'); // for class_dm_user.php +require_once('./includes/class_dm_user.php'); // for user functions +require_once('./includes/functions.php'); // vbsetcookie etc. +require_once('./includes/functions_login.php'); // process login/logout + + +//--------------------------------------------------------------------- +// This function duplicates the functionality of fetch_userinfo(), +// using the user name instead of numeric ID as the argument. +// See comments in includes/functions.php for documentation. +//--------------------------------------------------------------------- +function fetch_userinfo_from_username(&$username, $option=0, $languageid=0) +{ + global $vbulletin; + $useridq = $vbulletin->db->query_first_slave("SELECT userid FROM " + . TABLE_PREFIX . "user WHERE username='{$username}'"); + if (!$useridq) return $useridq; + $userid = $useridq['userid']; + return fetch_userinfo($userid, $option, $languageid); +} + + +//--------------------------------------------------------------------- +// CLASS ForumOps +//--------------------------------------------------------------------- +class ForumOps extends vB_DataManager_User { + var $userdm; + +// ********************************************************************************************************* + + function __construct( &$vbulletin ) // constructor + { + $this->vbulletin =& $vbulletin; + $this->userdm =& datamanager_init('user', $vbulletin, ERRTYPE_ARRAY); + } + + function ForumOps() // constructor + { + global $vbulletin; + $this->userdm =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); + } + + // ********************************************************************************************************* + + //======== USER REGISTRATION / UPDATE / DELETE ======== + + function register_newuser(&$userdata, $login = true) + { + global $vbulletin; + $vbuser = userdata_convert($userdata); + foreach($vbuser as $key => $value) + $this->userdm->set($key, $value); + $this->userdm->set('usergroupid', REGISTERED_USERGROUP); + $this->userdm->set('timezoneoffset', 1); + + // Bitfields; set to desired defaults. + // Comment out those you have set as defaults + // in the vBuleltin admin control panel + $this->userdm->set_bitfield('options', 'adminemail', 1); + $this->userdm->set_bitfield('options', 'showsignatures', 1); + $this->userdm->set_bitfield('options', 'showavatars', 0); + $this->userdm->set_bitfield('options', 'showimages', 1); + $this->userdm->set_bitfield('options', 'showemail', 0); + + if ($login) $this->login($vbuser); + + //$this->userdm->errors contains error messages + if (empty($this->userdm->errors)) + $vbulletin->userinfo['userid'] = $this->userdm->save(); + else + return implode('
    ', $this->userdm->errors); + return NULL; + } + +// ********************************************************************************************************* + + function update_user(&$userdata) + { + global $vbulletin; + $vbuser = userdata_convert($userdata); + + if (!($existing_user = fetch_userinfo_from_username($vbuser['username']))) + return 'fetch_userinfo_from_username() failed.'; + + $this->userdm->set_existing($existing_user); + foreach($vbuser as $key => $value) + $this->userdm->set($key, $value); + + // reset password cookie in case password changed + if (isset($vbuser['password'])) + vbsetcookie('password', + md5($vbulletin->userinfo['password'].COOKIE_SALT), + PERMANENT_COOKIE, true, true); + + if (count($this->userdm->errors)) + return implode('
    ', $this->userdm->errors); + $vbulletin->userinfo['userid'] = $this->userdm->save(); + return NULL; + } + + +// ********************************************************************************************************* + + function update_avatar(&$userdata) { + global $vbulletin; + $vbuser = userdata_convert($userdata); + + if (!($existing_user = fetch_userinfo_from_username($vbuser['username']))) + return 'fetch_userinfo_from_username() failed.'; + + $this->userdm->set_existing($existing_user); + + // update avatar in case it should be + if (!empty($vbuser['avatarurl'])) { + //~ echo"
    ";
    +				//~ print_r ($existing_user);
    +			//~ echo "
    "; + + // begin custom avatar code + require_once(DIR . '/includes/class_upload.php'); + require_once(DIR . '/includes/class_image.php'); + + $upload = new vB_Upload_Userpic($vbulletin); + + $upload->data =& datamanager_init('Userpic_Avatar', $vbulletin, ERRTYPE_STANDARD, 'userpic'); + $upload->image =& vB_Image::fetch_library($vbulletin); + $upload->userinfo =& $existing_user; + cache_permissions($existing_user, false); + $upload->maxwidth = $vbulletin->userinfo['permissions']['avatarmaxwidth']; + $upload->maxheight = $vbulletin->userinfo['permissions']['avatarmaxheight']; + if (!$upload->process_upload($vbuser['avatarurl'])) { + echo $upload->fetch_error(); + } + } + else { // no avatar used! + $userpic =& datamanager_init('Userpic_Avatar', $vbulletin, ERRTYPE_CP, 'userpic'); + $userpic->condition = "userid = " . $existing_user['userid']; + $userpic->delete(); + } + $this->userdm->set_existing($vbulletin->userinfo); + + ($hook = vBulletinHook::fetch_hook('profile_updateavatar_complete')) ? eval($hook) : false; + return NULL; + } + +// ********************************************************************************************************* + + function delete_user(&$username) + { + // The vBulletin documentation suggests using userdm->delete() + // to delete a user, but upon examining the code, this doesn't + // delete everything associated with the user. The following + // is adapted from admincp/user.php instead. + // NOTE: THIS MAY REQUIRE MAINTENANCE WITH NEW VBULLETIN UPDATES. + + global $vbulletin; + $db = &$vbulletin->db; + $userdata = $db->query_first_slave("SELECT userid FROM " + . TABLE_PREFIX . "user WHERE username='{$username}'"); + $userid = $userdata['userid']; + if ($userid) { + + // from admincp/user.php 'do prune users (step 1)' + + // delete subscribed forums + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "subscribeforum WHERE userid={$userid}"); + // delete subscribed threads + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "subscribethread WHERE userid={$userid}"); + // delete events + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "event WHERE userid={$userid}"); + // delete event reminders + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "subscribeevent WHERE userid={$userid}"); + // delete custom avatars + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "customavatar WHERE userid={$userid}"); + $customavatars = $db->query_read("SELECT userid, avatarrevision FROM " + . TABLE_PREFIX . "user WHERE userid={$userid}"); + while ($customavatar = $db->fetch_array($customavatars)) { + @unlink($vbulletin->options['avatarpath'] . "/avatar{$customavatar['userid']}_{$customavatar['avatarrevision']}.gif"); + } + // delete custom profile pics + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "customprofilepic WHERE userid={$userid}"); + $customprofilepics = $db->query_read( + "SELECT userid, profilepicrevision FROM " + . TABLE_PREFIX . "user WHERE userid={$userid}"); + while ($customprofilepic = $db->fetch_array($customprofilepics)) { + @unlink($vbulletin->options['profilepicpath'] . "/profilepic$customprofilepic[userid]_$customprofilepic[profilepicrevision].gif"); + } + // delete user forum access + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "access WHERE userid={$userid}"); + // delete moderator + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "moderator WHERE userid={$userid}"); + // delete private messages + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "pm WHERE userid={$userid}"); + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "pmreceipt WHERE userid={$userid}"); + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "session WHERE userid={$userid}"); + // delete user group join requests + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "usergrouprequest WHERE userid={$userid}"); + // delete bans + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "userban WHERE userid={$userid}"); + // delete user notes + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "usernote WHERE userid={$userid}"); + + // from admincp/users.php 'do prune users (step 2)' + + // update deleted user's posts with userid=0 + $db->query_write("UPDATE " . TABLE_PREFIX + . "thread SET postuserid = 0, postusername = '" + . $db->escape_string($username) + . "' WHERE postuserid = $userid"); + $db->query_write("UPDATE " . TABLE_PREFIX + . "post SET userid = 0, username = '" + . $db->escape_string($username) + . "' WHERE userid = $userid"); + + // finally, delete the user + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "usertextfield WHERE userid={$userid}"); + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "userfield WHERE userid={$userid}"); + $db->query_write("DELETE FROM " . TABLE_PREFIX + . "user WHERE userid={$userid}"); + } + /* + the following is suggested in the documentation but doesn't work: + + $existing_user = fetch_userinfo_from_username($username); + $this->userdm->set_existing($existing_user); + return $this->userdm->delete(); + */ + } + + function set_email( $username, $email ) { + global $vbulletin; + $db = &$vbulletin->db; + $db->query_write("UPDATE " . TABLE_PREFIX . "user SET email = '" + .mysql_real_escape_string($email)."' WHERE username = '" + .mysql_real_escape_string($username)."'" + ); + } + + function set_pass( $username, $pass ) { + global $vbulletin; + $db = &$vbulletin->db; + $pass = md5($pass); + $salt = $this->fetch_user_salt(); + $db->query_write("UPDATE " . TABLE_PREFIX . "user SET password = '" + .mysql_real_escape_string(md5($pass.$salt))."', + salt = '".mysql_real_escape_string($salt)."' WHERE username = '" + .mysql_real_escape_string($username)."'" + ); + } + + function fetch_user_salt($length = SALT_LENGTH) { + $salt = ''; + + for ($i = 0; $i < $length; $i++) + { + $salt .= chr(rand(33, 126)); + } + + return $salt; + } + + // ======== USER LOGIN / LOGOUT ======== + + function login($vbuser) + { + global $vbulletin; + $vbulletin->userinfo = fetch_userinfo_from_username($vbuser['username']); + // set cookies + vbsetcookie('userid', $vbulletin->userinfo['userid'], + PERMANENT_COOKIE, true, true); + vbsetcookie('password', + md5($vbulletin->userinfo['password'].COOKIE_SALT), + PERMANENT_COOKIE, true, true); + // create session stuff + process_new_login('', 1, ''); + } + + + function logout() + { + process_logout(); // unsets all cookies and session data + } + +} // end class ForumOps +chdir($cwd); +?> \ No newline at end of file diff --git a/lib/config.php b/lib/config.php new file mode 100644 index 0000000..5bd2221 --- /dev/null +++ b/lib/config.php @@ -0,0 +1,112 @@ + false, + 'path' => '/../forum' + ); + + // Cache settings + public static $cache = array( + 'enabled' => false, + 'path' => 'cache/', + 'clearEvery' => 10 + ); + + // Database settings + public static $db = array( + 'host' => 'localhost', + 'database' => 'name', + 'user' => 'usernmae', + 'password' => 'passwort', + 'prefix' => 'pl_' + ); + + // Image processing and thumbnail creation + public static $images = array( + 'thumbsPerPage' => 125, + 'imagePath' => 'data/images/', + 'thumbPath' => 'data/thumbs/', + 'avatarsPath' => 'data/avatars/', + 'maxDownload' => 8097152, + 'jpegQuality' => 100, + 'sharpen' => false + ); + + // Grid Solver settings + public static $gridView = array( + 'gridSize' => 64, + 'gridWidth' => 12, + 'borderWidth' => 2, + + // Definition of all Thumbnail classes --------------------------- + // KEY: CSS-className + // width/ height: Size of the thumb in grid units + // percentage: Percentage of thumbnails in this size + // dir: Name of the subdir with thumbs in this size + 'classes' => array( + 'b2' => array( 'width'=>1, 'height'=>1, 'percentage'=>0.6, 'dir'=>'64x64' ), + 'b1' => array( 'width'=>2, 'height'=>2, 'percentage'=>0.35, 'dir'=>'128x128' ), + 'b0' => array( 'width'=>3, 'height'=>3, 'percentage'=>0.05, 'dir'=>'192x192' ) + ), + ); +} + + +// Edit below this line only if you know what you're doing! +// ----------------------------------------------------------------------- + +// MySQL Table names +define( 'TABLE_IMAGES', Config::$db['prefix'].'images' ); +define( 'TABLE_IMAGECOLORS',Config::$db['prefix'].'imagecolors' ); +define( 'TABLE_USERS', Config::$db['prefix'].'users' ); +define( 'TABLE_IPLOCK', Config::$db['prefix'].'iplock' ); +define( 'TABLE_UPLOADLOCK', Config::$db['prefix'].'uploadlock' ); +define( 'TABLE_TAGLOG', Config::$db['prefix'].'taglog' ); +define( 'TABLE_COMMENTS', Config::$db['prefix'].'comments' ); + +// MagicQuotes undo +if( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ) { + $_GET = array_map( 'stripslashes', $_GET ); + $_POST = array_map( 'stripslashes', $_POST ); +} + +?> \ No newline at end of file diff --git a/lib/db-mobile.php b/lib/db-mobile.php new file mode 100644 index 0000000..1b4c98e --- /dev/null +++ b/lib/db-mobile.php @@ -0,0 +1,132 @@ + &$value ) { + $r[] = ( $useKeys ? "`$key`=":'' ) . self::quote( $value ); + } + return $r; + } +} + +?> \ No newline at end of file diff --git a/lib/db.php b/lib/db.php new file mode 100644 index 0000000..bcf67bf --- /dev/null +++ b/lib/db.php @@ -0,0 +1,132 @@ + &$value ) { + $r[] = ( $useKeys ? "`$key`=":'' ) . self::quote( $value ); + } + return $r; + } +} + +?> \ No newline at end of file diff --git a/lib/filesystem.php b/lib/filesystem.php new file mode 100644 index 0000000..339f733 --- /dev/null +++ b/lib/filesystem.php @@ -0,0 +1,102 @@ +array( + 'method'=>"GET", + 'header'=>"Referer: $referer\r\n" + ) + ); + $context = stream_context_create($opts); + $fp = fopen( $url, 'r', false, $context ); + } else { + + }*/ + + $contents= file_get_contents($url); + $savefile = fopen($target, "w"); + fwrite($savefile, $contents); + fclose($savefile); + return true; + /* + try { + $fp = @fopen( $url, 'r' ); + } + catch (Exception $e) { + return false; + } + + while ( !feof( $fp ) ) { + $chunk = fread( $fp, 8192 ); + $bytesRead += strlen( $chunk ); + if( $bytesRead > $maxSize) { + return false; + } + $contents .= $chunk; + } + fclose( $fp ); + + file_put_contents( $target, $contents ); + return true;*/ + } +} + +?> diff --git a/lib/getcomments.php b/lib/getcomments.php new file mode 100644 index 0000000..4c41457 --- /dev/null +++ b/lib/getcomments.php @@ -0,0 +1,55 @@ +id); + $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); + $lower = strtolower($posterinfo["name"]); + + if(!($commentimg && ($comments[$c]["userId"] == $imageinfo["user"]))){ + + if (!in_array($lower,$blockeduser)){ + if ($imageinfo && $posterinfo){ + +?> + + + + \ No newline at end of file diff --git a/lib/gridview.php b/lib/gridview.php new file mode 100644 index 0000000..8a8d456 --- /dev/null +++ b/lib/gridview.php @@ -0,0 +1,172 @@ +gridWidth = $gridWidth; + $this->grid = array_fill( 0, $this->gridWidth, 0 ); + } + + // solve expects an array with thumbnails with the keys name and score + public function solve( &$thumbs ) { + if( !is_array( $thumbs ) ) { + return false; + } + + // Order thumbs by importance (score), but leave the keys as they are + uasort( $thumbs, array( $this, 'compareScore' ) ); + + // How many thumbs get which CSS-Class? The first n thumbnails + // get the biggest box etc. + $total = count( $thumbs ); + $classCounts = array(); + $currentCount = 0; + foreach( Config::$gridView['classes'] as $className => $gc ) { + $currentCount += $gc['percentage'] * $total; + $classCounts[$className] = ceil( $currentCount ); + } + + // Assign a CSS-Class to each thumb + $currentMax = -1; + $currentClass = ''; + $j = 0; + foreach( array_keys( $thumbs ) as $i ) { + if( $j >= $currentMax ) { + list( $currentClass, $currentMax ) = each( $classCounts ); + } + $j++; + $thumbs[$i]['class'] = $currentClass; + $thumbs[$i]['thumb'] = Config::$absolutePath . Config::$images['thumbPath'] . + str_replace( '-', '/', substr( $thumbs[$i]['logged'], 0, 7 ) ) + .'/'. Config::$gridView['classes'][$currentClass]['dir'] + .'/'. $thumbs[$i]['thumb']; + } + + // Sort the thumbs back in the order we got them + ksort( $thumbs ); + + // Now that every thumb has a CSS-Class, we can sort them into our grid + for( $i = 0; $i < $total; $i++ ) { + list( $x, $y ) = $this->insert( + Config::$gridView['classes'][$thumbs[$i]['class']]['width'], + Config::$gridView['classes'][$thumbs[$i]['class']]['height'] + ); + $thumbs[$i]['left'] = $x * Config::$gridView['gridSize']; + $thumbs[$i]['top'] = $y * Config::$gridView['gridSize']; + } + + // Calculate the final grid height + for( $i = 0; $i < $this->gridWidth; $i++ ) { + if( $this->grid[$i] > $this->height ) { + $this->height = $this->grid[$i]; + } + } + + return true; + } + + // Callback for uasort() + protected function compareScore( $a, $b ) { + return $a['score'] > $b['score'] ? + 1 : + ( $a['score'] == $b['score'] && $a['votes'] > $b['votes'] ? + 1 : + -1 + ); + } + + protected function insert( $boxWidth, $boxHeight ) { + + // Height of the grid + $maxHeight = 0; + + // Height of the grid at the last position + $currentHeight = $this->grid[0]; + + // Find free spots within the grid and collect them in an arry + // A spot is a area in the grid with equal height + $spotWidth = 0; // Width of the spot in grid units + $spotLeft = 0; // Position in the grid (relative to left border) + $freeSpots = array(); + + for( $i = 0; $i < $this->gridWidth; $i++ ) { + + // Height is the same as at the last position? + // -> increase the size of this spot + if( $currentHeight == $this->grid[$i] ) { + $spotWidth++; + } + + // The height is different from the last position, and our current spot + // is wider than 0 + if( ( $currentHeight != $this->grid[$i] || $i+1 == $this->gridWidth) && $spotWidth > 0 ) { + $freeSpots[] = array( 'width' =>$spotWidth, 'left' => $spotLeft, 'height' => $currentHeight ); + $spotWidth = 1; + $spotLeft = $i; + + // Make sure we don't miss the last one + if( $currentHeight != $this->grid[$i] && $i+1 == $this->gridWidth ) { + $freeSpots[] = array( 'width' =>$spotWidth, 'left' => $spotLeft, 'height' => $this->grid[$i] ); + } + } + + $currentHeight = $this->grid[$i]; + $maxHeight = max( $maxHeight, $this->grid[$i] ); + } + + // Loop through all found spots and rate them, based on their size and height + // This way the smallest possible spot in the lowest possible height is filled + $targetHeight = 0; + $targetLeft = 0; + + // Default spot (left border) if we don't find a better one + for( $i = 0; $i < $boxWidth; $i++ ) { + if( $this->grid[$i] > $targetHeight ) { + $targetHeight = $this->grid[$i]; + } + } + + $bestScore = -1; + foreach( array_keys( $freeSpots ) as $i ) { + + // Difference of the height of this spot to the total height of the grid + $heightScore = ( $maxHeight - $freeSpots[$i]['height'] ); + + // Relation of the required and the available space + $widthScore = $boxWidth / $freeSpots[$i]['width']; + + // The score for this spot is calculated by these both criteria + $score = $heightScore * $heightScore + $widthScore * 2; + + // Is the score for this spot higher than for the last one we found? + if( $freeSpots[$i]['width'] >= $boxWidth && $score > $bestScore ) { + $targetHeight = $freeSpots[$i]['height']; + $targetLeft = $freeSpots[$i]['left']; + $bestScore = $score; + } + } + + $newHeight = $targetHeight + $boxHeight; + + // Adjust grid height + for( $j = 0; $j < $boxWidth; $j++ ) { + $this->grid[$targetLeft + $j] = $newHeight; + } + + return array( $targetLeft, $targetHeight ); + } +} + +?> \ No newline at end of file diff --git a/lib/imagebrowser.php b/lib/imagebrowser.php new file mode 100644 index 0000000..27650b2 --- /dev/null +++ b/lib/imagebrowser.php @@ -0,0 +1,258 @@ +thumbsPerPage = abs(intval($thumbsPerPage)); + } + + public function setPage( $page ) { + $page = intval($page); + $this->page = $page > 0 ? $page - 1 : 0; + } + public function setComment( $cmt,$un ) { + $this->commentBool = $cmt ; + $this->unreadBool = $un; + } + public function setFav( $fav ) { + $this->FavBool = $fav ; + } + public function setuserID( $id ) { + $this->userID = $id ; + } + +public function sortByOneKey(array $array, $key, $asc = true) { + $result = array(); + + $values = array(); + foreach ($array as $id => $value) { + $values[$id] = isset($value[$key]) ? $value[$key] : ''; + } + + if ($asc) { + asort($values); + } + else { + arsort($values); + } + + foreach ($values as $key => $value) { + $result[$key] = $array[$key]; + } + + return $result; +} + + + +function multi_unique($myArray) +{ + if(!is_array($myArray)) + return $myArray; + + foreach ($myArray as &$myvalue){ + $myvalue=serialize($myvalue); + } + + $myArray=array_unique($myArray); + + foreach ($myArray as &$myvalue){ + $myvalue=unserialize($myvalue); + } + + return $myArray; + +} + + + public function load() { + $this->grid=true; + + if( !empty( $this->searchColor ) ) { // ----------------------------------- color search + $this->thumbs = DB::query( + 'SELECT SQL_CALC_FOUND_ROWS + i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS, + i.keyword, i.thumb, i.score, i.votes, + u.name AS userName, + MIN( ABS(ic.r - :3) + ABS(ic.g - :4) + ABS(ic.b - :5) ) AS deviation + FROM '.TABLE_IMAGES.' i + LEFT JOIN '.TABLE_USERS.' u + ON u.id = i.user + LEFT JOIN '.TABLE_IMAGECOLORS.' ic + ON ic.imageId = i.id + WHERE + ic.r BETWEEN :3 - :6 AND :3 + :6 + AND + ic.g BETWEEN :4 - :6 AND :4 + :6 + AND + ic.b BETWEEN :5 - :6 AND :5 + :6 + GROUP BY i.id + ORDER BY deviation, i.id DESC + LIMIT :1, :2', + $this->page * $this->thumbsPerPage, + $this->thumbsPerPage, + + $this->searchColor['r'], + $this->searchColor['g'], + $this->searchColor['b'], + Config::$colorSearchDev + ); + } + else if( $this->searchTerm ) { // ------------------------ fulltext search + $ftq = preg_replace( '/\s+/',' +', $this->searchTerm ); + $this->thumbs = DB::query( + 'SELECT SQL_CALC_FOUND_ROWS + i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS, + i.keyword, i.thumb, i.score, i.votes, + u.name AS userName + FROM '.TABLE_IMAGES.' i + LEFT JOIN '.TABLE_USERS.' u + ON u.id = i.user + WHERE + i.image LIKE :3 + OR MATCH( i.tags ) AGAINST ( :4 IN BOOLEAN MODE ) + ORDER BY i.id DESC + LIMIT :1, :2', + $this->page * $this->thumbsPerPage, + $this->thumbsPerPage, + + '%'.$this->searchTerm.'%', + $ftq + ); + } + + elseif ($this->commentBool) { + + if($this->unreadBool) { + + $this->thumbs = DB::query("SELECT SQL_CALC_FOUND_ROWS i.logged, UNIX_TIMESTAMP(i.logged) as loggedTS,i.keyword as keyword, i.thumb as thumb, i.score as score, i.votes as votes, us.name as userName FROM pl_images as i, pl_unread as u, pl_users as us WHERE u.userid = :1 AND u.imageid=i.id AND us.id=i.user ORDER BY loggedTS DESC LIMIT :2, :3",$this->userID, + $this->page * $this->thumbsPerPage,$this->thumbsPerPage); + if (count($this->thumbs) < $this->thumbsPerPage){ + $this->thumbsPerPage = count($this->thumbs);} + + }else{ + $this->thumbs = DB::query('SELECT SQL_CALC_FOUND_ROWS i.logged, UNIX_TIMESTAMP(i.logged) as loggedTS,i.keyword as keyword, i.thumb as thumb, i.score as score, i.votes as votes, u.name as userName FROM pl_comments as c, pl_images as i, pl_users as u WHERE c.c_like=0 AND c.userId=u.id AND c.userId=:1 AND i.id=c.imageId GROUP BY c.imageId ORDER BY loggedTS DESC LIMIT :2, :3',$this->userID, + $this->page * $this->thumbsPerPage,$this->thumbsPerPage); + + } + + + $this->commentState = true; + $this->basePath = "comments/"; + + + + + }elseif ($this->FavBool) { + $this->thumbs = DB::query("SELECT SQL_CALC_FOUND_ROWS i.logged, UNIX_TIMESTAMP( i.logged ) AS loggedTS, i.keyword AS keyword, i.thumb AS thumb, i.score AS score, i.votes AS votes, u.name AS userName +FROM pl_fav AS c, pl_images AS i, pl_users AS u +WHERE c.user = u.id +AND c.user =:1 +AND i.id = c.imageId +GROUP BY c.imageId +ORDER BY loggedTS DESC LIMIT :2, :3",$this->userID, + $this->page * $this->thumbsPerPage,$this->thumbsPerPage); + $this->basePath = "favorites/"; + $this->FavState = true; + + + }else { // -------------------------------------------------------- user/all + $conditions = ''; + if( !empty($this->user) ) { + $conditions .= ' AND i.user = :3'; + } + + $this->thumbs = DB::query( + 'SELECT SQL_CALC_FOUND_ROWS + i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS, + i.keyword, i.thumb, i.score, i.votes, + u.name AS userName + FROM '.TABLE_IMAGES.' i + LEFT JOIN '.TABLE_USERS.' u + ON u.id = i.user + WHERE 1 '.$conditions.' + ORDER BY i.id DESC + LIMIT :1, :2', + + + + $this->page * $this->thumbsPerPage, + $this->thumbsPerPage, + $this->user['id'] + ); + + $this->grid=true; + if(count($this->thumbs) > 3){ + $this->thumbs[0]["score"] = "100"; + $this->thumbs[1]["score"] = "10"; + $this->thumbs[2]["score"] = "10"; + + $thumbsCount = count($this->thumbs); + if ($thumbsCount > 50){ + for ($i=$thumbsCount-40; $i<$thumbsCount; $i++){ + $this->thumbs[$i]["score"] = "0"; + } + } + } + + } + + $this->totalResults = DB::foundRows(); + + + // compute previoues, current and next page + if( $this->totalResults > 0 ) { + $this->pages['current'] = $this->page+1; + $this->pages['total'] = ceil($this->totalResults / $this->thumbsPerPage); + if( $this->page > 0 ) { + $this->pages['prev'] = $this->page; + } + if( $this->totalResults > $this->thumbsPerPage * $this->page + $this->thumbsPerPage ) { + $this->pages['next'] = $this->page + 2; + } + } + } + + public function loadRandom( $minScore, $thumbSize ) { + $this->thumbs = DB::query( + 'SELECT SQL_CALC_FOUND_ROWS + i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS, + i.keyword, i.thumb, i.score, i.votes, + u.name AS userName + FROM '.TABLE_IMAGES.' i + LEFT JOIN '.TABLE_USERS.' u + ON u.id = i.user + WHERE i.score >= :2 + ORDER BY RAND() + LIMIT :1', + + $this->thumbsPerPage, + $minScore + ); + + foreach( array_keys( $this->thumbs ) as $i ) { + $this->thumbs[$i]['thumb'] = Config::$images['thumbPath'] . + str_replace( '-', '/', substr( $this->thumbs[$i]['logged'], 0, 7 ) ) + .'/'. $thumbSize + .'/'. $this->thumbs[$i]['thumb']; + } + } +} + +?> \ No newline at end of file diff --git a/lib/imagecatalog.php b/lib/imagecatalog.php new file mode 100644 index 0000000..3d90ce4 --- /dev/null +++ b/lib/imagecatalog.php @@ -0,0 +1,61 @@ +user = DB::getRow( + 'SELECT id, name, score, images, avatar, website + FROM '.TABLE_USERS.' + WHERE + valid = 1 AND + name = :1', + $name + ); + if( !empty($this->user) ) { + $this->basePath = 'user/'.$this->user['name'].'/'; + } + } + + public function setSearch( $term ) { + + $this->basePath = 'search/'.htmlspecialchars($term).'/'; + + if( preg_match( '/^\s*0x([0-9a-f]{6})\s*$/i', $term, $m ) ) { + $c = str_split( $m[1], 2 ); + $this->searchColor = array( + 'r' => hexdec($c[0]), + 'g' => hexdec($c[1]), + 'b' => hexdec($c[2]), + ); + } + else if( !empty($term) ) { + $this->searchTerm = $term; + $ftq = preg_replace( '/\s+/',' +', $this->searchTerm ); + $this->seachCondition .= " AND ( + i.image LIKE ".DB::quote('%'.$this->searchTerm.'%')." + OR MATCH( i.tags ) AGAINST ( ".DB::quote($ftq)." IN BOOLEAN MODE ) + )"; + } + } + + + + public function load() { + } +} + +?> \ No newline at end of file diff --git a/lib/images.php b/lib/images.php new file mode 100644 index 0000000..adbaea4 --- /dev/null +++ b/lib/images.php @@ -0,0 +1,98 @@ + 10000 + || $srcHeight < 1 || $srcHeight > 10000 + ) { + return false; + } + + if( $type == IMAGETYPE_JPEG ) { + $imgcreate = 'ImageCreateFromJPEG'; + } else if( $type == IMAGETYPE_GIF ) { + $imgcreate = 'ImageCreateFromGIF'; + } else if( $type == IMAGETYPE_PNG ) { + $imgcreate = 'ImageCreateFromPNG'; + } else { + return false; + } + + $thumbDirName = dirname( $thumbPath ); + + if( ( $srcWidth/$srcHeight ) > ( $thumbWidth/$thumbHeight ) ) { + $zoom = ($srcWidth/$srcHeight) / ($thumbWidth/$thumbHeight); + $srcX = ($srcWidth - $srcWidth / $zoom) / 2; + $srcWidth = $srcWidth / $zoom; + } + else { + $zoom = ($thumbWidth/$thumbHeight) / ($srcWidth/$srcHeight); + $srcY = ($srcHeight - $srcHeight / $zoom) / 2; + $srcHeight = $srcHeight / $zoom; + } + + $thumb = Imagecreatetruecolor( $thumbWidth, $thumbHeight ); + $orig = $imgcreate( $imgPath ); + Imagecopyresampled($thumb, $orig, 0, 0, $srcX, $srcY, $thumbWidth, $thumbHeight, $srcWidth, $srcHeight); + + if( Config::$images['sharpen'] && function_exists('imageconvolution') ) { + $sharpenMatrix = array( array(-1,-1,-1), array(-1,16,-1), array(-1,-1,-1) ); + imageconvolution($thumb, $sharpenMatrix, 8, 0); + } + imagejpeg( $thumb, $thumbPath, Config::$images['jpegQuality'] ); + + // clean up + Imagedestroy( $thumb ); + Imagedestroy( $orig ); + + return true; + } + + public static function getColors( $imgPath, $size ) { + list( $srcWidth, $srcHeight, $type ) = getimagesize( $imgPath ); + + if( $type == IMAGETYPE_JPEG ) { + $imgcreate = 'ImageCreateFromJPEG'; + } else if( $type == IMAGETYPE_GIF ) { + $imgcreate = 'ImageCreateFromGIF'; + } else if( $type == IMAGETYPE_PNG ) { + $imgcreate = 'ImageCreateFromPNG'; + } else { + return array(); + } + + $orig = $imgcreate( $imgPath ); + + $thumb = Imagecreatetruecolor( $size, $size ); + Imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $size, $size, $srcWidth, $srcHeight); + + $colors = array(); + for( $x = 0; $x < $size; $x++ ) { + for( $y = 0; $y < $size; $y++ ) { + $rgb = ImageColorAt($thumb, $x, $y); + $r = ($rgb >> 16) & 0xFF; + $g = ($rgb >> 8) & 0xFF; + $b = $rgb & 0xFF; + $colors[] = array( + 'r' => $r, + 'g' => $g, + 'b' => $b + ); + } + } + return $colors; + } +} + +?> \ No newline at end of file diff --git a/lib/imageuploader.php b/lib/imageuploader.php new file mode 100644 index 0000000..25f661b --- /dev/null +++ b/lib/imageuploader.php @@ -0,0 +1,324 @@ +login(); + + if( !$user->id ) { + $errors['notLoggedIn'] = 'You are not logged in!'; + return false; + } + + // no non-images + if( + !preg_match( '/([^\/]*?)\.(gif|jpg|jpeg|png)$/i', $name, $fileMatch ) + ) { + $errors['wrongExtension'] = 'Your file has not the right extension (gif, jpg or png)!'; + self::writeError("1"); + return false; + } + + $time = time(); + $keyword = Keyword::get( $fileMatch[1] ); + + // Iterate over all keywords, if this one is allready taken + $taken = array(); + $r = DB::query( 'SELECT keyword FROM '.TABLE_IMAGES.' WHERE keyword LIKE :1', date('Y/m/',$time).$keyword.'%' ); + foreach( $r as $v ) { + $taken[] = substr($v['keyword'],8); // Keyword without date! + } + $keyword = Keyword::iterate( $keyword, $taken ); + + list( $srcWidth, $srcHeight, $type, $attr ) = getimagesize($localPath); + + if( $type == IMAGETYPE_JPEG ) { + $extension = 'jpg'; + } else if( $type == IMAGETYPE_GIF ) { + $extension = 'gif'; + } else if( $type == IMAGETYPE_PNG ) { + $extension = 'png'; + } else if($uploaded == false) { + if(preg_match( '/([^\/]*?)\.(jpg|jpeg)$/i', $localPath, $fileMatch )) { + $extension = 'jpg'; + } + else if(preg_match( '/([^\/]*?)\.(png)$/i', $localPath, $fileMatch )) { + $extension = 'png'; + } + else if(preg_match( '/([^\/]*?)\.(gif)$/i', $localPath, $fileMatch )) { + $extension = 'gif'; + } + + } else { + self::writeError("2"); + return false; + } + + + + + $thumbName = $keyword.".jpg"; // all thumbs are jpegs! + $name = $keyword.".".$extension; + $imageDir = Config::$images['imagePath'] . date('Y/m', $time); + $thumbDir = Config::$images['thumbPath'] . date('Y/m', $time); + $imagePath = $imageDir.'/'.$name; + + if( !Filesystem::mkdirr($imageDir) || !Filesystem::mkdirr($thumbDir) ) { + $errors['downloadFailed'] = 'folder failed'; + self::writeError("3"); + return false; + } + + if( $uploaded ) { + if( !@move_uploaded_file( $localPath, $imagePath ) ) { + $errors['downloadFailed'] = 'move failed'; + return false; + } + } else { + if( !@rename( $localPath, $imagePath ) ) { + $errors['downloadFailed'] = 'rename failed'; + self::writeError($extension); + + return false; + } + } + self::writeError($imagePath); + + if($commentUpload == false && $cid == 0){ + $hash = md5_file( $imagePath ); + $c = DB::getRow('SELECT id,keyword FROM '.TABLE_IMAGES.' WHERE hash = :1', $hash); + if( !empty( $c ) ) { + + unlink( $imagePath ); + $errors['duplicate'] = + 'This image is already in our database!'."
    Click here to comment it."; + self::writeError("5"); + return false; + + }else{ + $c = DB::query('SELECT id FROM pl_bannedimages WHERE hash = :1', $hash); + if( !empty( $c ) ) { + unlink( $imagePath ); + $errors['duplicate'] = 'This image is already in our database!'; + self::writeError("6"); + return false; + } + } + + + } + + + + // make thumbs + foreach( Config::$gridView['classes'] as $gc ) { + $thumbPath = $thumbDir.'/'.$gc['dir'].'/'.$thumbName; + Filesystem::mkdirr($thumbDir.'/'.$gc['dir']); + if( !Image::createThumb( $imagePath, $thumbPath, + $gc['width'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth'], + $gc['height'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth'] + )) { + unlink( $imagePath ); + $errors['internalError'] = 'Error generating thumbnails!'; + return false; + } + } + + ///watermark + watermark($imagePath,"media/watermark.png",$imagePath); + ///watermark + + $user->increaseScore( Config::$postScore ); + + + + + if (($commentUpload) && ($cid != 0)){ + + DB::query('INSERT INTO pl_commentuploads (c_id,image_link,thumb_link) VALUES (:1,:2,:3)',$cid,$imagePath,"data/thumbs/".date('Y/m/', $time)."64x64/".$thumbName); + + + + + /*DB::insertRow( "pl_commentuploads",array('c_id' => $cid,"image_link" =>$imagePath,"thumb_link" => "data/thumbs/".date('Y/m/', $time)."/128x128/".$name));*/ + + }else{ + $iCount = DB::getRow("SELECT COUNT(*) as c FROM pl_images WHERE user=:1",$user->id); + DB::query( 'UPDATE '.TABLE_USERS.' SET images =:2 WHERE id = :1', $user->id,(int)$iCount["c"]); + + DB::insertRow( TABLE_IMAGES, + array( + 'logged' => date('Y-m-d H:i:s', $time), + 'user' => $user->id, + 'score' => 1, + 'votes' => 0, + 'keyword' => date('Y/m/', $time).$keyword, + 'tags' => $tags, + 'image' => $name, + 'thumb' => $thumbName, + 'hash' => $hash, + 'source' => $source + ) + ); + } + + $imageId = DB::insertId(); + + /*$colors = Image::getColors( $imagePath, 4 ); + foreach( $colors as $c ) { + DB::insertRow( TABLE_IMAGECOLORS, + array( + 'imageId' => $imageId, + 'r' => $c['r'], + 'g' => $c['g'], + 'b' => $c['b'] + ) + ); + }*/ + return true; + } +} + + + function watermark($SourceFile, $WatermarkFile, $SaveToFile = NULL) + +{ + + list( $srcWidth, $srcHeight, $type ) = getimagesize( $SourceFile ); + if( $type != IMAGETYPE_GIF ) { + + $watermark = @imagecreatefrompng($WatermarkFile) + + + or exit('Cannot open the watermark file.'); + + imageAlphaBlending($watermark, false); + + imageSaveAlpha($watermark, true); + + $image_string = @file_get_contents($SourceFile) + + + or exit('Cannot open image file.'); + + $image = @imagecreatefromstring($image_string) + + + or exit('Not a valid image format.'); + + /*$tmp = imagecreatetruecolor($srcWidth,($srcHeight + 30));*/ + + /*$back = imagecolorallocatealpha($image, 0, 0, 0,60); + imagefilledrectangle($image,0, $srcHeight - 20,$srcWidth,$srcHeight ,$back); */ + + /*imagecopy($tmp,$image,0,0,0,0,$srcWidth,$srcHeight); + + $image = $tmp;*/ + + + $imageWidth=imageSX($image); + $imageHeight=imageSY($image); + + $watermarkWidth=imageSX($watermark); + $watermarkHeight=imageSY($watermark); + + $coordinate_X = ( $imageWidth) - ( $watermarkWidth); + $coordinate_Y = ( $imageHeight) - ( $watermarkHeight); + + imagecopy($image, $watermark, $coordinate_X, $coordinate_Y, 0, 0, $watermarkWidth, $watermarkHeight); + + if(!($SaveToFile)) header('Content-Type: image/jpeg'); + + imagejpeg ($image, $SaveToFile, 100); + + + imagedestroy($image); + + imagedestroy($watermark); + + if(!($SaveToFile)) exit; + } + +} + + +?> diff --git a/lib/imageviewer.php b/lib/imageviewer.php new file mode 100644 index 0000000..64be10a --- /dev/null +++ b/lib/imageviewer.php @@ -0,0 +1,209 @@ +keyword = $keyword; + } + public function setFav( $case ) { + $this->Fav = $case; + } + public function CommentSpam( $userId) { + + } + + public function addComment( $userId, $comment,$iname="") { + + + $countcomments = DB::getRow("SELECT COUNT(*) as c FROM pl_comments WHERE created > now() - INTERVAL 10 SECOND AND userId=:1",$userId); + $sp = DB::getRow("SELECT spamblocked, time FROM pl_users WHERE id=:1",$userId); + + if (intval($countcomments["c"]) > 2 || $sp["spamblocked"] == 1) { + if (int($sp["time"]) > 0){ + $timeAdd = int($sp["time"]) + 1800; + }else{ + $timeAdd = time() + 1800; + } + DB::updateRow("pl_users",array("id" => $userId),array("spamblocked" => 1,"spam_reason"=>"Commentspam","time" => $timeAdd)); + return false; + }else{ + + if( $this->image['id'] && $userId && !empty($comment)) { + + + $datenow = date( 'Y.m.d H:i:s' ); + + if (strlen($iname) > 0){ + DB::insertRow( TABLE_COMMENTS, array( + 'imageId' => $this->image['id'], + 'userId' => $userId, + 'created' => $datenow, + 'content' => $comment, + 'thumb' => 1)); + + + }else{ + DB::insertRow( TABLE_COMMENTS, array( + 'imageId' => $this->image['id'], + 'userId' => $userId, + 'created' => $datenow, + 'content' => $comment, + 'thumb' =>0)); + } + if ($this->image['user'] != $userId){ + DB::query("UPDATE pl_images SET score=score+1 WHERE id=:1",$this->image['id']); + } + + + + $comments_load = DB::query( + 'SELECT userId FROM pl_comments WHERE imageid=:1', + $this->image['id'] + ); + + + + foreach( array_keys($comments_load) as $i ) { + + + $counter = DB::getRow("SELECT COUNT(*) as c FROM pl_unread WHERE userid=:1 AND imageid=:2",$comments_load[$i]["userId"],$this->image['id']); + + if (($counter["c"] == 0) && $comments_load[$i]["userId"] != $userId){ + DB::insertRow( "pl_unread", array('imageid' =>$this->image['id'], 'userid' => $comments_load[$i]["userId"],'keyword' => $this->keyword, 'createdby' => $userId)); + } + + + } + + $counter = DB::getRow("SELECT COUNT(*) as c FROM pl_unread WHERE userid=:1 AND imageid=:2",$this->image["user"],$this->image['id']); + if ($counter["c"] == 0 && $this->image["user"] != $userId){ + DB::insertRow( "pl_unread", array('imageid' =>$this->image['id'], 'userid' => $this->image["user"],'keyword' => $this->keyword, 'createdby' => $userId));} + + + + + + return true; + + } else { + return false; + } + } + } + + public function load() { + + + $conditions = ''; + if( !empty($this->user) ) { + $conditions .= ' AND i.user = :2'; + $this->userInfo = $this->user; + } + $this->image = DB::getRow( + 'SELECT + i.id, i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS, + i.keyword, i.image, i.score, i.votes, + tags, u.name AS userName, i.user, u.color + FROM '.TABLE_IMAGES.' i + LEFT JOIN '.TABLE_USERS.' u + ON u.id = i.user + WHERE i.keyword = :1 '.$conditions, + $this->keyword, + $this->user['id'] + ); + $this->image['path'] = date('Y/m/', $this->image['loggedTS']).$this->image['image']; + + if( empty( $this->user) ) { + $this->userInfo = DB::getRow( + 'SELECT id, name, score, images, avatar, website, color + FROM '.TABLE_USERS.' + WHERE + id = :1', + $this->image['user'] + ); + } + + // compute previoues and next page + $next = DB::getRow( + 'SELECT i.keyword + FROM '.TABLE_IMAGES.' i + WHERE i.id < :1 '.$conditions.' + ORDER BY id DESC + LIMIT 1', + $this->image['id'], + $this->user['id'] + ); + + $prev = DB::getRow( + 'SELECT i.keyword + FROM '.TABLE_IMAGES.' i + WHERE i.id > :1 '.$conditions.' + ORDER BY id ASC + LIMIT 1', + $this->image['id'], + $this->user['id'] + ); + + + + if( !empty($next) ) { + $this->stream['next'] = $next['keyword']; + } + if( !empty($prev) ) { + $this->stream['prev'] = $prev['keyword']; + } + } + + public function howlong($a=0, $b=0) { + if (!is_numeric($a)) $a = strtotime($a); if (!is_numeric($b)) $b = strtotime($b); + if ($a == 0) $a = time(); if ($b == 0) $b = time(); + if ($a == $b) return "at the same time"; + if ($a > $b) { $aa = $b; $b = $a; $a = $aa; $q = "away"; } else { $q = "ago"; } + $value = $b-$a; + if ($value == 1) return "1 sec $q"; + if ($value < 60) return "$value sec $q"; + $value /= 60; + if (round($value) == 1) return "1 min $q"; + if ($value < 60) return round($value) . " min $q"; + $value /= 60; + if (round($value) == 1) return "1 hour $q"; + if ($value < 24) return round($value) . " hours $q"; + $value /= 24; + if (round($value) == 1) if ($q == "ago") return "yesterday"; else return "tomorrow"; + if ($value < 31) return round($value) . " days $q"; + $value /= 31; + if (round($value) == 1) return "1 month $q"; + if ($value < 12) return round($value) . " months $q"; + $value /= 12; + if (round($value) == 1) return "1 year $q"; + return round($value) . " years $q"; + } + + + + + + public function loadComments() { + + } +} + +?> \ No newline at end of file diff --git a/lib/keyword.php b/lib/keyword.php new file mode 100644 index 0000000..5c77b87 --- /dev/null +++ b/lib/keyword.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/lib/staticfiles.class.php b/lib/staticfiles.class.php new file mode 100644 index 0000000..b808ba4 --- /dev/null +++ b/lib/staticfiles.class.php @@ -0,0 +1,635 @@ + array( + 'files' => array(), // will be filled with addMedia() + 'tplHtml' => '', + 'fRewrite' => '', + 'fCompress' => 'compressJs', + ), + 'css' => array( + 'files' => array(), // will be filled with addMedia() + 'tplHtml' => '', + 'fRewrite' => 'rewriteCss', + 'fCompress' => 'compressCss', + ) + ); + + /** + * flag: show debug output? If it is true then you see the merged files, + * replacements and statistic data in the html header section (as comment) + * @var boolean + */ + var $bDebug = false; // debug enables additional infos + + /** + * flag: merge files into a cachefile? If it is false then the source + * files will be used. This is helpful in the development environment to + * debug code with original files. + * @var boolean + */ + var $bMerging = false; // use compressed files; false links to original files + + /** + * flag: overwrite cachefile on each request? + * You can use it in your development environment. It overrides the setting + * of $this->iMinCacheTime and regenerates merged cachefiles on each request. + * debug code with original files. + * @var boolean + */ + var $bRewriteOnEachRequest = false; + + /** + * minimum time to cache js and css cachefile on server - even one of the + * source files have been changed. + * @var integer + */ + var $iMinCacheTime = 3600; + + /** + * name for basepath behind webroot + * @var string + */ + var $sCacheBase = '/~cache/'; + + /** + * absolute path of cache directory; it will be set in the method + * setDefaults to [document root]/$this->sCacheBase/ + * @var string + */ + var $sCacheDir = false; + + // ---------------------------------------------------------------------- + // INIT + // ---------------------------------------------------------------------- + + /** + * init function; it sets defaults. + * @return bool (dummy) + */ + public function __construct() { + return $this->setDefaults(); + } + + // ---------------------------------------------------------------------- + // private functions + // ---------------------------------------------------------------------- + + /** + * generate html code to link the cachefile (or original files if cache is disabled) + * @param string $sType type; one of css|js + * @param array $aFile array with filedata (keys are attributes) + * @return string html code + */ + private function _genHtml($sType, $aFile) { + $s = $this->_aStatic[$sType]["tplHtml"]; + + // TODO: autodetect with pregmatch + $aReplace = array("SRC", "DEFER", "HREF", "MEDIA", "TITLE"); + + foreach ($aReplace as $sFrom) { + $sKey = strtolower($sFrom); + $sTo = ""; + if ($aFile[$sKey]) + $sTo = " $sKey=\"" . $aFile[$sKey] . "\" "; + $s = str_replace($sFrom, $sTo, $s); + } + $s = str_replace('defer="execution"', " ", $s); + $s = str_replace(" ", " ", $s); + $s = str_replace(" ", " ", $s); + $s = str_replace(" >", ">", $s); + return $s; + } + + /** + * show some statistics info about code compression an gzip + * @param type $sOrig + * @param type $sCrunched + * @param type $sCommment + * @return type + */ + private function _getStats($sOrig, $sCrunched, $sCommment) { + if (!$this->bDebug) + return ""; + + $iOrigSize = strlen($sOrig); + $iNewSize = strlen($sCrunched); + $igzSize1 = strlen(gzencode($sOrig)); + $igzSize2 = strlen(gzencode($sCrunched)); + return $sCommment . " + statistics: + ... orig size: $iOrigSize bytes + ... compression function: " . $iNewSize . " byte (" . (100 - round($iNewSize / $iOrigSize * 100)) . "% less) + + ... gzip + ...... orig " . $igzSize1 . " byte (" . (100 - round($igzSize1 / $iOrigSize * 100)) . "% less) + ...... compressed: " . $igzSize2 . " byte (" . (100 - round($igzSize2 / $iNewSize * 100)) . "% less than crunched; " . (100 - round($igzSize2 / $iOrigSize * 100)) . "% less than original) + "; + } + + /** + * write logging information (only if debug is enabled) + * @param type $s + * @return type + */ + private function _log($s) { + if (!$this->bDebug) + return true; + + if ($s == "===") + $s = "================================================================================"; + if ($s == "---") + $s = "................................................................................"; + echo "\n"; + } + + // ---------------------------------------------------------------------- + // add media files + // ---------------------------------------------------------------------- + + /** + * add a css file to this object + * @param string $sFile path and filename of css file like in href attribute + * @param string $sMedia media type + * @param title $sTitle title (will be ignored so far) + * @return bool (dummy) + */ + public function addCss($sFile, $sMedia = 'all', $sTitle = '') { + return $this->addMedia("css", array( + 'file' => $sFile, + 'href' => $sFile, + 'media' => $sMedia, + 'title' => $sTitle, + ) + ); + } + + /** + * add a js file to the js array + * @param string $sFile file to load + * @param string $sDefer + * @return type + */ + public function addJs($sFile, $defer = "execution") { + return $this->addMedia("js", array( + 'file' => $sFile, + 'src' => $sFile, + 'defer' => $defer, + ) + ); + } + + /** + * add media file to array; it is called by addJs() and addCss() + * @param string $sType one of css|js + * @param array $aFiledata; Keys: file: filename; other: attributes + * @return type + */ + public function addMedia($sType, $aFiledata) { + $sGroup = false; + if ($sType == "css") + $sGroup = $aFiledata["media"]; + if ($sType == "js") + $sGroup = $aFiledata["defer"]; + if (!$sGroup) + return false; + return $this->_aStatic[$sType]["files"][$sGroup][] = $aFiledata; + } + + /** + * compress css code: remove spaces, tabs, line breaks + * @param string $s css data + * @return string rewritten css data + */ + public function compressCss($s) { + // remove unneded spaces, tabs, new lines + $s = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ',), '', $s); + + /* remove unnecessary spaces */ + foreach (explode(" ", "{ } ; , ; ( ) ") as $char) { + $s = str_replace('\ *' . $char . '\ *', '{', $s); + } + // remove comments + $s = preg_replace('#\/\*.*\*\/#U', '', $s); + return $s; + } + + /** + * compress js code + * @param string $s js code + * @return string with new js code + */ + public function compressJs($s) { + /* remove tabs, spaces, new lines, etc. */ + $s = str_replace(array("\t", ' ', ' '), ' ', $s); + + /* remove unnecessary spaces */ + foreach (explode(" ", "{ } ; , ; ( ) ") as $char) { + $s = str_replace('\ *' . $char . '\ *', '{', $s); + } + return $s; + } + + // ---------------------------------------------------------------------- + // getter + // ---------------------------------------------------------------------- + + /** + * get current basepath of cache + * @return boolean + */ + public function getCacheBase() { + return $this->sCacheBase; + } + + /** + * get full path of current cache directory + * @return boolean + */ + public function getCacheDir() { + return $this->sCacheDir; + } + + /** + * get current debug flag + * @return boolean + */ + public function getDebug() { + return $this->bDebug; + } + + /** + * get current merge flag + * @return boolean + */ + public function getMerging() { + return $this->bMerging; + } + + /** + * get current caching time on server + * @return integer + */ + public function getMinCacheTime() { + return $this->iMinCacheTime; + } + + /** + * get current flag to rewrite the cache + * @return boolean + */ + public function getRewriteCache() { + return $this->bRewriteOnEachRequest; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + /** + * rewrite urls in css data; this function finds relative + * pathes and rewrites them to absolute pathes + * @param string $s css content + * @param string $sFile filename of included css (to detect the "current" path) + * @return string the reswritten css code + */ + public function rewriteCss($s, $sFile) { + + $aFrom = array(); + $aTo = array(); + $treffer = array(); + preg_match_all("/url\((.*)\)/", $s, $treffer, PREG_OFFSET_CAPTURE); + foreach ($treffer[1] as $sUrl) { + if (strpos($sUrl[0], "../") or true) { + + $sTo = $sUrl[0]; + $sWrap = $sTo[0]; + if ($sWrap == "'" or $sWrap == '"') { + $sTo = str_replace($sWrap, "", $sTo); + } else + $sWrap = ""; + + // if there is no absolute path then try to rewrite + if ($sTo[0] != "/") { + $sTo = str_replace($sWrap, "", $sTo); + + // do replacements + $sDir = dirname($sFile); + $sTo = str_replace("../", "", $sTo, $count); + for ($i = 0; $i < $count; $i++) { + $sDir = str_replace(basename($sDir), "", $sDir); + } + $sTo = $sDir . "/" . $sTo; + $sTo = str_replace("//", "/", $sTo); + $sTo = str_replace("./", "", $sTo); + + // add wrapping characters + $sTo = $sWrap . $sTo . $sWrap; + + $aFrom[] = $sUrl[0]; + $aTo[] = $sTo; + $this->_log("replacing " . $sUrl[0] . " to: " . $sTo . " "); + } + } + } + if (count($aFrom)) + $s = str_replace($aFrom, $aTo, $s); + return $s; + } + + // ---------------------------------------------------------------------- + // setter + // ---------------------------------------------------------------------- + + /** + * set another basepath (behind webroot) + * @param string new basepath + * @return boolean + */ + public function setCacheBase($str) { + $this->sCacheDir = $_SERVER["DOCUMENT_ROOT"] . $str; + return $this->sCacheBase = $str; + } + + /** + * set another cache directory. + * @param string new basepath (below webroot) + * @return boolean + */ + public function setCacheDir($str) { + return $this->sCacheDir = $_SERVER["DOCUMENT_ROOT"] . $str; + } + + /** + * set debug flag (for development environment) + * @param boolean set true to enable debug output + * @return boolean + */ + public function setDebug($bool) { + return $this->bDebug = (bool) $bool; + } + + /** + * set debug default settings + * @return bool (always true) + */ + public function setDebugDefaults() { + $this->iMinCacheTime = 0; + $this->bDebug = true; + $this->bMerging = true; // set to false that you can debug with original files + $this->bRewriteOnEachRequest = true; + return true; + } + + /** + * set all vars to initial values + * @return bool (always true) + */ + public function setDefaults() { + $this->sCacheBase = '/~cache/'; // added to url + $this->iMinCacheTime = 3600; // force using the cachefile and don't update it + $this->bDebug = false; // debug enables additional infos + $this->bMerging = true; // use compressed files + $this->sCacheDir = $_SERVER["DOCUMENT_ROOT"] . $this->sCacheBase; // local file + $this->bRewriteOnEachRequest = false; + return true; + } + + /** + * set merge flag (for development environment) + * @param boolean set false to disable the generation of merged cachefiles + * @return boolean + */ + public function setMerging($bool) { + return $this->bMerging = (bool) $bool; + } + + /** + * set minimum cachetime on server for merged js and css files + * @param integer value in seconds + * @return boolean + */ + public function setMinCacheTime($int) { + return $this->iMinCacheTime = (int) $int; + } + + /** + * set flag bRewriteOnEachRequest (for development environment) + * @param boolean set true to ignore caching time + * @return type + */ + public function setRewriteCache($bool) { + return $this->bRewriteOnEachRequest = (bool) $bool; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + /** + * Merge original files of a group to a single cachefile. It updates or just touches the cachefile. + * Output is the html code to include the cached css/ js in the html header. + * @param string $sType one of css|js + * @return bool (dummy) + */ + public function writeMedia($sType) { + $sHtml = ''; // generated html output to document + $aFiles = $this->_aStatic[$sType]["files"]; + $this->_log("==="); + $this->_log("type: $sType"); + $this->_log("THANKS FOR USING MY PHP CLASS STATICFILES!\n (this message and debug stuff below is shown with enabled debug only)\n www.axel-hahn.de"); + + // if caching is disabled then generate output with original files and return + if (!$this->bMerging) { + $this->_log("You disabled the merging feature - here you get the links to the original files."); + foreach ($aFiles as $sGroup => $aFiledata) { + foreach ($aFiledata as $aFile) { + $sHtml.=$this->_genHtml($sType, $aFile); + } + } + echo $sHtml; + return true; + } + + + // step 1: get all files of a group + $aFileList = array(); + foreach ($aFiles as $sGroup => $aFiledata) { + foreach ($aFiledata as $aFile) { + $aFileList[$sGroup][] = $aFile['file']; + } + } + + // check / regenerate cache file + foreach ($aFiles as $sGroup => $aFiledata) { + $bCompress = true; + $iNewest = 0; + $sData = ''; + + // get cachefile and check age + $sCacheFile = $sType . "_cache_" . md5($sGroup . implode($aFileList[$sGroup])) . "." . $sType; + $sCacheFullFile = $this->sCacheDir . $sCacheFile; + + $this->_log("==="); + $this->_log("$sType-group: \"$sGroup\""); + $this->_log("cachefile = " . $sCacheFullFile); + if (file_exists($sCacheFullFile)) { + $bCompress = false; + $aStatCache = stat($sCacheFullFile); + $iCacheAge = date("U") - $aStatCache['mtime']; + if ($iCacheAge > $this->iMinCacheTime) + $bCompress = true; + $this->_log("age of cachefile = $iCacheAge s (cachefile will be used $this->iMinCacheTime s; " . ($this->iMinCacheTime - $iCacheAge) . " s left)"); + } else { + $this->_log("cachefile does not exist yet"); + } + + // if there is no cachefile or cachefile is out of date + // then compare with newest filestamp + if ($bCompress) { + + // merge all files into $sData + // and get timestamp of newest file $iNewest + foreach ($aFiledata as $aFile) { + $this->_log("---"); + $sFile = $aFile["file"]; + $sFullFile = $_SERVER["DOCUMENT_ROOT"] . $sFile; + if (!file_exists($sFullFile)) + die("ERROR: writeMedia() failed. File not found: $sFullFile."); + $aTmp = stat($sFullFile); + if ($aTmp['mtime'] > $iNewest) + $iNewest = $aTmp['mtime']; + $s = file_get_contents($sFullFile); + $this->_log("checking $sFile - \tunix ts: " . $aTmp['mtime'] . ";\t" . strlen($s) . " byte (group: " . $sGroup . ")"); + if ($this->_aStatic[$sType]["fRewrite"]) { + $this->_log("rewrite with \$this->" . $this->_aStatic[$sType]["fRewrite"]); + $sRewritten = $this->{$this->_aStatic[$sType]["fRewrite"]}($s, $sFile); + if (strlen($sRewritten) == 0) { + $this->_log("OOOPS rewrite function for file $sFile - " . $this->_aStatic[$sType]["fRewrite"] . " returns ZERO(!!!) bytes"); + } else + $s = $sRewritten; + } + $sData.=$s; + } + $this->_log("unix ts of cachefile " . $aStatCache['mtime']); + + if (($aStatCache['mtime'] - $iMinCacheTime) < $iNewest || $this->bRewriteOnEachRequest) { + $this->_log("Need to (re)generate cache. A static file is newer than cache or cache did not exist."); + $sOrig = $sData; + + if ($this->_aStatic[$sType]["fCompress"]) { + $this->_log("compress with \$this->" . $this->_aStatic[$sType]["fCompress"] . " "); + $sData = $this->{$this->_aStatic[$sType]["fCompress"]}($sData); + if (strlen($sData) == 0) { + $this->_log("OOOPS compress function for type $sType - " . $this->_aStatic[$sType]["fCompress"] . " returns ZERO(!!!) bytes"); + $this->_log("orig: " . strlen($sOrig) . " byte - files: \n" . print_r($aFileList[$sGroup], true) . " "); + $sData = $sOrig; + } + } else { + $this->_log("no compression for type " . $sType . " "); + } + $sStats = $this->_getStats($sOrig, $sData, " "); + $this->_log($sStats); + if ($this->bDebug) + $sData = "/* AXEL HAHN - CACHED " . $sType . " MERGE FILE ... created " . date("Y-m-d H:i:s") . " " . $sStats . " (you see this only if debug is enabled) */ \n" . $sData; + $this->_log("writing cachefile"); + if (!file_exists(dirname($sCacheFullFile))) + mkdir(dirname($sCacheFullFile)); + file_put_contents($sCacheFullFile, $sData); + } else { + $this->_log("just touching cachefile to use it further $this->iMinCacheTime s"); + touch($sCacheFullFile); + } + } + + // generate html output: link to the cacheile + if ($sType == "css") + $aCachefileoptions = array( + 'file' => $this->sCacheBase . $sCacheFile, + 'href' => $this->sCacheBase . $sCacheFile, + 'media' => $sGroup, + ); + if ($sType == "js") { + $aCachefileoptions = array( + 'file' => $this->sCacheBase . $sCacheFile, + 'src' => $this->sCacheBase . $sCacheFile, + ); + } + if ($aCachefileoptions) + $sHtml.=$this->_genHtml($sType, $aCachefileoptions) . "\n"; + } + + echo $sHtml . "\n"; + return true; + } + +} + +?> diff --git a/lib/userlist.php b/lib/userlist.php new file mode 100644 index 0000000..36a7700 --- /dev/null +++ b/lib/userlist.php @@ -0,0 +1,57 @@ +usersPerPage = abs(intval($usersPerPage)); + } + + public function setPage( $page ) { + $page = intval($page); + $this->page = $page > 0 ? $page - 1 : 0; + } + + public function load() { + $this->users = DB::query( + 'SELECT SQL_CALC_FOUND_ROWS + UNIX_TIMESTAMP( u.registered ) as registered, + u.name, u.score, u.images, u.avatar, u.website + FROM '.TABLE_USERS.' u + WHERE valid = 1 + GROUP BY u.id + ORDER BY u.id ASC + LIMIT :1, :2', + $this->page * $this->usersPerPage, + $this->usersPerPage + ); + $this->totalResults = DB::foundRows(); + + // compute previoues, current and next page + if( $this->totalResults > 0 ) { + $this->pages['current'] = $this->page+1; + $this->pages['total'] = ceil($this->totalResults / $this->usersPerPage); + if( $this->page > 0 ) { + $this->pages['prev'] = $this->page; + } + if( $this->totalResults > $this->usersPerPage * $this->page + $this->usersPerPage ) { + $this->pages['next'] = $this->page + 2; + } + } + } +} + +?> \ No newline at end of file diff --git a/lib/users-mobile.php b/lib/users-mobile.php new file mode 100644 index 0000000..4039e2a --- /dev/null +++ b/lib/users-mobile.php @@ -0,0 +1,601 @@ + $u['id']), array( 'valid' => 0) ); + + session_name( Config::$sessionCookie ); + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + $_SESSION['avatar'] = $this->avatar = $u['avatar']; + + setcookie( Config::$rememberCookie, $id, time() + 3600 * 24 * 365, Config::$absolutePath ); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + return true; + } + + public function isSpamLocked() { + // delete all ips older than IP_LOCK_TIME + DB::query( 'DELETE FROM '.TABLE_UPLOADLOCK.' WHERE ts < :1', time() - Config::$uploadLockTime ); + + $ip = $_SERVER['REMOTE_ADDR']; + $r = DB::getRow( 'SELECT COUNT(*) AS c FROM '.TABLE_UPLOADLOCK.' + WHERE ip = :1', + $ip + ); + + if( $r['c'] > Config::$maxNumUploads ) { + return true; + } else { + return false; + } + } +public function isSpamer() { + + + $r = DB::getRow( 'SELECT logged FROM pl_images + WHERE user = :1 order by logged desc', + $this->id + ); + $time = strtotime($r["logged"]); + + if( (time() - (integer)$time) < 10 ) { + return true; + } else { + return false; + } + } + +public function isSpamming() { + $block = DB::getRow("SELECT spamblocked,time FROM pl_users WHERE id=:1",$this->id); + if ( (int)$block["spamblocked"] == 1) + { + if ((int)$block["time"] != 0){ + $now = time(); + $then = (int)$block["time"]; + if ($now > $then) { + DB::updateRow("pl_users",array("id" => $this->id),array("time" => 0,"spamblocked" => 0)); + return false; + }else{ + return $block["time"]; + exit(); + } + }else{ + return true; + } + } + + + + $count = DB::getRow( 'SELECT COUNT(*) as c FROM pl_images + WHERE user = :1', + $this->id + ); + + if ( $count["c"] >= 3){ + + $r = DB::query( 'SELECT id,image,keyword,logged FROM pl_images + WHERE user = :1 LIMIT '.((integer)$count["c"]-3).',2', + $this->id + ); + + + $r0 = DB::getRow( 'SELECT image,keyword,logged FROM pl_images + WHERE user = :1 LIMIT '.((integer)$count["c"]-1).',1', + $this->id + ); + + require_once("img_class.php"); + $ban =0; + foreach ($r as $checkable) { + + + + if ((strtotime($r0["logged"]) - strtotime($checkable["logged"])) < 60){ + + + + $splitter = split("/",$checkable["keyword"]); + $file2 = $splitter[0]."/".$splitter[1]."/".$checkable["image"]; + $splitter = split("/",$r0["keyword"]); + $file1 = $splitter[0]."/".$splitter[1]."/".$r0["image"]; + + $diff = new imagediff("data/images/".$file2, "data/images/".$file1); + $dif = $diff->diff(); + + if ($dif > 0.92){ + $ban += 1; + } + } + } + + if ($ban >= 2){ + foreach ($r as $checkable) { + DB::query("DELETE FROM pl_images WHERE id=:1",$checkable["id"]); + } + DB::updateRow("pl_users",array("id" => $this->id),array("spamblocked" => 1,"spam_reason"=>"Imagespam","time" => time() + (7 * 24 * 60 * 60))); + return true; + }else{ + return false;} + }else{ return false;} + } + + public function logUpload() { + $ip = $_SERVER['REMOTE_ADDR']; + DB::insertRow( TABLE_UPLOADLOCK, array('ip' => $ip, 'ts' => time(),'user' => $this->id) ); + } + + public function login() { + + // attempt to login via post, session or remeber cookie + + + + session_name( Config::$sessionCookie ); + + if( isset($_POST['login']) ) { // post login + + + $u = DB::getRow( + 'SELECT id, name, admin, website, color, style,avatar FROM '.TABLE_USERS.' WHERE name = :1 AND pass = :2 and valid = 1', + $_POST['name'], md5($_POST['pass']) + ); + $banstate = DB::getRow("SELECT * FROM pl_banned WHERE id=:1",$u['id']); + if ($banstate){ + return "ban/".$banstate["reason"]; + } + + if( !empty($u) ) { + $c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']); + if ((int)$c["c"] == 0){ + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{ + DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s'))); + } + + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + $_SESSION['avatar'] = $this->avatar = $u['avatar']; + + if( !empty($_POST['remember']) ) { + $r = md5(uniqid(rand())); + DB::updateRow( TABLE_USERS, array('id' => $this->id), array('remember' => $r ) ); + setcookie( Config::$rememberCookie, $r, time() + 3600 * 24 * 365, Config::$absolutePath ); + } + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + }else{return "wronglogin";} + + } + + else if( !empty($_COOKIE[Config::$sessionCookie]) ) { // session running + session_start(); + $c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']); + if ((int)$c["c"] == 0){ + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{ + DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s'))); + } + if( empty($_SESSION['id']) ) { + setcookie(Config::$sessionCookie, false, time() - 3600, Config::$absolutePath ); + } else { + $this->id = $_SESSION['id']; + $this->name = $_SESSION['name']; + $this->admin = $_SESSION['admin']; + $this->website = $_SESSION['website']; + $this->color = $u['color']; + $this->stylecolor = $u['stylecolor']; + $this->avatar = $u['avatar']; + + + } + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$this->id)){ + $this->logout(); + return "banned"; + + } + } + + else if( !empty($_COOKIE[Config::$rememberCookie]) ) { // remember cookie found + $u = DB::getRow( + 'SELECT id, name, admin, website, style, color, avatar FROM '.TABLE_USERS.' WHERE remember = :1', + $_COOKIE[Config::$rememberCookie] + ); + + if( !empty($u) ) { + + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + $_SESSION['avatar'] = $this->avatar = $u['avatar']; + // refresh for another year + setcookie( Config::$rememberCookie, $_COOKIE[Config::$rememberCookie], time() + 3600 * 24 * 365, Config::$absolutePath ); + + + $c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']); + if ((int)$c["c"] == 0){ + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{ + DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s'))); + } + + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){ + $this->logout(); + return "banned"; + } + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + } + } + } + + public function profile( $localFile, &$messages ) { + $upd = array( 'website' => $_POST['website'] ); + + $_SESSION['website'] = $_POST['website']; + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + } + + $p = trim($_POST['cpass']); + if( !empty( $p ) ) { + if( strlen($_POST['cpass']) < 6 ) { + $messages['passToShort'] = true; + } + else if( $_POST['cpass'] != $_POST['cpass2'] ) { + $messages['passNotEqual'] = true; + } + else { + $upd['pass'] = md5($_POST['cpass2']); + if( Config::$vbbIntegration['enabled'] ) { + $forum->set_pass( $_SESSION['name'], $_POST['cpass2']); + } + } + } + + if( !empty( $localFile ) ) { + require_once( 'lib/images.php' ); + + list( $imgWidth, $imgHeight, $imgtype ) = getimagesize($localFile); + + if ( $imgWidth == 64 && $imgHeight == 64 && $imgtype == IMAGETYPE_GIF){ + $name = Config::$images['avatarsPath'].uniqid().'.gif'; + if (!move_uploaded_file($localFile,$name)){ + $messages['avatarFailed'] = true; + $upd['avatar'] = Config::$images['avatarsPath']."default.png"; + }else{ + $upd['avatar'] = $name; + } + }else{ + $name = Config::$images['avatarsPath'].uniqid().'.jpg'; + + if( Image::createThumb( $localFile, $name, 64,64 ) ) { + $upd['avatar'] = $name; + } else { + $messages['avatarFailed'] = true; + } + } + } + + if(!empty($_POST['color'])){ + if(preg_match('/^[a-f0-9]{6}$/i', $_POST['color'])){ + if ( strtolower($_POST['color']) != "ffffff"){ + $upd['color'] = $_POST['color']; + }else{ + $upd['color'] = "0"; + } + }else{ + $messages['colorFailed'] = true; + } + } + //--------------------------------------------------------------------blockuser + if(!empty($_POST['blockuser'])){ + if(preg_match('/^\w{2,20}$/', $_POST['blockuser'])){ + $blockedusers = array(); + $blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id); + + if(!empty($blockedusers)){ + $blockedusers = unserialize($blockedusers['users']); + if (in_array(strtolower ($_POST['blockuser']),$blockedusers)){ + $messages['blockAlready'] = true; + }else{ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', strtolower ($_POST['blockuser']))){ + + array_push($blockedusers,$_POST['blockuser']); + if(DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id)){ + $messages['blocked'] = true; + }else{ + $messages['blockFailed'] = true; + } + }else{ + $messages['userFailed'] = true; + } + + } + }else{ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){ + $newarray = array(); + array_push($newarray,strtolower ($_POST['blockuser'])); + + if(DB::query("INSERT INTO pl_blocked (id,users) VALUES (:1,:2)",$this->id,serialize($newarray))){ + $messages['blocked'] = true; + }else{ + $messages['blockFailed'] = true; + } + + }else{ + $messages['userFailed'] = true; + } + } + }else{ + $messages['blockFailed'] = true; + } + + } + //--------------------------------------------------------------------UNblockuser +function remove_item_by_value($array, $val = '', $preserve_keys = true) { + if (count($array) == 1) return false; + if (empty($array) || !is_array($array)) return false; + if (!in_array($val, $array)) return $array; + + foreach($array as $key => $value) { + if ($value == $val) unset($array[$key]); + } + + return ($preserve_keys === true) ? $array : array_values($array); +} + //--------------------------------------------------------------------UNblockuser + if(!empty($_POST['unblockuser'])){ + if ($_POST['unblockuser'] != "select"){ + if(preg_match('/^\w{2,20}$/', $_POST['unblockuser'])){ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['unblockuser'])){ + $blockedusers = array(); + $blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id); + if(!empty($blockedusers)){ + $blockedusers = unserialize($blockedusers['users']); + if (in_array($_POST['unblockuser'],$blockedusers)){ + $blockedusers = remove_item_by_value($blockedusers,$_POST['unblockuser']); + if ($blockedusers){ + DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id); + $messages['unblocked'] = true; + }else{ + DB::query('DELETE FROM pl_blocked WHERE id=:1',$this->id); + $messages['unblocked'] = true; + } + }else{$messages['notBlocked'] = true;} + }else{$messages['unblockFailed'] = true;} + }else{$messages['userFailed'] = true;} + }else{$messages['unblockFailed'] = true;} + } + } + + //-------------------------------------------------------------------------STYLE + + if(isset($_POST['stylecolor'])) { + if($_POST['stylecolor'] == 'white') { + + $upd['style'] = $_POST['stylecolor']; + + } elseif($_POST['stylecolor'] == 'black') { + $upd['style'] = $_POST['stylecolor']; + } else{ + $upd['style'] = $_POST['black']; + } + } + + + + if( empty($this->email) && + preg_match('/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email']) + ) { + if( Config::$vbbIntegration['enabled'] ) { + $forum->set_email( $_SESSION['name'], $_POST['email']); + } + $upd['email'] = $_POST['email']; + } + + DB::updateRow( TABLE_USERS, array( 'id' => $this->id ), $upd ); + } + + public function loadEmail() { + $tmp = DB::getRow( + 'SELECT email,color,style,avatar FROM '.TABLE_USERS.' WHERE id = :1', + $this->id + ); + $this->email = $tmp['email']; + $this->color = $tmp['color']; + $this->stylecolor = $tmp['style']; + $this->avatar = $u['avatar']; + } + + public function logout() { + session_unset(); + session_destroy(); + $_SESSION = array(); + setcookie( Config::$rememberCookie, false, time() - 3600, Config::$absolutePath ); + setcookie( Config::$sessionCookie, false, time() - 3600, Config::$absolutePath ); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->logout(); + } + } + + public function increaseScore( $amount ) { + DB::query( + 'UPDATE '.TABLE_USERS.' SET score = score + :1 WHERE id = :2', + intval( $amount ), + $this->id + ); + } + + public function register( &$messages,$inviteC=false ) { + + DB::query( 'DELETE FROM '.TABLE_USERS.' WHERE valid = 0 AND registered < NOW() - INTERVAL 30 MINUTE' ); + $iplocks = DB::getRow("DELETE FROM pl_registerlock WHERE created < (NOW() - INTERVAL 1440 MINUTE)"); + + + $reg = DB::getRow("SELECT * FROM pl_settings"); + $doubleacc = DB::getRow("SELECT COUNT(*) as c FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + + if($inviteC == false){ + if ($reg["register"] != 1 || $doubleacc["c"] > 0){ + $messages['registerClosed'] = true; + } + }else{ + if ($doubleacc["c"] > 0){ + DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>1)); + $inviteC = false; + $messages['registerClosed'] = true; + } + } + + if( !preg_match('/^\w{2,20}$/', $_POST['name']) ) { + $messages['nameInvalid'] = true; + } else { + $u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE name = :1', $_POST['name'] ); + if( !empty($u) ) { + $messages['nameInUse'] = true; + } + } + + if( strlen($_POST['pass']) < 6 ) { + $messages['passToShort'] = true; + } + else if( $_POST['pass'] != $_POST['pass2'] ) { + $messages['passNotEqual'] = true; + } + + if( !preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'] ) ) { + $messages['wrongEmail'] = true; + } else { + $u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE email = :1', $_POST['email'] ); + if( !empty($u) ) { + $messages['emailInUse'] = true; + } + } + + + if( !empty($messages) ) { + return false; + } + + + $this->validationString = md5(uniqid(rand())); + + DB::insertRow( TABLE_USERS, array( + 'registered' => date('Y-m-d H:i:s'), + 'name' => $_POST['name'], + 'pass' => md5($_POST['pass']), + 'valid' => 1, + 'score' => 0, + 'images' => 0, + 'website' => '', + 'avatar' => Config::$images['avatarsPath'].'default.png', + 'remember' => $this->validationString, + 'admin' => 0, + 'email' => $_POST['email'], + 'color' => '0', + 'style' => 'black', + 'invite' => $inviteC + )); + + if($inviteC != false){ + $lastid= DB::getRow("SELECT LAST_INSERT_ID() as id"); + DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>$lastid["id"])); + } + + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s'))); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $user['name'] = $_POST['name']; + $user['pass'] = $_POST['pass']; + $user['email'] = $_POST['email']; + echo $forum->register_newuser($user, false); + } + + $mail = file_get_contents( Config::$templates.'registrationmail.txt' ); + preg_match( '/From: (?.*?)\r?\nSubject: (?.*?)\r?\n\r?\n(?.*)/sim', $mail, $mail ); + $mail['text'] = str_replace( '%validationString%', $this->validationString, $mail['text'] ); + $mail['text'] = str_replace( '%siteName%', Config::$siteName, $mail['text'] ); + $mail['text'] = str_replace( '%frontendPath%', Config::$frontendPath, $mail['text'] ); + $mail['text'] = str_replace( '%userName%', $_POST['name'], $mail['text'] ); + + $mail['subject'] = str_replace( '%siteName%', Config::$siteName, $mail['subject'] ); + $mail['subject'] = str_replace( '%userName%', $_POST['name'], $mail['subject'] ); + + //mail( $_POST['email'], $mail['subject'], $mail['text'], 'FROM: '.$mail['from'] ); + mail($_POST['email'],$mail['subject'],$mail['text'],"FROM:".$mail['from']); + + + + return true; + } +} + +?> \ No newline at end of file diff --git a/lib/users.php b/lib/users.php new file mode 100644 index 0000000..867befd --- /dev/null +++ b/lib/users.php @@ -0,0 +1,601 @@ + $u['id']), array( 'valid' => 0) ); + + session_name( Config::$sessionCookie ); + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + $_SESSION['avatar'] = $this->avatar = $u['avatar']; + + setcookie( Config::$rememberCookie, $id, time() + 3600 * 24 * 365, Config::$absolutePath ); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + return true; + } + + public function isSpamLocked() { + // delete all ips older than IP_LOCK_TIME + DB::query( 'DELETE FROM '.TABLE_UPLOADLOCK.' WHERE ts < :1', time() - Config::$uploadLockTime ); + + $ip = $_SERVER['REMOTE_ADDR']; + $r = DB::getRow( 'SELECT COUNT(*) AS c FROM '.TABLE_UPLOADLOCK.' + WHERE ip = :1', + $ip + ); + + if( $r['c'] > Config::$maxNumUploads ) { + return true; + } else { + return false; + } + } +public function isSpamer() { + + + $r = DB::getRow( 'SELECT logged FROM pl_images + WHERE user = :1 order by logged desc', + $this->id + ); + $time = strtotime($r["logged"]); + + if( (time() - (integer)$time) < 10 ) { + return true; + } else { + return false; + } + } + +public function isSpamming() { + $block = DB::getRow("SELECT spamblocked,time FROM pl_users WHERE id=:1",$this->id); + if ( (int)$block["spamblocked"] == 1) + { + if ((int)$block["time"] != 0){ + $now = time(); + $then = (int)$block["time"]; + if ($now > $then) { + DB::updateRow("pl_users",array("id" => $this->id),array("time" => 0,"spamblocked" => 0)); + return false; + }else{ + return $block["time"]; + exit(); + } + }else{ + return true; + } + } + + + + $count = DB::getRow( 'SELECT COUNT(*) as c FROM pl_images + WHERE user = :1', + $this->id + ); + + if ( $count["c"] >= 3){ + + $r = DB::query( 'SELECT id,image,keyword,logged FROM pl_images + WHERE user = :1 LIMIT '.((integer)$count["c"]-3).',2', + $this->id + ); + + + $r0 = DB::getRow( 'SELECT image,keyword,logged FROM pl_images + WHERE user = :1 LIMIT '.((integer)$count["c"]-1).',1', + $this->id + ); + + require_once("img_class.php"); + $ban =0; + foreach ($r as $checkable) { + + + + if ((strtotime($r0["logged"]) - strtotime($checkable["logged"])) < 60){ + + + + $splitter = split("/",$checkable["keyword"]); + $file2 = $splitter[0]."/".$splitter[1]."/".$checkable["image"]; + $splitter = split("/",$r0["keyword"]); + $file1 = $splitter[0]."/".$splitter[1]."/".$r0["image"]; + + $diff = new imagediff("data/images/".$file2, "data/images/".$file1); + $dif = $diff->diff(); + + if ($dif > 0.92){ + $ban += 1; + } + } + } + + if ($ban >= 2){ + foreach ($r as $checkable) { + DB::query("DELETE FROM pl_images WHERE id=:1",$checkable["id"]); + } + DB::updateRow("pl_users",array("id" => $this->id),array("spamblocked" => 1,"spam_reason"=>"Imagespam","time" => time() + (7 * 24 * 60 * 60))); + return true; + }else{ + return false;} + }else{ return false;} + } + + public function logUpload() { + $ip = $_SERVER['REMOTE_ADDR']; + DB::insertRow( TABLE_UPLOADLOCK, array('ip' => $ip, 'ts' => time(),'user' => $this->id) ); + } + + public function login() { + + // attempt to login via post, session or remeber cookie + + + + session_name( Config::$sessionCookie ); + + if( isset($_POST['login']) ) { // post login + + + $u = DB::getRow( + 'SELECT id, name, admin, website, color, style,avatar FROM '.TABLE_USERS.' WHERE name = :1 AND pass = :2 and valid = 1', + $_POST['name'], md5($_POST['pass']) + ); + $banstate = DB::getRow("SELECT * FROM pl_banned WHERE id=:1",$u['id']); + if ($banstate){ + return "ban/".$banstate["reason"]; + } + + if( !empty($u) ) { + $c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']); + if ((int)$c["c"] == 0){ + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{ + DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s'))); + } + + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + $_SESSION['avatar'] = $this->avatar = $u['avatar']; + + if( !empty($_POST['remember']) ) { + $r = md5(uniqid(rand())); + DB::updateRow( TABLE_USERS, array('id' => $this->id), array('remember' => $r ) ); + setcookie( Config::$rememberCookie, $r, time() + 3600 * 24 * 365, Config::$absolutePath ); + } + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + }else{return "wronglogin";} + + } + + else if( !empty($_COOKIE[Config::$sessionCookie]) ) { // session running + session_start(); + $c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']); + if ((int)$c["c"] == 0){ + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{ + DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s'))); + } + if( empty($_SESSION['id']) ) { + setcookie(Config::$sessionCookie, false, time() - 3600, Config::$absolutePath ); + } else { + $this->id = $_SESSION['id']; + $this->name = $_SESSION['name']; + $this->admin = $_SESSION['admin']; + $this->website = $_SESSION['website']; + $this->color = $u['color']; + $this->stylecolor = $u['stylecolor']; + $this->avatar = $u['avatar']; + + + } + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$this->id)){ + $this->logout(); + return "banned"; + + } + } + + else if( !empty($_COOKIE[Config::$rememberCookie]) ) { // remember cookie found + $u = DB::getRow( + 'SELECT id, name, admin, website, style, color, avatar FROM '.TABLE_USERS.' WHERE remember = :1', + $_COOKIE[Config::$rememberCookie] + ); + + if( !empty($u) ) { + + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + $_SESSION['avatar'] = $this->avatar = $u['avatar']; + // refresh for another year + setcookie( Config::$rememberCookie, $_COOKIE[Config::$rememberCookie], time() + 3600 * 24 * 365, Config::$absolutePath ); + + + $c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']); + if ((int)$c["c"] == 0){ + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{ + DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s'))); + } + + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){ + $this->logout(); + return "banned"; + } + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + } + } + } + + public function profile( $localFile, &$messages ) { + $upd = array( 'website' => $_POST['website'] ); + + $_SESSION['website'] = $_POST['website']; + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + } + + $p = trim($_POST['cpass']); + if( !empty( $p ) ) { + if( strlen($_POST['cpass']) < 6 ) { + $messages['passToShort'] = true; + } + else if( $_POST['cpass'] != $_POST['cpass2'] ) { + $messages['passNotEqual'] = true; + } + else { + $upd['pass'] = md5($_POST['cpass2']); + if( Config::$vbbIntegration['enabled'] ) { + $forum->set_pass( $_SESSION['name'], $_POST['cpass2']); + } + } + } + + if( !empty( $localFile ) ) { + require_once( 'lib/images.php' ); + + list( $imgWidth, $imgHeight, $imgtype ) = getimagesize($localFile); + + if ( $imgWidth == 64 && $imgHeight == 64 && $imgtype == IMAGETYPE_GIF){ + $name = Config::$images['avatarsPath'].uniqid().'.gif'; + if (!move_uploaded_file($localFile,$name)){ + $messages['avatarFailed'] = true; + $upd['avatar'] = Config::$images['avatarsPath']."default.png"; + }else{ + $upd['avatar'] = $name; + } + }else{ + $name = Config::$images['avatarsPath'].uniqid().'.jpg'; + + if( Image::createThumb( $localFile, $name, 64,64 ) ) { + $upd['avatar'] = $name; + } else { + $messages['avatarFailed'] = true; + } + } + } + + if(!empty($_POST['color'])){ + if(preg_match('/^[a-f0-9]{6}$/i', $_POST['color'])){ + if ( strtolower($_POST['color']) != "ffffff"){ + $upd['color'] = $_POST['color']; + }else{ + $upd['color'] = "0"; + } + }else{ + $messages['colorFailed'] = true; + } + } + //--------------------------------------------------------------------blockuser + if(!empty($_POST['blockuser'])){ + if(preg_match('/^\w{2,20}$/', $_POST['blockuser'])){ + $blockedusers = array(); + $blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id); + + if(!empty($blockedusers)){ + $blockedusers = unserialize($blockedusers['users']); + if (in_array(strtolower ($_POST['blockuser']),$blockedusers)){ + $messages['blockAlready'] = true; + }else{ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', strtolower ($_POST['blockuser']))){ + + array_push($blockedusers,$_POST['blockuser']); + if(DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id)){ + $messages['blocked'] = true; + }else{ + $messages['blockFailed'] = true; + } + }else{ + $messages['userFailed'] = true; + } + + } + }else{ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){ + $newarray = array(); + array_push($newarray,strtolower ($_POST['blockuser'])); + + if(DB::query("INSERT INTO pl_blocked (id,users) VALUES (:1,:2)",$this->id,serialize($newarray))){ + $messages['blocked'] = true; + }else{ + $messages['blockFailed'] = true; + } + + }else{ + $messages['userFailed'] = true; + } + } + }else{ + $messages['blockFailed'] = true; + } + + } + //--------------------------------------------------------------------UNblockuser +function remove_item_by_value($array, $val = '', $preserve_keys = true) { + if (count($array) == 1) return false; + if (empty($array) || !is_array($array)) return false; + if (!in_array($val, $array)) return $array; + + foreach($array as $key => $value) { + if ($value == $val) unset($array[$key]); + } + + return ($preserve_keys === true) ? $array : array_values($array); +} + //--------------------------------------------------------------------UNblockuser + if(!empty($_POST['unblockuser'])){ + if ($_POST['unblockuser'] != "select"){ + if(preg_match('/^\w{2,20}$/', $_POST['unblockuser'])){ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['unblockuser'])){ + $blockedusers = array(); + $blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id); + if(!empty($blockedusers)){ + $blockedusers = unserialize($blockedusers['users']); + if (in_array($_POST['unblockuser'],$blockedusers)){ + $blockedusers = remove_item_by_value($blockedusers,$_POST['unblockuser']); + if ($blockedusers){ + DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id); + $messages['unblocked'] = true; + }else{ + DB::query('DELETE FROM pl_blocked WHERE id=:1',$this->id); + $messages['unblocked'] = true; + } + }else{$messages['notBlocked'] = true;} + }else{$messages['unblockFailed'] = true;} + }else{$messages['userFailed'] = true;} + }else{$messages['unblockFailed'] = true;} + } + } + + //-------------------------------------------------------------------------STYLE + + if(isset($_POST['stylecolor'])) { + if($_POST['stylecolor'] == 'white') { + + $upd['style'] = $_POST['stylecolor']; + + } elseif($_POST['stylecolor'] == 'black') { + $upd['style'] = $_POST['stylecolor']; + } else{ + $upd['style'] = $_POST['black']; + } + } + + + + if( empty($this->email) && + preg_match('/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email']) + ) { + if( Config::$vbbIntegration['enabled'] ) { + $forum->set_email( $_SESSION['name'], $_POST['email']); + } + $upd['email'] = $_POST['email']; + } + + DB::updateRow( TABLE_USERS, array( 'id' => $this->id ), $upd ); + } + + public function loadEmail() { + $tmp = DB::getRow( + 'SELECT email,color,style,avatar FROM '.TABLE_USERS.' WHERE id = :1', + $this->id + ); + $this->email = $tmp['email']; + $this->color = $tmp['color']; + $this->stylecolor = $tmp['style']; + $this->avatar = $u['avatar']; + } + + public function logout() { + session_unset(); + session_destroy(); + $_SESSION = array(); + setcookie( Config::$rememberCookie, false, time() - 3600, Config::$absolutePath ); + setcookie( Config::$sessionCookie, false, time() - 3600, Config::$absolutePath ); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->logout(); + } + } + + public function increaseScore( $amount ) { + DB::query( + 'UPDATE '.TABLE_USERS.' SET score = score + :1 WHERE id = :2', + intval( $amount ), + $this->id + ); + } + + public function register( &$messages,$inviteC=false ) { + + DB::query( 'DELETE FROM '.TABLE_USERS.' WHERE valid = 0 AND registered < NOW() - INTERVAL 30 MINUTE' ); + $iplocks = DB::getRow("DELETE FROM pl_registerlock WHERE created < (NOW() - INTERVAL 1440 MINUTE)"); + + + $reg = DB::getRow("SELECT * FROM pl_settings"); + $doubleacc = DB::getRow("SELECT COUNT(*) as c FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']); + + if($inviteC == false){ + if ($reg["register"] != 1 || $doubleacc["c"] > 0){ + $messages['registerClosed'] = true; + } + }else{ + if ($doubleacc["c"] > 0){ + DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>1)); + $inviteC = false; + $messages['registerClosed'] = true; + } + } + + if( !preg_match('/^\w{2,20}$/', $_POST['name']) ) { + $messages['nameInvalid'] = true; + } else { + $u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE name = :1', $_POST['name'] ); + if( !empty($u) ) { + $messages['nameInUse'] = true; + } + } + + if( strlen($_POST['pass']) < 6 ) { + $messages['passToShort'] = true; + } + else if( $_POST['pass'] != $_POST['pass2'] ) { + $messages['passNotEqual'] = true; + } + + if( !preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'] ) ) { + $messages['wrongEmail'] = true; + } else { + $u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE email = :1', $_POST['email'] ); + if( !empty($u) ) { + $messages['emailInUse'] = true; + } + } + + + if( !empty($messages) ) { + return false; + } + + + $this->validationString = md5(uniqid(rand())); + + DB::insertRow( TABLE_USERS, array( + 'registered' => date('Y-m-d H:i:s'), + 'name' => $_POST['name'], + 'pass' => md5($_POST['pass']), + 'valid' => 1, + 'score' => 0, + 'images' => 0, + 'website' => '', + 'avatar' => Config::$images['avatarsPath'].'default.png', + 'remember' => $this->validationString, + 'admin' => 0, + 'email' => $_POST['email'], + 'color' => '0', + 'style' => 'black', + 'invite' => $inviteC + )); + + if($inviteC != false){ + $lastid= DB::getRow("SELECT LAST_INSERT_ID() as id"); + DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>$lastid["id"])); + } + + DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s'))); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $user['name'] = $_POST['name']; + $user['pass'] = $_POST['pass']; + $user['email'] = $_POST['email']; + echo $forum->register_newuser($user, false); + } + + $mail = file_get_contents( Config::$templates.'registrationmail.txt' ); + preg_match( '/From: (?.*?)\r?\nSubject: (?.*?)\r?\n\r?\n(?.*)/sim', $mail, $mail ); + $mail['text'] = str_replace( '%validationString%', $this->validationString, $mail['text'] ); + $mail['text'] = str_replace( '%siteName%', Config::$siteName, $mail['text'] ); + $mail['text'] = str_replace( '%frontendPath%', Config::$frontendPath, $mail['text'] ); + $mail['text'] = str_replace( '%userName%', $_POST['name'], $mail['text'] ); + + $mail['subject'] = str_replace( '%siteName%', Config::$siteName, $mail['subject'] ); + $mail['subject'] = str_replace( '%userName%', $_POST['name'], $mail['subject'] ); + + //mail( $_POST['email'], $mail['subject'], $mail['text'], 'FROM: '.$mail['from'] ); + mail($_POST['email'],$mail['subject'],$mail['text'],"FROM:".$mail['from']); + + + + return true; + } +} + +?> \ No newline at end of file diff --git a/lib/watermark.png b/lib/watermark.png new file mode 100644 index 0000000..02ec45b Binary files /dev/null and b/lib/watermark.png differ diff --git a/media/404.jpg b/media/404.jpg new file mode 100644 index 0000000..f695148 Binary files /dev/null and b/media/404.jpg differ diff --git a/media/4d.png b/media/4d.png new file mode 100644 index 0000000..e261fcd Binary files /dev/null and b/media/4d.png differ diff --git a/media/_watermark.png b/media/_watermark.png new file mode 100644 index 0000000..0321589 Binary files /dev/null and b/media/_watermark.png differ diff --git a/media/abuse.png b/media/abuse.png new file mode 100644 index 0000000..e72b79d Binary files /dev/null and b/media/abuse.png differ diff --git a/media/ageblock.css b/media/ageblock.css new file mode 100644 index 0000000..2258018 --- /dev/null +++ b/media/ageblock.css @@ -0,0 +1,109 @@ +@charset "UTF-8"; +/* CSS Document */ + +.o-hidden { + overflow:hidden; +} + +#overlay { + background: url(images-age/overlay.png) repeat; + position: fixed; + z-index:100; + height: 100%; + width:100%; + top:0; + left:0; +} +#modal-container { + padding: 5px; + position: fixed; + z-index: 102; + width: 30%; + top:30%; + left:35%; + background: url(images-age/modal.png) repeat; + margin:0; + -moz-border-radius:3px; + -webkit-border-radius:3px; + border:1px solid #111; + color: #000; +} +div#modal-inner { + background:#fff; + border:1px solid #fff; + padding: 15px 15px 15px 15px; +} +div#modal-inner h1 { + margin-bottom: 5px; + line-height:11px; + color: #000; +} +div#modal-inner img#badge { + float:left; + height: 32px; + width:32px; + display:inline-block; + margin-top: 8px; + margin-right: 8px; + margin-bottom: 25px; + padding: 5px; + border:1px solid #bbb; + -moz-border-radius: 3px; + -webkit-border-radius:3px; + border-radius: 3px; +} +div#modal-inner form div.field { + float:left; + width: 32%; +} +div#modal-inner form { + padding-top: 5px; + background:#fff; + padding: 10px; + -moz-border-radius: 3px; + -webkit-border-radius:3px; + border-radius: 3px; + border:1px solid #ccc; +} +div#modal-inner form label { + display:block; + margin: 5px 0 5px 0; +} +div#modal-inner form select { + padding: 5px; + border:1px solid #bbb; + display: inline-block; + width: 90%; + -moz-border-radius: 3px; + -webkit-border-radius:3px; + border-radius: 3px; +} +div#modal-inner form input[type=submit]{ + padding: 4px; + text-align:center; + font-size:inherit; + margin-top: 15px; + display:block; + -moz-border-radius: 3px; + -webkit-border-radius:3px; + border-radius: 3px; + color: #000; +} +div#modal-inner form div.spacer { + height: 60px; + margin: 5px 0 5px 0; + cursor:pointer; +} +.grey { + background-image: -webkit-linear-gradient(top, #eee, #ccc); + background-image: -moz-linear-gradient(top, #eee, #ccc); + background-image: -ms-linear-gradient(top, #eee, #ccc); + background-image: -o-linear-gradient(top, #eee, #ccc); + border:1px solid #aaa; + text-shadow:#fff 0px 1px 1px; + cursor:pointer; +} +.grey:hover { + -moz-box-shadow: #aaa 0px 0px 3px; + -webkit-box-shadow: #aaa 0px 0px 3px; +} diff --git a/media/ageblock.min.js b/media/ageblock.min.js new file mode 100644 index 0000000..0fa7f37 --- /dev/null +++ b/media/ageblock.min.js @@ -0,0 +1,18 @@ +/*///////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////// + +Author : Jordan Prybylski, JRD89 +Name : AGE BLOCK +Created : SEP 5th 2011 +Version : 1.0 +Help File : For More information and help please read the help file + supplied with this file. If after reading the help file + you still need technical help. Please feel free to + email me via codecanyon.com + +NOTICE : YOU MAY NOT USE THIS SCRIPT WITH OUT THE PROPER LICENSE/PERMISSION + +/////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////*/ + +(function(a){a.fn.extend({ageBlock:function(b){var c={title:"Hello, one second please.",subtitle:"In order to view our awesome content we need to verify your age",button:"Let me in",age:"18",showError:false,error:"",opacity:1,process:""};var b=a.extend(c,b);return this.each(function(){function l(){return k("v_age")}function k(a){var b,c,d,e=document.cookie.split(";");for(b=0;bb;d--){c=c+""}return c}var c=a(this);var d=b;var e=l();if(!e){a("html:not(:animated),body:not(:animated)").animate({scrollTop:0},20);var f='
    \n\t\t\t\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t\t\t';a("body").append(f).addClass("o-hidden");a("#overlay").css("opacity",d.opacity)}a("#verify").submit(function(b){var c=a(this).serializeArray();var e=0;for(var f in c){if(!c[f].value){e=1}}if(!e){var g=h(c);if(g){if(d.process){a.ajax({url:d.process,data:c,type:"post"})}a("#block-container").fadeOut("medium",function(){a("body").removeClass("o-hidden");j("v_age",true,30);a(this).remove()})}else{i()}}else{i()}b.preventDefault()})})}})})(jQuery) \ No newline at end of file diff --git a/media/alert.gif b/media/alert.gif new file mode 100644 index 0000000..6137467 Binary files /dev/null and b/media/alert.gif differ diff --git a/media/alert.png b/media/alert.png new file mode 100644 index 0000000..1192a9a Binary files /dev/null and b/media/alert.png differ diff --git a/media/all.png b/media/all.png new file mode 100644 index 0000000..6d4e6c9 Binary files /dev/null and b/media/all.png differ diff --git a/media/andrew.jpeg b/media/andrew.jpeg new file mode 100644 index 0000000..633898e Binary files /dev/null and b/media/andrew.jpeg differ diff --git a/media/arrow.gif b/media/arrow.gif new file mode 100644 index 0000000..246478a Binary files /dev/null and b/media/arrow.gif differ diff --git a/media/ban.png b/media/ban.png new file mode 100644 index 0000000..5b34956 Binary files /dev/null and b/media/ban.png differ diff --git a/media/banner.jpg b/media/banner.jpg new file mode 100644 index 0000000..3ee16ab Binary files /dev/null and b/media/banner.jpg differ diff --git a/media/blank.gif b/media/blank.gif new file mode 100644 index 0000000..35d42e8 Binary files /dev/null and b/media/blank.gif differ diff --git a/media/blank_b.gif b/media/blank_b.gif new file mode 100644 index 0000000..283622f Binary files /dev/null and b/media/blank_b.gif differ diff --git a/media/blink.gif b/media/blink.gif new file mode 100644 index 0000000..d1cfea2 Binary files /dev/null and b/media/blink.gif differ diff --git a/media/close.png b/media/close.png new file mode 100644 index 0000000..703d2a8 Binary files /dev/null and b/media/close.png differ diff --git a/media/color.png b/media/color.png new file mode 100644 index 0000000..662ae6f Binary files /dev/null and b/media/color.png differ diff --git a/media/colorpicker-h.png b/media/colorpicker-h.png new file mode 100644 index 0000000..fc8ddc4 Binary files /dev/null and b/media/colorpicker-h.png differ diff --git a/media/colorpicker-select-h.png b/media/colorpicker-select-h.png new file mode 100644 index 0000000..b765793 Binary files /dev/null and b/media/colorpicker-select-h.png differ diff --git a/media/colorpicker-select-sv.png b/media/colorpicker-select-sv.png new file mode 100644 index 0000000..7f2a36d Binary files /dev/null and b/media/colorpicker-select-sv.png differ diff --git a/media/colorpicker-sv.png b/media/colorpicker-sv.png new file mode 100644 index 0000000..59fc626 Binary files /dev/null and b/media/colorpicker-sv.png differ diff --git a/media/cross.gif b/media/cross.gif new file mode 100644 index 0000000..0ee9c7a Binary files /dev/null and b/media/cross.gif differ diff --git a/media/default.gif b/media/default.gif new file mode 100644 index 0000000..5d499b5 Binary files /dev/null and b/media/default.gif differ diff --git a/media/del.png b/media/del.png new file mode 100644 index 0000000..5d40200 Binary files /dev/null and b/media/del.png differ diff --git a/media/dolan404.jpg b/media/dolan404.jpg new file mode 100644 index 0000000..913c9da Binary files /dev/null and b/media/dolan404.jpg differ diff --git a/media/duck.png b/media/duck.png new file mode 100644 index 0000000..e569780 Binary files /dev/null and b/media/duck.png differ diff --git a/media/ducksw.png b/media/ducksw.png new file mode 100644 index 0000000..56fe693 Binary files /dev/null and b/media/ducksw.png differ diff --git a/media/ducktruhe.png b/media/ducktruhe.png new file mode 100644 index 0000000..9d89d9a Binary files /dev/null and b/media/ducktruhe.png differ diff --git a/media/ducky.gif b/media/ducky.gif new file mode 100644 index 0000000..26359a6 Binary files /dev/null and b/media/ducky.gif differ diff --git a/media/exclamation.png b/media/exclamation.png new file mode 100644 index 0000000..c37bd06 Binary files /dev/null and b/media/exclamation.png differ diff --git a/media/farbig.png b/media/farbig.png new file mode 100644 index 0000000..4f13da8 Binary files /dev/null and b/media/farbig.png differ diff --git a/media/fav.png b/media/fav.png new file mode 100644 index 0000000..06a5492 Binary files /dev/null and b/media/fav.png differ diff --git a/media/favicon.gif b/media/favicon.gif new file mode 100644 index 0000000..ca497c8 Binary files /dev/null and b/media/favicon.gif differ diff --git a/media/favicon.ico b/media/favicon.ico new file mode 100644 index 0000000..0cbe909 Binary files /dev/null and b/media/favicon.ico differ diff --git a/media/fbicon.png b/media/fbicon.png new file mode 100644 index 0000000..931b2a3 Binary files /dev/null and b/media/fbicon.png differ diff --git a/media/forum.png b/media/forum.png new file mode 100644 index 0000000..b6f7e05 Binary files /dev/null and b/media/forum.png differ diff --git a/media/hof.png b/media/hof.png new file mode 100644 index 0000000..b53454b Binary files /dev/null and b/media/hof.png differ diff --git a/media/home-fb.png b/media/home-fb.png new file mode 100644 index 0000000..9924cd4 Binary files /dev/null and b/media/home-fb.png differ diff --git a/media/home.png b/media/home.png new file mode 100644 index 0000000..8796cb3 Binary files /dev/null and b/media/home.png differ diff --git a/media/hs.png b/media/hs.png new file mode 100644 index 0000000..3d94486 Binary files /dev/null and b/media/hs.png differ diff --git a/media/hv.png b/media/hv.png new file mode 100644 index 0000000..1c5e01f Binary files /dev/null and b/media/hv.png differ diff --git a/media/images-age/modal.png b/media/images-age/modal.png new file mode 100644 index 0000000..88d6a73 Binary files /dev/null and b/media/images-age/modal.png differ diff --git a/media/images-age/overlay.png b/media/images-age/overlay.png new file mode 100644 index 0000000..fda8a51 Binary files /dev/null and b/media/images-age/overlay.png differ diff --git a/media/imageuploader.php b/media/imageuploader.php new file mode 100644 index 0000000..c9b5ecb --- /dev/null +++ b/media/imageuploader.php @@ -0,0 +1,245 @@ +login(); + + if( !$user->id ) { + $errors['notLoggedIn'] = 'You are not logged in!'; + return false; + } + + // no non-images + if( + !preg_match( '/([^\/]*?)\.(gif|jpg|jpeg|png)$/i', $name, $fileMatch ) + ) { + $errors['wrongExtension'] = 'Your file has not the right extension (gif, jpg or png)!'; + return false; + } + + $time = time(); + $keyword = Keyword::get( $fileMatch[1] ); + + // Iterate over all keywords, if this one is allready taken + $taken = array(); + $r = DB::query( 'SELECT keyword FROM '.TABLE_IMAGES.' WHERE keyword LIKE :1', date('Y/m/',$time).$keyword.'%' ); + foreach( $r as $v ) { + $taken[] = substr($v['keyword'],8); // Keyword without date! + } + $keyword = Keyword::iterate( $keyword, $taken ); + + list( $srcWidth, $srcHeight, $type ) = getimagesize( $localPath ); + if( $type == IMAGETYPE_JPEG ) { + $extension = 'jpg'; + } else if( $type == IMAGETYPE_GIF ) { + $extension = 'gif'; + } else if( $type == IMAGETYPE_PNG ) { + $extension = 'png'; + } else { + return false; + } + + $thumbName = $keyword.".jpg"; // all thumbs are jpegs! + $name = $keyword.".".$extension; + $imageDir = Config::$images['imagePath'] . date('Y/m', $time); + $thumbDir = Config::$images['thumbPath'] . date('Y/m', $time); + $imagePath = $imageDir.'/'.$name; + + if( !Filesystem::mkdirr($imageDir) || !Filesystem::mkdirr($thumbDir) ) { + return false; + } + + if( $uploaded ) { + if( !@move_uploaded_file( $localPath, $imagePath ) ) { + return false; + } + } else { + if( !@rename( $localPath, $imagePath ) ) { + return false; + } + } + + $hash = md5_file( $imagePath ); + $c = DB::query('SELECT id FROM '.TABLE_IMAGES.' WHERE hash = :1', $hash); + if( !empty( $c ) ) { + unlink( $imagePath ); + $errors['duplicate'] = 'This image is already in our database!'; + return false; + } + + + //watermark + function watermark($SourceFile, $WatermarkFile, $SaveToFile = NULL) + +{ + + list( $srcWidth, $srcHeight, $type ) = getimagesize( $SourceFile ); + if( $type != IMAGETYPE_GIF ) { + + + + + $watermark = @imagecreatefrompng($WatermarkFile) + + + or exit('Cannot open the watermark file.'); + + imageAlphaBlending($watermark, false); + + imageSaveAlpha($watermark, true); + + $image_string = @file_get_contents($SourceFile) + + + or exit('Cannot open image file.'); + + $image = @imagecreatefromstring($image_string) + + or exit('Not a valid image format.'); + + $imageWidth=imageSX($image); + + $imageHeight=imageSY($image); + + + $watermarkWidth=imageSX($watermark); + + $watermarkHeight=imageSY($watermark); + + $coordinate_X = ( $imageWidth) - ( $watermarkWidth); + + + $coordinate_Y = ( $imageHeight) - ( $watermarkHeight); + + imagecopy($image, $watermark, $coordinate_X, $coordinate_Y, + + + 0, 0, $watermarkWidth, $watermarkHeight); + + if(!($SaveToFile)) header('Content-Type: image/jpeg'); + + imagejpeg ($image, $SaveToFile, 100); + + + imagedestroy($image); + + imagedestroy($watermark); + + if(!($SaveToFile)) exit; + } + +} + + + + // make thumbs + foreach( Config::$gridView['classes'] as $gc ) { + $thumbPath = $thumbDir.'/'.$gc['dir'].'/'.$thumbName; + Filesystem::mkdirr($thumbDir.'/'.$gc['dir']); + if( !Image::createThumb( $imagePath, $thumbPath, + $gc['width'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth'], + $gc['height'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth'] + )) { + unlink( $imagePath ); + $errors['internalError'] = 'Internal error processing the image!'; + return false; + } + } + + ///watermark + watermark($imagePath,"watermark.png",$imagePath); + ///watermark + + $user->increaseScore( Config::$postScore ); + + DB::query( 'UPDATE '.TABLE_USERS.' SET images = images + 1 WHERE id = :1', $user->id ); + + + if ($commentUpload && $cid != 0){ + DB::insertRow( "pl_commentuploads",array('c_id' => $cid,"image_link" =>$imagePath,"thumb_link" => "data/thumbs/".date('Y/m/', $time)."/128x128/".$name)); + + }else{ + DB::insertRow( TABLE_IMAGES, + array( + 'logged' => date('Y-m-d H:i:s', $time), + 'user' => $user->id, + 'score' => 3, + 'votes' => 0, + 'keyword' => date('Y/m/', $time).$keyword, + 'tags' => $tags, + 'image' => $name, + 'thumb' => $thumbName, + 'hash' => $hash, + 'source' => $source + ) + ); + } + + $imageId = DB::insertId(); + + $colors = Image::getColors( $imagePath, 4 ); + foreach( $colors as $c ) { + DB::insertRow( TABLE_IMAGECOLORS, + array( + 'imageId' => $imageId, + 'r' => $c['r'], + 'g' => $c['g'], + 'b' => $c['b'] + ) + ); + } + return true; + } +} +?> \ No newline at end of file diff --git a/media/img.png b/media/img.png new file mode 100644 index 0000000..ebc2ae5 Binary files /dev/null and b/media/img.png differ diff --git a/media/jquery.js b/media/jquery.js new file mode 100644 index 0000000..93adea1 --- /dev/null +++ b/media/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
    "+""+"
    ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
    t
    ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
    ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/media/jscolor.js b/media/jscolor.js new file mode 100644 index 0000000..2bdf7cd --- /dev/null +++ b/media/jscolor.js @@ -0,0 +1,935 @@ +/** + * jscolor, JavaScript Color Picker + * + * @version 1.3.13 + * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html + * @author Jan Odvarko, http://odvarko.cz + * @created 2008-06-15 + * @updated 2012-01-19 + * @link http://jscolor.com + */ + + +var jscolor = { + + + dir : '', // location of jscolor directory (leave empty to autodetect) + bindClass : 'color', // class name + binding : true, // automatic binding via + preloading : true, // use image preloading? + + + install : function() { + jscolor.addEvent(window, 'load', jscolor.init); + }, + + + init : function() { + if(jscolor.binding) { + jscolor.bind(); + } + if(jscolor.preloading) { + jscolor.preload(); + } + }, + + + getDir : function() { + if(!jscolor.dir) { + var detected = jscolor.detectDir(); + jscolor.dir = detected!==false ? detected : 'jscolor/'; + } + return jscolor.dir; + }, + + + detectDir : function() { + var base = location.href; + + var e = document.getElementsByTagName('base'); + for(var i=0; i vs[a] ? + (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) : + tp[a], + -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ? + (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) : + (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c) + ]; + } + drawPicker(pp[a], pp[b]); + } + }; + + + this.importColor = function() { + if(!valueElement) { + this.exportColor(); + } else { + if(!this.adjust) { + if(!this.fromString(valueElement.value, leaveValue)) { + styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage; + styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; + styleElement.style.color = styleElement.jscStyle.color; + this.exportColor(leaveValue | leaveStyle); + } + } else if(!this.required && /^\s*$/.test(valueElement.value)) { + valueElement.value = ''; + styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage; + styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; + styleElement.style.color = styleElement.jscStyle.color; + this.exportColor(leaveValue | leaveStyle); + + } else if(this.fromString(valueElement.value)) { + // OK + } else { + this.exportColor(); + } + } + }; + + + this.exportColor = function(flags) { + if(!(flags & leaveValue) && valueElement) { + var value = this.toString(); + if(this.caps) { value = value.toUpperCase(); } + if(this.hash) { value = '#'+value; } + valueElement.value = value; + } + if(!(flags & leaveStyle) && styleElement) { + styleElement.style.backgroundImage = "none"; + styleElement.style.backgroundColor = + '#'+this.toString(); + styleElement.style.color = + 0.213 * this.rgb[0] + + 0.715 * this.rgb[1] + + 0.072 * this.rgb[2] + < 0.5 ? '#FFF' : '#000'; + } + if(!(flags & leavePad) && isPickerOwner()) { + redrawPad(); + } + if(!(flags & leaveSld) && isPickerOwner()) { + redrawSld(); + } + }; + + + this.fromHSV = function(h, s, v, flags) { // null = don't change + h<0 && (h=0) || h>6 && (h=6); + s<0 && (s=0) || s>1 && (s=1); + v<0 && (v=0) || v>1 && (v=1); + this.rgb = HSV_RGB( + h===null ? this.hsv[0] : (this.hsv[0]=h), + s===null ? this.hsv[1] : (this.hsv[1]=s), + v===null ? this.hsv[2] : (this.hsv[2]=v) + ); + this.exportColor(flags); + }; + + + this.fromRGB = function(r, g, b, flags) { // null = don't change + r<0 && (r=0) || r>1 && (r=1); + g<0 && (g=0) || g>1 && (g=1); + b<0 && (b=0) || b>1 && (b=1); + var hsv = RGB_HSV( + r===null ? this.rgb[0] : (this.rgb[0]=r), + g===null ? this.rgb[1] : (this.rgb[1]=g), + b===null ? this.rgb[2] : (this.rgb[2]=b) + ); + if(hsv[0] !== null) { + this.hsv[0] = hsv[0]; + } + if(hsv[2] !== 0) { + this.hsv[1] = hsv[1]; + } + this.hsv[2] = hsv[2]; + this.exportColor(flags); + }; + + + this.fromString = function(hex, flags) { + var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i); + if(!m) { + return false; + } else { + if(m[1].length === 6) { // 6-char notation + this.fromRGB( + parseInt(m[1].substr(0,2),16) / 255, + parseInt(m[1].substr(2,2),16) / 255, + parseInt(m[1].substr(4,2),16) / 255, + flags + ); + } else { // 3-char notation + this.fromRGB( + parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255, + parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255, + parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255, + flags + ); + } + return true; + } + }; + + + this.toString = function() { + return ( + (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) + + (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) + + (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1) + ); + }; + + + function RGB_HSV(r, g, b) { + var n = Math.min(Math.min(r,g),b); + var v = Math.max(Math.max(r,g),b); + var m = v - n; + if(m === 0) { return [ null, 0, v ]; } + var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m); + return [ h===6?0:h, m/v, v ]; + } + + + function HSV_RGB(h, s, v) { + if(h === null) { return [ v, v, v ]; } + var i = Math.floor(h); + var f = i%2 ? h-i : 1-(h-i); + var m = v * (1 - s); + var n = v * (1 - s*f); + switch(i) { + case 6: + case 0: return [v,n,m]; + case 1: return [n,v,m]; + case 2: return [m,v,n]; + case 3: return [m,n,v]; + case 4: return [n,m,v]; + case 5: return [v,m,n]; + } + } + + + function removePicker() { + delete jscolor.picker.owner; + document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB); + } + + + function drawPicker(x, y) { + if(!jscolor.picker) { + jscolor.picker = { + box : document.createElement('div'), + boxB : document.createElement('div'), + pad : document.createElement('div'), + padB : document.createElement('div'), + padM : document.createElement('div'), + sld : document.createElement('div'), + sldB : document.createElement('div'), + sldM : document.createElement('div'), + btn : document.createElement('div'), + btnS : document.createElement('span'), + btnT : document.createTextNode(THIS.pickerCloseText) + }; + for(var i=0,segSize=4; i#hoverNav{ left: 0;} +#hoverNav a{ outline: none;} + +#prevLink, #nextLink{ width: 49%; height: 100%; background-image: url(data:image/gif;base64,AAAA); /* Trick IE into showing hover */ display: block; } +#prevLink { left: 0; float: left;} +#nextLink { right: 0; float: right;} +#prevLink:hover, #prevLink:visited:hover { background: url(/media/prevlabel.gif) left 15% no-repeat; } +#nextLink:hover, #nextLink:visited:hover { background: url(/media/nextlabel.gif) right 15% no-repeat; } + +#imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100% ; } + +#imageData{ padding:0 10px; color: #666; } +#imageData #imageDetails{ width: 70%; float: left; text-align: left; } +#imageData #caption{ font-weight: bold; } +#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; } +#imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; outline: none;} + +#overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; } diff --git a/media/lightbox/bg-checker.png b/media/lightbox/bg-checker.png new file mode 100644 index 0000000..e5edf8e Binary files /dev/null and b/media/lightbox/bg-checker.png differ diff --git a/media/lightbox/box.png b/media/lightbox/box.png new file mode 100644 index 0000000..48a6ba7 Binary files /dev/null and b/media/lightbox/box.png differ diff --git a/media/lightbox/bullet.gif b/media/lightbox/bullet.gif new file mode 100644 index 0000000..bf8e3c6 Binary files /dev/null and b/media/lightbox/bullet.gif differ diff --git a/media/lightbox/close.png b/media/lightbox/close.png new file mode 100644 index 0000000..99a011f Binary files /dev/null and b/media/lightbox/close.png differ diff --git a/media/lightbox/donate.png b/media/lightbox/donate.png new file mode 100644 index 0000000..0723c5c Binary files /dev/null and b/media/lightbox/donate.png differ diff --git a/media/lightbox/favicon.gif b/media/lightbox/favicon.gif new file mode 100644 index 0000000..084b099 Binary files /dev/null and b/media/lightbox/favicon.gif differ diff --git a/media/lightbox/lightbox.css b/media/lightbox/lightbox.css new file mode 100644 index 0000000..05b8752 --- /dev/null +++ b/media/lightbox/lightbox.css @@ -0,0 +1,180 @@ +/* line 6, ../sass/lightbox.sass */ +#lightboxOverlay { + position: absolute; + top: 0; + left: 0; + z-index: 10005; + background-color: black; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); + opacity: 0.85; + display: none; +} + +/* line 15, ../sass/lightbox.sass */ +#lightbox { + position: absolute; + left: 0; + width: 100%; + z-index: 10006; + text-align: center; + line-height: 0; + font-family: "lucida grande", tahoma, verdana, arial, sans-serif; + font-weight: normal; +} +/* line 24, ../sass/lightbox.sass */ +#lightbox img { + width: auto; + height: auto; +} +/* line 27, ../sass/lightbox.sass */ +#lightbox a img { + border: none; +} + +/* line 30, ../sass/lightbox.sass */ +.lb-outerContainer { + position: relative; + *zoom: 1; + width: 250px; + height: 250px; + margin: 0 auto; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; +} +/* line 38, ../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */ +.lb-outerContainer:after { + content: ""; + display: table; + clear: both; +} + +/* line 39, ../sass/lightbox.sass */ +.lb-container { + padding: 10px; +} + +/* line 42, ../sass/lightbox.sass */ +.lb-loader { + position: absolute; + top: 40%; + left: 0%; + height: 25%; + width: 100%; + text-align: center; + line-height: 0; +} + +/* line 51, ../sass/lightbox.sass */ +.lb-nav { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + z-index: 10; +} + +/* line 59, ../sass/lightbox.sass */ +.lb-container > .nav { + left: 0; +} + +/* line 62, ../sass/lightbox.sass */ +.lb-nav a { + outline: none; +} + +/* line 65, ../sass/lightbox.sass */ +.lb-prev, .lb-next { + width: 49%; + height: 100%; + background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); + /* Trick IE into showing hover */ + display: block; +} + +/* line 72, ../sass/lightbox.sass */ +.lb-prev { + left: 0; + float: left; +} + +/* line 76, ../sass/lightbox.sass */ +.lb-next { + right: 0; + float: right; +} + +/* line 81, ../sass/lightbox.sass */ +.lb-prev:hover { + background: url(prev.png) left 48% no-repeat; +} + +/* line 85, ../sass/lightbox.sass */ +.lb-next:hover { + background: url(next.png) right 48% no-repeat; +} + +/* line 88, ../sass/lightbox.sass */ +.lb-dataContainer { + margin: 0 auto; + padding-top: 5px; + *zoom: 1; + width: 100%; + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + -ms-border-bottom-left-radius: 4px; + -o-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + -ms-border-bottom-right-radius: 4px; + -o-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; +} +/* line 38, ../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */ +.lb-dataContainer:after { + content: ""; + display: table; + clear: both; +} + +/* line 95, ../sass/lightbox.sass */ +.lb-data { + padding: 0 10px; + color: #bbbbbb; +} +/* line 98, ../sass/lightbox.sass */ +.lb-data .lb-details { + width: 85%; + float: left; + text-align: left; + line-height: 1.1em; +} +/* line 103, ../sass/lightbox.sass */ +.lb-data .lb-caption { + font-size: 13px; + font-weight: bold; + line-height: 1em; +} +/* line 107, ../sass/lightbox.sass */ +.lb-data .lb-number { + display: block; + clear: left; + padding-bottom: 1em; + font-size: 11px; +} +/* line 112, ../sass/lightbox.sass */ +.lb-data .lb-close { + width: 35px; + float: right; + padding-bottom: 0.7em; + outline: none; +} +/* line 117, ../sass/lightbox.sass */ +.lb-data .lb-close:hover { + cursor: pointer; +} diff --git a/media/lightbox/loading.gif b/media/lightbox/loading.gif new file mode 100644 index 0000000..5087c2a Binary files /dev/null and b/media/lightbox/loading.gif differ diff --git a/media/lightbox/next.png b/media/lightbox/next.png new file mode 100644 index 0000000..40b5884 Binary files /dev/null and b/media/lightbox/next.png differ diff --git a/media/lightbox/prev.png b/media/lightbox/prev.png new file mode 100644 index 0000000..6f50afd Binary files /dev/null and b/media/lightbox/prev.png differ diff --git a/media/lightbox/speech-bubbles.png b/media/lightbox/speech-bubbles.png new file mode 100644 index 0000000..569cef2 Binary files /dev/null and b/media/lightbox/speech-bubbles.png differ diff --git a/media/load.gif b/media/load.gif new file mode 100644 index 0000000..b713e27 Binary files /dev/null and b/media/load.gif differ diff --git a/media/load_b.gif b/media/load_b.gif new file mode 100644 index 0000000..283622f Binary files /dev/null and b/media/load_b.gif differ diff --git a/media/loading.gif b/media/loading.gif new file mode 100644 index 0000000..0b1ba83 Binary files /dev/null and b/media/loading.gif differ diff --git a/media/login_fb.png b/media/login_fb.png new file mode 100644 index 0000000..89187ba Binary files /dev/null and b/media/login_fb.png differ diff --git a/media/logo-fb-hov.png b/media/logo-fb-hov.png new file mode 100644 index 0000000..3259c63 Binary files /dev/null and b/media/logo-fb-hov.png differ diff --git a/media/logo-fb.png b/media/logo-fb.png new file mode 100644 index 0000000..57126a1 Binary files /dev/null and b/media/logo-fb.png differ diff --git a/media/logo-hover.png b/media/logo-hover.png new file mode 100644 index 0000000..597494c Binary files /dev/null and b/media/logo-hover.png differ diff --git a/media/logo-hv.png b/media/logo-hv.png new file mode 100644 index 0000000..5840ceb Binary files /dev/null and b/media/logo-hv.png differ diff --git a/media/logo.png b/media/logo.png new file mode 100644 index 0000000..b65b3d3 Binary files /dev/null and b/media/logo.png differ diff --git a/media/logo_black.png b/media/logo_black.png new file mode 100644 index 0000000..3f66612 Binary files /dev/null and b/media/logo_black.png differ diff --git a/media/logo_white.png b/media/logo_white.png new file mode 100644 index 0000000..66c64b5 Binary files /dev/null and b/media/logo_white.png differ diff --git a/media/logout.png b/media/logout.png new file mode 100644 index 0000000..3ce1b52 Binary files /dev/null and b/media/logout.png differ diff --git a/media/logout_b.png b/media/logout_b.png new file mode 100644 index 0000000..aca1159 Binary files /dev/null and b/media/logout_b.png differ diff --git a/media/luci.ttf b/media/luci.ttf new file mode 100644 index 0000000..6f67c86 Binary files /dev/null and b/media/luci.ttf differ diff --git a/media/mail.png b/media/mail.png new file mode 100644 index 0000000..08adbc1 Binary files /dev/null and b/media/mail.png differ diff --git a/media/mailme.png b/media/mailme.png new file mode 100644 index 0000000..6e6c566 Binary files /dev/null and b/media/mailme.png differ diff --git a/media/mailme_fb.png b/media/mailme_fb.png new file mode 100644 index 0000000..e88c931 Binary files /dev/null and b/media/mailme_fb.png differ diff --git a/media/manage-fb.png b/media/manage-fb.png new file mode 100644 index 0000000..ed9ca14 Binary files /dev/null and b/media/manage-fb.png differ diff --git a/media/manage.png b/media/manage.png new file mode 100644 index 0000000..f8eb741 Binary files /dev/null and b/media/manage.png differ diff --git a/media/modal.png b/media/modal.png new file mode 100644 index 0000000..88d6a73 Binary files /dev/null and b/media/modal.png differ diff --git a/media/n.png b/media/n.png new file mode 100644 index 0000000..6a091d4 Binary files /dev/null and b/media/n.png differ diff --git a/media/n_b.png b/media/n_b.png new file mode 100644 index 0000000..a39abcf Binary files /dev/null and b/media/n_b.png differ diff --git a/media/next.png b/media/next.png new file mode 100644 index 0000000..17bd4b3 Binary files /dev/null and b/media/next.png differ diff --git a/media/normal.png b/media/normal.png new file mode 100644 index 0000000..62062ef Binary files /dev/null and b/media/normal.png differ diff --git a/media/overlay.png b/media/overlay.png new file mode 100644 index 0000000..fda8a51 Binary files /dev/null and b/media/overlay.png differ diff --git a/media/p.png b/media/p.png new file mode 100644 index 0000000..410d200 Binary files /dev/null and b/media/p.png differ diff --git a/media/p_a_w.png b/media/p_a_w.png new file mode 100644 index 0000000..73da2f1 Binary files /dev/null and b/media/p_a_w.png differ diff --git a/media/p_b.png b/media/p_b.png new file mode 100644 index 0000000..6647e83 Binary files /dev/null and b/media/p_b.png differ diff --git a/media/picturelicious.js b/media/picturelicious.js new file mode 100644 index 0000000..c38794f --- /dev/null +++ b/media/picturelicious.js @@ -0,0 +1,490 @@ +function $(id){return document.getElementById(id)} +function gridView(id){ gridSolve(id); gridSolve(id); window.setInterval("gridSolve('"+id+"')",250); } +function swap(e, c1, c2) { e.className = e.className == c1 ? c2 : c1; }; + +// GridSolver ------------------------------------------------------------ +var gridSize = 64; +var gridMinWidth = 6; +var gridWidth = 0; +var grid = null; +var boxDef = { + 'b0': {'width': 3, 'height': 3}, + 'b1': {'width': 2, 'height': 2}, + 'b2': {'width': 1, 'height': 1} +}; + +function gridSolve( cid ) { + var container = $(cid); + var newWidth = parseInt( container.offsetWidth ); + var newGridWidth = parseInt( newWidth / gridSize ); + newGridWidth = newGridWidth < gridMinWidth ? gridMinWidth : newGridWidth; + + if( gridWidth == newGridWidth ) + return; + else + gridWidth = newGridWidth; + + boxes = new Array(); + while( container.hasChildNodes() ) { + e = container.removeChild( container.firstChild ); + if( e.tagName == 'DIV' ) { + boxes.push( e ); + } + } + + grid = new Array( gridWidth ); + for( var i = 0; i < grid.length; i++ ) { + grid[i] = 0; + } + + for(var i = 0; i < boxes.length; i++) { + insertThumb( boxes[i], cid ) + } + + var maxHeight = 0; + for( var i = 0; i < grid.length; i++) { + maxHeight = Math.max( maxHeight,grid[i] ); + } + container.style.height = (maxHeight * gridSize) + 'px'; + $('images').style.height = (maxHeight * gridSize) + 'px'; +} + +function insertThumb( box, cid ) { + var boxWidth = boxDef[box.className]['width']; + var boxHeight = boxDef[box.className]['height']; + var maxHeight = 0; + var currentHeight = -1; + var spotWidth = 0; + var spotLeft = 0; + var freeSpots = new Array(); + for( var i = 0; i < grid.length; i++) { + if( currentHeight == grid[i] ) { + spotWidth++; + } + + if( (currentHeight != grid[i] || i+1 == grid.length) && spotWidth > 0) { + freeSpots.push({'width': spotWidth, 'left': spotLeft, 'height': currentHeight}); + + spotWidth = 1; + spotLeft = i; + if(currentHeight != grid[i] && i+1 == grid.length) { + freeSpots.push({'width': spotWidth, 'left': spotLeft, 'height': grid[i]}); + } + } + + else if( spotWidth == 0 ) { + spotWidth = 1; + } + + currentHeight = grid[i]; + if( grid[i] > maxHeight ) { + maxHeight = grid[i]; + } + } + + var targetHeight = 0; + var targetLeft = 0; + var bestScore = -1; + for( var j = 0; j < boxWidth; j++ ) { + if( grid[j] > targetHeight ) { + targetHeight = grid[j]; + } + } + var newHeight = targetHeight + boxHeight; + + for( var i = 0; i < freeSpots.length; i++ ) { + var heightScore = ( maxHeight - freeSpots[i]['height'] ); + var widthScore = boxWidth / freeSpots[i]['width']; + var score = heightScore * heightScore + widthScore * 2; + + if( freeSpots[i]['width'] >= boxWidth && score > bestScore ) { + targetHeight = freeSpots[i]['height']; + targetLeft = freeSpots[i]['left']; + newHeight = freeSpots[i]['height'] + boxHeight; + bestScore = score; + } + } + + for( var j = 0; j < boxWidth; j++ ) { + grid[targetLeft + j] = newHeight; + } + + var container = $( cid ); + container.appendChild( box ); + box.style.left = (targetLeft * gridSize) + 'px'; + box.style.top = (targetHeight * gridSize) + 'px'; + return true; +} + +// Colorpicker ----------------------------------------------------------- +function colorpicker( id, size, onchange, onshow ) { + var that = this; + this.size = size; + this.onchange = onchange; + this.onshow = onshow; + + this.mode = 'none'; + + this.sv = $(id+'SV'); + this.svselect = $(id+'SVSelect'); + this.h = $(id+'H'); + this.hselect = $(id+'HSelect'); + this.value = $(id+'Value'); + this.current = $(id+'Current'); + + this.cap = function( v, min, max ) { + return Math.min(Math.max(min,v),max); + } + + this.getMousPos = function( event ) { + if(event.pageX || event.pageY){ + return { + 'x': event.pageX, + 'y': event.pageY + }; + } + return { + 'x': event.clientX + document.body.scrollLeft - document.body.clientLeft, + 'y': event.clientY + document.body.scrollTop - document.body.clientTop + }; + } + + this.getObjPos = function( obj ) { + var curleft = curtop = 0; + if (obj.offsetParent) { + curleft = obj.offsetLeft; + curtop = obj.offsetTop; + while (obj = obj.offsetParent) { + curleft += obj.offsetLeft; + curtop += obj.offsetTop; + } + } + return { + 'x':curleft, + 'y':curtop + }; + } + + + this.release = function() { + document.onmousemove = ''; + this.mode = 'none'; + } + + this.move = function( event ) { + if (!event) var event = window.event; + if(event.pageX || event.pageY) { + var mx = event.pageX; + var my = event.pageY; + } else { + var mx = event.clientX + document.body.scrollLeft - document.body.clientLeft; + var my = event.clientY + document.body.scrollTop - document.body.clientTop; + } + if( this.mode == 'sv' ) { + var obj = this.getObjPos( this.sv ); + var x = this.cap(mx - obj.x - 3, -4, this.size - 4); + var y = this.cap(my - obj.y - 3, -4, this.size - 4); + this.svselect.style.left = x + "px"; + this.svselect.style.top = y + "px"; + } + else if ( this.mode == 'h' ) { + var obj = this.getObjPos( this.sv ); + var y = this.cap(my - obj.y - 2, -2, this.size - 3); + this.hselect.style.top = y + "px"; + this.sv.style.backgroundColor = '#' + this.rgb2hex(this.hsv2rgb( {'h':1-((y+3)/this.size), 's':1, 'v':1} )); + } + else return false; + + var hex = this.getHex(); + this.current.style.backgroundColor = '#' + hex; + this.value.innerHTML = '#' + hex; + this.onchange( this ); + return false; + } + + this.sv.onmousedown = function() { + that.mode = 'sv'; + document.onmousemove = function( event ) { that.move( event ) }; + document.onmouseup = that.release; + return false; + } + + this.h.onmousedown = function() { + that.mode = 'h'; + document.onmousemove = function( event ) { that.move( event ) }; + document.onmouseup = that.release; + return false; + } + + + this.getHSV = function() { + var svpos = this.getObjPos( this.sv ); + var svselectpos = this.getObjPos( this.svselect ); + + var hpos = this.getObjPos( this.h ); + var hselectpos = this.getObjPos( this.hselect ); + + return { + 'h': 1 - (this.cap(hselectpos.y - hpos.y + 3, 0, this.size) / this.size), + 's': this.cap(svselectpos.x - svpos.x + 2, 0, this.size) / this.size, + 'v': 1 - (this.cap(svselectpos.y - svpos.y + 4, 0, this.size) / this.size) + } + } + + this.getRGB = function() { + return this.hsv2rgb( this.getHSV() ); + } + + this.getHex = function() { + return this.rgb2hex( this.getRGB() ); + } + + this.toHex = function(v) { v=Math.round(Math.min(Math.max(0,v),255)); return("0123456789ABCDEF".charAt((v-v%16)/16)+"0123456789ABCDEF".charAt(v%16)); } + this.rgb2hex = function(c) { return this.toHex(c.r)+this.toHex(c.g)+this.toHex(c.b); } + + this.hsv2rgb = function( c ) { + var R, B, G, H = c.h, S = c.s, V = c.v; + if( S>0 ) { + if(H>=1) H=0; + + H=6*H; F=H-Math.floor(H); + A=Math.round(255*V*(1.0-S)); + B=Math.round(255*V*(1.0-(S*F))); + C=Math.round(255*V*(1.0-(S*(1.0-F)))); + V=Math.round(255*V); + + switch(Math.floor(H)) { + case 0: R=V; G=C; B=A; break; + case 1: R=B; G=V; B=A; break; + case 2: R=A; G=V; B=C; break; + case 3: R=A; G=B; B=V; break; + case 4: R=C; G=A; B=V; break; + case 5: R=V; G=A; B=B; break; + } + return {'r': (R?R:0), 'g': (G?G:0), 'b': (B?B:0)}; + } + else { + return {'r': (Math.round(V*255)), 'g': (Math.round(V*255)), 'b': (Math.round(V*255))}; + } + } +} + + +// Adjust height of prev/next bars in IE --------------------------------- +var ieAdjustCount = 0; +function ieAdjustHeight( oldHeight ) { + var pe = ($('viewer') ? $('viewer') : $('images')); + if( + !document.all || // IE + !( pe ) || + ( + pe.scrollHeight < oldHeight + 50 && + ieAdjustCount > 10 + ) + ) { + return; + } + ieAdjustCount++; + var newHeight = pe.scrollHeight; + $('prevBar').style.height = pe.scrollHeight + 'px'; + $('nextBar').style.height = pe.scrollHeight + 'px'; + setTimeout( 'ieAdjustHeight(' + newHeight + ')', 100 ); +} + +//GET + +function getUrlVars() { + var vars = {}; + var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { + vars[key] = value; + }); + return vars; +} + + +// JSON functions for tagging, rating, deleting... ----------------------- +function post( url, params, callback ) { + if (window.ActiveXObject) { // ie + try { + req = new ActiveXObject( 'Msxml2.XMLHTTP' ); + } + catch (e) { + try { + req = new ActiveXObject( 'Microsoft.XMLHTTP' ); + } + catch (e) {} + } + } + else if (window.XMLHttpRequest) { // moz + req = new XMLHttpRequest(); + req.overrideMimeType( 'text/plain' ); + } + req.onreadystatechange = function(){ + if (req.readyState == 4 && req.status == 200) { + callback(); + } + }; + + if( !req ) return false; + req.open( 'POST', url, true ); + req.setRequestHeader( 'Content-type', 'application/x-www-form-urlencoded; charset=UTF-8' ); + req.setRequestHeader( 'Content-length', params.length ); + req.setRequestHeader( 'Connection', 'close' ); + req.send( params ); +} + +function addTags( imageId, inputField, admin ) { + $( 'loadTags' ).style.display = 'block'; + var tags = encodeURIComponent(inputField.value); + if( !admin ) { + inputField.value = ''; + } + post( + location.protocol + "//" + location.host + '/json.php?addTags', + 'id='+imageId+'&tags='+tags, + function(){ + q = ( eval('('+req.responseText+')') ); + if( q.tags ) { + $('tags').innerHTML = q.tags; + } + $('addTag').className='hidden'; + $( 'loadTags' ).style.display = 'none'; + } + ); + return false; +} + +function del( imageId ) { + try { + if( !confirm( 'Delete this image: ' + imageId +' ?' ) ) return false; + //$( 'loadDelete' ).style.display = 'block'; + + post( + location.protocol + "//" + location.host + '/json.php?delete','id='+imageId); + LoadData("comments","cmts",imageId); + } + catch (e) { + + alert("Fehler: "+e); + return false; + + } + return false; +} + +function movehof( imageId ) { + try { + if( !confirm( 'Move to Hall of Fame?' ) ) return false; + //$( 'loadhof' ).style.display = 'block'; + + post( + location.protocol + "//" + location.host + '/json.php?fame', + 'id='+imageId); + //function(){ + //$( 'loadhof' ).style.display = 'none'; + // //$( 'hof' ).style.display = 'none'; + //} + } + catch (e) { + + alert("Fehler: "+e); + return false; + + } + return false; +} + +function CloseThread( imageId ) { + try { + if( !confirm( 'Close Thread?' ) ) return false; + //$( 'loadhof' ).style.display = 'block'; + + post( + location.protocol + "//" + location.host + '/json.php?CloseThread', + 'id='+imageId); + //function(){ + //$( 'loadhof' ).style.display = 'none'; + // //$( 'hof' ).style.display = 'none'; + //} + } + catch (e) { + + alert("Fehler: "+e); + return false; + + } + return false; +} + + +function banUser( userId ) { + + if( !confirm( 'Ban this User?' ) ) return false; + var rsn = prompt("Why?"); + //$( 'loadDelete' ).style.display = 'block'; + post( + location.protocol + "//" + location.host + '/json.php?banUser', + 'id='+userId+'&rsn='+rsn); + return false; +} + +function TimeUser( userId ) { + + if( !confirm( 'Spamlock this user?' ) ) return false; + var tm = prompt("How long? (in hours)"); + var rsn = prompt("Why?"); + //$( 'loadDelete' ).style.display = 'block'; + var now = parseInt(Math.round((new Date()).getTime() / 1000)); + now = now + (3600 * parseInt(tm)); + alert(now); + post( + location.protocol + "//" + location.host + '/json.php?TimeUser', + 'id='+userId+'&time='+now+'&rsn='+rsn); + + return false; +} + +function delComment( commentId, e ) { + if( !confirm( 'Delete this comment?' ) ) return false; + var cdiv = e.parentNode.parentNode.parentNode; + post( + location.protocol + "//" + location.host + '/json.php?deleteComment', + 'id='+commentId); + return false; +} + +function addfav( imageId, e ) { + post( + location.protocol + "//" + location.host + '/json.php?addfav', + 'id='+imageId); + return false; +} + + +// mouseover for rating stars +function sr( id, scale ) { + $( id ).style.backgroundPosition = ( (20 * scale) - 100 ) + 'px 0'; +} + +function rate( imageId, score ) { + $( 'loadRating' ).style.display = 'block'; + post( + $('home').href + 'json.php?rate', + 'id='+imageId+'&score='+score, + function() { + q = ( eval('('+req.responseText+')') ); + $( 'loadRating' ).style.display = 'none'; + $( 'currentRating' ).style.width = 20 * parseFloat(q.score) + 'px'; + $( 'ratingDescription' ).innerHTML = q.score + ' after ' + q.votes + ' Vote' + ( q.votes > 1 ? 's' : '' ); + } + ); + return false; +} + +function s() { + var q = $( 'q' ); + if( q && q.value ) { + window.location = $('home').href + 'search/' + encodeURI( q.value ); + } + return false; +} \ No newline at end of file diff --git a/media/post.js.php b/media/post.js.php new file mode 100644 index 0000000..ed65b7c --- /dev/null +++ b/media/post.js.php @@ -0,0 +1,146 @@ + +function RP_RemotePost( postURL, stylesheet ) { + this.postURL = postURL; + this.stylesheet = stylesheet; + + this.visible = false; + this.menu = null; + this.dialog = null; + this.iframe = null; + this.checkSuccessInterval = 0; + this.minImageSize = 32; + + + this.create = function(){ + var that = this; + var css = document.createElement('link'); + css.type = 'text/css'; + css.rel = 'stylesheet'; + css.href = this.stylesheet; + if( document.getElementsByTagName("head").item(0) ) { + document.getElementsByTagName("head").item(0).appendChild( css ); + } else { + document.getElementsByTagName("body").item(0).appendChild( css ); + } + + var closeButton = document.createElement('a'); + closeButton.appendChild( document.createTextNode("x") ); + closeButton.className = 'close'; + closeButton.onclick = function() { return that.toggle(); } + closeButton.href = '#'; + + + this.dialog = document.createElement('div'); + this.dialog.id = 'RP_Dialog'; + this.iframe = document.createElement('iframe'); + this.iframe.src = 'about:blank'; + this.dialog.appendChild( this.iframe ); + this.dialog.appendChild( closeButton ); + document.body.appendChild( this.dialog ); + + this.loadIFrame( {} ); + } + + + this.loadIFrame = function( params ) { + var reqUrl = this.postURL + '?nocache=' + parseInt(Math.random()*10000); + for( p in params ) { + reqUrl += '&' + p + '=' + encodeURIComponent( params[p] ); + } + this.iframe.src = reqUrl; + } + + + this.selectImage = function( image ) { + var title = image.title ? image.title : ( image.alt ? image.alt : document.title ); + var imageSrc = image.src; + if( + image.parentNode.tagName.match(/^a$/i) && + image.parentNode.href && + image.parentNode.href.match(/\.(jpe?g|gif|png)$/i) + ) { + imageSrc = image.parentNode.href; + } + this.loadIFrame( { + 'url': imageSrc, + 'xhrLocation': document.location.href.replace(/#.*$/,'') + }); + return false; + } + + + this.checkSuccess = function() { + if( document.location.href.match(/#RP_Success/) ) { + var that = this; + document.location.href = document.location.href.replace(/#.*$/, '#'); + setTimeout( function() { that.hide() }, 500 ); + } + } + + + this.show = function() { + this.visible = true; + var that = this; + + this.checkSuccessInterval = setInterval( function() { that.checkSuccess(); }, 500 ); + this.dialog.style.display = 'block'; + + var images = document.getElementsByTagName('img'); + for( var i=0; i this.minImageSize && img.height > this.minImageSize) { + img.onclick = function( ev ) { + if( ev && ev.stopPropagation ) { + ev.stopPropagation(); + } + return that.selectImage(this); + }; + img.className = img.className ? img.className + ' RP_PostImage' : 'RP_PostImage'; + } + } + } + + + this.hide = function() { + this.visible = false; + + clearInterval( this.checkSuccessInterval ); + this.dialog.style.display = 'none'; + + var images = document.getElementsByTagName('img'); + for( var i=0; i this.minImageSize && img.height > this.minImageSize) { + img.onclick = null; + img.className = img.className.replace(/\s*RP_PostImage/, ''); + } + } + } + + + this.toggle = function() { + if( !this.visible ) { + this.show(); + } else { + this.hide(); + } + return false; + } + + + this.create(); +} + +if( typeof(RP_Instance) == 'undefined' ) { + var RP_Instance = new RP_RemotePost( + 'remotepost.php', + 'media/remotepost.css' + ); +} +RP_Instance.toggle(); diff --git a/media/prev.png b/media/prev.png new file mode 100644 index 0000000..9077986 Binary files /dev/null and b/media/prev.png differ diff --git a/media/profile.png b/media/profile.png new file mode 100644 index 0000000..5c9acb9 Binary files /dev/null and b/media/profile.png differ diff --git a/media/profile_b.png b/media/profile_b.png new file mode 100644 index 0000000..744ea3d Binary files /dev/null and b/media/profile_b.png differ diff --git a/media/quicktags.js b/media/quicktags.js new file mode 100644 index 0000000..c89eb55 --- /dev/null +++ b/media/quicktags.js @@ -0,0 +1,44 @@ +var nextImage = {}; +var preload = null; +function quickTag( logId, imageId, inputField ) { + var tags = encodeURIComponent(inputField.value); + + // swap nextImage + $('imageLocation').href = nextImage['link']; + $('imageLocation').innerHTML = nextImage['link']; + $('imageId').value = nextImage['id']; + $('logId').value = nextImage['logId']; + $('image').src = nextImage['image']; + $('tags').innerHTML = nextImage['tags']; + $('tagText').value = ''; + $('tagText').focus(); + + if( !nextImage['link'] ) { + $('imageInfo').innerHTML = 'No more Images found'; + } + + post( + $('home').href + 'json.php?quickTag', + 'logId='+logId+'&id='+imageId+'&tags='+tags, + function(){ + nextImage = ( eval('('+req.responseText+')') ); + preload = new Image(1,1) + preload.src=nextImage['image']; + } + ); + return false; +} + +function quickTagInit() { + swap($('quickTagIntro'), 'article', 'hidden'); + swap($('viewer'), 'hidden', 'visible'); + post( + $('home').href + 'json.php?quickTag', + '', + function(){ + nextImage = ( eval('('+req.responseText+')') ); + quickTag( 0, 0, $('tagText') ); + } + ); + return false; +} \ No newline at end of file diff --git a/media/random.png b/media/random.png new file mode 100644 index 0000000..04815fe Binary files /dev/null and b/media/random.png differ diff --git a/media/refresh.png b/media/refresh.png new file mode 100644 index 0000000..8e3905e Binary files /dev/null and b/media/refresh.png differ diff --git a/media/refresh_fb.png b/media/refresh_fb.png new file mode 100644 index 0000000..021d898 Binary files /dev/null and b/media/refresh_fb.png differ diff --git a/media/regeln.png b/media/regeln.png new file mode 100644 index 0000000..2b0428c Binary files /dev/null and b/media/regeln.png differ diff --git a/media/register_fb.png b/media/register_fb.png new file mode 100644 index 0000000..72382a9 Binary files /dev/null and b/media/register_fb.png differ diff --git a/media/remotepost.css b/media/remotepost.css new file mode 100644 index 0000000..74a0f32 --- /dev/null +++ b/media/remotepost.css @@ -0,0 +1,58 @@ +img.RP_PostImage { + border: 2px dashed #00adef !important; + cursor: pointer !important; +} + + img.RP_PostImage:hover, img.RP_PostImageActive { + border: 2px solid #00adef !important; + } + +#RP_Dialog { + position: fixed; + top: 0; + left: 50%; + width: 450px; + margin-left: -243px; + padding: 0 18px 0 0; + z-index: 99999; + + background-color: #222 !important; + color: #fff !important; + + font-size: 12pt; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal; + font-style: normal; + text-align: left; + border-left: 1px solid #fff; + border-right: 1px solid #ccc; + border-bottom: 1px solid #aaa; +} + +#RP_Dialog iframe { + width: 450px; + height: 100px; + border: 0; +} + +#RP_Dialog a { + color: #fff !important; + background: transparent none !important; + text-decoration: none !important; + border: 0 !important; +} + +#RP_Dialog a:hover { + color: #fff !important; + background: #000 none !important; + text-decoration: none !important; + border: 0 !important; +} + +#RP_Dialog a.close { + position: absolute !important; + top: 0 !important; + right: 0 !important; + padding: 3px 10px; + font-weight: bold; +} diff --git a/media/search.png b/media/search.png new file mode 100644 index 0000000..de3dba2 Binary files /dev/null and b/media/search.png differ diff --git a/media/star-base.png b/media/star-base.png new file mode 100644 index 0000000..22eb816 Binary files /dev/null and b/media/star-base.png differ diff --git a/media/star-current.png b/media/star-current.png new file mode 100644 index 0000000..a7c33a1 Binary files /dev/null and b/media/star-current.png differ diff --git a/media/star-rate.png b/media/star-rate.png new file mode 100644 index 0000000..532f57e Binary files /dev/null and b/media/star-rate.png differ diff --git a/media/star.png b/media/star.png new file mode 100644 index 0000000..8921f61 Binary files /dev/null and b/media/star.png differ diff --git a/media/styles_b.css b/media/styles_b.css new file mode 100644 index 0000000..468fb10 --- /dev/null +++ b/media/styles_b.css @@ -0,0 +1,1194 @@ + +/* ----------------------------------------------- +layout & typo */ + +@font-face { + font-family: luci; + src:url('luci.ttf'); +} + +body { + background-color: #242424; + color: #cbcbcb; + font-family: Arial, Verdana, Trebuchet MS; + font-size: 10pt; + margin: 0; +} + +div#system{border:2px dashed #FF0000;color:#FFFFFF;text-align:center;margin:8px;padding:8px;} + +div#UploadD{ + z-index:901; + background-image:url(upload_pfeil_b.png); + background-repeat:no-repeat; + background-position:20px top; + padding-top:10px; + position:absolute; + top:40px; + left:160px; + max-width:400px; + +} +div#UploadD a{ + color:#fff; +} +div#UploadD_d{ + padding:20px; + color:#fff; + background-color:#202020; + margin:0px; + border-right:#000; + border-bottom:#000; +} +div#MenuLoad{ + display:none; +} + +div.inboxalert{ + z-index:801; + position:absolute; + text-align:center; + font-family:luci; + font-size:70%; + top:3px; + right:6px; + padding:1px; + min-width:7px; + background-color:#f03d25; + color:#fff; + border-right:1px solid #00376a; + border-bottom:1px solid #00376a; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} + +div.buttonlist{ + float:right; + height:16px; + margin-right:5px; + margin-top:-5px; + background-color:#686868; + +} + +div.buttonlist:hover{ + background-color:#96b2e4; +} + + +div#menu { + height: 42px; + background-image:url(top_back_b.png); + background-repeat:repeat-x; + position: fixed; + width: 100%; + left: 0; + top: 0; + z-index: 900; +} + +div#MenuRightBlock { + float: right; + width: 180px; + height: 42px; +} + +div#smalltime{ + color:#4b4b4b;font-size:80%; font-weight:lighter +} + +hr { + border: 0; + width: 100%; + height:1px; + background-color:#212121; +} +div.userMenu { + float: right; + font-size: 90%; + margin: 5px 30px 0 0; +} +.color { + background-color: #fff; + border: 1px solid #bdc7d8; + color: #000; + width: 12em; + +} +div.search { + position: relative; + float: left; + font-size: 70%; + margin: 30px 30px 0 30px; +} + +div.menuItems { + position: relative; + float: left; + font-size: 90%; + margin-top: 15px; +} + +div.menuItems a { + color:#929292; + text-decoration:none; + padding-left:8px; + padding-right:8px; + height: 100%; + padding-top: 15px; + padding-bottom: 9px; + text-transform: uppercase; + font-weight: bolder; +} +div.menuItems a:hover { + background-color:#252525; + color: #fff; +} + +div.menuItems2 { + position: relative; + float: right; + font-size: 90%; + height:30px; + margin-top:2px; + margin-right:2px; + padding:3px; +} +div.menuItems2 a { + color:#fff; +text-decoration:none; + padding-left:5px; + padding-right:5px; + font-family:luci; +} +div.menuItems2 a:hover { + color:#fff; + text-decoration:none; +} +div.menuItems2:hover { + background-color:#252525; +} + +div.lastcomments { + padding:5px; + position: relative; + float: left; + font-size: 80%; +} + +.table{ + border:1px solid #111; +} +.tabletop{ + background-color:#222; + +} +.tabletoptd{ + padding:3px; + + border-bottom:1px solid #111; +} +.tablelist{ + background-color:#232323; +} +.tabletd { + padding:3px; + border-right:1px solid #111; +} + +div#sidebar{ +} + +div#top{ + position:fixed; + width:180px; + right:0px; + height:32px; + border-left:1px solid #171717; + top:0px; + background-color:#131313; + background-image: url(top_back_b.png); + background-repeat: repeat-x; + text-align: center; + padding-top: 6px; + z-index: 901; +} + +div#rightpanel{ + position:fixed; + width:180px; + right:0px; + border-left:1px solid #171717; + border-bottom:1px solid #171717; + top:38px; + background-color:#131313; +} + +div#bottom{ + position:fixed; + width:180px; + right:0px; + height:auto; + border-left:1px solid #171717; + bottom: 0px; + background-color:#131313; + border-top: 1px solid #242424; + border-left:1px solid #171717; + text-align: center; + padding-top: 6px; +} + +div#Last5Div{ + width:230px; + background-color:#131313; + border:1px solid #000; + z-index:902; + position:absolute; + visibility:hidden; + right:181px; + top:37px; + padding-right:1px; +} +div#Last5Div table{ + padding-left:3px; + border-bottom:1px solid #000; +} +div#Last5Div a:hover{ + text-decoration:none; +} +div#Last5Div table:hover{ + + background-color:#212121; +} + +div#hof{ + border:1px solid #171717; +} + +div#site{ + margin-right:180px; +} + +#commentbar{ + font-family:Verdana, Geneva, sans-serif; + color:#cbcbcb; + font-size:11px; + padding:6px; + min-height:30px; +} + +#commentbar:hover{ + background-color:#212121; +} +#commentbar a{ + color:#cbcbcb; + +} +#commentbar a:hover{ + text-decoration:none; + color:#cbcbcb; +} + +div#commenttext{ + margin-left:35px; + max-width:140px; + min-height:30px; + margin-right:3px; +} +div#commentimg{ + width:32px; + float:left; +} + +div.search input { + font-size: 100%; +} + +input.search { + background-image: url(search.png); + background-repeat: no-repeat; + background-position: 2px 2px; + color: #fff; + text-align: right; + width: auto; + padding-left: 14px; +} + +input.color { + background-image: url(color.png); + background-repeat: no-repeat; + width: 18px; +} + +#logo { + float: left; + margin-left: 15px; + margin-right: 10px; + margin-top: 5px; + background: url(logo.png) no-repeat; + width: 140px; + height: 30px; +} +#logo:hover { + background: url(logo-hover.png) no-repeat; +} + +img { + border: 0; +} + +div#content { + margin: 3.5em 0.3em 1em; +} + +div#footer { + margin-right: 180px; + color: #444; + background: #171717; + padding: 13px; + font-size: 90%; + font-weight: bolder; +} + +span.love { + color: #7b0043; +} + +h1 { + color: #cbcbcb; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; +} + +h1.remotePost { + color: #cbcbcb; + font-size: 110%; + font-weight: bold; + text-transform: none; +} + +h2 { + margin-top: 3em; + color: #cbcbcb; + font-size: 110%; + font-weight: bold; +} + +a { + color: #FFF; + text-decoration: none; +} + +a:hover { + color: #FFF; + text-decoration:underline; +} + +div.article { + margin-left: 1em; + width: 40em; +} + +ul { + list-style-type:circle; +} + +div.userbutton{ + + float:right; + font-family:luci; + + display: table-cell; + vertical-align: middle; + + height:30px; + + margin-top:6px; + +} +div.userbutton img { + float:right; +} +div.userbutton a { + font-family:luci; + text-align:center; + height:16px; + padding:7px; + margin-top:6px; +} +div.userbutton a:hover { + color:#FFFFFF; + margin-top:6px; + background-color:#4b67a1; +} + +/* ----------------------------------------------- +prev next bars */ + +a.next, a.prev, div.noPrev, div.noNext { + text-indent: 16px; + color: #fff; + width: 12px; + overflow: hidden; + display: block; + text-align: center; + position: absolute; +} + +/* Hide from IE < 7 */ +a.next[class], a.prev[class], div.noPrev[class], div.noNext[class] { + height: 100%; +} + +a.prev { + + background-image: url(prev.png); + background-position: -12px 0; + left: 0; + top: 0; +} + a.prev:hover { + background-position: -24px 0; + } + + +a.next { + + background-image: url(next.png); + background-position: -12px 0; + right: 0; + top: 0; +} + + a.next:hover { + background-position: 0 0; + } + +div.noPrev { + background-image: url(prev.png); + background-position: 0 0; + left: 0; + top: 0; +} + +div.noNext { + background-image: url(next.png); + background-position: -24px 0; + right: 0; + top: 0; +} + + + + +/* ----------------------------------------------- +grid view */ + +.unread{ + float:left; + background-image:url(alert.gif); + width:10px; + height:10px; +} + +.noscr { +text-align:center; + background-color: #de5c5c; + margin:5px; + padding:3px; + color:#000; + border: 1px solid #bc3c3c; +} +div#images { + position: relative; + + +} + + div#imageGrid { + + margin: 0 13px; + left: 0; + top: 0; + position: relative; + } + + #imageGrid div { + + position: absolute; + overflow: hidden; + } + .b0 { + width: 192px; + height: 192px; + } + .b1 { + width: 128px; + height: 128px; + } + .b2 { + width: 64x; + height: 64px; + } + + a.thumb { + display: block; + padding: 1px; + background-color: #242424; + } + + a.thumb:hover{ + + opacity:0.9; + filter:alpha(opacity=90); /* For IE8 and earlier */ + } + +.overlay { + z-index:800; + position:absolute; + top:0; + bottom:0; + left:0; + width:100%; + height:100%; + background-color:#96b2e4; + opacity:0.45; + -moz-opacity:0.45; + filter:alpha(opacity=45); +} + + +/* ----------------------------------------------- +single image view */ + +div#viewer { + position: relative; + +} + + div#imageContainer { + margin: 0 14px; + overflow:auto; /* this is important */ + } + + div#infoContainer{ + font-family:luci; + text-align:center; + display:block; + margin: 0 auto; + max-width: 50%; + padding:5px; + max-height: 500px; + min-height:20px; + border-bottom:1px solid #202020; + background-color:#242424; + color:#eee; + } + + img#image { + display:block; + margin: 0 auto; + + } + + img#image[src] { + cursor: pointer; + } + + img.scaled { + max-width: 70%; + max-height: 600px; + } + + img.full { + max-width: none; + max-height: none; + } + +div#imageInfo { + + width: 500px; + margin: 1em auto; + overflow: hidden; + /*border:1px solid #212121;*/ + padding: 1em; + position: relative; +} + +div.date { + color: #444; + position: absolute; + right: 1em; + top: 0.7em; + font-style: italic; +} + +div.teaser { + margin: 1em 0; +} + +.hidden { + display: none; +} +.visible { + display: block; +} + + +/* Comments +---------------------------------------------------------*/ +div.comments h3 { + font-size: 10pt; + color: #fff; +} + +form.addComment { + +} + +textarea { + font-family:luci; + color: #cbcbcb; + background-color: #171717; + border:1px solid #000; + font-size: 10pt; + margin:5px; +} + +textarea:focus { + border: 1px solid #3b5998; +} + +div.comment { + /* font-family:luci; */ + word-break:break-strict; + padding-top:5px; + padding-bottom:5px; + padding-left:5px; + border:1px solid #111; + background-color:#202020; + color:#898989; + margin-top:15px; + margin-right:5px; + font-size: 14px; +} + +div.commentHead { + margin-bottom: 2px; +} +img.avatarSmall { + height:32px; + width:32px; + +} + + + +/* image rating +---------------------------------------------------------*/ +div.rating { + display:none; + font-weight: bold; + margin-bottom: 0.5em; + position: relative; +} + + div.rating span { + display: block; + padding-top: 2px; + } + + div.ratingBase { + display:none; + position: relative; + float: left; + margin-right: 0.5em; + width: 102px; + height: 20px; + background-image: url( star-base.png ); + } + + div.ratingCurrent { + position: absolute; + top: 0; + left: 0; + height: 20px; + background-image: url( star-current.png ); + } + + div.ratingRate { + display:none; + position: absolute; + top: 0; + left: 0; + width: 102px; + height: 20px; + background-image: url( star-rate.png ); + background-repeat: no-repeat; + background-position: -100px 0; + } + + div.ratingRate a { + display: block; + height: 20px; + width: 20px; + float: left; + } + + div.ratingRate a:hover { + background: transparent; + } + + div.load { + background-image: url( loading.gif ); + background-repeat: no-repeat; + float: left; + margin-top: 3px; + width: 14px; + height: 14px; + display: none; + } + div.load:hover{ + background-color:#96b2e4; + } + + +/* UserInfo +---------------------------------------------------------*/ + +div.userInfo { + margin: 1em 0; + color: #cbcbcb; + position: relative; +} +div.info{ + font-size:100%; + color:#4b4b4b; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; +} + +img.avatar { + float: left; + margin-right: 1em; + position: relative; +} + +div.name { + + font-family:luci; + color: #cbcbcb; +} + +a.textPrev, div.textNoPrev { + display: block; + float: left; +} + +a.textNext, div.textNoNext { + display: block; + float: right; +} + + +/* Forms +---------------------------------------------------------*/ + +div.warn { + background-image:url('/media/warn.png'); + background-repeat:no-repeat; + min-height:95px; + background-color: #de5c5c; + padding-left:105px; + padding-top:15px; + + + border: 1px solid #bc3c3c; + color: #171717; + margin: 2em; +} + +div.success { + background-color: #69d96b; + padding: 0.1em 0.4em; + border: 1px solid #3cbc3f; + color: #171717; + margin: 2em; +} + +input { + background-color: #171717; + color: #cbcbcb; + border:1px solid #000; + width: 12em; + margin:5px; +} + +input.button { + color: #cbcbcb; + background-color: #171717; + border-left: 1px solid #000; + border-top: 1px solid #000; + width: auto; + margin:5px; +} + +input.check { + width: auto; + margin:5px; +} + +input.login, input.register { + margin-top: 1em; + padding: 0 1em; + color: #cbcbcb; +} + +input:focus, input.button:focus { + border: 1px solid #3b5998; + +} + +dl.form dd { + font-family:luci; + color:#cbcbcb; + margin: 0.4em 0; + text-align:left; + font-size:80%; +} +dl.form dd input{ + color:#FFF; +} + + +dl.form dt { + font-family:luci; + margin-left: 0.5em; + padding: 0.4em 0 0 1em; + width: 8em; + height: 1em; + text-align: left; + display: block; + float: left; + + color: #cbcbcb; +} + +fieldset { + width: 48em; + margin-top: 0.5em; + border: 1px solid #171717; +} + + legend { + color: #cbcbcb; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; + } + + legend p{ + color:#cbcbcb; + } + + +pre { + font-family: Bitstream Vera Sans Mono, Courier New, Lucida Console, monospace; + font-size: 9pt; + border-top: 1px solid #444; + border-bottom: 1px solid #333; + padding: 0.4em; + color: #fff; +} + + + + +/* colorpicker +---------------------------------------------------------*/ + +div#colorpicker { + position: absolute; + top: 16px; + left: 0; + width: 80px; + height: 76px; + background-color: #333; + border: 1px solid #777; + z-index: 10; +} +div#colorpickerSV { + background-color: #f00; + position: absolute; + bottom: 0; + left: 0; + width: 64px; + height: 64px; + background-image: url(colorpicker-sv.png); +} + +div#colorpickerH { + position: absolute; + bottom: 0; + right: 0; + width: 14px; + height: 64px; + background-image: url(colorpicker-h.png); + background-repeat: no-repeat; +} + +div#colorpickerSVSelect { + position: absolute; + top: -4px; + left: -4px; + width: 9px; + height: 9px; + background-image: url(colorpicker-select-sv.png); +} + +div#colorpickerHSelect { + position: absolute; + top: -2px; + right: 1px; + width: 3px; + height: 5px; + background-image: url(colorpicker-select-h.png); +} + +div#colorpickerCurrent { + background-color: #fff; + position: absolute; + top: 2px; + left: 1px; + width: 8px; + height: 8px; +} +div#colorpickerValue { + font-size: 9px; + font-family: arial; + color: #fff; + position: absolute; + top: 0; + left: 12px; + height: 8px; +} + +.alert{ + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background: #333 url(/media/exclamation.png) center no-repeat; + background-position: 15px 50%; + text-align: left; + padding: 5px 20px 5px 45px; + margin: 5px; + font-weight: bold; +} + +.duckytable table{ + border-collapse: collapse; + text-align:left; +} +.duckytable caption{ + text-transform: uppercase; + font-size: 2em; + color: #fff; + text-align: left; + font-weight: bolder; + border-bottom: 6px solid #000; +} + +.duckytable thead tr th{ + color: #0099ff; + text-transform: uppercase; + text-align: center; + padding: 0.4em 0; + border-bottom: 3px solid #000; +} + +.duckytable tfoot th, tfoot td{ + border-top: 3px solid #000; +} +.duckytable tr td, tr th{ + border-bottom: 1px solid #000; + padding: 0.6em 0.4em; + line-height: 1.5em; +} + +.spender td{ + background: #008000; + width: 40%; +} + +.kosten td{ + background: #b22222; + width: 40%; +} + +#footer-back-to-top { + z-index: 999; + text-decoration: none; + position: fixed; + bottom: 4px; + right: 212px; + overflow: hidden; + width: 30px; + height: 31px; + border: none; + text-indent: 100%; + background: url(/media/ui.totop.png) no-repeat left top; + filter:alpha(opacity=70); /* IE */ + -moz-opacity: 0.70; /* Mozilla */ + opacity: 0.70; /* Opera */ +} + +.Spoiler{ + color: #171717; + background-color: #171717; +} + +.Spoiler:hover{ + color: #fff; +} + +.quote { + color: #5A5A5A; +} + +.imgbbcode { + float:left; + margin-top:5px; + margin-right:10px; + max-height:150px; + max-width:200px; +} + +#userstats{ + background-color: #333; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + float: left; + width: 7em; + height: 64px; + text-align: center; + margin: 0 0 8px 8px; + font-size: 18px; +} + +#imgscore{ + background-color: #333; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + float: left; + width: 6em; + height: 49px; + text-align: center; + margin: 0 0 8px 8px; + font-size: 18px; +} + +#imgscore div { + font-weight: bold; + color: white; + font-size: 170%; +} + +#userstats div { + font-weight: bold; + color: white; + font-size: 200%; +} + +.meter { + height: 20px; /* Can be anything */ + position: relative; + background: #555; + text-align: center; + -moz-border-radius: 25px; + -webkit-border-radius: 25px; + border-radius: 5px; + padding: 5px; + -webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); + -moz-box-shadow : inset 0 -1px 1px rgba(255,255,255,0.3); + box-shadow : inset 0 -1px 1px rgba(255,255,255,0.3); +} + +.meter > span { + display: block; + height: 100%; + color: #fff; + -webkit-border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 3px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + -webkit-border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -moz-border-radius-topleft: 3px; + -moz-border-radius-bottomleft: 3px; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + background-color: #008000; + position: relative; + overflow: hidden; +} + +.score { + position: relative; + -webkit-box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3); + -moz-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); + box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.3); + overflow: hidden; +} + +.score > span { + display: block; + height: 13px; + background-color: green; +} + +#basic-modal-content {display:none;} + +/* Overlay */ +#simplemodal-overlay {background-color:#000; cursor:wait;} + +/* Container */ +#simplemodal-container input, #simplemodal-container button, #simplemodal-container label { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 15px; + font-weight: 300; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +#simplemodal-container input[type=text], #simplemodal-container input[type=password] { + padding: 0 10px; + width: 300px; + height: 40px; + color: #bbb; + text-shadow: 1px 1px 1px black; + background: rgba(0, 0, 0, 0.16); + border: 0; + border-radius: 5px; + -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.06); + box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.06); +} +#simplemodal-container input[type=text]:focus, #simplemodal-container input[type=password]:focus { + color: white; + background: rgba(0, 0, 0, 0.1); + outline: 0; +} +#simplemodal-container {height:300px; width:400px; color:#bbb; background-color:#242424; border:4px solid #444; padding:12px;} +#simplemodal-container .simplemodal-data {padding:8px;} +#simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; font-size:12px; margin-bottom:12px; padding:4px 6px 6px;} +#simplemodal-container a {color:#ddd;} +#simplemodal-container a.modalCloseImg {background:url(/media/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;} +#simplemodal-container h3 {color:#fff;} \ No newline at end of file diff --git a/media/styles_black.css b/media/styles_black.css new file mode 100644 index 0000000..7bb31fb --- /dev/null +++ b/media/styles_black.css @@ -0,0 +1,822 @@ + +/* ----------------------------------------------- +layout & typo */ + +@font-face { + font-family: luci; + src:url('luci.ttf'); +} + +body { + background-color: #e7ebf2; + color: #3b5998; + font-family: Arial, Verdana, Trebuchet MS; + font-size: 10pt; + margin: 0; + padding: 0 0 1em 0; +} +div#system{border:2px dashed #FF0000;color:#FFFFFF;text-align:center;margin:8px;padding:8px;} + +div.inboxalert{ +position:absolute; +text-align:center; +font-family:luci; +font-size:70%; +top:3px; +right:6px; +padding:1px; +min-width:7px; +background-color:#f03d25; +color:#fff; +border-right:1px solid #00376a; +border-bottom:1px solid #00376a; + + + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; + + +} + +div.buttonlist{ + float:right; + height:16px; + margin:5px; + margin-top:20px; +} + +div.buttonlist:hover{ + background-color:#96b2e4; +} + + +div#menu { + height: 42px; + background-image:url(top_back.png); + background-repeat:repeat-x; + background-color: #FFF; + +} + +hr { + border: 0; + width: 100%; + height:1px; + background-color:#3b5998; +} +div.userMenu { + float: right; + font-size: 90%; + margin: 5px 30px 0 0; +} +.color { + background-color: #fff; + border: 1px solid #bdc7d8; + color: #000; + width: 12em; + +} +div.search { + position: relative; + float: left; + font-size: 70%; + margin: 30px 30px 0 30px; +} + +div.menuItems { + position: relative; + float: left; + font-size: 90%; + height:16px; + display: table-cell; + vertical-align: middle; + +} +div.menuItems2 { + position: relative; + float: right; + font-size: 90%; + height:30px; + margin-top:2px; + margin-right:2px; + padding:3px; +} +div.menuItems2 a { + color:#fff; +text-decoration:none; + padding-left:5px; + padding-right:5px; + font-family:luci; +} +div.menuItems2 a:hover { +color:#fff; +text-decoration:none; +} +div.menuItems2:hover { + background-color:#4b67a1; +} + + +div.lastcomments { + padding:5px; + position: relative; + float: left; + font-size: 80%; +} + +div.menuItems a { + font-family:luci; + float: left; + text-align:center; + height:16px; + color:#fff; +text-decoration:none; + padding:7px; + margin-top:7px; +} +div.menuItems a:hover { + +text-decoration:none; + color:#FFFFFF; + float: left; + text-align:center; + height:16px; + padding:7px; + margin-top:7px; + background-color:#4b67a1; + +} + + +div#rightpanel{ + position:fixed; + right:0px; + width:180px; + height:100%; + border-left:1px solid #999999; + border-bottom:1px solid #999999; + top:0px; +} +div#site{ + + margin-right:180px; +} + +#commentbar{ + font-family:Verdana, Geneva, sans-serif; + color:#333; + font-size:11px; + border:1px solid #d8dfea; + width:180px; + padding:6px; + min-height:30px; +} + +#commentbar:hover{ + background-color:#eceff5; +} +#commentbar a{ + color:#333; +} +#commentbar a:hover{ + text-decoration:none; + color:#333; +} + +div#commenttext{ + margin-left:35px; + max-width:140px; + min-height:30px; +} +div#commentimg{ + width:32px; + float:left; +} + + + +div.search input { + font-size: 100%; +} + +input.search { + background-image: url(search.png); + background-repeat: no-repeat; + background-position: 2px 2px; + color: #fff; + text-align: right; + width: auto; + padding-left: 14px; +} + +input.color { + background-image: url(color.png); + background-repeat: no-repeat; + width: 18px; +} + +img#logo { + float: left; + margin-left:50px; + margin-right:10px; + margin-top:7px; +} +img#logo:hover { + background-color:#4b67a1; +} + +img { + border: 0; +} + +div#content { + margin: 0.3em 1em; + +} + + +div#footer { + + font-family:Verdana, Geneva, sans-serif; + color: #444; + text-align: center; + margin: 0.3em 1em; +} + +span.love { + color: #7b0043; +} + +h1 { + color: #3b5998; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; +} + +h1.remotePost { + color: #3b5998; + font-size: 110%; + font-weight: bold; + text-transform: none; +} + +h2 { + margin-top: 3em; + color: #3b5998; + font-size: 110%; + font-weight: bold; +} + +a { + color: #3b5998; + text-decoration: none; +} + +a:hover { + color: #3b5998; + text-decoration:underline; +} + +div.article { + margin-left: 1em; + width: 40em; +} + +ul { + list-style-type: square; +} + +div.userbutton{ + + float:right; + font-family:luci; + + display: table-cell; + vertical-align: middle; + + height:30px; + + margin-top:6px; + +} +div.userbutton img { + float:right; +} +div.userbutton a { + font-family:luci; + text-align:center; + height:16px; + padding:7px; + margin-top:6px; +} +div.userbutton a:hover { + color:#FFFFFF; + margin-top:6px; + background-color:#4b67a1; +} + + + + +/* ----------------------------------------------- +prev next bars */ + +a.next, a.prev, div.noPrev, div.noNext { + text-indent: 16px; + color: #fff; + width: 12px; + overflow: hidden; + display: block; + text-align: center; + position: absolute; +} + +/* Hide from IE < 7 */ +a.next[class], a.prev[class], div.noPrev[class], div.noNext[class] { + height: 100%; +} + +a.prev { + + background-image: url(prev.png); + background-position: -12px 0; + left: 0; + top: 0; +} + a.prev:hover { + background-position: -24px 0; + } + + +a.next { + + background-image: url(next.png); + background-position: -12px 0; + right: 0; + top: 0; +} + + a.next:hover { + background-position: 0 0; + } + +div.noPrev { + background-image: url(prev.png); + background-position: 0 0; + left: 0; + top: 0; +} + +div.noNext { + background-image: url(next.png); + background-position: -24px 0; + right: 0; + top: 0; +} + + + + +/* ----------------------------------------------- +grid view */ + +.unread{ + float:left; + background-image:url(alert.gif); + width:10px; + height:10px; + +} + + +div#images { + position: relative; +} + + div#imageGrid { + margin: 0 13px; + left: 0; + top: 0; + position: relative; + } + + #imageGrid div { + position: absolute; + overflow: hidden; + } + .b0 { + width: 192px; + height: 192px; + } + .b1 { + width: 128px; + height: 128px; + } + .b2 { + width: 64x; + height: 64px; + } + + a.thumb { + display: block; + padding: 1px; + background-color: #e7ebf2; + } + a.thumb:hover{ + + opacity:0.9; + filter:alpha(opacity=90); /* For IE8 and earlier */ + } + + + + +/* ----------------------------------------------- +single image view */ + +div#viewer { + position: relative; + +} + + div#imageContainer { + margin: 0 14px; + overflow: auto; + } + + img#image { + display:block; + + margin: 1em auto; + } + + img#image[src] { + cursor: pointer; + } + + img.scaled { + max-width: 90%; + max-height: 500px; + } + + img.full { + max-width: none; + max-height: none; + } + +div#imageInfo { + width: 500px; + margin: 1em auto; + overflow: hidden; + border:1px solid #d2d9e7; + /*background-color: #1a1a1a;*/ + padding: 1em; + position: relative; +} + +div.date { + color: #444; + position: absolute; + right: 1em; + top: 0.7em; + font-style: italic; +} + +div.teaser { + margin: 1em 0; +} + +.hidden { + display: none; +} +.visible { + display: block; +} + + +/* Comments +---------------------------------------------------------*/ +div.comments h3 { + font-size: 10pt; + color: #fff; +} + +form.addComment { + +} + +textarea { + font-family:luci; + color: #000; + background-color: #fff; + border:1px solid #bdc7d8; + font-size: 10pt; + margin-bottom: 3px; + width: 100%; +} + +textarea:focus { + border: 1px solid #fff; +} + +div.comment { + margin-left:20px; + font-family:luci; + background-color: #e9ecf1; + padding-top:5px; + padding-bottom:5px; + padding-left:10px; + border-bottom:1px solid #dcdee3; + color:#333333; + +} + +div.commentHead { + margin-bottom: 2px; +} +img.avatarSmall { + height:32px; + width:32px; + +} + + + +/* image rating +---------------------------------------------------------*/ +div.rating { + display:none; + font-weight: bold; + margin-bottom: 0.5em; + position: relative; +} + + div.rating span { + display: block; + padding-top: 2px; + } + + div.ratingBase { + display:none; + position: relative; + float: left; + margin-right: 0.5em; + width: 102px; + height: 20px; + background-image: url( star-base.png ); + } + + div.ratingCurrent { + position: absolute; + top: 0; + left: 0; + height: 20px; + background-image: url( star-current.png ); + } + + div.ratingRate { + display:none; + position: absolute; + top: 0; + left: 0; + width: 102px; + height: 20px; + background-image: url( star-rate.png ); + background-repeat: no-repeat; + background-position: -100px 0; + } + + div.ratingRate a { + display: block; + height: 20px; + width: 20px; + float: left; + } + + div.ratingRate a:hover { + background: transparent; + } + + div.load { + background-image: url( loading.gif ); + background-repeat: no-repeat; + float: left; + margin-top: 3px; + width: 14px; + height: 14px; + display: none; + } + div.load:hover{ + background-color:#96b2e4; + } + + +/* UserInfo +---------------------------------------------------------*/ + +div.userInfo { + margin: 1em 0; + border: 1px solid #e7ebf2; + background-color: #e7ebf2; + color: #3b5998; + position: relative; +} +div.info{ + font-size:80%; + color:#808080; +} + +img.avatar { + float: left; + margin-right: 1em; + position: relative; +} + +div.name { + + font-family:luci; + color: #3b5998; +} + +a.textPrev, div.textNoPrev { + display: block; + float: left; +} + +a.textNext, div.textNoNext { + display: block; + float: right; +} + + +/* Forms +---------------------------------------------------------*/ + +div.warn { + + background-color: #f5c5c5; + padding: 0.1em 0.4em; + border: 1px solid #ff9696; + color: #3b5998; + margin: 2em; +} + +div.success { + background-color: #cddaf2; + padding: 0.1em 0.4em; + border: 1px solid #96b2e4; + color: #3b5998; + margin: 2em; +} + +input { + background-color: #fff; + color: #000; + border:1px solid #bdc7d8; + width: 12em; +} + +input.button { + background-color: #fff; + border-left: 1px solid #bdc7d8; + border-top: 1px solid #bdc7d8; + width: auto; +} + +input.check { + width: auto; +} + +input.login, input.register { + margin-top: 1em; + padding: 0 1em; + +} + +input:focus, input.button:focus { + border: 1px solid #3b5998; +} + +dl.form dd { + font-family:luci; + color:#3b5998; + margin: 0.4em 0; + text-align:left; + font-size:80%; +} + +dl.form dt { + font-family:luci; + margin-left: 0.5em; + padding: 0.4em 0 0 1em; + width: 8em; + height: 1em; + text-align: left; + display: block; + float: left; + + color: #3b5998; +} + +fieldset { + width: 48em; + margin-top: 0.5em; + border: 1px solid #d2d9e7; +} + + legend { + color: #3b5998; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; + } + + legend p{ + color:#3b5998; + } + + +pre { + font-family: Bitstream Vera Sans Mono, Courier New, Lucida Console, monospace; + font-size: 9pt; + border-top: 1px solid #444; + border-bottom: 1px solid #333; + padding: 0.4em; + color: #fff; +} + + + + +/* colorpicker +---------------------------------------------------------*/ + +div#colorpicker { + position: absolute; + top: 16px; + left: 0; + width: 80px; + height: 76px; + background-color: #333; + border: 1px solid #777; + z-index: 10; +} +div#colorpickerSV { + background-color: #f00; + position: absolute; + bottom: 0; + left: 0; + width: 64px; + height: 64px; + background-image: url(colorpicker-sv.png); +} + +div#colorpickerH { + position: absolute; + bottom: 0; + right: 0; + width: 14px; + height: 64px; + background-image: url(colorpicker-h.png); + background-repeat: no-repeat; +} + +div#colorpickerSVSelect { + position: absolute; + top: -4px; + left: -4px; + width: 9px; + height: 9px; + background-image: url(colorpicker-select-sv.png); +} + +div#colorpickerHSelect { + position: absolute; + top: -2px; + right: 1px; + width: 3px; + height: 5px; + background-image: url(colorpicker-select-h.png); +} + +div#colorpickerCurrent { + background-color: #fff; + position: absolute; + top: 2px; + left: 1px; + width: 8px; + height: 8px; +} +div#colorpickerValue { + font-size: 9px; + font-family: arial; + color: #fff; + position: absolute; + top: 0; + left: 12px; + height: 8px; +} + diff --git a/media/styles_fb.css b/media/styles_fb.css new file mode 100644 index 0000000..1ff0c25 --- /dev/null +++ b/media/styles_fb.css @@ -0,0 +1,1118 @@ + +/* ----------------------------------------------- +layout & typo */ + +@font-face { + font-family: luci; + src:url('luci.ttf'); +} + +body { + background-color: #e7ebf2; + color: #3b5998; + font-family: Arial, Verdana, Trebuchet MS; + font-size: 10pt; + margin: 0; +} +div#system{border:2px dashed #FF0000;color:#FFFFFF;text-align:center;margin:8px;padding:8px;} + +div#UploadD{ + z-index:10001; + background-image:url(upload_pfeil.png); + background-repeat:no-repeat; + background-position:20px top; + padding-top:10px; + position:absolute; + top:40px; + left:160px; + max-width:400px; +} +div#UploadD a{ + color:#fff; +} +div#UploadD_d{ + padding:20px; + color:#fff; + background-color:#3b5998; + margin:0px; +} +div#MenuLoad{ + display:none; +} + +div.inboxalert{ + z-index:1001; +position:absolute; +text-align:center; +font-family:luci; +font-size:70%; +top:3px; +right:6px; +padding:1px; +min-width:7px; +background-color:#f03d25; +color:#fff; +border-right:1px solid #00376a; +border-bottom:1px solid #00376a; + + + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; + + +} + +div.buttonlist{ + float:right; + height:16px; + margin-right:5px; + margin-top:-5px; + +} + +div.buttonlist:hover{ + background-color:#96b2e4; +} + + +div#menu { + height: 42px; + background-image:url(top_back.png); + background-repeat:repeat-x; + position: fixed; + width: 100%; + left: 0; + top: 0; + z-index: 10000; +} + +div#MenuRightBlock { + float: right; + width: 180px; + height: 42px; +} + +div#smalltime{ + color:#808080;font-size:80%; font-weight:lighter +} + +hr { + border: 0; + width: 100%; + height:1px; + background-color:#d2d9e7; +} +div.userMenu { + float: right; + font-size: 90%; + margin: 5px 30px 0 0; +} + +.color { + background-color: #fff; + border: 1px solid #bdc7d8; + color: #000; + width: 12em; + +} +div.search { + position: relative; + float: left; + font-size: 70%; + margin: 30px 30px 0 30px; +} + +div.menuItems { + position: relative; + float: left; + font-size: 90%; + margin-top: 15px; +} + +div.menuItems a { + color:#fff; + text-decoration:none; + padding-left:8px; + padding-right:8px; + height: 100%; + padding-top: 15px; + padding-bottom: 8px; + text-transform: uppercase; + font-weight: bolder; +} +div.menuItems a:hover { + background-color:#4b67a1; +} + +div.menuItems2 { + position: relative; + float: right; + font-size: 90%; + height:30px; + margin-top:2px; + margin-right:2px; + padding:3px; +} +div.menuItems2 a { + color:#fff; +text-decoration:none; + padding-left:5px; + padding-right:5px; + font-family:luci; +} +div.menuItems2 a:hover { +color:#fff; +text-decoration:none; +} +div.menuItems2:hover { + background-color:#4b67a1; +} + + +div.lastcomments { + padding:5px; + position: relative; + float: left; + font-size: 80%; +} + +.table{ + border:1px solid #bdc5d5; +} +.tabletop{ + background-color:#bdc5d5; + border-bottom:1px solid #3b5998; +} +.tabletoptd{ + padding:3px; +} +.tablelist{ + background-color:#d2d9e7; +} +.tabletd { + padding:3px; + border-right:1px solid #bdc5d5; +} + +div#top{ + position:fixed; + right:0px; + width:181px; + height:32px; + top:0px; + background-color:#131313; + background-image: url(top_back.png); + background-repeat: repeat-x; + text-align: center; + padding-top: 6px; + z-index: 10001; +} + +div#rightpanel{ + position:fixed; + right:0px; + width:180px; + border-left:1px solid #999999; + border-bottom:1px solid #999999; + top:38px; +} + +div#bottom{ + position:fixed; + width:180px; + right:0px; + height:auto; + bottom: 0px; + background-color:#E7EBF2; + border-left:1px solid #999999; + border-top:1px solid #999999; + text-align: center; + padding-top: 6px; +} + +div#Last5Div{ + width:230px;background-color:#e7ebf2;border:1px solid #d8dfea; z-index:10002;position:absolute;visibility:hidden; right:181px; top:38px; padding-right:1px; +} +div#Last5Div table{ + padding-left:3px; + border-bottom:1px solid #d8dfea; +} +div#Last5Div a:hover{ + text-decoration:none; +} +div#Last5Div table:hover{ + background-color:#eceff5; +} + +div#hof{ + border:1px solid #3b5998; +} +div#site{ + margin-right:180px; +} + +#commentbar{ + font-family:Verdana, Geneva, sans-serif; + color:#333; + font-size:11px; + border:1px solid #d8dfea; + padding:6px; + min-height:30px; +} + +#commentbar:hover{ + background-color:#eceff5; +} +#commentbar a{ + color:#333; +} +#commentbar a:hover{ + text-decoration:none; + color:#333; +} + +div#commenttext{ + margin-right:3px; + margin-left:35px; + max-width:140px; + min-height:30px; +} +div#commentimg{ + width:32px; + float:left; +} + + + +div.search input { + font-size: 100%; +} + +input.search { + background-image: url(search.png); + background-repeat: no-repeat; + background-position: 2px 2px; + color: #fff; + text-align: right; + width: auto; + padding-left: 14px; +} + +input.color { + background-image: url(color.png); + background-repeat: no-repeat; + width: 18px; +} + +#logo { + float: left; + margin-left: 15px; + margin-right: 10px; + margin-top: 4px; + background: url(logo-fb.png) no-repeat; + width: 140px; + height: 30px; +} +#logo:hover { + background: url(logo-fb-hov.png) no-repeat; +} + +img { + border: 0; +} + +div#content { + margin: 3.5em 0.3em 1em; +} + +div#footer { + margin-right: 180px; + color: #fff; + margin-top: 1em; + background: #3B5B93; + padding: 13px; + font-size: 90%; + font-weight: bolder; +} + +div#footer a { + color: #fff; +} + +span.love { + color: #7b0043; +} + +h1 { + color: #3b5998; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; +} + +h1.remotePost { + color: #3b5998; + font-size: 110%; + font-weight: bold; + text-transform: none; +} + +h2 { + margin-top: 3em; + color: #3b5998; + font-size: 110%; + font-weight: bold; +} + +a { + color: #3b5998; + text-decoration: none; +} + +a:hover { + color: #3b5998; + text-decoration:underline; +} + +div.article { + margin-left: 1em; + width: 40em; +} + +ul { + list-style-type:circle; +} + +div.userbutton{ + + float:right; + font-family:luci; + + display: table-cell; + vertical-align: middle; + + height:30px; + + margin-top:6px; + +} +div.userbutton img { + float:right; +} +div.userbutton a { + font-family:luci; + text-align:center; + height:16px; + padding:7px; + margin-top:6px; +} +div.userbutton a:hover { + color:#FFFFFF; + margin-top:6px; + background-color:#4b67a1; +} + + + + +/* ----------------------------------------------- +prev next bars */ + +a.next, a.prev, div.noPrev, div.noNext { + text-indent: 16px; + color: #fff; + width: 12px; + overflow: hidden; + display: block; + text-align: center; + position: absolute; +} + +/* Hide from IE < 7 */ +a.next[class], a.prev[class], div.noPrev[class], div.noNext[class] { + height: 100%; +} + +a.prev { + + background-image: url(prev.png); + background-position: -12px 0; + left: 0; + top: 0; +} + a.prev:hover { + background-position: -24px 0; + } + + +a.next { + + background-image: url(next.png); + background-position: -12px 0; + right: 0; + top: 0; +} + + a.next:hover { + background-position: 0 0; + } + +div.noPrev { + background-image: url(prev.png); + background-position: 0 0; + left: 0; + top: 0; +} + +div.noNext { + background-image: url(next.png); + background-position: -24px 0; + right: 0; + top: 0; +} + + + + +/* ----------------------------------------------- +grid view */ + +.unread{ + float:left; + background-image:url(alert.gif); + width:10px; + height:10px; + +} +.noscr { + text-align:center; + background-color: #de5c5c; + margin:5px; + padding:3px; + color:#000; + border: 1px solid #bc3c3c; +} + +div#images { + + position: relative; + +} + + div#imageGrid { + margin: 0 13px; + left: 0; + top: 0; + position: relative; + } + + #imageGrid div { + + position: absolute; + overflow: hidden; + } + .b0 { + width: 192px; + height: 192px; + } + .b1 { + width: 128px; + height: 128px; + } + .b2 { + width: 64x; + height: 64px; + } + + a.thumb { + display: block; + padding: 1px; + background-color: #e7ebf2; + } + + a.thumb:hover{ + + opacity:0.9; + filter:alpha(opacity=90); /* For IE8 and earlier */ + } + +.overlay { +z-index:1000; +position:absolute; +top:0; +bottom:0; +left:0; +width:100%; +height:100%; +background-color:#96b2e4; +opacity:0.45; +-moz-opacity:0.45; +filter:alpha(opacity=45); +} + + +/* ----------------------------------------------- +single image view */ + +div#viewer { + position: relative; + +} + + div#imageContainer { + margin: 0 14px; + overflow: auto; + } + div#infoContainer{ + font-family:luci; + text-align:center; + display:block; + margin: 0 auto; + max-width: 50%; + padding:5px; + max-height: 500px; + border-bottom:1px solid #d2d9e7; + color:#eee; + } + + + img#image { + display:block; + margin: 0 auto; + } + + + img#image[src] { + cursor: pointer; + } + + img.scaled { + max-width: 70%; + max-height: 600px; + } + + img.full { + max-width: none; + max-height: none; + } + +div#imageInfo { + width: 500px; + margin: 1em auto; + overflow: hidden; + /*border:1px solid #d2d9e7;*/ + /*background-color: #1a1a1a;*/ + padding: 1em; + position: relative; +} + +div.date { + color: #444; + position: absolute; + right: 1em; + top: 0.7em; + font-style: italic; +} + +div.teaser { + margin: 1em 0; +} + +.hidden { + display: none; +} +.visible { + display: block; +} + + +/* Comments +---------------------------------------------------------*/ +div.comments h3 { + font-size: 10pt; + color: #fff; +} + +form.addComment { + +} + +textarea { + font-family:luci; + color: #000; + background-color: #fff; + border:1px solid #bdc7d8; + font-size: 10pt; + margin:5px; +} + +textarea:focus { + border: 1px solid #3b5998; +} + +div.comment { + background-color: #e0e4ee; + padding-top:5px; + padding-bottom:5px; + padding-left:5px; + border:1px solid #d2d9e7; + color:#333333; + margin-top:15px; + margin-right:5px; +} + +div.commentHead { + margin-bottom: 2px; +} +img.avatarSmall { + height:32px; + width:32px; + +} + + + +/* image rating +---------------------------------------------------------*/ +div.rating { + display:none; + font-weight: bold; + margin-bottom: 0.5em; + position: relative; +} + + div.rating span { + display: block; + padding-top: 2px; + } + + div.ratingBase { + display:none; + position: relative; + float: left; + margin-right: 0.5em; + width: 102px; + height: 20px; + background-image: url( star-base.png ); + } + + div.ratingCurrent { + position: absolute; + top: 0; + left: 0; + height: 20px; + background-image: url( star-current.png ); + } + + div.ratingRate { + display:none; + position: absolute; + top: 0; + left: 0; + width: 102px; + height: 20px; + background-image: url( star-rate.png ); + background-repeat: no-repeat; + background-position: -100px 0; + } + + div.ratingRate a { + display: block; + height: 20px; + width: 20px; + float: left; + } + + div.ratingRate a:hover { + background: transparent; + } + + div.load { + background-image: url( loading.gif ); + background-repeat: no-repeat; + float: left; + margin-top: 3px; + width: 14px; + height: 14px; + display: none; + } + div.load:hover{ + background-color:#96b2e4; + } + + +/* UserInfo +---------------------------------------------------------*/ + +div.userInfo { + margin: 1em 0; + border: 1px solid #e7ebf2; + background-color: #e7ebf2; + color: #3b5998; + position: relative; +} +div.info{ + font-size:100%; + color:#808080; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; +} + +img.avatar { + float: left; + margin-right: 1em; + position: relative; +} + +div.name { + + font-family:luci; + color: #3b5998; +} + +a.textPrev, div.textNoPrev { + display: block; + float: left; +} + +a.textNext, div.textNoNext { + display: block; + float: right; +} + + +/* Forms +---------------------------------------------------------*/ + +div.warn { + background-image:url('/media/warn.png'); + background-repeat:no-repeat; + min-height:100px; + background-color: #cddaf2; + padding-left:105px; + padding-top:15px; + + + border: 1px solid #96b2e4; + color: #3b5998; + margin: 2em; +} + +div.success { + background-color: #cddaf2; + padding: 0.1em 0.4em; + border: 1px solid #96b2e4; + color: #3b5998; + margin: 2em; +} + +input { + background-color: #fff; + color: #000; + border:1px solid #bdc7d8; + width: 12em; + margin:5px; +} + +input.button { + background-color: #fff; + border-left: 1px solid #bdc7d8; + border-top: 1px solid #bdc7d8; + width: auto; + margin:5px; +} + +input.check { + width: auto; + margin:5px; +} + +input.login, input.register { + margin-top: 1em; + padding: 0 1em; + +} + +input:focus, input.button:focus { + border: 1px solid #3b5998; +} + +dl.form dd { + font-family:luci; + color:#3b5998; + margin: 0.4em 0; + text-align:left; + font-size:80%; +} + +dl.form dt { + font-family:luci; + margin-left: 0.5em; + padding: 0.4em 0 0 1em; + width: 8em; + height: 1em; + text-align: left; + display: block; + float: left; + + color: #3b5998; +} + +fieldset { + width: 48em; + margin-top: 0.5em; + border: 1px solid #d2d9e7; +} + + + + legend { + color: #3b5998; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; + } + + legend p{ + color:#3b5998; + } + + +pre { + font-family: Bitstream Vera Sans Mono, Courier New, Lucida Console, monospace; + font-size: 9pt; + border-top: 1px solid #444; + border-bottom: 1px solid #333; + padding: 0.4em; + color: #fff; +} + + + + +/* colorpicker +---------------------------------------------------------*/ + +div#colorpicker { + position: absolute; + top: 16px; + left: 0; + width: 80px; + height: 76px; + background-color: #333; + border: 1px solid #777; + z-index: 10; +} +div#colorpickerSV { + background-color: #f00; + position: absolute; + bottom: 0; + left: 0; + width: 64px; + height: 64px; + background-image: url(colorpicker-sv.png); +} + +div#colorpickerH { + position: absolute; + bottom: 0; + right: 0; + width: 14px; + height: 64px; + background-image: url(colorpicker-h.png); + background-repeat: no-repeat; +} + +div#colorpickerSVSelect { + position: absolute; + top: -4px; + left: -4px; + width: 9px; + height: 9px; + background-image: url(colorpicker-select-sv.png); +} + +div#colorpickerHSelect { + position: absolute; + top: -2px; + right: 1px; + width: 3px; + height: 5px; + background-image: url(colorpicker-select-h.png); +} + +div#colorpickerCurrent { + background-color: #fff; + position: absolute; + top: 2px; + left: 1px; + width: 8px; + height: 8px; +} +div#colorpickerValue { + font-size: 9px; + font-family: arial; + color: #fff; + position: absolute; + top: 0; + left: 12px; + height: 8px; +} + +.alert{ + background: #fff6bf url(/media/exclamation.png) center no-repeat; + background-position: 15px 50%; + text-align: left; + padding: 5px 20px 5px 45px; + border-top: 2px solid #ffd324; + border-bottom: 2px solid #ffd324; + color: #000; +} + +.duckytable table{ + border-collapse: collapse; + text-align:left; +} +.duckytable caption{ + text-transform: uppercase; + font-size: 2em; + color: #3A5B93; + text-align: left; + font-weight: bolder; + border-bottom: 6px solid #3A5B93; +} + +.duckytable thead tr th{ + color: #3A5B93; + text-transform: uppercase; + text-align: center; + padding: 0.4em 0; + border-bottom: 3px solid #3A5B93; +} + +.duckytable tfoot th, tfoot td{ + border-top: 3px solid #3A5B93; +} +.duckytable tr td, tr th{ + border-bottom: 1px solid #3A5B93; + padding: 0.6em 0.4em; + line-height: 1.5em; +} + +.spender td{ + background: #98Fb98; + width: 40%; +} + +.kosten td{ + background: #f08080; + width: 40%; +} + +#footer-back-to-top { + z-index: 9999; + text-decoration: none; + position: fixed; + bottom: 4px; + right: 212px; + overflow: hidden; + width: 30px; + height: 31px; + border: none; + text-indent: 100%; + background: url(/media/ui.totop.png) no-repeat left top; + filter:alpha(opacity=70); /* IE */ + -moz-opacity: 0.70; /* Mozilla */ + opacity: 0.70; /* Opera */ +} + +.Spoiler{ + color: #171717; + background-color: #171717; +} + +.Spoiler:hover{ + color: #fff; +} + +.quote { + color: #979797; +} + +.imgbbcode { + float:left; + margin-top:5px; + margin-right:10px; + max-height:150px; + max-width:200px; +} + +#userstats{ + background-color: #ADBACF; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + float: left; + width: 7em; + height: 64px; + text-align: center; + margin: 0 0 8px 8px; + font-size: 18px; + color: white; +} + +#userstats div { + font-weight: bold; + font-size: 200%; +} + +.meter { + height: 20px; /* Can be anything */ + position: relative; + background: #555; + text-align: center; + -moz-border-radius: 25px; + -webkit-border-radius: 25px; + border-radius: 5px; + padding: 5px; + -webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); + -moz-box-shadow : inset 0 -1px 1px rgba(255,255,255,0.3); + box-shadow : inset 0 -1px 1px rgba(255,255,255,0.3); +} + +.meter > span { + display: block; + height: 100%; + color: #fff; + -webkit-border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 3px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + -webkit-border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -moz-border-radius-topleft: 3px; + -moz-border-radius-bottomleft: 3px; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + background-color: #008000; + position: relative; + overflow: hidden; +} + +#basic-modal-content {display:none;} + +/* Overlay */ +#simplemodal-overlay {background-color:#000; cursor:wait;} + +/* Container */ +#simplemodal-container {height:360px; width:600px; color:#bbb; background-color:#242424; border:4px solid #444; padding:12px;} +#simplemodal-container .simplemodal-data {padding:8px;} +#simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; font-size:12px; margin-bottom:12px; padding:4px 6px 6px;} +#simplemodal-container a {color:#ddd;} +#simplemodal-container a.modalCloseImg {background:url(/media/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;} +#simplemodal-container h3 {color:#84b8d9;} \ No newline at end of file diff --git a/media/styles_white.css b/media/styles_white.css new file mode 100644 index 0000000..9995be2 --- /dev/null +++ b/media/styles_white.css @@ -0,0 +1,626 @@ + +/* ----------------------------------------------- +layout & typo */ + +body { + background-color: #fff; + color: #000; + font-family: Arial, Verdana, Trebuchet MS; + font-size: 10pt; + margin: 0; + padding: 0 0 1em 0; +} +div#system{border:2px dashed #FF0000;color:#FFFFFF;text-align:center;margin:8px;padding:8px;} +div#menu { + height: 67px; + background-color: #EAEAEA; + border-bottom: 1px solid #888; +} +hr { + border: 0; + width: 100%; + height:1px; + background-color:#888; +} +div.userMenu { + float: right; + font-size: 90%; + margin: 5px 30px 0 0; +} + +div.search { + position: relative; + float: left; + font-size: 70%; + margin: 30px 30px 0 30px; +} + +div.menuItems { + position: relative; + float: left; + font-size: 90%; +} +div.lastcomments { + padding:5px; + position: relative; + float: left; + font-size: 80%; +} + +div.menuItems a { + float: left; + display: block; + height: 37px; + padding: 30px 12px 0 12px; + border-left: 1px solid #E0E0E0; + background-color: #EAEAEA; +} + +div.menuItems a:hover { + background-color: #E0E0E0; + color: #000; + border-bottom:2px solid #ff0096; +} + +div.search input { + font-size: 100%; +} + +input.search { + background-image: url(search.png); + background-repeat: no-repeat; + background-position: 2px 2px; + color: #000; + text-align: right; + width: auto; + padding-left: 14px; +} + +input.color { + background-image: url(color.png); + background-repeat: no-repeat; + width: 18px; +} + +img#logo { + float: left; +} + +img { + border: 0; +} + +div#content { + margin: 0.3em 1em; +} + + +div#footer { + font-family:Verdana, Geneva, sans-serif; + color: #444; + text-align: center; + margin: 0.3em 1em; +} + +span.love { + color: #7b0043; +} + +h1 { + color: #888; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; +} + +h1.remotePost { + color:#FFFFFF; + font-size: 110%; + font-weight: bold; + text-transform: none; +} + +h2 { + margin-top: 3em; + color: #000; + font-size: 110%; + font-weight: bold; +} + +a { + color: #000; + text-decoration: none; +} + +a:hover { + color: #ff0096; + +} + +div.article { + margin-left: 1em; + width: 40em; +} + +ul { + list-style-type: square; +} + + +/* ----------------------------------------------- +prev next bars */ + +a.next, a.prev, div.noPrev, div.noNext { + text-indent: 16px; + color: #000; + width: 12px; + overflow: hidden; + display: block; + text-align: center; + position: absolute; +} + +/* Hide from IE < 7 */ +a.next[class], a.prev[class], div.noPrev[class], div.noNext[class] { + height: 100%; +} + +a.prev { + background-color: #4bbed5; + background-image: url(prev.png); + background-position: -12px 0; + left: 0; + top: 0; +} + a.prev:hover { + background-position: -24px 0; + } + + +a.next { + background-color: #4bbed5; + background-image: url(next.png); + background-position: -12px 0; + right: 0; + top: 0; +} + + a.next:hover { + background-position: 0 0; + } + +div.noPrev { + background-image: url(prev.png); + background-position: 0 0; + left: 0; + top: 0; +} + +div.noNext { + background-image: url(next.png); + background-position: -24px 0; + right: 0; + top: 0; +} + + + + +/* ----------------------------------------------- +grid view */ + +div#images { + position: relative; +} + + div#imageGrid { + margin: 0 13px; + left: 0; + top: 0; + position: relative; + } + + #imageGrid div { + position: absolute; + overflow: hidden; + } + .b0 { + width: 192px; + height: 192px; + } + .b1 { + width: 128px; + height: 128px; + } + .b2 { + width: 64x; + height: 64px; + } + + a.thumb { + display: block; + padding: 1px; + /*background-color: #fff;*/ + } + a.thumb:hover{ + background-color: #ff0096; + opacity:0.9; + filter:alpha(opacity=90); /* For IE8 and earlier */ + } + + + +/* ----------------------------------------------- +single image view */ + +div#viewer { + position: relative; +} + + div#imageContainer { + margin: 0 14px; + overflow: auto; + } + + img#image { + display:block; + border: 2px solid #333; + margin: 1em auto; + } + + img#image[src] { + cursor: pointer; + } + + img.scaled { + max-width: 90%; + max-height: 500px; + } + + img.full { + max-width: none; + max-height: none; + } + +div#imageInfo { + width: 500px; + margin: 1em auto; + overflow: hidden; + background-color: #FFF; + padding: 1em; + position: relative; +} + +div.date { + color: #A0A0A0; + position: absolute; + right: 1em; + top: 0.7em; + font-style: italic; +} + +div.teaser { + margin: 1em 0; +} + +.hidden { + display: none; +} +.visible { + display: block; +} + + +/* Comments +---------------------------------------------------------*/ +div.comments h3 { + font-size: 10pt; + color: #888; +} + +form.addComment { + margin-top: 10px; +} + +textarea { + font-family: Arial, Verdana, Trebuchet MS; + font-size: 10pt; + border: 1px solid #888; + background-color: #fff; + color: #000; + margin-bottom: 3px; + width: 100%; +} + +textarea:focus { + border: 1px solid #000; +} + +div.comment { + background-color: #fff; + padding: 2px 5px; + border: 1px solid #888; + + margin: 10px 0; +} + +div.commentHead { + color: #888; + + margin-bottom: 2px; +} +img.avatarSmall { + height:16px; + width:16px; + vertical-align:bottom; +} + + + +/* image rating +---------------------------------------------------------*/ +div.rating { + display:none; + font-weight: bold; + margin-bottom: 0.5em; + position: relative; +} + + div.rating span { + display: block; + padding-top: 2px; + } + + div.ratingBase { + display:none; + position: relative; + float: left; + margin-right: 0.5em; + width: 102px; + height: 20px; + background-image: url( star-base.png ); + } + + div.ratingCurrent { + position: absolute; + top: 0; + left: 0; + height: 20px; + background-image: url( star-current.png ); + } + + div.ratingRate { + display:none; + position: absolute; + top: 0; + left: 0; + width: 102px; + height: 20px; + background-image: url( star-rate.png ); + background-repeat: no-repeat; + background-position: -100px 0; + } + + div.ratingRate a { + display: block; + height: 20px; + width: 20px; + float: left; + } + + div.ratingRate a:hover { + background: transparent; + } + + div.load { + background-image: url( loading.gif ); + background-repeat: no-repeat; + float: left; + margin-top: 3px; + width: 14px; + height: 14px; + display: none; + } + + +/* UserInfo +---------------------------------------------------------*/ + +div.userInfo { + margin: 1em 0; + border: 1px solid #888; + background-color: #fff; + color: #000; + position: relative; +} + +img.avatar { + float: left; + margin-right: 1em; + position: relative; +} + +div.name { + margin-top: 0.1em; + font-size: 130%; +} + +a.textPrev, div.textNoPrev { + display: block; + float: left; +} + +a.textNext, div.textNoNext { + display: block; + float: right; +} + + +/* Forms +---------------------------------------------------------*/ + +div.warn { + background-color: #7a0d00; + padding: 0.1em 0.4em; + border: 1px solid #fd5c6a; + color: #fff; + margin: 2em; +} + +div.success { + background-color: #090; + padding: 0.1em 0.4em; + border: 1px solid #0C0; + color: #fff; + margin: 2em; +} + +input { + background-color: #fff; + border: 1px solid #888; + color: #000; + width: 12em; +} + + +input.button { + background-color: #fff; + border-left: 1px solid #888; + border-top: 1px solid #888; + width: auto; +} + +input.check { + width: auto; +} + +input.login, input.register { + margin-top: 1em; + padding: 0 1em; + +} + +input:focus, input.button:focus { + border: 1px solid #000; +} + +dl.form dd { + margin: 0.4em 0; + text-align:left; +} + +dl.form dt { + margin-left: 0.5em; + padding: 0.4em 0 0 1em; + width: 8em; + height: 1em; + text-align: left; + display: block; + float: left; + font-style: italic; + color: #000; +} + +fieldset { + width: 48em; + margin-top: 0.5em; + border: 1px solid #888; +} + + legend { + color: #000; + font-size: 90%; + font-weight: normal; + text-transform: uppercase; + } + + +pre { + font-family: Bitstream Vera Sans Mono, Courier New, Lucida Console, monospace; + font-size: 9pt; + border-top: 1px solid #888; + border-bottom: 1px solid #888; + padding: 0.4em; + color: #000; +} + + + + +/* colorpicker +---------------------------------------------------------*/ + +div#colorpicker { + position: absolute; + top: 16px; + left: 0; + width: 80px; + height: 76px; + background-color: #333; + border: 1px solid #777; + z-index: 10; +} +div#colorpickerSV { + background-color: #f00; + position: absolute; + bottom: 0; + left: 0; + width: 64px; + height: 64px; + background-image: url(colorpicker-sv.png); +} + +div#colorpickerH { + position: absolute; + bottom: 0; + right: 0; + width: 14px; + height: 64px; + background-image: url(colorpicker-h.png); + background-repeat: no-repeat; +} + +div#colorpickerSVSelect { + position: absolute; + top: -4px; + left: -4px; + width: 9px; + height: 9px; + background-image: url(colorpicker-select-sv.png); +} + +div#colorpickerHSelect { + position: absolute; + top: -2px; + right: 1px; + width: 3px; + height: 5px; + background-image: url(colorpicker-select-h.png); +} + +div#colorpickerCurrent { + background-color: #fff; + position: absolute; + top: 2px; + left: 1px; + width: 8px; + height: 8px; +} +div#colorpickerValue { + font-size: 9px; + font-family: arial; + color: #fff; + position: absolute; + top: 0; + left: 12px; + height: 8px; +} + +.color { + + background-color: #fff; + border: 1px solid #888; + color: #000; + width: 12em; + +} diff --git a/media/suche.png b/media/suche.png new file mode 100644 index 0000000..78a8d24 Binary files /dev/null and b/media/suche.png differ diff --git a/media/time.png b/media/time.png new file mode 100644 index 0000000..656b95c Binary files /dev/null and b/media/time.png differ diff --git a/media/top_back.png b/media/top_back.png new file mode 100644 index 0000000..b5ca1d2 Binary files /dev/null and b/media/top_back.png differ diff --git a/media/top_back_b.png b/media/top_back_b.png new file mode 100644 index 0000000..b6c20f4 Binary files /dev/null and b/media/top_back_b.png differ diff --git a/media/truhe.png b/media/truhe.png new file mode 100644 index 0000000..2d84fae Binary files /dev/null and b/media/truhe.png differ diff --git a/media/ui.totop.png b/media/ui.totop.png new file mode 100644 index 0000000..e063d71 Binary files /dev/null and b/media/ui.totop.png differ diff --git a/media/upload_pfeil.png b/media/upload_pfeil.png new file mode 100644 index 0000000..366c855 Binary files /dev/null and b/media/upload_pfeil.png differ diff --git a/media/upload_pfeil_b.png b/media/upload_pfeil_b.png new file mode 100644 index 0000000..22af0bd Binary files /dev/null and b/media/upload_pfeil_b.png differ diff --git a/media/w.png b/media/w.png new file mode 100644 index 0000000..b14c1af Binary files /dev/null and b/media/w.png differ diff --git a/media/w_b.png b/media/w_b.png new file mode 100644 index 0000000..bb01715 Binary files /dev/null and b/media/w_b.png differ diff --git a/media/warn.png b/media/warn.png new file mode 100644 index 0000000..c38b31f Binary files /dev/null and b/media/warn.png differ diff --git a/media/watermark.png b/media/watermark.png new file mode 100644 index 0000000..47d9730 Binary files /dev/null and b/media/watermark.png differ diff --git a/media/www.png b/media/www.png new file mode 100644 index 0000000..f0e7ab4 Binary files /dev/null and b/media/www.png differ diff --git a/media/www_fb.png b/media/www_fb.png new file mode 100644 index 0000000..345f516 Binary files /dev/null and b/media/www_fb.png differ diff --git a/media/x.png b/media/x.png new file mode 100644 index 0000000..c11f7af Binary files /dev/null and b/media/x.png differ diff --git a/media/xd.png b/media/xd.png new file mode 100644 index 0000000..d36b59b Binary files /dev/null and b/media/xd.png differ diff --git a/media/xfb.png b/media/xfb.png new file mode 100644 index 0000000..190a3cc Binary files /dev/null and b/media/xfb.png differ diff --git a/recaptchalib.php b/recaptchalib.php new file mode 100644 index 0000000..32c4f4d --- /dev/null +++ b/recaptchalib.php @@ -0,0 +1,277 @@ + $value ) + $req .= $key . '=' . urlencode( stripslashes($value) ) . '&'; + + // Cut the last '&' + $req=substr($req,0,strlen($req)-1); + return $req; +} + + + +/** + * Submits an HTTP POST to a reCAPTCHA server + * @param string $host + * @param string $path + * @param array $data + * @param int port + * @return array response + */ +function _recaptcha_http_post($host, $path, $data, $port = 80) { + + $req = _recaptcha_qsencode ($data); + + $http_request = "POST $path HTTP/1.0\r\n"; + $http_request .= "Host: $host\r\n"; + $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; + $http_request .= "Content-Length: " . strlen($req) . "\r\n"; + $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; + $http_request .= "\r\n"; + $http_request .= $req; + + $response = ''; + if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) { + die ('Could not open socket'); + } + + fwrite($fs, $http_request); + + while ( !feof($fs) ) + $response .= fgets($fs, 1160); // One TCP-IP packet + fclose($fs); + $response = explode("\r\n\r\n", $response, 2); + + return $response; +} + + + +/** + * Gets the challenge HTML (javascript and non-javascript version). + * This is called from the browser, and the resulting reCAPTCHA HTML widget + * is embedded within the HTML form it was called from. + * @param string $pubkey A public key for reCAPTCHA + * @param string $error The error given by reCAPTCHA (optional, default is null) + * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false) + + * @return string - The HTML to be embedded in the user's form. + */ +function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) +{ + if ($pubkey == null || $pubkey == '') { + die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); + } + + if ($use_ssl) { + $server = RECAPTCHA_API_SECURE_SERVER; + } else { + $server = RECAPTCHA_API_SERVER; + } + + $errorpart = ""; + if ($error) { + $errorpart = "&error=" . $error; + } + return ' + + '; +} + + + + +/** + * A ReCaptchaResponse is returned from recaptcha_check_answer() + */ +class ReCaptchaResponse { + var $is_valid; + var $error; +} + + +/** + * Calls an HTTP POST function to verify if the user's guess was correct + * @param string $privkey + * @param string $remoteip + * @param string $challenge + * @param string $response + * @param array $extra_params an array of extra variables to post to the server + * @return ReCaptchaResponse + */ +function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array()) +{ + if ($privkey == null || $privkey == '') { + die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); + } + + if ($remoteip == null || $remoteip == '') { + die ("For security reasons, you must pass the remote ip to reCAPTCHA"); + } + + + + //discard spam submissions + if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) { + $recaptcha_response = new ReCaptchaResponse(); + $recaptcha_response->is_valid = false; + $recaptcha_response->error = 'incorrect-captcha-sol'; + return $recaptcha_response; + } + + $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify", + array ( + 'privatekey' => $privkey, + 'remoteip' => $remoteip, + 'challenge' => $challenge, + 'response' => $response + ) + $extra_params + ); + + $answers = explode ("\n", $response [1]); + $recaptcha_response = new ReCaptchaResponse(); + + if (trim ($answers [0]) == 'true') { + $recaptcha_response->is_valid = true; + } + else { + $recaptcha_response->is_valid = false; + $recaptcha_response->error = $answers [1]; + } + return $recaptcha_response; + +} + +/** + * gets a URL where the user can sign up for reCAPTCHA. If your application + * has a configuration page where you enter a key, you should provide a link + * using this function. + * @param string $domain The domain where the page is hosted + * @param string $appname The name of your application + */ +function recaptcha_get_signup_url ($domain = null, $appname = null) { + return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname)); +} + +function _recaptcha_aes_pad($val) { + $block_size = 16; + $numpad = $block_size - (strlen ($val) % $block_size); + return str_pad($val, strlen ($val) + $numpad, chr($numpad)); +} + +/* Mailhide related code */ + +function _recaptcha_aes_encrypt($val,$ky) { + if (! function_exists ("mcrypt_encrypt")) { + die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed."); + } + $mode=MCRYPT_MODE_CBC; + $enc=MCRYPT_RIJNDAEL_128; + $val=_recaptcha_aes_pad($val); + return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); +} + + +function _recaptcha_mailhide_urlbase64 ($x) { + return strtr(base64_encode ($x), '+/', '-_'); +} + +/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */ +function recaptcha_mailhide_url($pubkey, $privkey, $email) { + if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) { + die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . + "you can do so at http://www.google.com/recaptcha/mailhide/apikey"); + } + + + $ky = pack('H*', $privkey); + $cryptmail = _recaptcha_aes_encrypt ($email, $ky); + + return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); +} + +/** + * gets the parts of the email to expose to the user. + * eg, given johndoe@example,com return ["john", "example.com"]. + * the email is then displayed as john...@example.com + */ +function _recaptcha_mailhide_email_parts ($email) { + $arr = preg_split("/@/", $email ); + + if (strlen ($arr[0]) <= 4) { + $arr[0] = substr ($arr[0], 0, 1); + } else if (strlen ($arr[0]) <= 6) { + $arr[0] = substr ($arr[0], 0, 3); + } else { + $arr[0] = substr ($arr[0], 0, 4); + } + return $arr; +} + +/** + * Gets html to display an email address given a public an private key. + * to get a key, go to: + * + * http://www.google.com/recaptcha/mailhide/apikey + */ +function recaptcha_mailhide_html($pubkey, $privkey, $email) { + $emailparts = _recaptcha_mailhide_email_parts ($email); + $url = recaptcha_mailhide_url ($pubkey, $privkey, $email); + + return htmlentities($emailparts[0]) . "...@" . htmlentities ($emailparts [1]); + +} + + +?> diff --git a/remotepost.php b/remotepost.php new file mode 100644 index 0000000..356f363 --- /dev/null +++ b/remotepost.php @@ -0,0 +1,34 @@ +login(); + +$status = 'ready'; + +if (is_numeric($user->isSpamming())){ + $status = 'failed'; + if( $user->isSpamming() > 0 ){ + $uploadErrors[] = 'Upload gesperrt bis: '.date("D M j G:i:s T Y",$user->isSpamming()); + } + +}elseif( $user->id && !$user->isSpamLocked() && !$user->isSpamer() && !$user->isSpamming() && !empty($_GET['url'])) { + $uploadErrors = array(); + require_once( 'lib/imageuploader.php' ); + if( + ImageUploader::copyFromUrl( $_GET['url'], '', $_SERVER['HTTP_REFERER'], $uploadErrors) + ) { + $status = 'posted'; + $user->logUpload(); + } else { + $status = 'failed'; + } +} + +include( Config::$templates.'remotepost.tpl.php' ); + +?> \ No newline at end of file diff --git a/runfav.php b/runfav.php new file mode 100644 index 0000000..178374a --- /dev/null +++ b/runfav.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/snowstorm-min.js b/snowstorm-min.js new file mode 100644 index 0000000..ba5ea66 --- /dev/null +++ b/snowstorm-min.js @@ -0,0 +1,26 @@ +/** @license + + DHTML Snowstorm! JavaScript-based Snow for web pages + -------------------------------------------------------- + Version 1.43.20111201 (Previous rev: 1.42.20111120) + Copyright (c) 2007, Scott Schiller. All rights reserved. + Code provided under the BSD License: + http://schillmania.com/projects/snowstorm/license.txt +*/ +var snowStorm=function(e,d){function g(a,d){isNaN(d)&&(d=0);return Math.random()*a+d}function o(){e.setTimeout(function(){a.start(true)},20);a.events.remove(i?d:e,"mousemove",o)}function r(){if(!a.excludeMobile||!s)a.freezeOnBlur?a.events.add(i?d:e,"mousemove",o):o();a.events.remove(e,"load",r)}this.autoStart=true;this.flakesMax=128;this.flakesMaxActive=64;this.animationInterval=33;this.excludeMobile=true;this.flakeBottom=null;this.followMouse=true;this.snowColor="#fff";this.snowCharacter="•"; +this.snowStick=true;this.targetElement=null;this.useMeltEffect=true;this.usePositionFixed=this.useTwinkleEffect=false;this.freezeOnBlur=true;this.flakeRightOffset=this.flakeLeftOffset=0;this.flakeHeight=this.flakeWidth=8;this.vMaxX=5;this.vMaxY=4;this.zIndex=0;var a=this,y=this,i=navigator.userAgent.match(/msie/i),z=navigator.userAgent.match(/msie 6/i),A=navigator.appVersion.match(/windows 98/i),s=navigator.userAgent.match(/mobile|opera m(ob|in)/i),B=i&&d.compatMode==="BackCompat",t=s||B||z,h=null, +k=null,j=null,m=null,u=null,v=null,p=1,n=false,q;a:{try{d.createElement("div").style.opacity="0.5"}catch(C){q=false;break a}q=true}var w=false,x=d.createDocumentFragment();this.timers=[];this.flakes=[];this.active=this.disabled=false;this.meltFrameCount=20;this.meltFrames=[];this.events=function(){function a(b){var b=f.call(b),c=b.length;l?(b[1]="on"+b[1],c>3&&b.pop()):c===3&&b.push(false);return b}function d(a,c){var e=a.shift(),f=[b[c]];if(l)e[f](a[0],a[1]);else e[f].apply(e,a)}var l=!e.addEventListener&& +e.attachEvent,f=Array.prototype.slice,b={add:l?"attachEvent":"addEventListener",remove:l?"detachEvent":"removeEventListener"};return{add:function(){d(a(arguments),"add")},remove:function(){d(a(arguments),"remove")}}}();this.randomizeWind=function(){var c;c=g(a.vMaxX,0.2);u=parseInt(g(2),10)===1?c*-1:c;v=g(a.vMaxY,0.2);if(this.flakes)for(c=0;c=0&&b.vX<0.2)b.vX=0.2;else if(b.vX<0&&b.vX>-0.2)b.vX=-0.2;if(b.vY>=0&&b.vY<0.2)b.vY=0.2};this.move=function(){var d=b.vX*p;b.x+=d;b.y+=b.vY*b.vAmp;if(b.x>=h||h-b.x0.998)b.melting=true,b.melt();if(a.useTwinkleEffect)if(b.twinkleFrame)b.twinkleFrame--,b.o.style.visibility=b.twinkleFrame&&b.twinkleFrame%2===0?"hidden":"visible";else if(Math.random()>0.9)b.twinkleFrame=parseInt(Math.random()*20,10)}};this.animate=function(){b.move()};this.setVelocities=function(){b.vX=u+g(a.vMaxX*0.12,0.1);b.vY=v+g(a.vMaxY*0.12,0.1)};this.setOpacity=function(a,b){if(!q)return false; +a.style.opacity=b};this.melt=function(){!a.useMeltEffect||!b.melting?b.recycle():b.meltFramea.flakesMaxActive)a.flakes[a.flakes.length-1].active=-1;y.targetElement.appendChild(x)};this.timerInit= +function(){a.timers=!A?[setInterval(a.snow,a.animationInterval)]:[setInterval(a.snow,a.animationInterval*3),setInterval(a.snow,a.animationInterval)]};this.init=function(){var c;for(c=0;c» Bookmarklet +
    +

    Remote Upload

    + + +

    + To use the remote upload just drag the following link somewhere to your bookmarks (or in Opera right click it + and choose Bookmark link): + » Post to « +

    + +

    + Now, if you're on a website where you see an image you want to post, just click on your newly created bookmark + and then on the image you want to post. Thats all. Really! +

    + +
    \ No newline at end of file diff --git a/templates/404.tpl.php b/templates/404.tpl.php new file mode 100644 index 0000000..d7dbd51 --- /dev/null +++ b/templates/404.tpl.php @@ -0,0 +1,11 @@ + + + +
    404Broken link - no image found!
    +Go back to the main...
    + + + + + + \ No newline at end of file diff --git a/templates/abuse.tpl.php b/templates/abuse.tpl.php new file mode 100644 index 0000000..1da6d27 --- /dev/null +++ b/templates/abuse.tpl.php @@ -0,0 +1,25 @@ + +
    + Abused failed.

    + » back'); } ?> +
    + +
    + Abused. Wait for response.

    + » back'); } ?> +
    + +
    + Wrong captcha.

    + » back'); } ?> +
    + \ No newline at end of file diff --git a/templates/abuseform.tpl.php b/templates/abuseform.tpl.php new file mode 100644 index 0000000..7041aef --- /dev/null +++ b/templates/abuseform.tpl.php @@ -0,0 +1,34 @@ + +
    + +
    + +
    + Abuse // Contact: abuse@4ducky.com +

    Report Abuse or Request Deletion (Copyrighted Material, Pornography, Harassment) If requesting the removal of copyrighted materials, you must be the owner or legally represent the owner of said materials. Report it here:

    +
    + +
    Imagelink:
    +
    + +
    +
    Reason:
    +
    + +
    + +
    Email:
    +
    + +
    + +
    + + "> +
    +
    + +
    + +
    + \ No newline at end of file diff --git a/templates/browse.tpl.php b/templates/browse.tpl.php new file mode 100644 index 0000000..3812d02 --- /dev/null +++ b/templates/browse.tpl.php @@ -0,0 +1,154 @@ +id){ + ?> +
    + Only registered users can see images! Register now. +
    + user['id'] ) { + /* Abfrage nach Kommentaren / Likes des Users */ + $idAbfrage = $ib->user['id']; + $comm = DB::getRow("SELECT COUNT(*) as count FROM pl_comments WHERE userid=:1 AND c_like = 0",$idAbfrage); + $favs = DB::getRow("SELECT COUNT(*) as count FROM pl_fav WHERE user=:1",$idAbfrage); + $users = DB::getRow("SELECT color as color,registered as reg FROM pl_users WHERE id=:1",$idAbfrage); + $days = floor((time() - strtotime(substr($users['reg'],0,10)))/86400); +?> + +
    + +
    + user['name']; ?> 1100) {echo "☪";} +elseif ($idAbfrage < 500) {echo "ϟϟ";} +elseif ($idAbfrage > 939) {echo "✡";} +else {echo "☭";} ?> user['website'])) { ?>- www - +
    + +
    <?php echo $ib->user['name']; ?>
    + +
    user['id']; ?>
    ID
    +
    Days past
    +
    user['images']; ?>
    Uploads
    +
    Comments
    +
    Favs
    + +
    + + + +
    + +

    + » Browsing + user) ) { ?> + User: user['name']; ?> + channel) ) { ?> + Channel: channel['name']; ?>, + searchColor) || !empty($ib->searchTerm) ) { ?> + Results for , + commentState)) { ?> + Comments , + FavState)) { ?> + favorites , + + All, + + + Page: pages['current']; ?> of pages['total']; ?> + commentState)) { ?> + | » reset unread + id); + if( $newcomments["c"] > 0 ) { ?> + + | » newest comments () | » Comments + +

    + +
    + pages['prev']) ) { ?> + + +
    Previous
    + + + pages['next']) ) { ?> + + +
    Next
    + + + + +
    +searchColor) || !empty($ib->searchTerm) || ($ib->commentState) || ($ib->FavState) ) { + $imgBasePath = 'all/'; + } else { + $imgBasePath = $ib->basePath; + } + foreach( $ib->thumbs as $thumb ) { + if( isset( $thumb['left'] ) ) { + + $blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id); + $commentalert = DB::getRow("SELECT COUNT(*) as count FROM pl_unread WHERE keyword=:1 AND userid=:2",$thumb['keyword'],$user->id); + $commentdiv = ""; + $commentcolor =""; + $commentalertdiv =""; + + if($commentalert["count"] > 0){ + $commentdiv ='
    '; + $commentcolor = 'style="background-color:#96b2e4;"' ; + $commentalertdiv = '
    !
    '; + }else{ + $commentdiv = ""; + $commentalertdiv =""; + $commentcolor = '' ; + } + + if (!empty($blockedrow)) { + + $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); + $lower = strtolower($thumb['userName']); + if (!in_array($lower,$blockeduser)){ + + echo '
    '.$commentalertdiv.''.$commentdiv.''.$thumb['keyword'].'
    '."\n"; + + } + + + }else{ + if (!$user->id){ + $bilder = scandir('images/rs', 1); + $random = rand(3,114); + $thumb['thumb'] = "http://www.4ducky.com/images/rs/" . $bilder[$random]; + + echo "
    " . $bilder[0] . "
    "; + } + echo '
    '.$commentalertdiv.''.$commentdiv.''.$thumb['keyword'].'
    '."\n"; + + } + } + } +?> +
    +
    + + + + + \ No newline at end of file diff --git a/templates/chat.tpl.php b/templates/chat.tpl.php new file mode 100644 index 0000000..d216fb8 --- /dev/null +++ b/templates/chat.tpl.php @@ -0,0 +1,4 @@ +
    +
    + +
    \ No newline at end of file diff --git a/templates/closed.php b/templates/closed.php new file mode 100644 index 0000000..a63a266 --- /dev/null +++ b/templates/closed.php @@ -0,0 +1,9 @@ +
    + Monglol wurde gebannt da er sich anscheinend nicht an Regeln halten will.
    + Ich gebe euch viele Freiheiten, aber das hier ist nicht edelchan, da könnt ihr eure Gorebildchen posten.
    + Oder geht auf entsprechende Seiten, dafür sind diese da wenn euch das erregt oderso.
    +
    + Ich habe keine Lust zu entsprechend harten Regeln zu greifen wie 4fuckr, aber wenn ihr nicht anders könnt, dann werde ich das tun. Zudem: Ich mach das hier zu Spaß und bin nicht wie Feivel auf die Einnahmen angewiesen. Ich werde die Seite also bei Bedarf einfach wieder vom Netz nehmen. Juckt mich wenig.
    +
    + Für heute ist hier erstmal zu. Solltet ihr euch einfach nicht an die 2 Regeln halten können, werden ich schärfere einführen oder die Seite anders nutzen. +
    diff --git a/templates/fame-old.tpl.php b/templates/fame-old.tpl.php new file mode 100644 index 0000000..de6d689 --- /dev/null +++ b/templates/fame-old.tpl.php @@ -0,0 +1,61 @@ + + + +
    + +
    + +
    + + + + +
    +
    " align="top" style="float:left;margin-right:5px;">
    + +
    + +
    + +
    + + + +
    +
    + ID: | + Images: + | + + Website + + +
    +
    +
    + + + + + +
    + " target="_blank">» watch thread. + +
    +
    + + +
    +
    + + + \ No newline at end of file diff --git a/templates/fame.tpl.php b/templates/fame.tpl.php new file mode 100644 index 0000000..2fa1555 --- /dev/null +++ b/templates/fame.tpl.php @@ -0,0 +1,24 @@ + + +
    + + + + + +
    + + \ No newline at end of file diff --git a/templates/footer.tpl.php b/templates/footer.tpl.php new file mode 100644 index 0000000..da22639 --- /dev/null +++ b/templates/footer.tpl.php @@ -0,0 +1,64 @@ +
    + + +id){ ?> + + + + + + +
    +image["id"])){?> + + + +id) { + echo ''; + + echo ''; + } + */ +?> + + + \ No newline at end of file diff --git a/templates/forum.tpl.php b/templates/forum.tpl.php new file mode 100644 index 0000000..5070778 --- /dev/null +++ b/templates/forum.tpl.php @@ -0,0 +1,5 @@ +
    + + + +
    \ No newline at end of file diff --git a/templates/header.tpl.php b/templates/header.tpl.php new file mode 100644 index 0000000..f472f10 --- /dev/null +++ b/templates/header.tpl.php @@ -0,0 +1,174 @@ +image['image']); + +function shorter($input, $length) +{ + //no need to trim, already shorter than trim length + if (strlen($input) <= $length) { + return $input; + } + + //find last space within length + $last_space = strrpos(substr($input, 0, $length), ' '); + if(!$last_space) $last_space = $length; + $trimmed_text = substr($input, 0, $last_space); + + //add ellipses (...) + $trimmed_text .= '...'; + + return $trimmed_text; +} + + +?> + + + +<?php if( !empty($ib->user) ) { echo $ib->user['name']." | ";} ?><?php if( !empty($pname) ) { echo $pname." | ".Config::$siteTitle; } else { echo Config::$siteTitle;} ?> + + +stylecolor == "white") { ?> + + + + + + + + + +
    + +
    +
    id){ $settings = DB::getRow("SELECT * FROM pl_settings"); echo $settings["message"]; ?> /media/xfb.png/media/xd.png" alt="close"/>Dolan: "Hate annoying advertisements? Register now for free to have them removed!" Like us on Facebook.com
    \ No newline at end of file diff --git a/templates/impressum.tpl.php b/templates/impressum.tpl.php new file mode 100644 index 0000000..422ec9d --- /dev/null +++ b/templates/impressum.tpl.php @@ -0,0 +1,47 @@ +
    +
    + About +Admin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Owner: +

     

    +
    Email:support@4ducky.com
      
    Rules 1.) No underaged people / no cp / no illustration with naked kids
     
     2.) No gore / dead people / dead animals
      
    Saw something like this?Please request deletion
      
    +
    + +
    \ No newline at end of file diff --git a/templates/inbox.tpl.php b/templates/inbox.tpl.php new file mode 100644 index 0000000..d3794cc --- /dev/null +++ b/templates/inbox.tpl.php @@ -0,0 +1,128 @@ + + + + +
    +
      +
    • User not found.
    • +
    +
    + + +
    +
      +
    • User blocked you.
    • +
    +
    + + + +

    + + + +id); + +if ( count($messages) == 0 ){ ?> + + + + + +id); + $blockeduser = array_map('strtolower', unserialize($blockedrow['users'])); + $lower = strtolower($userinformation["name"]); + if (!in_array($userinformation["name"],$blockeduser)){ + $unread = DB::getRow("SELECT COUNT(*) as c, read_m FROM pl_messages WHERE from_m=:1 AND read_m=0 AND to_m=:2",$s["sender"],$user->id); + + if ($unread["c"] > 0) { + + $unreadborder = ' border:1px solid #FFD600; '; + + }elseif ($unread["c"] == 0){ + + if ($user->stylecolor == "black") { + $unreadborder="border:1px solid #333;"; + }else{ + $unreadborder = ' border:1px solid #d2d9e7; '; + } + + } + + ?> + + + + + + + + + + +
    Messages:
    +
    + Your inbox is empty. +
    +
    + +
    + +
    + + + +
    +
    + ID: / + Images: + + / + Website: + + + + 1 ){ ?> + + / Subject: ]+)#i', + "$3$4", + nl2br( htmlspecialchars($s["title"]))); + + + + echo $s["title"]; ?> + + +
    + +
    + + +
    + +

    + + \ No newline at end of file diff --git a/templates/inboxuser.tpl.php b/templates/inboxuser.tpl.php new file mode 100644 index 0000000..dfb29e7 --- /dev/null +++ b/templates/inboxuser.tpl.php @@ -0,0 +1,110 @@ + + +

    + + + + + +stylecolor == "black") { + $border="border:1px dotted #333;"; + }else{ + $border = ' border:1px solid #d2d9e7; '; + } + + + + +$userinformation = DB::getRow('SELECT * FROM pl_users WHERE name="'.$r[1].'"'); + + +if (count($userinformation) == 0 ){ header( 'location: '.Config::$absolutePath); } + +$messages = DB::query("SELECT * FROM pl_messages WHERE (to_m=:1 AND from_m=:2) OR (to_m=:2 AND from_m=:1) ORDER BY created DESC",$userinformation["id"],$user->id); + + ?> + + + + + + +
    Conversation with:
    + +
    + +
    + + + +
    +
    + ID: / + Images: + + / + + Website + + +

    +
    +
    + + +
    +
    +
    + Message to : +
    +
    +
    + +
    +
    +
    + + $user->id, "created" => $s["created"]),array("read_m" => 1)); + $bordercolor = $border; + if ($s["read_m"] == 0 && $s["to_m"] == $user->id){ + $bordercolor = 'border:1px solid #FFD600'; + } + ?> + +
    +
    + + + at + +
    + + ]+)#i', + "$3$4", + nl2br( htmlspecialchars($s['message_m']))); + + ?> +
    + +
    + + ');} ?> + + + + +

    + \ No newline at end of file diff --git a/templates/invites.tpl.php b/templates/invites.tpl.php new file mode 100644 index 0000000..90c2d7b --- /dev/null +++ b/templates/invites.tpl.php @@ -0,0 +1,67 @@ + +
    +
    +
    + Invites + +
    +
    Info:
    +
    + -Invitemissbrauch führt zum Ban. (Keine Reaktivierung) / Darunter fällt auch einem gebannten User einen Invite zu geben. +
    +
    +
    -Nutzt die Invites weise. Baut euer Gast groben Unfug, seid ihr auch weg.
    +
    Howto:
    +
    Einfach den Link weiterschicken.
    +
    + + + + + + + id); + + if($invites){ + foreach(array_keys($invites) as $i){?> + + + + + + + + + + + +
    InviteCodeUsed
    + '.$invites[$i]["code"].''; + }else{ + echo $invites[$i]["code"]; + }?> + + +
    Zurzeit keine Invites für dich
    + +
    +
    +
    + + \ No newline at end of file diff --git a/templates/login.tpl.php b/templates/login.tpl.php new file mode 100644 index 0000000..7f2ee7f --- /dev/null +++ b/templates/login.tpl.php @@ -0,0 +1,46 @@ + +
    +
    +
    + Login + + +
    + Wrong user or password! +
    + + +
    + Account banned!
    2){ echo "Grund: ".$messages['bannedLogin'];} ?> +
    + + + +
    +
    Name:
    +
    + +
    + +
    Passwort:
    +
    + +
    + +
     
    +
    + + +
    + +
     
    +
    + +
    +
    + + Don't have an account yet? Register! +
    +
    +
    + \ No newline at end of file diff --git a/templates/manage.tpl.php b/templates/manage.tpl.php new file mode 100644 index 0000000..a87767f --- /dev/null +++ b/templates/manage.tpl.php @@ -0,0 +1,124 @@ +login(); +$user->loadEmail(); +if( !$user->admin ) { + echo "You need to be logged in as an admin user!"; + exit(); +} + +$Spammer = DB::query("SELECT * from pl_users WHERE spamblocked=1"); +$Abuses = DB::query("SELECT * FROM `pl_abuse`WHERE `read` =:1",0); + +$newComments = DB::query( + 'SELECT + c.id, c.content, u.name, u.avatar, + UNIX_TIMESTAMP(c.created) AS created, + i.keyword FROM '.TABLE_COMMENTS.' c + LEFT JOIN '.TABLE_USERS.' u + ON u.id = c.userId + LEFT JOIN '.TABLE_IMAGES.' i + ON i.id = c.imageId + ORDER BY c.created DESC LIMIT 100' +); +include( 'templates/header.tpl.php' ); +?> +
    + + + + + + + + +
    Spammer / Abuse:
    + 0){ + echo '

    Newest Spammer:

    '; +foreach( $Spammer as $u ) {?> + +
    + +
    + + + +
    +
    + ID: / + Images: + / + Website: + + + + 0 ){ echo "/ Bis:".date('Y-m-d H:i:s', $u["time"]); echo("
    Grund: ".$u["spam_reason"]);} if ($user->id == 11 || $user->id == 1 ){ ?> / ">Unblock + +
    +
    +
    + + +No Spammer atm'; }?>
    + + + 0){ + echo '

    Newest Abuses:

    '; +foreach( $Abuses as $a ) { + $Image = DB::getRow("SELECT *,UNIX_TIMESTAMP(logged) AS loggedTS FROM pl_images WHERE id=:1",$a["imageid"]); + + if ($Image != NULL && $a["imageid"] != 0){ + ?> + +
    + "/> + +
    + Reason: / + Email: + + User:'.$username["name"].''); + } + + echo('
    Delete Abuse'); ?> + +
    + +
    +
    + + +'); + echo(''.$a["imagelink"].'
    '); + echo('Reason: '.$a['reason'].' / + Email: '.$a['email'].''); + echo(''); + echo('
    '); + echo('Löschen'); + echo('
    '); + + } + +} + + + +}else{echo '

    No Abuses

    ';}?> +
    + + \ No newline at end of file diff --git a/templates/profile.tpl.php b/templates/profile.tpl.php new file mode 100644 index 0000000..f2d0326 --- /dev/null +++ b/templates/profile.tpl.php @@ -0,0 +1,195 @@ + +
    + +
    +
    + Change Profile + + +
    Your password must be at least 6 characters long!
    + + + +
    Your both passwords are not equal!
    + + + +
    Your avatar Image could not be processed!
    + + + +
    Not a valid colorcode!
    + + + + + +
    +
    Passwort:
    +
    + (leave empty, if you don't want to change it) +
    + +
    (Repeat)
    +
    + +
    + + + + email) ) { ?> +
    E-Mail:
    +
    + +
    + + +
    Website:
    +
    + +
    + +
    Avatar:
    +
    +
    +
    +
    Color:
    +
    + (default:: 000000) +
    +
    + +
    Style:
    +
    + +
    + +
     
    +
    + +
    + + +
    +
    +
    + + + +
    +
    + Block user + + +
    User blocked!
    + + +
    Could not block user!
    + + +
    User already blocked!
    + + +
    User not found!
    + + +
    User unblocked!
    + + +
    Could not unblock user!
    + + +
    WHAT?
    + + +
    User not blocked!
    + + + +
    + id); + + if (!empty($blockedrow['users'])){ + $des = unserialize($blockedrow['users']); + + foreach ( $des as $username){ + $userinfo = DB::query('SELECT id,name,images,avatar FROM pl_users WHERE name="'.$username.'"'); + ?> +
    + +
    + + + +
    +
    + + Images: + +
    +
    +
    + + +
    No users blocked!
    + + + + +
    User:
    +
    + +
    +
     
    +
    + +
    + +
    User:
    +
    + '); + echo(''); + foreach ( $des as $username){ + echo(''); + } + echo(''); + }else{ echo("No user blocked!");} + + ?> +
    +
     
    +
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/quicktags.tpl.php b/templates/quicktags.tpl.php new file mode 100644 index 0000000..2b116dd --- /dev/null +++ b/templates/quicktags.tpl.php @@ -0,0 +1,77 @@ + + + +

    + » Quicktagger +

    + +
    +

    Quick tagging?

    +

    + This special site automatically searches for images which are in desperate need of getting tagged. + That is: new images without any or very few tags. +

    + +

    + This site is carefully designed to allow efficient tagging of images. You don't have to move your hands + away from the keyboard - just write and press enter for the next image. Make sure javascript is + enabled in your browser, or you wont see anything. +

    + + +

    A few words about tagging

    + +

    + If you are unsure what tags to write, just imagine you are searching for this image - what word(s) would you + search for? +

    + +

    + Also, is there any written text on the image itself? Try to write only the most essential words down. For instance + if you see a motivational with the text: +

    +
    + Huddle House
    + For those times when Waffle House isn't quite white trashy enough +
    +

    + good tags for this image would be "motivational huddle house white trash" +

    +

    + If you don't know what to write, just press enter to skip the image. +

    + +

    + Don't abuse the system in any way, or the wrath of the administrator will come done on you! +

    + + +

    » I get it, let's start already!

    +
    + + + + \ No newline at end of file diff --git a/templates/random.js.php b/templates/random.js.php new file mode 100644 index 0000000..468c500 --- /dev/null +++ b/templates/random.js.php @@ -0,0 +1,6 @@ + +thumbs as $t ) { ?> + document.write(''); + \ No newline at end of file diff --git a/templates/register.tpl.php b/templates/register.tpl.php new file mode 100644 index 0000000..1300948 --- /dev/null +++ b/templates/register.tpl.php @@ -0,0 +1,82 @@ + +
    +
    +
    + Create Account + + +
    Not a valid invitecode!
    Code:
    + + +
    This Username is already registered!
    + + + +
    Your name must be at least 2 characters long an may not have any special characters!
    + + + +
    Your password must be at least 6 characters long!
    + + + +
    Your both passwords are not equal!
    + + + +
    There is already a registered user with this E-Mail address!
    + + + +
    Your E-Mail address seems to be invalid!
    + + +
    Register Closed!
    + + +
    Incorrect Captcha!
    + + + +
    +
    Username:
    +
    + + Only letters and numbers; at least 2 characters long; no spaces +
    + +
    E-Mail:
    +
    + + Must be valid! +
    + +
    Password:
    +
    + +
    + +
    (Repeat)
    +
    + +
    + +
    Captcha:
    +
    + + +
    + +
     
    +
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/register_closed.tpl.php b/templates/register_closed.tpl.php new file mode 100644 index 0000000..0a5cef2 --- /dev/null +++ b/templates/register_closed.tpl.php @@ -0,0 +1,48 @@ + +
    + +
    Not a valid invitecode!
    Code:
    + + +
    This Username is allready registered!
    + + + +
    Your name must be at least 2 characters long an may not have any special characters!
    + + + +
    Your password must be at least 6 characters long!
    + + + +
    Your both passwords are not equal!
    + + + +
    There is already a registered user with this E-Mail address!
    + + + +
    Your E-Mail address seems to be invalid!
    + + +
    Register Closed!
    + + +
    Incorrect Captcha!
    + + +
    + Register + +
    +
    Registration is closed at the moment. Like us on Facebook to stay up2date:
    +

    +
    +
    + + +
    +
    + \ No newline at end of file diff --git a/templates/register_invite.tpl.php b/templates/register_invite.tpl.php new file mode 100644 index 0000000..90cc31e --- /dev/null +++ b/templates/register_invite.tpl.php @@ -0,0 +1,90 @@ + +
    +
    +
    + Create Account + + +
    Not a valid invitecode!
    Code:
    + + +
    This Username is allready registered!
    + + + +
    Your name must be at least 2 characters long an may not have any special characters!
    + + + +
    Your password must be at least 6 characters long!
    + + + +
    Your both passwords are not equal!
    + + + +
    There is already a registered user with this E-Mail address!
    + + + +
    Your E-Mail address seems to be invalid!
    + + +
    Register Closed!
    + + +
    Incorrect Captcha!
    + + + +
    +
    Name:
    +
    + + Only letters and numbers; at least 2 characters long +
    + +
    E-Mail:
    +
    + + Must be valid! +
    + +
    Password:
    +
    + +
    + +
    (Repeat)
    +
    + +
    + +
    Invitecode:
    +
    +
    + + +
    +
    + +
    Captcha
    +
    + + +
    + +
     
    +
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/registered.tpl.php b/templates/registered.tpl.php new file mode 100644 index 0000000..3d871cc --- /dev/null +++ b/templates/registered.tpl.php @@ -0,0 +1,7 @@ + +
    +

    Account successfully created

    +

    You can now login.

    + +
    + \ No newline at end of file diff --git a/templates/registrationmail.txt b/templates/registrationmail.txt new file mode 100644 index 0000000..422feec --- /dev/null +++ b/templates/registrationmail.txt @@ -0,0 +1,11 @@ +From: support@4ducky.com +Subject: Welcome to %siteName%! + +Hello %userName%, +thank you for your registration at %siteName%. + +To activate your account, please click the following link +%frontendPath%login/%validationString% + + +Your %siteName% Team \ No newline at end of file diff --git a/templates/remotepost.tpl.php b/templates/remotepost.tpl.php new file mode 100644 index 0000000..509d122 --- /dev/null +++ b/templates/remotepost.tpl.php @@ -0,0 +1,42 @@ + + + + <?php echo Config::$siteTitle ?> + + + + + + +

    4ducky.com - One click Uploader

    + +id ) { ?> +
    + Name: + + + Passwort: + + + + +
    +isSpamLocked() ) { ?> +

    Sorry, you are not allowed to post more than 10 Images in 2 Hours.

    + +

    Please click on the image you want to publish on 4ducky.com!

    +

    Rules: Gore, CP, Spam (no Thread) = Ban

    + +

    Sorry, the Image could not be posted for the following reason:

    +

    + +

    Image posted! Thank you!

    + + + + + \ No newline at end of file diff --git a/templates/shop.tpl.php b/templates/shop.tpl.php new file mode 100644 index 0000000..14c20e8 --- /dev/null +++ b/templates/shop.tpl.php @@ -0,0 +1,5 @@ +
    + + + +
    \ No newline at end of file diff --git a/templates/truhe.tpl.php b/templates/truhe.tpl.php new file mode 100644 index 0000000..aff449e --- /dev/null +++ b/templates/truhe.tpl.php @@ -0,0 +1,311 @@ +zaehler; + +$banned = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_banned'))->zaehler; + +$comm = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_comments'))->zaehler; + +$img = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_images'))->zaehler; + +$fav = mysql_fetch_object(mysql_query('SELECT COUNT(imageId) AS zaehler FROM pl_fav'))->zaehler; +?> + +
    + + + + + + + + + + + + + + + + + + +
    4ducky.com Finances:
    Current 4ducky balance:20,00 Euro
    50 % achieved
    +
    + + +
    + +Jeder User hat die Möglichkeit 4ducky.com mit Spenden zu unterstützen. Der 4ducky.com Server kostet derzeit 30 Euro im Monat. + Wer etwas beisteuern möchte, der schickt einfach einen Amazon-Gutschein (bitte auf eure E-Mail Adresse und nur den Code per PN) an den User "Pandora" oder spendet via Bitcoin an 13wcgskYqQ2L4cPtV6TJHyfzrQ8NT5Zt9e. Spender werden hier geehrt: + +
    Last activities & donations:
    + + + + + + + +
    DateActivity / FeelerAmount
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Oktober 2015Pulvertoastmann+ 10,00 Euro
    Oktober 2015nadjer+ 20,00 Euro
    Oktober 2015Server-Miete- 30,00 Euro
    September 2015Moses+ 10,00 Euro
    September 2015Server-Miete- 30,00 Euro
    August 2015Server-Miete- 30,00 Euro
    August 2015Anonym+ 30,00 Euro
    Juli 2015Server-Miete- 30,00 Euro
    Juni 2015DerFickNigger+ 10,00 Euro
    Juni 2015waluri+ 10,00 Euro
    Juni 2015Kastritis+ 17,00 Euro
    Juni 2015BASEDGOD+ 10,00 Euro
    Juni 2015Server-Miete- 30,00 Euro
    Mai 2015Server-Miete- 30,00 Euro
    April 2015DerFickNigger+ 25,00 Euro
    April 2015Server-Miete- 30,00 Euro
    März 2015AntraX+ 88,00 Euro
    März 2015Server-Miete- 30,00 Euro
    Februar 2015Ahmed+ 50,00 Euro
    März 2015Server-Miete- 30,00 Euro
    Januar 2015FG+ 30,00 Euro
    Januar 2015Nadjer+ 10,00 Euro
    Januar 2015Server-Miete- 30,00 Euro
    Dezember 2014Kastritis+ 11,00 Euro
    Dezember 2014vergessen wer+ 10,00 Euro
    Juli 2014RoterIndianer+ 40,00 Euro
    Juli 2014Seine_Durchlaucht+ 10,00 Euro
    Juli 2014Napalm+ 10,00 Euro
    Juni 2014Sozialfall+ 20,00 Euro
    Dezember 2013IchHab4Euro+ 4,00 Euro
    Dezember 2013FG+ 25,00 Euro
    Dezember 2013Kastritis+ 10,00 Euro
    Oktober 2013Hitler+ 20,00 Euro
    September 2013Pandora+ 20,00 Euro
    September 2013Server-Miete- 20 Euro
    +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    4ducky.com Statistics:
    Images: Images~ Images/User
    User: Duckies Banned Duckies
    Comments: Comments~ Comments/User
    Likes: Likes~ Likes/User
    + +
    \ No newline at end of file diff --git a/templates/upload.tpl.php b/templates/upload.tpl.php new file mode 100644 index 0000000..f3800ae --- /dev/null +++ b/templates/upload.tpl.php @@ -0,0 +1,69 @@ + +
    +
    + Upload / Post +
    + There was an issue uploading your image: +
      Upload Disabled.
    +
    +
    +
    + +
    +
    +
    + Upload / Post + + + +
    + There was an issue uploading your image: +
      + +
    • + +
    +
    + + +
    +
    Info:
    +
    + - Sinnloser Goreupload = Ban +
    +
     
    +
    + - Nur lustige Sachen erlaubt. +
    +
     
    +
    + - Wenn ihr Fragen habt schreibt eine PN - oh wait hier ist nicht Schwuchtel-4fuckr, nervt jemand Anderen mit euren Problemen. +
    +
     
     
    +
    File:
    +
    + +
    + +
    or URL:
    +
    + +
    +
    Comment
    +
    + +
    + +
     
    +
    + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/userlist.tpl.php b/templates/userlist.tpl.php new file mode 100644 index 0000000..0216998 --- /dev/null +++ b/templates/userlist.tpl.php @@ -0,0 +1,54 @@ + +

    + » Browsing Users, + Page: pages['current']; ?> of pages['total']; ?> +

    + + +stylecolor == "black") { + $border="border:1px solid #333;"; + }else{ + $border = ' border:1px solid #d2d9e7; '; + } + +?> + +users as $i => $u ) { ?> +
    + +
    + + + +
    +
    + + Images: + | + + Website + + +
    +
    +
    + + +
    + pages['prev']) ) { ?> + « Previous + +
    « Previous
    + + + pages['next']) ) { ?> + Next » + +
    Next »
    + + +
    +
    + + \ No newline at end of file diff --git a/templates/users.php b/templates/users.php new file mode 100644 index 0000000..cd490f9 --- /dev/null +++ b/templates/users.php @@ -0,0 +1,511 @@ + $u['id']), array( 'valid' => 1) ); + + session_name( Config::$sessionCookie ); + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + + setcookie( Config::$rememberCookie, $id, time() + 3600 * 24 * 365, Config::$absolutePath ); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + return true; + } + + public function isSpamLocked() { + // delete all ips older than IP_LOCK_TIME + DB::query( 'DELETE FROM '.TABLE_UPLOADLOCK.' WHERE ts < :1', time() - Config::$uploadLockTime ); + + $ip = $_SERVER['REMOTE_ADDR']; + $r = DB::getRow( 'SELECT COUNT(*) AS c FROM '.TABLE_UPLOADLOCK.' + WHERE ip = :1', + $ip + ); + + if( $r['c'] > Config::$maxNumUploads ) { + return true; + } else { + return false; + } + } +public function isSpamer() { + + + $r = DB::getRow( 'SELECT logged FROM pl_images + WHERE user = :1 order by logged desc', + $this->id + ); + $time = strtotime($r["logged"]); + + if( (time() - (integer)$time) < 10 ) { + return true; + } else { + return false; + } + } + +public function isSpamming() { + + + $count = DB::getRow( 'SELECT COUNT(*) as c FROM pl_images + WHERE user = :1', + $this->id + ); + + if ( $count["c"] >= 3){ + + $r = DB::query( 'SELECT image,keyword,logged FROM pl_images + WHERE user = :1 LIMIT '.((integer)$count["c"]-3).',2', + $this->id + ); + + + $r0 = DB::getRow( 'SELECT image,keyword,logged FROM pl_images + WHERE user = :1 LIMIT '.((integer)$count["c"]-1).',1', + $this->id + ); + + require_once("img_class.php"); + $ban =0; + foreach ($r as $checkable) { + + echo(strtotime($r0["logged"])." - "); + echo(strtotime($checkable["logged"])); + + if ((strtotime($r0["logged"]) - strtotime($checkable["logged"])) < 15){ + + + + $splitter = split("/",$checkable["keyword"]); + $file2 = $splitter[0]."/".$splitter[1]."/".$checkable["image"]; + $splitter = split("/",$r0["keyword"]); + $file1 = $splitter[0]."/".$splitter[1]."/".$r0["image"]; + + $diff = new imagediff("data/images/".$file2, "data/images/".$file1); + $dif = $diff->diff(); + + if ($dif > 0.92){ + $ban += 1; + } + } + } + if ($ban >= 2){ + return true; + }else{ + return false;} + }else{ return false;} + } + + public function logUpload() { + $ip = $_SERVER['REMOTE_ADDR']; + DB::insertRow( TABLE_UPLOADLOCK, array('ip' => $ip, 'ts' => time(),'user' => $this->id) ); + } + + public function login() { + + // attempt to login via post, session or remeber cookie + + + + session_name( Config::$sessionCookie ); + + if( isset($_POST['login']) ) { // post login + $u = DB::getRow( + 'SELECT id, name, admin, website, color, style FROM '.TABLE_USERS.' WHERE name = :1 AND pass = :2 and valid = 1', + $_POST['name'], md5($_POST['pass']) + ); + + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){ + return "banned"; + } + + if( !empty($u) ) { + + + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + + if( !empty($_POST['remember']) ) { + $r = md5(uniqid(rand())); + DB::updateRow( TABLE_USERS, array('id' => $this->id), array('remember' => $r ) ); + setcookie( Config::$rememberCookie, $r, time() + 3600 * 24 * 365, Config::$absolutePath ); + } + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + } + } + + else if( !empty($_COOKIE[Config::$sessionCookie]) ) { // session running + session_start(); + if( empty($_SESSION['id']) ) { + setcookie(Config::$sessionCookie, false, time() - 3600, Config::$absolutePath ); + } else { + $this->id = $_SESSION['id']; + $this->name = $_SESSION['name']; + $this->admin = $_SESSION['admin']; + $this->website = $_SESSION['website']; + $this->color = $u['color']; + $this->stylecolor = $u['stylecolor']; + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$this->id)){ + $this->logout(); + return "banned"; + + } + } + } + + else if( !empty($_COOKIE[Config::$rememberCookie]) ) { // remember cookie found + $u = DB::getRow( + 'SELECT id, name, admin, website, style, color FROM '.TABLE_USERS.' WHERE remember = :1', + $_COOKIE[Config::$rememberCookie] + ); + if( !empty($u) ) { + + session_start(); + $_SESSION['id'] = $this->id = $u['id']; + $_SESSION['name'] = $this->name = $u['name']; + $_SESSION['admin'] = $this->admin = $u['admin']; + $_SESSION['website'] = $this->website = $u['website']; + $_SESSION['color'] = $this->color = $u['color']; + $_SESSION['stylecolor'] = $this->stylecolor = $u['style']; + + // refresh for another year + setcookie( Config::$rememberCookie, $_COOKIE[Config::$rememberCookie], time() + 3600 * 24 * 365, Config::$absolutePath ); + + if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){ + $this->logout(); + return "banned"; + } + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->login(array('username' => $u['name'])); + } + } + } + } + + public function profile( $localFile, &$messages ) { + $upd = array( 'website' => $_POST['website'] ); + + $_SESSION['website'] = $_POST['website']; + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + } + + $p = trim($_POST['cpass']); + if( !empty( $p ) ) { + if( strlen($_POST['cpass']) < 6 ) { + $messages['passToShort'] = true; + } + else if( $_POST['cpass'] != $_POST['cpass2'] ) { + $messages['passNotEqual'] = true; + } + else { + $upd['pass'] = md5($_POST['cpass2']); + if( Config::$vbbIntegration['enabled'] ) { + $forum->set_pass( $_SESSION['name'], $_POST['cpass2']); + } + } + } + + if( !empty( $localFile ) ) { + require_once( 'lib/images.php' ); + + list( $imgWidth, $imgHeight, $imgtype ) = getimagesize($localFile); + + if ( $imgWidth == 64 && $imgHeight == 64 && $imgtype == IMAGETYPE_GIF){ + $name = Config::$images['avatarsPath'].uniqid().'.gif'; + if (!move_uploaded_file($localFile,$name)){ + $messages['avatarFailed'] = true; + $upd['avatar'] = Config::$images['avatarsPath']."default.png"; + }else{ + $upd['avatar'] = $name; + } + }else{ + $name = Config::$images['avatarsPath'].uniqid().'.jpg'; + + if( Image::createThumb( $localFile, $name, 64,64 ) ) { + $upd['avatar'] = $name; + } else { + $messages['avatarFailed'] = true; + } + } + } + + if(!empty($_POST['color'])){ + if(preg_match('/^[a-f0-9]{6}$/i', $_POST['color'])){ + $upd['color'] = $_POST['color']; + }else{ + $messages['colorFailed'] = true; + } + } + //--------------------------------------------------------------------blockuser + if(!empty($_POST['blockuser'])){ + if(preg_match('/^\w{2,20}$/', $_POST['blockuser'])){ + $blockedusers = array(); + $blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id); + + if(!empty($blockedusers)){ + $blockedusers = unserialize($blockedusers['users']); + if (in_array($_POST['blockuser'],$blockedusers)){ + $messages['blockAlready'] = true; + }else{ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){ + + array_push($blockedusers,$_POST['blockuser']); + if(DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id)){ + $messages['blocked'] = true; + }else{ + $messages['blockFailed'] = true; + } + }else{ + $messages['userFailed'] = true; + } + + } + }else{ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){ + $newarray = array(); + array_push($newarray,$_POST['blockuser']); + + if(DB::query("INSERT INTO pl_blocked (id,users) VALUES (:1,:2)",$this->id,serialize($newarray))){ + $messages['blocked'] = true; + }else{ + $messages['blockFailed'] = true; + } + + }else{ + $messages['userFailed'] = true; + } + } + }else{ + $messages['blockFailed'] = true; + } + + } + //--------------------------------------------------------------------UNblockuser +function remove_item_by_value($array, $val = '', $preserve_keys = true) { + if (count($array) == 1) return false; + if (empty($array) || !is_array($array)) return false; + if (!in_array($val, $array)) return $array; + + foreach($array as $key => $value) { + if ($value == $val) unset($array[$key]); + } + + return ($preserve_keys === true) ? $array : array_values($array); +} + //--------------------------------------------------------------------UNblockuser + if(!empty($_POST['unblockuser'])){ + if(preg_match('/^\w{2,20}$/', $_POST['unblockuser'])){ + if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['unblockuser'])){ + $blockedusers = array(); + $blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id); + if(!empty($blockedusers)){ + $blockedusers = unserialize($blockedusers['users']); + if (in_array($_POST['unblockuser'],$blockedusers)){ + $blockedusers = remove_item_by_value($blockedusers,$_POST['unblockuser']); + if ($blockedusers){ + DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id); + $messages['unblocked'] = true; + }else{ + DB::query('DELETE FROM pl_blocked WHERE id=:1',$this->id); + $messages['unblocked'] = true; + } + }else{$messages['notBlocked'] = true;} + }else{$messages['unblockFailed'] = true;} + }else{$messages['userFailed'] = true;} + }else{$messages['unblockFailed'] = true;} + } + + //-------------------------------------------------------------------------STYLE + + if(isset($_POST['stylecolor'])) { + if($_POST['stylecolor'] == 'white') { + + $upd['style'] = $_POST['stylecolor']; + + } elseif($_POST['stylecolor'] == 'black') { + $upd['style'] = $_POST['stylecolor']; + } else{ + $upd['style'] = $_POST['black']; + } + } + + + + if( empty($this->email) && + preg_match('/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email']) + ) { + if( Config::$vbbIntegration['enabled'] ) { + $forum->set_email( $_SESSION['name'], $_POST['email']); + } + $upd['email'] = $_POST['email']; + } + + DB::updateRow( TABLE_USERS, array( 'id' => $this->id ), $upd ); + } + + public function loadEmail() { + $tmp = DB::getRow( + 'SELECT email,color,style FROM '.TABLE_USERS.' WHERE id = :1', + $this->id + ); + $this->email = $tmp['email']; + $this->color = $tmp['color']; + $this->stylecolor = $tmp['style']; + } + + public function logout() { + session_unset(); + session_destroy(); + $_SESSION = array(); + setcookie( Config::$rememberCookie, false, time() - 3600, Config::$absolutePath ); + setcookie( Config::$sessionCookie, false, time() - 3600, Config::$absolutePath ); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $forum->logout(); + } + } + + public function increaseScore( $amount ) { + DB::query( + 'UPDATE '.TABLE_USERS.' SET score = score + :1 WHERE id = :2', + intval( $amount ), + $this->id + ); + } + + public function register( &$messages ) { + + DB::query( 'DELETE FROM '.TABLE_USERS.' WHERE valid = 0 AND registered < NOW() - INTERVAL 30 MINUTE' ); + + if( !preg_match('/^\w{2,20}$/', $_POST['name']) ) { + $messages['nameInvalid'] = true; + } else { + $u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE name = :1', $_POST['name'] ); + if( !empty($u) ) { + $messages['nameInUse'] = true; + } + } + + if( strlen($_POST['pass']) < 6 ) { + $messages['passToShort'] = true; + } + else if( $_POST['pass'] != $_POST['pass2'] ) { + $messages['passNotEqual'] = true; + } + + if( !preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'] ) ) { + $messages['wrongEmail'] = true; + } else { + $u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE email = :1', $_POST['email'] ); + if( !empty($u) ) { + $messages['emailInUse'] = true; + } + } + + + if( !empty($messages) ) { + return false; + } + + + $this->validationString = md5(uniqid(rand())); + + DB::insertRow( TABLE_USERS, array( + 'registered' => date('Y-m-d H:i:s'), + 'name' => $_POST['name'], + 'pass' => md5($_POST['pass']), + 'valid' => 0, + 'score' => 0, + 'images' => 0, + 'website' => '', + 'avatar' => Config::$images['avatarsPath'].'default.png', + 'remember' => $this->validationString, + 'admin' => 0, + 'email' => $_POST['email'], + 'color' => '0', + 'style' => '"black"' + )); + + if( Config::$vbbIntegration['enabled'] ) { + global $vbulletin; + $forum = new ForumOps($vbulletin); + $user['name'] = $_POST['name']; + $user['pass'] = $_POST['pass']; + $user['email'] = $_POST['email']; + echo $forum->register_newuser($user, false); + } + + $mail = file_get_contents( Config::$templates.'registrationmail.txt' ); + preg_match( '/From: (?.*?)\r?\nSubject: (?.*?)\r?\n\r?\n(?.*)/sim', $mail, $mail ); + $mail['text'] = str_replace( '%validationString%', $this->validationString, $mail['text'] ); + $mail['text'] = str_replace( '%siteName%', Config::$siteName, $mail['text'] ); + $mail['text'] = str_replace( '%frontendPath%', Config::$frontendPath, $mail['text'] ); + $mail['text'] = str_replace( '%userName%', $_POST['name'], $mail['text'] ); + + $mail['subject'] = str_replace( '%siteName%', Config::$siteName, $mail['subject'] ); + $mail['subject'] = str_replace( '%userName%', $_POST['name'], $mail['subject'] ); + + mail( $_POST['email'], $mail['subject'], $mail['text'], 'FROM: '.$mail['from'] ); + return true; + } +} + +?> \ No newline at end of file diff --git a/templates/view.tpl.php b/templates/view.tpl.php new file mode 100644 index 0000000..eff2489 --- /dev/null +++ b/templates/view.tpl.php @@ -0,0 +1,256 @@ +image["color"] != "000000"){ + $csi = 'style="color:#'.$iv->image["color"].'"'; + } + +//if (!$user->id){ +// echo('
    Only registered users can see images! Register now.
    '); +// include( $templates.'footer.tpl.php' ); +// exit(); +// } + +//DB::query("UPDATE `pl_images` SET `views` = views + '1' WHERE id=:1",$iv->image['id']); +// $bild = DB::getRow("SELECT views as views,source as source FROM pl_images WHERE id=:1",$iv->image['id']); + +// $comment = DB::getRow("SELECT COUNT(*) as count FROM pl_comments WHERE imageId=:1",$iv->image['id']); + +$comment_open = DB::getRow("SELECT comment as open FROM pl_images WHERE id=:1",$iv->image['id']); +?> + + + +

    » Viewing + user) ) { ?> + User: user['name']; ?> + channel) ) { ?> + Channel: channel['name']; ?> + + : , uploaded howlong($iv->image['loggedTS'],time());} ?> (image['loggedTS']); ?>) +

    + +
    +stream['prev']) ) { ?> + + +
    Previous
    + +stream['next']) ) { ?> + + +
    Next
    + + +
    +id){?> +<?php echo $pname ?> + +register
    + +
    + +
    + +
    + Avatar + + id){?> + fav + + +
    href="userInfo['name']; ?>">userInfo['name']; ?> + +userInfo['id'] == 180) {echo "ϟϟ xxx Stellvertreter";} +elseif ($iv->userInfo['id'] == 191) {echo "aka. katzenschnupfen :3";} +elseif ($iv->userInfo['id'] == 807) {echo "Beliebteste Neuente";} +elseif ($iv->userInfo['id'] == 29) {echo "RGR";} +elseif ($iv->userInfo['id'] == 74) {echo "ϟϟ Arschfodse";} +elseif ($iv->userInfo['id'] == 238) {echo "Musikente";} +elseif ($iv->userInfo['id'] == 297) {echo "DarkPsyPolizei";} +elseif ($iv->userInfo['id'] == 75) {echo "DJ";} +elseif ($iv->userInfo['id'] == 12) {echo "König der ✡ und ewiger Mod";} +elseif ($iv->userInfo['id'] > 250) {echo "☪";} +elseif ($iv->userInfo['id'] < 89) {echo "ϟϟ";} +elseif ($iv->userInfo['id'] > 89) {echo "✡";} + +else {echo "☭";} ?> + +
    + + id){ ?> +
    message | comment | + + admin) { ?> +
    Score: image["score"]; ?> | + id == "1"){ ?> HoF | Ban | TimeBlock User | Close Thread | Delete Pic
    +
    + + + +
    + + + + + + + + + + + +
    + +
    + + stylecolor == "white") {?> +
    + +
    + +
    + +
    + +
    + + id && $comment_open[open] == 0 ) { ?> +
    + + + +
    + + + + isSpamming(); + if (is_numeric($spaming)){ + echo '
    '; + $blockreason = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$user->id); + echo 'Upload gesperrt bis: '.date('Y-m-d H:i:s',(int)$blockreason["time"]); + echo '
    Grund: '.$blockreason["spam_reason"]; + $left = ((int)$blockreason["time"] - (int)time())/60; + echo '
    Noch: '.round($left,2).' Minuten '; + echo "
    "; + }elseif( $user->isSpamming() ){ + echo '
    '; + echo "Spamblocked"; + echo "
    "; + }else{ + + + ?> + + + + + + + + + + +
    + » BB-Codes: [img] [link] [spoiler] [youtube] + + +
     );"/> + + +
    +
    +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + \ No newline at end of file