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
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (1 invisible), 920 guests, and 238 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)