diff --git a/classes/text.class.php b/classes/text.class.php index 5990ebbc..93afee70 100644 --- a/classes/text.class.php +++ b/classes/text.class.php @@ -138,6 +138,8 @@ class Text { * @return string */ public static function full_format($Str, $OutputTOC = true, $Min = 3) { + global $Debug; + $Debug->set_flag('BBCode start'); $Str = display_str($Str); self::$Headlines = array(); @@ -166,6 +168,7 @@ public static function full_format($Str, $OutputTOC = true, $Min = 3) { $HTML = self::parse_toc($Min) . $HTML; } + $Debug->set_flag('BBCode end'); return $HTML; } @@ -277,6 +280,7 @@ private static function parse($Str) { $Len = strlen($Str); $Array = array(); $ArrayPos = 0; + $StrLC = strtolower($Str); while ($i < $Len) { $Block = ''; @@ -393,7 +397,7 @@ private static function parse($Str) { // Every time we find an internal open tag of the same type, search for the next close tag // (as the first close tag won't do - it's been opened again) do { - $CloseTag = stripos($Str, "[/$TagName]", $CloseTag + 1); + $CloseTag = strpos($StrLC, "[/$TagName]", $CloseTag + 1); if ($CloseTag === false) { $CloseTag = $Len; break; diff --git a/classes/torrents.class.php b/classes/torrents.class.php index c630ad35..97641b0d 100644 --- a/classes/torrents.class.php +++ b/classes/torrents.class.php @@ -523,6 +523,7 @@ public static function update_hash($GroupID) { G::$Cache->delete_value("torrents_details_$GroupID"); G::$Cache->delete_value("torrent_group_$GroupID"); + G::$Cache->delete_value("torrent_group_light_$GroupID"); $ArtistInfo = Artists::get_artist($GroupID); foreach ($ArtistInfo as $Importances => $Importance) { diff --git a/sections/artist/artist.php b/sections/artist/artist.php index 7b452d4e..f25eb18e 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -399,9 +399,13 @@ function compare($X, $Y) {
- Remove bookmark + + Remove bookmark + - Bookmark + + Bookmark + + Remove bookmark + + Bookmark + DL - Reported - - Remove bookmark - - Bookmark - + + Remove bookmark + + + Bookmark + +
format()?>
diff --git a/sections/top10/votes.php b/sections/top10/votes.php index cea25e52..f579d61f 100644 --- a/sections/top10/votes.php +++ b/sections/top10/votes.php @@ -219,9 +219,13 @@ - Remove bookmark + + Remove bookmark + - Bookmark + + Bookmark +
format()?>
diff --git a/sections/torrents/browse.php b/sections/torrents/browse.php index 881895cd..5268bc7a 100644 --- a/sections/torrents/browse.php +++ b/sections/torrents/browse.php @@ -990,9 +990,13 @@ function header_link($SortKey, $DefaultWay = 'desc') {
- Remove bookmark + + Remove bookmark + - Bookmark + + Bookmark +
format('torrents.php?'.$Action.'&taglist=')?>
diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php index bec5fab6..958739b8 100644 --- a/sections/torrents/notify.php +++ b/sections/torrents/notify.php @@ -314,11 +314,13 @@ function header_link($SortKey, $DefaultWay = 'desc') { New!'; } ?> - - Remove bookmark + + Remove bookmark + - Bookmark + + Bookmark
diff --git a/static/functions/ajax.class.js b/static/functions/ajax.class.js index 59778933..68885cec 100644 --- a/static/functions/ajax.class.js +++ b/static/functions/ajax.class.js @@ -116,26 +116,15 @@ var ajax = { }; //Bookmarks function Bookmark(type, id, newName) { - if (window.location.pathname.indexOf('top10.php') != -1 || window.location.search.indexOf('?action=notify') != -1) { - var oldName = $('#bookmarklink_' + type + '_' + id).raw().innerHTML; - ajax.get("bookmarks.php?action=add&type=" + type + "&auth=" + authkey + "&id=" + id, function() { - var bookmarklinks = $('#bookmarklink_' + type + '_' + id); - for (var i = 0; i < bookmarklinks.results(); i++) { - $(bookmarklinks[i].parentNode.parentNode.parentNode).add_class('bookmarked'); - bookmarklinks[i].onclick = function() { Unbookmark(type, id, oldName); return false; }; - bookmarklinks[i].innerHTML = newName; - bookmarklinks[i].title = 'Remove bookmark'; - } + var bmLinks = $('#bookmarklink_' + type + '_' + id + ', .bookmarklink_' + type + '_' + id); + var oldName = bmLinks.html(); + ajax.get("bookmarks.php?action=add&type=" + type + "&auth=" + authkey + "&id=" + id, function() { + bmLinks.parent('.remove_bookmark, .add_bookmark').toggleClass('add_bookmark remove_bookmark'); + bmLinks.html(newName).attr('title', 'Remove bookmark').removeAttr('onclick').off('click').click(function() { + Unbookmark(type, id, oldName); + return false; }); - } else { - var lnk = $('#bookmarklink_' + type + '_' + id).raw(); - var oldName = lnk.innerHTML; - ajax.get("bookmarks.php?action=add&type=" + type + "&auth=" + authkey + "&id=" + id, function() { - lnk.onclick = function() { Unbookmark(type, id, oldName); return false; }; - lnk.innerHTML = newName; - lnk.title = 'Remove bookmark'; - }); - } + }); } function Unbookmark(type, id, newName) { @@ -145,24 +134,15 @@ function Unbookmark(type, id, newName) { $('.groupid_' + id).remove(); $('.bookmark_' + id).remove(); }); - } else if (window.location.pathname.indexOf('top10.php') != -1 || window.location.search.indexOf('?action=notify') != -1) { - var oldName = $('#bookmarklink_' + type + '_' + id).raw().innerHTML; - ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function() { - var bookmarklinks = $('#bookmarklink_' + type + '_' + id); - for (var i = 0; i < bookmarklinks.results(); i++) { - $(bookmarklinks[i].parentNode.parentNode.parentNode).remove_class('bookmarked'); - bookmarklinks[i].onclick = function() { Bookmark(type, id, oldName); return false; }; - bookmarklinks[i].innerHTML = newName; - bookmarklinks[i].title = 'Add bookmark'; - } - }); } else { - var lnk = $('#bookmarklink_' + type + '_' + id).raw(); - var oldName = lnk.innerHTML; + var bmLinks = $('#bookmarklink_' + type + '_' + id + ', .bookmarklink_' + type + '_' + id); + var oldName = bmLinks.html(); ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function() { - lnk.onclick = function() { Bookmark(type, id, oldName); return false; }; - lnk.innerHTML = newName; - lnk.title = 'Add bookmark'; + bmLinks.parent('.remove_bookmark, .add_bookmark').toggleClass('add_bookmark remove_bookmark'); + bmLinks.html(newName).attr('title', 'Add bookmark').removeAttr('onclick').off('click').click(function() { + Bookmark(type, id, oldName); + return false; + }); }); } } diff --git a/static/functions/sizzle.js b/static/functions/sizzle.js deleted file mode 100644 index 38f208d9..00000000 --- a/static/functions/sizzle.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Sizzle CSS Selector Engine - v1.0 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,o=false;var b=function(E,u,B,w){B=B||[];var e=u=u||document;if(u.nodeType!==1&&u.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var C=[],D,z,H,G,A,t,s=true,x=p(u);q.lastIndex=0;while((D=q.exec(E))!==null){C.push(D[1]);if(D[2]){t=RegExp.rightContext;break}}if(C.length>1&&j.exec(E)){if(C.length===2&&f.relative[C[0]]){z=g(C[0]+C[1],u)}else{z=f.relative[C[0]]?[u]:b(C.shift(),u);while(C.length){E=C.shift();if(f.relative[E]){E+=C.shift()}z=g(E,z)}}}else{if(!w&&C.length>1&&u.nodeType===9&&!x&&f.match.ID.test(C[0])&&!f.match.ID.test(C[C.length-1])){var I=b.find(C.shift(),u,x);u=I.expr?b.filter(I.expr,I.set)[0]:I.set[0]}if(u){var I=w?{expr:C.pop(),set:a(w)}:b.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&u.parentNode?u.parentNode:u,x);z=I.expr?b.filter(I.expr,I.set):I.set;if(C.length>0){H=a(z)}else{s=false}while(C.length){var v=C.pop(),y=v;if(!f.relative[v]){v=""}else{y=C.pop()}if(y==null){y=u}f.relative[v](H,y,x)}}else{H=C=[]}}if(!H){H=z}if(!H){throw"Syntax error, unrecognized expression: "+(v||E)}if(d.call(H)==="[object Array]"){if(!s){B.push.apply(B,H)}else{if(u&&u.nodeType===1){for(var F=0;H[F]!=null;F++){if(H[F]&&(H[F]===true||H[F].nodeType===1&&h(u,H[F]))){B.push(z[F])}}}else{for(var F=0;H[F]!=null;F++){if(H[F]&&H[F].nodeType===1){B.push(z[F])}}}}}else{a(H,B)}if(t){b(t,e,B,w);b.uniqueSort(B)}return B};b.uniqueSort=function(s){if(c){o=false;s.sort(c);if(o){for(var e=1;e":function(x,s,y){var v=typeof s==="string";if(v&&!/\W/.test(s)){s=y?s:s.toUpperCase();for(var t=0,e=x.length;t=0)){if(!t){e.push(w)}}else{if(t){s[v]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(s,e){for(var t=0;e[t]===false;t++){}return e[t]&&p(e[t])?s[1]:s[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(s[1]+(s[2]||1))-0;e[3]=s[3]-0}e[0]=i++;return e},ATTR:function(v,s,t,e,w,x){var u=v[1].replace(/\\/g,"");if(!x&&f.attrMap[u]){v[1]=f.attrMap[u]}if(v[2]==="~="){v[4]=" "+v[4]+" "}return v},PSEUDO:function(v,s,t,e,w){if(v[1]==="not"){if(q.exec(v[3]).length>1||/^\w/.test(v[3])){v[3]=b(v[3],null,null,s)}else{var u=b.filter(v[3],s,t,true^w);if(!t){e.push.apply(e,u)}return false}}else{if(f.match.POS.test(v[0])||f.match.CHILD.test(v[0])){return true}}return v},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(t,s,e){return !!b(e[3],t).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(s,e){return e===0},last:function(t,s,e,u){return s===u.length-1},even:function(s,e){return e%2===0},odd:function(s,e){return e%2===1},lt:function(t,s,e){return se[3]-0},nth:function(t,s,e){return e[3]-0==s},eq:function(t,s,e){return e[3]-0==s}},filter:{PSEUDO:function(w,s,t,x){var e=s[1],u=f.filters[e];if(u){return u(w,t,s,x)}else{if(e==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(e==="not"){var v=s[3];for(t=0,l=v.length;t=0)}}},ID:function(s,e){return s.nodeType===1&&s.getAttribute("id")===e},TAG:function(s,e){return(e==="*"&&s.nodeType===1)||s.nodeName===e},CLASS:function(s,e){return(" "+(s.className||s.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(w,u){var t=u[1],e=f.attrHandle[t]?f.attrHandle[t](w):w[t]!=null?w[t]:w.getAttribute(t),x=e+"",v=u[2],s=u[4];return e==null?v==="!=":v==="="?x===s:v==="*="?x.indexOf(s)>=0:v==="~="?(" "+x+" ").indexOf(s)>=0:!s?x&&e!==false:v==="!="?x!=s:v==="^="?x.indexOf(s)===0:v==="$="?x.substr(x.length-s.length)===s:v==="|="?x===s||x.substr(0,s.length+1)===s+"-":false},POS:function(v,s,t,w){var e=s[2],u=f.setFilters[e];if(u){return u(v,t,s,w)}}}};var j=f.match.POS;for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(s,e){s=Array.prototype.slice.call(s,0);if(e){e.push.apply(e,s);return e}return s};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(k){a=function(v,u){var s=u||[];if(d.call(v)==="[object Array]"){Array.prototype.push.apply(s,v)}else{if(typeof v.length==="number"){for(var t=0,e=v.length;t";var e=document.documentElement;e.insertBefore(s,e.firstChild);if(!!document.getElementById(t)){f.find.ID=function(v,w,x){if(typeof w.getElementById!=="undefined"&&!x){var u=w.getElementById(v[1]);return u?u.id===v[1]||typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id").nodeValue===v[1]?[u]:undefined:[]}};f.filter.ID=function(w,u){var v=typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id");return w.nodeType===1&&v&&v.nodeValue===u}}e.removeChild(s);e=s=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(s,w){var v=w.getElementsByTagName(s[1]);if(s[1]==="*"){var u=[];for(var t=0;v[t];t++){if(v[t].nodeType===1){u.push(v[t])}}v=u}return v}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(s){return s.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,t=document.createElement("div");t.innerHTML="

";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0){return}b=function(x,w,u,v){w=w||document;if(!v&&w.nodeType===9&&!p(w)){try{return a(w.querySelectorAll(x),u)}catch(y){}}return e(x,w,u,v)};for(var s in e){b[s]=e[s]}t=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="
";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(s,t,u){if(typeof t.getElementsByClassName!=="undefined"&&!u){return t.getElementsByClassName(s[1])}};e=null})()}function n(s,x,w,B,y,A){var z=s=="previousSibling"&&!A;for(var u=0,t=B.length;u0){v=e;break}}}e=e[s]}B[u]=v}}}var h=document.compareDocumentPosition?function(s,e){return s.compareDocumentPosition(e)&16}:function(s,e){return s!==e&&(s.contains?s.contains(e):true)};var p=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,y){var u=[],v="",w,t=y.nodeType?[y]:y;while((w=f.match.PSEUDO.exec(e))){v+=w[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,s=t.length;x