PDA

View Full Version : A bit of JS/XHTML help here :D


Chris M
07-15-2005, 06:45 PM
I looked at an [expand] tag for vB 3.0.7 and decided that I could do it without any code modifications whatsoever!

However I have become stuck :p

After adding the tag and the replacement code to create a collapsable / expandable box, using vB's expand/contract js functions, I realised something...

If the [expand] tag is used more than once per page there will be conflict, as both boxes will have the same id :ermm:

So I fixed this by adding the {option} variable to the id of the box...

Then I thought "Well if someone uses the same box name elsewhere in the post and/or page of that thread, it will break again"...

I've been trying to add a "randomnumber" function, but I'm stuck - I need to generate (and use) a random number in the id part of the table so that it never becomes a duplicate...

Any tips/ideas/pointers? :)

Satan

deathemperor
07-16-2005, 12:46 PM
gimme your [expand] code and I'll test it for you, have just thought of an idea.

Chris M
07-16-2005, 01:43 PM
You've got mail!.... Or a PM, whatever:p

Satan

deathemperor
07-16-2005, 02:09 PM
Well, I figure it became impossible to do so, because you can't use PHP varibles in bbcode. As the $vbcollapse you used it doesn't return the value, hence if you collapsed/expanded it after a refresh everything will revert back.

So without modifying any code I don't think this is possible.

my idea was to use $post[postid] varible, lol ^^