Previous Thread
Next Thread
Print Thread
Hop To
#220950 01/09/2009 3:56 PM
Joined: Dec 2008
Posts: 14
S
stranger
stranger
S Offline
Joined: Dec 2008
Posts: 14
There is a minor bug in the javascript code for hiding/showing categories. When you click to hide an entry in the cookie is stored as |cat3|. But, when it is displayed again, the cat3 is removed, but the || are not. So, after many hide/shows you will get a cookie that looks like ||||||||||||||||||||cat3|||||||cat2|||||||||||cat1|. This can eventually get too large to function. It is easy to fix.
In ubb_jslib.js

In the function showHideblock(), at the very end before the setcookie statement, you can add the following code.

Code
var intIndexOfMatch = newCookie.indexOf( "||" );
while (intIndexOfMatch != -1){
   newCookie = newCookie.replace( "||", "|" );
   intIndexOfMatch = newCookie.indexOf( "||" );
}

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
good catch, but i'd suggest changing 1 line of code (line 194?):

from:
Code
setCookie('ubbt_collapsed',newCookie);
to:
Code
setCookie('ubbt_collapsed',newCookie.replace('||','|'));



Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Selling a Forum?
by ECNet - 10/10/2026 10:54 AM
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Who's Online Now
0 members (), 297 guests, and 145 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)