Merge branch 'master' of github.com:savetheinternet/Tinyboard-Tools into tools
Conflicts: README.md
No files matched your search
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* auto-reload.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/auto-reload.js
|
||||||
|
*
|
||||||
|
* Brings AJAX to Tinyboard.
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/auto-reload.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
if($('div.banner').length == 0)
|
||||||
|
return; // not index
|
||||||
|
|
||||||
|
var poll_interval;
|
||||||
|
|
||||||
|
var poll = function() {
|
||||||
|
$.ajax({
|
||||||
|
url: document.location,
|
||||||
|
success: function(data) {
|
||||||
|
$(data).find('div.post.reply').each(function() {
|
||||||
|
var id = $(this).attr('id');
|
||||||
|
if($('#' + id).length == 0) {
|
||||||
|
$(this).insertAfter($('div.post:last').next()).after('<br class="clear">');
|
||||||
|
$(document).trigger('new_post', this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
poll_interval = setTimeout(poll, 5000);
|
||||||
|
};
|
||||||
|
|
||||||
|
$(window).scroll(function() {
|
||||||
|
if($(this).scrollTop() + $(this).height() < $('div.post:last').position().top + $('div.post:last').height()) {
|
||||||
|
clearTimeout(poll_interval);
|
||||||
|
poll_interval = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(poll_interval === false) {
|
||||||
|
poll_interval = setTimeout(poll, 1500);
|
||||||
|
}
|
||||||
|
}).trigger('scroll');
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* fix-report-delete-submit.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/fix-report-delete-submit.js
|
||||||
|
*
|
||||||
|
* Fixes a known bug regarding the delete/report submit buttons.
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/fix-report-delete-submit.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('form[name="postcontrols"] div.delete input:not([type="checkbox"]):not([type="submit"]):not([type="hidden"])').keypress(function(e) {
|
||||||
|
if(e.which == 13) {
|
||||||
|
e.preventDefault();
|
||||||
|
$(this).next().click();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
* forced-anon.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/forced-anon.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/forced-anon.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
var force_anon = function() {
|
||||||
|
if($(this).children('a.capcode').length == 0) {
|
||||||
|
var id = $(this).parent().children('a.post_no:eq(1)').text();
|
||||||
|
|
||||||
|
if($(this).children('a.email').length != 0)
|
||||||
|
var p = $(this).children('a.email');
|
||||||
|
else
|
||||||
|
var p = $(this);
|
||||||
|
|
||||||
|
old_info[id] = {'name': p.children('span.name').text(), 'trip': p.children('span.trip').text()};
|
||||||
|
|
||||||
|
p.children('span.name').text('Anonymous');
|
||||||
|
if(p.children('span.trip').length != 0)
|
||||||
|
p.children('span.trip').text('');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var enable_fa = function() {
|
||||||
|
$('p.intro label').each(force_anon);
|
||||||
|
};
|
||||||
|
|
||||||
|
var disable_fa = function() {
|
||||||
|
$('p.intro label').each(function() {
|
||||||
|
if($(this).children('a.capcode').length == 0) {
|
||||||
|
var id = $(this).parent().children('a.post_no:eq(1)').text();
|
||||||
|
|
||||||
|
if(old_info[id]) {
|
||||||
|
if($(this).children('a.email').length != 0)
|
||||||
|
var p = $(this).children('a.email');
|
||||||
|
else
|
||||||
|
var p = $(this);
|
||||||
|
|
||||||
|
p.children('span.name').text(old_info[id]['name']);
|
||||||
|
if(p.children('span.trip').length != 0)
|
||||||
|
p.children('span.trip').text(old_info[id]['trip']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
old_info = {};
|
||||||
|
forced_anon = localStorage['forcedanon'] ? true : false;
|
||||||
|
|
||||||
|
$('hr:first').before('<div id="forced-anon" style="text-align:right"><a class="unimportant" href="javascript:void(0)">-</a></div>');
|
||||||
|
$('div#forced-anon a').text('Forced anonymity (' + (forced_anon ? 'enabled' : 'disabled') + ')');
|
||||||
|
|
||||||
|
$('div#forced-anon a').click(function() {
|
||||||
|
forced_anon = !forced_anon;
|
||||||
|
|
||||||
|
if(forced_anon) {
|
||||||
|
$('div#forced-anon a').text('Forced anonymity (enabled)');
|
||||||
|
localStorage.forcedanon = true;
|
||||||
|
enable_fa();
|
||||||
|
} else {
|
||||||
|
$('div#forced-anon a').text('Forced anonymity (disabled)');
|
||||||
|
delete localStorage.forcedanon;
|
||||||
|
disable_fa();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(forced_anon)
|
||||||
|
enable_fa();
|
||||||
|
|
||||||
|
$(document).bind('new_post', function(e, post) {
|
||||||
|
if(forced_anon)
|
||||||
|
$(post).find('p.intro label').each(force_anon);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/*! jQuery v1.7.1 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 cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(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;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;iLine truncated
|
||||||
|
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),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<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=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;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.cLine truncated
|
||||||
|
{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){if(a===b)return this[0]&&this[0].nodeType===1?this[0].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></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?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||!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;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacitLine truncated
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* local-time.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/local-time.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['quick_reply'] = true;
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/local-time.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
var iso8601 = function(s) {
|
||||||
|
s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
|
||||||
|
s = s.replace(/-/,"/").replace(/-/,"/");
|
||||||
|
s = s.replace(/T/," ").replace(/Z/," UTC");
|
||||||
|
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
|
||||||
|
return new Date(s);
|
||||||
|
};
|
||||||
|
var zeropad = function(num, count) {
|
||||||
|
return [Math.pow(10, count - num.toString().length), num].join('').substr(1);
|
||||||
|
};
|
||||||
|
|
||||||
|
$('time').each(function() {
|
||||||
|
if(!$(this).text().match(/^\d+\/\d+\/\d+ \(\w+\) \d+:\d+:\d+$/))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var t = iso8601($(this).attr('datetime'));
|
||||||
|
|
||||||
|
$(this).text(
|
||||||
|
// date
|
||||||
|
zeropad(t.getMonth() + 1, 2) + "/" + zeropad(t.getDate(), 2) + "/" + t.getFullYear().toString().substring(2) +
|
||||||
|
" (" + ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][t.getDay()] + ") " +
|
||||||
|
// time
|
||||||
|
zeropad(t.getHours(), 2) + ":" + zeropad(t.getMinutes(), 2) + ":" + zeropad(t.getSeconds(), 2)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* post-hover.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/post-hover.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/post-hover.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
var dont_fetch_again = [];
|
||||||
|
var init_hover = function() {
|
||||||
|
var link = $(this);
|
||||||
|
|
||||||
|
var id;
|
||||||
|
|
||||||
|
if(id = $(link).text().match(/^>>(\d+)$/)) {
|
||||||
|
id = id[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
var post = false;
|
||||||
|
var hovering = false;
|
||||||
|
var hovered_at;
|
||||||
|
$(link).hover(function(e) {
|
||||||
|
hovering = true;
|
||||||
|
hovered_at = {'x': e.pageX, 'y': e.pageY};
|
||||||
|
|
||||||
|
var start_hover = function(link) {
|
||||||
|
if(post.is(':visible') &&
|
||||||
|
post.offset().top + post.height() >= $(window).scrollTop() &&
|
||||||
|
post.offset().top <= $(window).scrollTop() + $(window).height()
|
||||||
|
) {
|
||||||
|
// post is in view
|
||||||
|
post.attr('style', 'border-style: none dashed dashed none; background: ' + post.css('border-right-color'));
|
||||||
|
} else {
|
||||||
|
post.clone()
|
||||||
|
.attr('id', 'post-hover-' + id)
|
||||||
|
.addClass('post-hover')
|
||||||
|
.css('position', 'absolute')
|
||||||
|
.css('border-style', 'solid')
|
||||||
|
.css('box-shadow', '1px 1px 1px #999')
|
||||||
|
.css('display', 'block')
|
||||||
|
.insertAfter($(link).parent());
|
||||||
|
$(link).trigger('mousemove');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
post = $('div.post#reply_' + id);
|
||||||
|
if(post.length > 0) {
|
||||||
|
start_hover(this);
|
||||||
|
} else {
|
||||||
|
var url = link.attr('href').replace(/#.*$/, '');
|
||||||
|
|
||||||
|
if($.inArray(url, dont_fetch_again) != -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dont_fetch_again.push(url);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
context: document.body,
|
||||||
|
success: function(data) {
|
||||||
|
$(data).find('div.post.reply').each(function() {
|
||||||
|
if($('#' + $(this).attr('id')).length == 0)
|
||||||
|
$('div.post:first').prepend($(this).css('display', 'none').addClass('hidden'));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
post = $('div.post#reply_' + id);
|
||||||
|
if(hovering && post.length > 0) {
|
||||||
|
start_hover(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, function() {
|
||||||
|
hovering = false;
|
||||||
|
if(!post)
|
||||||
|
return;
|
||||||
|
|
||||||
|
post.attr('style', '');
|
||||||
|
if(post.hasClass('hidden'))
|
||||||
|
post.css('display', 'none');
|
||||||
|
$('.post-hover').remove();
|
||||||
|
}).mousemove(function(e) {
|
||||||
|
if(!post)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var hover = $('#post-hover-' + id);
|
||||||
|
if(hover.length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var top = (e.pageY ? e.pageY : hovered_at['y']) - 10;
|
||||||
|
|
||||||
|
if(e.pageY < $(window).scrollTop() + 15) {
|
||||||
|
top = $(window).scrollTop();
|
||||||
|
} else if(e.pageY > $(window).scrollTop() + $(window).height() - hover.height() - 15) {
|
||||||
|
top = $(window).scrollTop() + $(window).height() - hover.height() - 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
hover.css('left', (e.pageX ? e.pageX : hovered_at['x'])).css('top', top);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$('p.body a:not([rel="nofollow"])').each(init_hover);
|
||||||
|
|
||||||
|
// allow to work with auto-reload.js, etc.
|
||||||
|
$(document).bind('new_post', function(e, post) {
|
||||||
|
$(post).find('p.body a:not([rel="nofollow"])').each(init_hover);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* quick-posts-controls.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/quick-posts-controls.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/quick-post-controls.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
var open_form = function() {
|
||||||
|
var thread = $(this).parent().parent().hasClass('op');
|
||||||
|
var id = $(this).attr('name').match(/^delete_(\d+)$/)[1];
|
||||||
|
var submitButton;
|
||||||
|
|
||||||
|
if(this.checked) {
|
||||||
|
var post_form = $('<form class="post-actions" method="post" style="margin:10px 0 0 0">' +
|
||||||
|
'<div style="text-align:right">' +
|
||||||
|
(!thread ? '<hr>' : '') +
|
||||||
|
|
||||||
|
'<input type="hidden" name="delete_' + id + '">' +
|
||||||
|
|
||||||
|
'<label for="password_' + id + '">Password</label>: ' +
|
||||||
|
'<input id="password_' + id + '" type="password" name="password" size="11" maxlength="18">' +
|
||||||
|
'<input title="Delete file only" type="checkbox" name="file" id="delete_file_' + id + '">' +
|
||||||
|
'<label for="delete_file_' + id + '">File</label>' +
|
||||||
|
' <input type="submit" name="delete" value="Delete">' +
|
||||||
|
|
||||||
|
'<br>' +
|
||||||
|
|
||||||
|
'<label for="reason_' + id + '">Reason</label>: ' +
|
||||||
|
'<input id="reason_' + id + '" type="text" name="reason" size="20" maxlength="100">' +
|
||||||
|
' <input type="submit" name="report" value="Report">' +
|
||||||
|
'</div>' +
|
||||||
|
'</form>');
|
||||||
|
post_form
|
||||||
|
.attr('action', $('form:first').attr('action'))
|
||||||
|
.append($('input[name=board]:first').clone())
|
||||||
|
.find('input:not([type="checkbox"]):not([type="submit"]):not([type="hidden"])').keypress(function(e) {
|
||||||
|
if(e.which == 13) {
|
||||||
|
e.preventDefault();
|
||||||
|
if($(this).attr('name') == 'password') {
|
||||||
|
post_form.find('input[name=delete]').click();
|
||||||
|
} else if($(this).attr('name') == 'reason') {
|
||||||
|
post_form.find('input[name=report]').click();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
post_form.find('input[type="password"]').val(localStorage.password);
|
||||||
|
|
||||||
|
if(thread) {
|
||||||
|
post_form.prependTo($(this).parent().parent().find('p.body'));
|
||||||
|
} else {
|
||||||
|
post_form.appendTo($(this).parent().parent());
|
||||||
|
//post_form.insertBefore($(this));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var elm = $(this).parent().parent().find('form');
|
||||||
|
|
||||||
|
if(elm.attr('class') == 'post-actions')
|
||||||
|
elm.remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$('div.post input[type=checkbox].delete').each(function() {
|
||||||
|
$(this).change(open_form);
|
||||||
|
if(this.checked)
|
||||||
|
$(this).trigger('change');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* quick-reply.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/quick-reply.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['quick_reply'] = true;
|
||||||
|
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||||
|
* $config['additional_javascript'][] = 'js/quick-reply.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
if($('div.banner').length != 0)
|
||||||
|
return; // not index
|
||||||
|
|
||||||
|
txt_new_topic = $('form[name=post] input[type=submit]').val();
|
||||||
|
txt_new_reply = txt_new_topic == 'Submit' ? txt_new_topic : 'New Reply';
|
||||||
|
|
||||||
|
undo_quick_reply = function() {
|
||||||
|
$('div.banner').remove();
|
||||||
|
$('form[name=post] input[type=submit]').val(txt_new_topic);
|
||||||
|
$('form[name=post] input[name=quick-reply]').remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('div.post.op').each(function() {
|
||||||
|
var id = $(this).children('p.intro').children('a.post_no:eq(1)').text();
|
||||||
|
$('<a href="?/b/res/69.html">[Quick reply]</a>').insertAfter($(this).children('p.intro').children('a:last')).click(function() {
|
||||||
|
$('div.banner').remove();
|
||||||
|
$('<div class="banner">Posting mode: Replying to <small>>>' + id + '</small> <a class="unimportant" onclick="undo_quick_reply()" href="javascript:void(0)">[Return]</a></div>')
|
||||||
|
.insertBefore('form[name=post]');
|
||||||
|
$('form[name=post] input[type=submit]').val(txt_new_reply);
|
||||||
|
|
||||||
|
$('<input type="hidden" name="quick-reply" value="' + id + '">').appendTo($('form[name=post]'));
|
||||||
|
|
||||||
|
$('form[name=post] textarea').select();
|
||||||
|
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* show-backlinks.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/show-backlinks.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/show-backlinks.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('div.post.reply').each(function() {
|
||||||
|
var reply_id = $(this).attr('id').replace(/^reply_/, '');
|
||||||
|
|
||||||
|
$(this).find('p.body a:not([rel="nofollow"])').each(function() {
|
||||||
|
var id, post, mentioned;
|
||||||
|
|
||||||
|
if(id = $(this).text().match(/^>>(\d+)$/))
|
||||||
|
id = id[1];
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
post = $('#reply_' + id);
|
||||||
|
if(post.length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mentioned = post.find('p.intro span.mentioned');
|
||||||
|
if(mentioned.length == 0)
|
||||||
|
mentioned = $('<span class="mentioned"></span>').appendTo(post.find('p.intro'));
|
||||||
|
|
||||||
|
mentioned.append('<a onclick="highlightReply(\'' + reply_id + '\');" href="#' + reply_id + '">>>' + reply_id + '</a>');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* smartphone-spoiler.js
|
||||||
|
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/smartphone-spoiler.js
|
||||||
|
*
|
||||||
|
* Released under the MIT license
|
||||||
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* $config['additional_javascript'][] = 'js/smartphone-spoiler.js';
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
/* This needs to be expanded upon: */
|
||||||
|
var is_mobile = navigator.userAgent.match(/iPhone|iPod|iPad|Android/i);
|
||||||
|
|
||||||
|
if(is_mobile) {
|
||||||
|
$('span.spoiler').each(function() {
|
||||||
|
$(this).click(function() {
|
||||||
|
if($(this).hasClass('show'))
|
||||||
|
$(this).css('color', 'black').removeClass('show');
|
||||||
|
else
|
||||||
|
$(this).css('color', 'white').addClass('show');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,338 @@
|
|||||||
|
<?php
|
||||||
|
set_time_limit(0);
|
||||||
|
$kusabaxc = Array();
|
||||||
|
|
||||||
|
|
||||||
|
/* Config */
|
||||||
|
|
||||||
|
// Path to KusabaX configuration file (config.php)
|
||||||
|
// Warning: This script will ignore anything past the first `require`. This is only a problem if you've extensively modified your config.php
|
||||||
|
$kusabaxc['config'] = '';
|
||||||
|
|
||||||
|
/* End config */
|
||||||
|
|
||||||
|
|
||||||
|
require 'inc/functions.php';
|
||||||
|
require 'inc/display.php';
|
||||||
|
require 'inc/template.php';
|
||||||
|
require 'inc/database.php';
|
||||||
|
require 'inc/user.php';
|
||||||
|
|
||||||
|
if(!isset($kusabaxc['config']) || empty($kusabaxc['config']))
|
||||||
|
error('Did you forget to configure the script?');
|
||||||
|
|
||||||
|
if(!file_exists($kusabaxc['config']) || !is_readable($kusabaxc['config']))
|
||||||
|
error('Kusaba X config file doesn\'t exist or I can\'t read it.');
|
||||||
|
|
||||||
|
$temp = tempnam($config['tmp'], 'kusabax');
|
||||||
|
|
||||||
|
$raw_config = file_get_contents($kusabaxc['config']);
|
||||||
|
|
||||||
|
// replace __FILE__ with the actual filename
|
||||||
|
$raw_config = str_replace('__FILE__', '\'' . addslashes(realpath($kusabaxc['config'])) . '\'', $raw_config);
|
||||||
|
|
||||||
|
// remove anything after the first `require`
|
||||||
|
$raw_config = substr($raw_config, 0, strpos($raw_config, 'require KU_ROOTDIR'));
|
||||||
|
|
||||||
|
file_put_contents($temp, $raw_config);
|
||||||
|
|
||||||
|
// Load KusabaX config
|
||||||
|
require $temp;
|
||||||
|
|
||||||
|
unlink($temp);
|
||||||
|
|
||||||
|
if(KU_DBTYPE != 'mysql' && KU_DBTYPE != 'mysqli')
|
||||||
|
error('Database type <strong>' . KU_DBTYPE . '</strong> not supported!');
|
||||||
|
|
||||||
|
$kusabaxc['db']['type'] = 'mysql';
|
||||||
|
$kusabaxc['db']['server'] = KU_DBHOST;
|
||||||
|
$kusabaxc['db']['user'] = KU_DBUSERNAME;
|
||||||
|
$kusabaxc['db']['password'] = KU_DBPASSWORD;
|
||||||
|
$kusabaxc['db']['database'] = KU_DBDATABASE;
|
||||||
|
$kusabaxc['db']['dsn'] = '';
|
||||||
|
$kusabaxc['db']['timeout'] = 5;
|
||||||
|
$kusabaxc['db']['persistent'] = false;
|
||||||
|
|
||||||
|
|
||||||
|
// KusabaX functions
|
||||||
|
function md5_decrypt($enc_text, $password, $iv_len = 16) {
|
||||||
|
$enc_text = base64_decode($enc_text);
|
||||||
|
$n = strlen($enc_text);
|
||||||
|
$i = $iv_len;
|
||||||
|
$plain_text = '';
|
||||||
|
$iv = substr($password ^ substr($enc_text, 0, $iv_len), 0, 512);
|
||||||
|
while ($i < $n) {
|
||||||
|
$block = substr($enc_text, $i, 16);
|
||||||
|
$plain_text .= $block ^ pack('H*', md5($iv));
|
||||||
|
$iv = substr($block . $iv, 0, 512) ^ $password;
|
||||||
|
$i += 16;
|
||||||
|
}
|
||||||
|
return preg_replace('/\\x13\\x00*$/', '', $plain_text);
|
||||||
|
}
|
||||||
|
|
||||||
|
// KusabaX -> Tinyboard HTML
|
||||||
|
function convert_markup($body) {
|
||||||
|
global $config;
|
||||||
|
$body = stripslashes($body);
|
||||||
|
|
||||||
|
// >quotes
|
||||||
|
$body = str_replace('"unkfunc"', '"quote"', $body);
|
||||||
|
|
||||||
|
// >>cites
|
||||||
|
$body = preg_replace('/<a href="[^"]+?\/(\w+)\/res\/(\d+).html#(\d+)" onclick="return highlight\(\'\d+\', true\);" class="[^"]+">/', '<a onclick="highlightReply(\'$3\');" href="' . $config['root'] . '$1/res/$2.html#$3">', $body);
|
||||||
|
|
||||||
|
// Public bans
|
||||||
|
$body = preg_replace('/<br \/><font color="#FF0000"><b>\((.+?)\)<\/b><\/font>/', '<span class="public_ban">($1)</span>', $body);
|
||||||
|
|
||||||
|
return $body;
|
||||||
|
}
|
||||||
|
|
||||||
|
$step = isset($_GET['step']) ? round($_GET['step']) : 0;
|
||||||
|
$page = Array(
|
||||||
|
'config' => $config,
|
||||||
|
'title' => 'KusabaX Database Migration',
|
||||||
|
'body' => ''
|
||||||
|
);
|
||||||
|
|
||||||
|
$log = Array();
|
||||||
|
|
||||||
|
// Trick Tinyboard into opening the KusabaX databse instead
|
||||||
|
$__temp = $config['db'];
|
||||||
|
$config['db'] = $kusabaxc['db'];
|
||||||
|
|
||||||
|
sql_open();
|
||||||
|
|
||||||
|
// Get databse link
|
||||||
|
$kusabax = $pdo;
|
||||||
|
// Clear
|
||||||
|
unset($pdo);
|
||||||
|
|
||||||
|
// Open Tinyboard database
|
||||||
|
$config['db'] = $__temp;
|
||||||
|
unset($__temp);
|
||||||
|
|
||||||
|
$k_query = $kusabax->query('SELECT * FROM `' . KU_DBPREFIX . 'boards`');
|
||||||
|
$boards = listBoards();
|
||||||
|
|
||||||
|
// Copy boards table, briefly
|
||||||
|
$kusabax_boards = Array();
|
||||||
|
while($board = $k_query->fetch()) {
|
||||||
|
// For later use...
|
||||||
|
$kusabax_boards[(int)$board['id']] = $board['name'];
|
||||||
|
|
||||||
|
$already_exists = false;
|
||||||
|
foreach($boards as &$_board) {
|
||||||
|
if($_board['uri'] == $board['name']) {
|
||||||
|
// Board already exists in Tinyboard...
|
||||||
|
$log[] = 'Board /' . $board['name'] . '/ already exists.';
|
||||||
|
$already_exists = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($already_exists)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$log[] = 'Creating board: <strong>/' . $board['name'] . '/</strong>';
|
||||||
|
|
||||||
|
// Go ahead and create this new board...
|
||||||
|
$query = prepare('INSERT INTO `boards` VALUES (NULL, :uri, :title, :subtitle)');
|
||||||
|
$query->bindValue(':uri', $board['name']);
|
||||||
|
$query->bindValue(':title', $board['desc']);
|
||||||
|
$query->bindValue(':subtitle', null, PDO::PARAM_NULL);
|
||||||
|
$query->execute() or error(db_error($query));
|
||||||
|
|
||||||
|
// Posting table
|
||||||
|
query(Element('posts.sql', Array('board' => $board['name']))) or error(db_error());
|
||||||
|
|
||||||
|
// Set up board (create directories, etc.) by opening it
|
||||||
|
openBoard($board['name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$k_query = $kusabax->query('SELECT `' . KU_DBPREFIX . 'posts`.*, `' . KU_DBPREFIX . '`.`type` FROM `' . KU_DBPREFIX . 'posts` LEFT JOIN `' . KU_DBPREFIX . 'staff` ON `posterauthority` = `' . KU_DBPREFIX . 'staff`.`id` WHERE `IS_DELETED` = 0') or error(db_error($kusabax));
|
||||||
|
while($post = $k_query->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
if(!isset($kusabax_boards[(int)$post['boardid']])) {
|
||||||
|
// Board doesn't exist...
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$board = $kusabax_boards[(int)$post['boardid']];
|
||||||
|
|
||||||
|
$log[] = 'Replicating post <strong>' . $post['id'] . '</strong> on /' . $board . '/';
|
||||||
|
|
||||||
|
$query = prepare(sprintf("INSERT INTO `posts_%s` VALUES
|
||||||
|
(
|
||||||
|
:id, :thread, :subject, :email, :name, :trip, :capcode, :body, NULL, :time, :time, :thumb, :thumbwidth, :thumbheight, :file, :width, :height, :filesize, :filename, :filehash, :password, :ip, :sticky, :locked, 0, :embed
|
||||||
|
)", $board));
|
||||||
|
|
||||||
|
// Post ID
|
||||||
|
$query->bindValue(':id', $post['id'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Thread (`parentid`)
|
||||||
|
if($post['parentid'] == 0)
|
||||||
|
$query->bindValue(':thread', null, PDO::PARAM_NULL);
|
||||||
|
else
|
||||||
|
$query->bindValue(':thread', (int)$post['parentid'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Name
|
||||||
|
if(empty($post['name']))
|
||||||
|
$post['name'] = $config['anonymous'];
|
||||||
|
$query->bindValue(':name', trim($post['name']), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// Trip
|
||||||
|
if(empty($post['tripcode']))
|
||||||
|
$query->bindValue(':trip', null, PDO::PARAM_NULL);
|
||||||
|
else
|
||||||
|
$query->bindValue(':trip', $post['tripcode'], PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// Email
|
||||||
|
$query->bindValue(':email', trim($post['email']), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// Subject
|
||||||
|
$query->bindValue(':subject', trim($post['subject']), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// Body (`message`)
|
||||||
|
$query->bindValue(':body', convert_markup($post['message']), PDO::PARAM_STR);
|
||||||
|
|
||||||
|
$embed_code = false;
|
||||||
|
|
||||||
|
// File
|
||||||
|
if(empty($post['file']) || $post['file'] == 'removed') {
|
||||||
|
if($post['file'] == 'removed')
|
||||||
|
$query->bindValue(':file', 'deleted', PDO::PARAM_STR);
|
||||||
|
else
|
||||||
|
$query->bindValue(':file', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':width', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':height', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':filesize', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':filename', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':filehash', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':thumb', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':thumbwidth', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':thumbheight', null, PDO::PARAM_NULL);
|
||||||
|
} elseif($post['file_size'] == 0 && empty($post['file_md5'])) {
|
||||||
|
// embed
|
||||||
|
$query->bindValue(':file', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':width', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':height', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':filesize', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':filename', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':filehash', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':thumb', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':thumbwidth', null, PDO::PARAM_NULL);
|
||||||
|
$query->bindValue(':thumbheight', null, PDO::PARAM_NULL);
|
||||||
|
|
||||||
|
if($post['file_type'] == 'you') {
|
||||||
|
// youtube
|
||||||
|
|
||||||
|
foreach($config['embedding'] as $embed) {
|
||||||
|
if(strpos($embed[0], 'youtube\.com') !== false) {
|
||||||
|
$embed_code = preg_replace($embed[0], $embed[1], 'http://youtube.com/watch?v=' . $post['file']);
|
||||||
|
$embed_code = str_replace('%%tb_width%%', $config['embed_width'], $embed_code);
|
||||||
|
$embed_code = str_replace('%%tb_height%%', $config['embed_height'], $embed_code);
|
||||||
|
|
||||||
|
$query->bindValue(':embed', $embed_code, PDO::PARAM_STR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$query->bindValue(':file', $post['file'] . '.' . $post['file_type'], PDO::PARAM_STR);
|
||||||
|
$query->bindValue(':width', $post['image_w'], PDO::PARAM_INT);
|
||||||
|
$query->bindValue(':height', $post['image_h'], PDO::PARAM_INT);
|
||||||
|
$query->bindValue(':filesize', $post['file_size'], PDO::PARAM_INT);
|
||||||
|
$query->bindValue(':filename', $post['file_original'] . '.' . $post['file_type'], PDO::PARAM_STR);
|
||||||
|
// They use MD5; we use SHA1 by default.
|
||||||
|
$query->bindValue(':filehash', null, PDO::PARAM_NULL);
|
||||||
|
|
||||||
|
$query->bindValue(':thumb', $post['file'] . '.' . $post['file_type'], PDO::PARAM_STR);
|
||||||
|
$query->bindValue(':thumbwidth', $post['thumb_w'], PDO::PARAM_INT);
|
||||||
|
$query->bindValue(':thumbheight', $post['thumb_h'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Copy file
|
||||||
|
$file_path = KU_BOARDSDIR . $board . '/src/' . $post['file'] . '.' . $post['file_type'];
|
||||||
|
$thumb_path = KU_BOARDSDIR . $board . '/thumb/' . $post['file'] . 's.' . $post['file_type'];
|
||||||
|
|
||||||
|
$to_file_path = sprintf($config['board_path'], $board) . $config['dir']['img'] . $post['file'] . '.' . $post['file_type'];
|
||||||
|
$to_thumb_path = sprintf($config['board_path'], $board) . $config['dir']['thumb'] . $post['file'] . '.' . $post['file_type'];
|
||||||
|
|
||||||
|
if(!file_exists($to_file_path)) {
|
||||||
|
$log[] = 'Copying file: <strong>' . $file_path . '</strong>';
|
||||||
|
if(!@copy($file_path, $to_file_path)) {
|
||||||
|
$err = error_get_last();
|
||||||
|
$log[] = 'Could not copy <strong>' . $file_path . '</strong>: ' . $err['message'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!file_exists($to_thumb_path)) {
|
||||||
|
$log[] = 'Copying file: <strong>' . $thumb_path . '</strong>';
|
||||||
|
if(!@copy($thumb_path, $to_thumb_path)) {
|
||||||
|
$err = error_get_last();
|
||||||
|
$log[] = 'Could not copy <strong>' . $thumb_path. '</strong>: ' . $err['message'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$embed_code)
|
||||||
|
$query->bindValue(':embed', null, PDO::PARAM_NULL);
|
||||||
|
|
||||||
|
// IP
|
||||||
|
$ip = md5_decrypt($post['ip'], KU_RANDOMSEED);
|
||||||
|
if(!preg_match('/^\d+\.\d+\.\d+\.\d+$/', $ip)) {
|
||||||
|
// Invalid IP address. Wrong KU_RANDOMSEED?
|
||||||
|
|
||||||
|
$log[] = 'Invalid IP address returned after decryption. Wrong KU_RANDOMSEED?';
|
||||||
|
$ip = '0.0.0.0'; // just set it to something valid and continue
|
||||||
|
}
|
||||||
|
$query->bindValue(':ip', $ip, PDO::PARAM_STR);
|
||||||
|
|
||||||
|
// Time (`timestamp`)
|
||||||
|
$query->bindValue(':time', $post['timestamp'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Bump (`bumped`)
|
||||||
|
$query->bindValue(':bump', $post['bumped'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Locked
|
||||||
|
$query->bindValue(':locked', $post['locked'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Sticky
|
||||||
|
$query->bindValue(':sticky', $post['stickied'], PDO::PARAM_INT);
|
||||||
|
|
||||||
|
// Impossible
|
||||||
|
$query->bindValue(':password', null, PDO::PARAM_NULL);
|
||||||
|
|
||||||
|
if($post['posterauthority']) {
|
||||||
|
$query->bindValue(':capcode', $post['type'] == 1 ? 'Admin' : 'Mod', PDO::PARAM_STR);
|
||||||
|
} else {
|
||||||
|
$query->bindValue(':capcode', null, PDO::PARAM_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insert post
|
||||||
|
$query->execute() or $log[] = 'Error: ' . db_error($query);
|
||||||
|
}
|
||||||
|
|
||||||
|
// News
|
||||||
|
$k_query = $kusabax->query('SELECT * FROM `' . KU_DBPREFIX . 'front` WHERE `page` = 0');
|
||||||
|
while($news = $k_query->fetch()) {
|
||||||
|
// Check if already exists
|
||||||
|
$query = prepare("SELECT 1 FROM `news` WHERE `body` = :body AND `time` = :time");
|
||||||
|
$query->bindValue(':time', $news['timestamp'], PDO::PARAM_INT);
|
||||||
|
$query->bindValue(':body', $news['message'], PDO::PARAM_STR);
|
||||||
|
$query->execute() or error(db_error($query));
|
||||||
|
if($query->fetch())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$query = prepare("INSERT INTO `news` VALUES (NULL, :name, :time, :subject, :body)");
|
||||||
|
$query->bindValue(':name', $news['poster'], PDO::PARAM_STR);
|
||||||
|
$query->bindValue(':time', $news['timestamp'], PDO::PARAM_INT);
|
||||||
|
$query->bindValue(':subject', $news['subject'], PDO::PARAM_STR);
|
||||||
|
$query->bindValue(':body', $news['message'], PDO::PARAM_STR);
|
||||||
|
$query->execute() or $log[] = 'Error: ' . db_error($query);
|
||||||
|
}
|
||||||
|
|
||||||
|
$page['body'] = '<div class="ban"><h2>Migrating…</h2><p>';
|
||||||
|
foreach($log as &$l) {
|
||||||
|
$page['body'] .= $l . '<br/>';
|
||||||
|
}
|
||||||
|
$page['body'] .= '</p></div>';
|
||||||
|
|
||||||
|
echo Element('page.html', $page);
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
/**
|
||||||
|
* dark.css
|
||||||
|
* For AwsumChan by Circlepuller
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
background: #1E1E1E;
|
||||||
|
color: #999999;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 20pt;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
}
|
||||||
|
div.title, h1 {
|
||||||
|
color: lime;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
div.title p {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
a:link, a:visited, p.intro a.email span.name {
|
||||||
|
color: #CCCCCC;
|
||||||
|
text-decoration: underline;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
a:link:hover, a:visited:hover {
|
||||||
|
color: #FF0000;
|
||||||
|
font-family: sans-serif;
|
||||||
|
text-decoration: underline overline;
|
||||||
|
}
|
||||||
|
a.post_no {
|
||||||
|
color: #AAAAAA;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a.post_no:hover {
|
||||||
|
color: maroon;
|
||||||
|
text-decoration: underline overline;
|
||||||
|
}
|
||||||
|
div.post.reply {
|
||||||
|
background: #333333;
|
||||||
|
border: #555555 1px solid;
|
||||||
|
}
|
||||||
|
div.post.reply.highlighted {
|
||||||
|
background: transparent;
|
||||||
|
border: transparent 0px solid;
|
||||||
|
}
|
||||||
|
div.post.reply p.body a:link, div.post.reply p.body a:visited {
|
||||||
|
color: #CCCCCC;
|
||||||
|
}
|
||||||
|
div.post.reply p.body a:link:hover, div.post.reply p.body a:visited:hover {
|
||||||
|
color: #FF0000;
|
||||||
|
}
|
||||||
|
p.intro span.subject {
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: sans-serif;
|
||||||
|
color: #446655;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
p.intro span.name {
|
||||||
|
color: #00CC00;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
p.intro a.capcode, p.intro a.nametag {
|
||||||
|
color: magenta;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
p.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name {
|
||||||
|
color: #00CCCC;
|
||||||
|
}
|
||||||
|
input[type="text"], textarea, select {
|
||||||
|
background: #333333;
|
||||||
|
color: #CCCCCC;
|
||||||
|
border: #666666 1px solid;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: -5px;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
input[type="password"] {
|
||||||
|
background: #333333;
|
||||||
|
color: #CCCCCC;
|
||||||
|
border: #666666 1px solid;
|
||||||
|
}
|
||||||
|
form table tr th {
|
||||||
|
background: #333333;
|
||||||
|
color: #AAAAAA;
|
||||||
|
font-weight: 800;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
div.banner {
|
||||||
|
background: #00AA00;
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-align: center;
|
||||||
|
width: 250px;
|
||||||
|
padding: 4px;
|
||||||
|
padding-left: 12px;
|
||||||
|
padding-right: 12px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
input[type="submit"] {
|
||||||
|
background: #333333;
|
||||||
|
border: #888888 1px solid;
|
||||||
|
color: #CCCCCC;
|
||||||
|
}
|
||||||
|
input[type="submit"]:hover {
|
||||||
|
background: #555555;
|
||||||
|
border: #888888 1px solid;
|
||||||
|
color: #FF0000;
|
||||||
|
}
|
||||||
|
p.fileinfo a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
span.trip {
|
||||||
|
color: #AAAAAA;
|
||||||
|
}
|
||||||
|
div.pages {
|
||||||
|
color: #AAAAAA;
|
||||||
|
background: #333333;
|
||||||
|
border: #666666 1px solid;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
div.pages a.selected {
|
||||||
|
color: #CCCCCC;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
height: 1px;
|
||||||
|
border: #333333 1px solid;
|
||||||
|
}
|
||||||
|
div.boardlist {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
div.ban {
|
||||||
|
background-color: transparent;
|
||||||
|
border: transparent 0px solid;
|
||||||
|
}
|
||||||
|
div.ban h2 {
|
||||||
|
background: transparent;
|
||||||
|
color: lime;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
table.modlog tr th {
|
||||||
|
background: #333333;
|
||||||
|
color: #AAAAAA;
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
/* +piwnichan style, based on futaba.css of Tinyboard */
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: #ffe;
|
||||||
|
color: #800000;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
div.title h1 {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
div.title p {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
div.pages {
|
||||||
|
font-size: 13px !important;
|
||||||
|
}
|
||||||
|
a:link, a:visited, p.intro a.email span.name {
|
||||||
|
color: #0000ff;
|
||||||
|
font-size: inherit;
|
||||||
|
text-decoration: inherit;
|
||||||
|
}
|
||||||
|
a:link:hover {
|
||||||
|
color: #d00;
|
||||||
|
text-decoration: inherit;
|
||||||
|
}
|
||||||
|
span.omitted {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
a.post_no {
|
||||||
|
color: #800000;
|
||||||
|
}
|
||||||
|
div.post.reply {
|
||||||
|
border: 0px;
|
||||||
|
background: #f0e0d6;
|
||||||
|
}
|
||||||
|
div.post.reply.highlighted {
|
||||||
|
background: #f0c0b0;
|
||||||
|
border-color: #d9bfb7;
|
||||||
|
}
|
||||||
|
div.post.reply p.body a {
|
||||||
|
color: navy;
|
||||||
|
}
|
||||||
|
p.intro span.subject {
|
||||||
|
color: #d00;
|
||||||
|
}
|
||||||
|
form table tr th {
|
||||||
|
background: #EA8;
|
||||||
|
}
|
||||||
|
div.ban h2 {
|
||||||
|
background: #FCA;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
div.ban {
|
||||||
|
border-color: #800;
|
||||||
|
}
|
||||||
|
div.ban p {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
div.pages {
|
||||||
|
padding: 7px 5px;
|
||||||
|
color: maroon;
|
||||||
|
font-size: 12pt;
|
||||||
|
|
||||||
|
background: none;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: inset;
|
||||||
|
|
||||||
|
}
|
||||||
|
div.pages a.selected {
|
||||||
|
color: #800;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: inset;
|
||||||
|
}
|
||||||
|
div.boardlist {
|
||||||
|
color: #B86;
|
||||||
|
}
|
||||||
|
div.boardlist a {
|
||||||
|
color: #800;
|
||||||
|
}
|
||||||
|
unimportant, .unimportant * {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
table.modlog tr th {
|
||||||
|
background: #EA8;
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 234 B |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 143 B |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 292 B |
|
After Width: | Height: | Size: 6.4 KiB |
@@ -0,0 +1,87 @@
|
|||||||
|
/**
|
||||||
|
* miku.css
|
||||||
|
* For AwsumChan by Circlepuller
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
background: #D2FFEE url('img/fade-miku.png') top repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link, a:visited {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #0093AB;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link:hover, a:visited:hover {
|
||||||
|
color: #DD0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.post_no {
|
||||||
|
color: #000033;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.intro a.email span.name {
|
||||||
|
color: #0093AB;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.intro a.email:hover span.name {
|
||||||
|
color: #DD0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2, div.title, h1 {
|
||||||
|
color: #800000;
|
||||||
|
}
|
||||||
|
|
||||||
|
form table tr th {
|
||||||
|
background: #95D2D3;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.banner {
|
||||||
|
background-color: #E04000;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.post.op hr {
|
||||||
|
border-color: #B7C9D5;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.intro span.subject {
|
||||||
|
color: #117743;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.intro span.name {
|
||||||
|
color: #117743;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.post.reply.highlighted {
|
||||||
|
background: #9988EE;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.post.reply {
|
||||||
|
background: #B6DDDE;
|
||||||
|
border-color: #8FCCCD;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.ban {
|
||||||
|
border: 1px solid #0093AB;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.ban h2 {
|
||||||
|
background: #B6DDDE;
|
||||||
|
color: #0093AB;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.pages {
|
||||||
|
color: #8899AA;
|
||||||
|
background: #B6DDDE;
|
||||||
|
border-right: 1px solid #8FCCCD;
|
||||||
|
border-bottom: 1px solid #8FCCCD;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border-color: #B7D9C5;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.boardlist {
|
||||||
|
color: #0093AB;
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
/* +piwnichan style, based on testorange.css from Karachan */
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
color:#bebebe;
|
||||||
|
|
||||||
|
background-color: #1e1e1e;
|
||||||
|
background-image: url('img/testorange_testo.png'), url('img/testorange_top_bg.gif'), url('img/testorange_bg.gif');
|
||||||
|
background-repeat: no-repeat, repeat-x, repeat;
|
||||||
|
background-attachment: fixed, scroll, scroll;
|
||||||
|
background-position: right bottom, 0% 0%, 0% 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link, a:visited, div.post.reply p.body a {
|
||||||
|
color:#ff9100;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:link:hover, a:visited:hover, div.post.reply p.body a:hover {
|
||||||
|
color:#ffff00;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.email span.name {
|
||||||
|
color:#ff9100 !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
color: #000;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
textarea {
|
||||||
|
background: #dedede url('img/testorange_textarea_bg.gif') repeat-x;
|
||||||
|
}
|
||||||
|
input, textarea {
|
||||||
|
border: 1px #fff solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
border: none;
|
||||||
|
background: #707070;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reflink a:hover{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.adminbar {
|
||||||
|
text-align:right;
|
||||||
|
clear:both;
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
clear:both;
|
||||||
|
text-align:center;
|
||||||
|
font-size: 2.5em;
|
||||||
|
color:#ff9100;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
div.title {
|
||||||
|
color:#ff9100;
|
||||||
|
}
|
||||||
|
div.banner, .replymode, .catalogmode {
|
||||||
|
text-align:center;
|
||||||
|
margin: 5px 0 5px 0;
|
||||||
|
padding: 5px 2px 5px 2px;
|
||||||
|
color:#000;
|
||||||
|
font-weight: bold;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
.postblock, form table th {
|
||||||
|
color: #000;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postarea {
|
||||||
|
}
|
||||||
|
.rules {
|
||||||
|
width: 468px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.rules li {
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
text-align:center;
|
||||||
|
font-size:12px;
|
||||||
|
}
|
||||||
|
.passvalid {
|
||||||
|
text-align:center;
|
||||||
|
width:100%;
|
||||||
|
color:#ffffff;
|
||||||
|
}
|
||||||
|
.dellist {
|
||||||
|
font-weight: bold;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
.delbuttons {
|
||||||
|
text-align:center;
|
||||||
|
padding-bottom:4px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.managehead {
|
||||||
|
background-color: #1e1e1e;
|
||||||
|
color: #bebebe;
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
.postlists {
|
||||||
|
background: #000;
|
||||||
|
width:100%;
|
||||||
|
padding:0px;
|
||||||
|
color: #bebebe;
|
||||||
|
}
|
||||||
|
.row1 {
|
||||||
|
background-color: #1e1e1e;
|
||||||
|
color: #bebebe;
|
||||||
|
}
|
||||||
|
.row2 {
|
||||||
|
background: #1e1e1e;
|
||||||
|
color: #bebebe;
|
||||||
|
}
|
||||||
|
.unkfunc {
|
||||||
|
background:inherit;
|
||||||
|
color:#789922;
|
||||||
|
}
|
||||||
|
.filesize {
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
.filetitle {
|
||||||
|
background:inherit;
|
||||||
|
font-size:1.2em;
|
||||||
|
color: #bebebe;
|
||||||
|
font-weight:800;
|
||||||
|
}
|
||||||
|
span.name, .postername {
|
||||||
|
color:#fff !important;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
span.trip, .postertrip {
|
||||||
|
color:#707070;
|
||||||
|
}
|
||||||
|
.oldpost {
|
||||||
|
color:#CC1105;
|
||||||
|
font-weight:800;
|
||||||
|
}
|
||||||
|
.omittedposts {
|
||||||
|
color:#707070;
|
||||||
|
}
|
||||||
|
.reply {
|
||||||
|
padding: 5px;
|
||||||
|
border: 1px #707070 solid !important;
|
||||||
|
background: #282828 !important;
|
||||||
|
|
||||||
|
-webkit-border-radius: 10px;
|
||||||
|
-khtml-border-radius: 10px;
|
||||||
|
-moz-border-radius: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.replyhl {
|
||||||
|
background-color: #1e1e1e;
|
||||||
|
color: #bebebe;
|
||||||
|
}
|
||||||
|
.doubledash {
|
||||||
|
vertical-align:top;
|
||||||
|
clear:both;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
.replytitle {
|
||||||
|
font-size: 1.2em;
|
||||||
|
color:#fff;
|
||||||
|
font-weight:800;
|
||||||
|
}
|
||||||
|
.commentpostername {
|
||||||
|
color: #fff;
|
||||||
|
font-weight:800;
|
||||||
|
}
|
||||||
|
.thumbnailmsg {
|
||||||
|
font-size: small;
|
||||||
|
color: #bebebe;
|
||||||
|
}
|
||||||
|
form table th, div.banner, div.pages, .replymode, .postblock, .passvalid, .catalogmode {
|
||||||
|
background: #ff9100 url('img/testorange_f_bg.gif') repeat-x !important;
|
||||||
|
}
|
||||||
|
div.pages {
|
||||||
|
color: black;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.abbrev {
|
||||||
|
color:#707070;
|
||||||
|
}
|
||||||
|
.highlight {
|
||||||
|
background:#000;
|
||||||
|
border: 1px dashed #ff9100;
|
||||||
|
}
|
||||||
|
|
||||||
|
#watchedthreads {
|
||||||
|
background-color: #282828 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reflinkpreview {
|
||||||
|
background-color: #282828 !important;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,390 @@
|
|||||||
|
/**
|
||||||
|
* wasabi.css
|
||||||
|
* For AwsumChan by Circlepuller
|
||||||
|
*/
|
||||||
|
body {
|
||||||
|
background: #F7F9B0 url('img/fade-yellow.png') repeat-x 50% 0%;
|
||||||
|
color: black;
|
||||||
|
font-family: arial, helvetica, sans-serif;
|
||||||
|
font-size: 10pt;
|
||||||
|
margin: 0 8px;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
table * {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
a:link, a:visited {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #400040;
|
||||||
|
}
|
||||||
|
a:link:hover, a:visited:hover {
|
||||||
|
color: limegreen;
|
||||||
|
}
|
||||||
|
a.post_no {
|
||||||
|
color: black;
|
||||||
|
text-decoration: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
p.intro a.post_no, p.intro a.email {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
p.intro a.email span.name {
|
||||||
|
color: #34345C;
|
||||||
|
}
|
||||||
|
p.intro a.email:hover span.name {
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
p.intro label {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
color: #AF0A0F;
|
||||||
|
font-size: 11pt;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-family: tahoma;
|
||||||
|
letter-spacing: -2px;
|
||||||
|
font-size: 20pt;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
h1.logo img {
|
||||||
|
display: inline;
|
||||||
|
float: none;
|
||||||
|
background-image: url('/static/logo_bg.gif');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
div.title, h1 {
|
||||||
|
color: #AF0A0F;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
div.title {
|
||||||
|
font-size: 8pt;
|
||||||
|
margin-bottom: 2em;
|
||||||
|
}
|
||||||
|
form {
|
||||||
|
margin-bottom: 4em;
|
||||||
|
}
|
||||||
|
form table {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
form table input {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
input[type="text"], input[type="password"], textarea {
|
||||||
|
border: 1px solid #a9a9a9;
|
||||||
|
text-indent: 0px;
|
||||||
|
text-shadow: none;
|
||||||
|
text-transform: none;
|
||||||
|
word-spacing: normal;
|
||||||
|
}
|
||||||
|
form table tr td {
|
||||||
|
text-align: left;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
form table tr th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
form table tr th {
|
||||||
|
background: #D7FE85;
|
||||||
|
}
|
||||||
|
form table tr td div {
|
||||||
|
text-align: center;
|
||||||
|
float: left;
|
||||||
|
padding-left: 3px;
|
||||||
|
}
|
||||||
|
form table tr td div input {
|
||||||
|
display: block;
|
||||||
|
margin: 2px auto 0 auto;
|
||||||
|
}
|
||||||
|
form table tr td div label {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.unimportant, .unimportant * {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
p.fileinfo {
|
||||||
|
display: block;
|
||||||
|
margin: 0px;
|
||||||
|
padding-right: 7em;
|
||||||
|
}
|
||||||
|
div.banner {
|
||||||
|
background-color: #400040;
|
||||||
|
font-size: 12pt;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
margin: 1em 0;
|
||||||
|
}
|
||||||
|
div.banner, div.banner a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
div.banner a:hover {
|
||||||
|
color: #EEF2FF;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
img.banner {
|
||||||
|
float: none;
|
||||||
|
margin: 4px auto 0 auto;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
div.post img {
|
||||||
|
padding: 5px;
|
||||||
|
margin: 5px 20px 0 0;
|
||||||
|
}
|
||||||
|
div.post img.icon {
|
||||||
|
display: inline;
|
||||||
|
float: none;
|
||||||
|
margin: 0 5px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
div.post.op {
|
||||||
|
margin-right: 20px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
div.post.op hr {
|
||||||
|
border-color: #D9BFB7;
|
||||||
|
}
|
||||||
|
p.intro {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
padding: 0;
|
||||||
|
padding-bottom: 0.2em;
|
||||||
|
}
|
||||||
|
input.delete {
|
||||||
|
float: left;
|
||||||
|
margin: 1px 6px 0 0;
|
||||||
|
}
|
||||||
|
p.intro span.subject {
|
||||||
|
color: #0F0C5D;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
p.intro span.name {
|
||||||
|
color: #117743;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
p.intro a.capcode, p.intro a.nametag {
|
||||||
|
color: #F00000;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
p.intro a {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
div.delete {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
div.post.reply p {
|
||||||
|
margin: 0.3em 0 0 0;
|
||||||
|
}
|
||||||
|
div.post.reply p.body {
|
||||||
|
margin-left: 1.8em;
|
||||||
|
margin-top: 0.8em;
|
||||||
|
padding-right: 3em;
|
||||||
|
padding-bottom: 0.3em;
|
||||||
|
}
|
||||||
|
div.post.reply.highlighted {
|
||||||
|
background: greenyellow;
|
||||||
|
}
|
||||||
|
div.post.reply p.body a {
|
||||||
|
color: #D00;
|
||||||
|
}
|
||||||
|
div.post {
|
||||||
|
max-width: 97%;
|
||||||
|
}
|
||||||
|
div.post p.body {
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
div.post.reply {
|
||||||
|
background: #D7FE85;
|
||||||
|
margin: 0.2em 16px;
|
||||||
|
padding: 0.2em 0.3em 0.5em 0.6em;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: none solid solid none;
|
||||||
|
border-color: lightgreen;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
span.trip {
|
||||||
|
color: #228854;
|
||||||
|
}
|
||||||
|
span.quote {
|
||||||
|
color: #789922;
|
||||||
|
}
|
||||||
|
span.omitted {
|
||||||
|
display: block;
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
br.clear {
|
||||||
|
clear: left;
|
||||||
|
}
|
||||||
|
span.controls {
|
||||||
|
float: right;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
span.controls.op {
|
||||||
|
float: none;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
span.controls a {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
div#wrap {
|
||||||
|
width: 900px;
|
||||||
|
margin:0 auto;
|
||||||
|
}
|
||||||
|
div.ban {
|
||||||
|
background-color: white;
|
||||||
|
border: 1px solid #400040;
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 30px auto;
|
||||||
|
}
|
||||||
|
div.ban p, div.ban h2 {
|
||||||
|
padding: 3px 7px;
|
||||||
|
}
|
||||||
|
div.ban h2 {
|
||||||
|
background: #D7FE85;
|
||||||
|
color: #400040;
|
||||||
|
font-size: 12pt;
|
||||||
|
}
|
||||||
|
div.ban p {
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
div.ban p.reason {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
span.heading {
|
||||||
|
color: #AF0A0F;
|
||||||
|
font-size: 11pt;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
span.spoiler {
|
||||||
|
background: black;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
div.post.reply p.body span.spoiler a {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
span.spoiler:hover, div.post.reply p.body span.spoiler:hover a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
div.styles {
|
||||||
|
float: right;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
div.styles a {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
div.styles a.selected {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
table.test {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
table.test td, table.test th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
table.test tr.h th {
|
||||||
|
background: #98E;
|
||||||
|
}
|
||||||
|
table.test td img {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
fieldset label {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
div.pages {
|
||||||
|
color: limegreen;
|
||||||
|
background: #D7FE85;
|
||||||
|
display: inline;
|
||||||
|
padding: 8px;
|
||||||
|
border-right: 1px solid limegreen;
|
||||||
|
border-bottom: 1px solid limegreen;
|
||||||
|
}
|
||||||
|
div.pages a.selected {
|
||||||
|
color: black;
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
div.pages a:link {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
div.pages form {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
div.pages form input {
|
||||||
|
margin: 0 5px;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
hr {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid limegreen;
|
||||||
|
height: 0px;
|
||||||
|
}
|
||||||
|
div.boardlist {
|
||||||
|
color: limegreen;
|
||||||
|
font-size: 9pt;
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
div.boardlist.bottom {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
div.boardlist a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
div.report {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
table.modlog {
|
||||||
|
margin: auto;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
table.modlog tr td {
|
||||||
|
text-align: left;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 4px 15px 0 0;
|
||||||
|
}
|
||||||
|
table.modlog tr th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 4px 15px 5px 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
table.modlog tr th {
|
||||||
|
background: #D7FE85;
|
||||||
|
}
|
||||||
|
td.minimal, th.minimal {
|
||||||
|
width: 1%;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
div.top_notice {
|
||||||
|
text-align: center;
|
||||||
|
margin: 5px auto;
|
||||||
|
}
|
||||||
|
span.public_ban {
|
||||||
|
display: block;
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
span.toolong {
|
||||||
|
display: block;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
div.blotter {
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* benchmark.php - benchmarks thumbnailing methods
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
require dirname(__FILE__) . '/inc/cli.php';
|
||||||
|
require 'inc/image.php';
|
||||||
|
|
||||||
|
// move back to this directory
|
||||||
|
chdir(dirname(__FILE__));
|
||||||
|
|
||||||
|
if(count($argv) != 2)
|
||||||
|
die("Usage: {$argv[0]} [file]\n");
|
||||||
|
|
||||||
|
$file = $argv[1];
|
||||||
|
$extension = strtolower(substr($file, strrpos($file, '.') + 1));
|
||||||
|
$out = tempnam($config['tmp'], 'thumb');
|
||||||
|
$count = 300;
|
||||||
|
|
||||||
|
function benchmark($method) {
|
||||||
|
global $config, $file, $extension, $out, $count;
|
||||||
|
|
||||||
|
$config['thumb_method'] = $method;
|
||||||
|
|
||||||
|
printf("Method: %s\nThumbnailing %d times... ", $method, $count);
|
||||||
|
|
||||||
|
$start = microtime(true);
|
||||||
|
for($i = 0; $i < $count; $i++) {
|
||||||
|
$image = new Image($file, $extension);
|
||||||
|
$thumb = $image->resize(
|
||||||
|
$config['thumb_ext'] ? $config['thumb_ext'] : $extension,
|
||||||
|
$config['thumb_width'],
|
||||||
|
$config['thumb_height']
|
||||||
|
);
|
||||||
|
|
||||||
|
$thumb->to($out);
|
||||||
|
$thumb->_destroy();
|
||||||
|
$image->destroy();
|
||||||
|
}
|
||||||
|
$end = microtime(true);
|
||||||
|
|
||||||
|
printf("Took %.2f seconds (%.2f/second; %.2f ms)\n", $end - $start, $rate = ($count / ($end - $start)), 1000 / $rate);
|
||||||
|
|
||||||
|
unlink($out);
|
||||||
|
}
|
||||||
|
|
||||||
|
benchmark('gd');
|
||||||
|
benchmark('imagick');
|
||||||
|
benchmark('convert');
|
||||||
|
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This script will look for Tinyboard in the following places (in order):
|
||||||
|
* - $TINYBOARD_PATH environment varaible
|
||||||
|
* - ./
|
||||||
|
* - ./Tinyboard/
|
||||||
|
* - ../
|
||||||
|
*/
|
||||||
|
|
||||||
|
set_time_limit(0);
|
||||||
|
$shell_path = getcwd();
|
||||||
|
|
||||||
|
if(getenv('TINYBOARD_PATH') !== false)
|
||||||
|
$dir = getenv('TINYBOARD_PATH');
|
||||||
|
elseif(file_exists('inc/functions.php'))
|
||||||
|
$dir = false;
|
||||||
|
elseif(file_exists('Tinyboard') && is_dir('Tinyboard') && file_exists('Tinyboard/inc/functions.php'))
|
||||||
|
$dir = 'Tinyboard';
|
||||||
|
elseif(file_exists('../inc/functions.php'))
|
||||||
|
$dir = '..';
|
||||||
|
else
|
||||||
|
die("Could not locate Tinyboard directory!\n");
|
||||||
|
|
||||||
|
if($dir && !chdir($dir))
|
||||||
|
die("Could not change directory to {$dir}\n");
|
||||||
|
|
||||||
|
if(!getenv('TINYBOARD_PATH')) {
|
||||||
|
// follow symlink
|
||||||
|
chdir(realpath('inc') . '/..');
|
||||||
|
}
|
||||||
|
|
||||||
|
putenv('TINYBOARD_PATH=' . getcwd());
|
||||||
|
|
||||||
|
require 'inc/functions.php';
|
||||||
|
require 'inc/display.php';
|
||||||
|
require 'inc/template.php';
|
||||||
|
require 'inc/database.php';
|
||||||
|
require 'inc/user.php';
|
||||||
|
require 'inc/mod.php';
|
||||||
|
|
||||||
|
$mod = Array(
|
||||||
|
'id' => -1,
|
||||||
|
'type' => ADMIN,
|
||||||
|
'username' => '?',
|
||||||
|
'boards' => Array('*')
|
||||||
|
);
|
||||||
|
|
||||||
|
function get_httpd_privileges() {
|
||||||
|
global $config, $shell_path, $argv;
|
||||||
|
|
||||||
|
if(php_sapi_name() != 'cli')
|
||||||
|
die("get_httpd_privileges(): invoked from HTTP client.\n");
|
||||||
|
|
||||||
|
echo "Dropping priviledges...\n";
|
||||||
|
|
||||||
|
if(!is_writable('.'))
|
||||||
|
die("get_httpd_privileges(): web directory is not writable\n");
|
||||||
|
|
||||||
|
$filename = '.' . md5(rand()) . '.php';
|
||||||
|
$inc_filename = '.' . md5(rand()) . '.php';
|
||||||
|
|
||||||
|
echo "Copying rebuilder to web directory...\n";
|
||||||
|
|
||||||
|
// replace "/inc/cli.php" with its new filename
|
||||||
|
passthru("cat " . escapeshellarg($shell_path . '/' . $_SERVER['PHP_SELF']) . " | sed \"s/'\/inc\/cli\.php'/'\/{$inc_filename}'/\" > {$filename}");
|
||||||
|
|
||||||
|
$inc_header = "<?php\n";
|
||||||
|
|
||||||
|
// copy environment
|
||||||
|
$env = explode("\n", shell_exec('printenv | grep ^TINYBOARD'));
|
||||||
|
foreach($env as $line) {
|
||||||
|
if(!empty($line))
|
||||||
|
$inc_header .= "putenv('" . addslashes($line) . "');\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy command line arguments
|
||||||
|
$inc_header .= "\$argv = " . var_export($argv, true) . ";\n";
|
||||||
|
|
||||||
|
// copy this file
|
||||||
|
file_put_contents($inc_filename, $inc_header . substr($inc = file_get_contents(__FILE__), strpos($inc, "\n")));
|
||||||
|
|
||||||
|
chmod($filename, 0666);
|
||||||
|
chmod($inc_filename, 0666);
|
||||||
|
|
||||||
|
if(preg_match('/^https?:\/\//', $config['root'])) {
|
||||||
|
$url = $config['root'] . $filename;
|
||||||
|
} elseif($host = getenv('TINYBOARD_HOST')) {
|
||||||
|
$url = 'http://' . $host . $config['root'] . $filename;
|
||||||
|
} else {
|
||||||
|
// assume localhost
|
||||||
|
$url = 'http://localhost' . $config['root'] . $filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Downloading $url\n";
|
||||||
|
|
||||||
|
passthru('curl -s -N ' . escapeshellarg($url));
|
||||||
|
|
||||||
|
unlink($filename);
|
||||||
|
unlink($inc_filename);
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* rebuild.php - rebuilds all static files
|
||||||
|
*
|
||||||
|
* Command line arguments:
|
||||||
|
* -q, --quiet
|
||||||
|
* Suppress output.
|
||||||
|
*
|
||||||
|
* --quick
|
||||||
|
* Do not rebuild posts.
|
||||||
|
*
|
||||||
|
* -b, --board <string>
|
||||||
|
* Rebuild only the specified board.
|
||||||
|
*
|
||||||
|
* -f, --full
|
||||||
|
* Rebuild replies as well as threads (re-markup).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
require dirname(__FILE__) . '/inc/cli.php';
|
||||||
|
|
||||||
|
if(!is_writable($config['file_script'])) {
|
||||||
|
get_httpd_privileges();
|
||||||
|
}
|
||||||
|
|
||||||
|
$start = microtime(true);
|
||||||
|
|
||||||
|
// parse command line
|
||||||
|
$opts = getopt('qfb:', Array('board:', 'quick', 'full', 'quiet'));
|
||||||
|
$options = Array();
|
||||||
|
|
||||||
|
$options['board'] = isset($opts['board']) ? $opts['board'] : (isset($opts['b']) ? $opts['b'] : false);
|
||||||
|
$options['quiet'] = isset($opts['q']) || isset($opts['quiet']);
|
||||||
|
$options['quick'] = isset($opts['quick']);
|
||||||
|
$options['full'] = isset($opts['full']) || isset($opts['f']);
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "== Tinyboard {$config['version']} ==\n";
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Clearing template cache...\n";
|
||||||
|
$twig = new Twig_Environment($loader, Array(
|
||||||
|
'cache' => "{$config['dir']['template']}/cache"
|
||||||
|
));
|
||||||
|
$twig->clearCacheFiles();
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Regenerating theme files...\n";
|
||||||
|
rebuildThemes('all');
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Generating Javascript file...\n";
|
||||||
|
buildJavascript();
|
||||||
|
|
||||||
|
$main_js = $config['file_script'];
|
||||||
|
|
||||||
|
$boards = listBoards();
|
||||||
|
|
||||||
|
foreach($boards as &$board) {
|
||||||
|
if($options['board'] && $board['uri'] != $options['board'])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Opening board /{$board['uri']}/...\n";
|
||||||
|
openBoard($board['uri']);
|
||||||
|
|
||||||
|
if($config['file_script'] != $main_js) {
|
||||||
|
// different javascript file
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Generating Javascript file...\n";
|
||||||
|
buildJavascript();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Creating index pages...\n";
|
||||||
|
buildIndex();
|
||||||
|
|
||||||
|
if($options['quick'])
|
||||||
|
continue; // do no more
|
||||||
|
|
||||||
|
if($options['full']) {
|
||||||
|
$query = query(sprintf("SELECT `id` FROM `posts_%s`", $board['uri'])) or error(db_error());
|
||||||
|
while($post = $query->fetch()) {
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Rebuilding #{$post['id']}...\n";
|
||||||
|
rebuildPost($post['id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error());
|
||||||
|
while($post = $query->fetch()) {
|
||||||
|
if(!$options['quiet'])
|
||||||
|
echo "Rebuilding #{$post['id']}...\n";
|
||||||
|
buildThread($post['id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$options['quiet'])
|
||||||
|
printf("Complete! Took %g seconds\n", microtime(true) - $start);
|
||||||
|
|
||||||
|
unset($board);
|
||||||
|
modLog('Rebuilt everything using tools/rebuild.php');
|
||||||
|
|
||||||