1

Topic: Java

So I've been integrating some Java into my PunBB board and I've come across a problem. I made the options in post.php collapsable.

as so http://img228.imageshack.us/img228/4711/punoptions8sk.png


The code I changed was

            </div>
            <div class="inform">
                <fieldset>
                    <legend><?php echo $lang_common['Options'] ?></legend>
                    <div class="infldset">
                        <div class="rbox">
                            <?php echo implode('<br /></label>'."\n\t\t\t\t", $checkboxes).'<br /></label>'."\n" ?>
                        </div>
                    </div>
                </fieldset>
<?php

}

?>
            </div>
            <p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
        </form>
    </div>
</div>

to


<div id="ido996" class="file" style="display:<?php echo  $div_ido?>">
            <h2>
                <span style="float:right"><a href="javascript:togglecategory(996, 0);"><img src="img/exp_down.png" alt="Expand" /></a></span>
                <span><?php echo  $lang_common['Options'] ?></span>
            </h2>
        </div>
        <div id="idx996" class="file" style="display:<?php echo  $div_idx?>">
            <h2>
                <span style="float:right"><a href="javascript:togglecategory(996, 1);"><img src="img/exp_up.png" alt="Collapse" /></a></span>
                <span><?php echo  $lang_common['Options'] ?></span>
            </h2>
                <div class="inform">
                    <div class="infldset" style="padding:10px;">
                        <div class="rbox">
                            <?php echo  implode('<br /></label>'."\n\t\t\t\t", $checkboxes).'<br /></label>'."\n" ?>
                        </div>
                    </div>
                </fieldset>
<?php

}

?>
    </div>
            </div><br />
            <input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" />
            <input type="submit" name="preview" onclick="ClearUploadSlots();" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" />
            <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a>
    </div>
</div>
<br />

But i can't get rid of the double bar and it won't remember which you selected.

Re: Java

Well, it's JavaScript, not Java.
Then, there already is a mod for this tongue

3

Re: Java

I know of a collapsble catagories mod. But I'm also trying to get better at write scripting languages. And I know the difference between java and javascript but that dosen't help me fix the problem by pointing it out.

Re: Java

But it is an important distinction for people looking to help wink

Now the reason you have a "double bar" (I assume you mean Options bar twice) is because you have it twice in your code. And where's the javascript? I don't see any of the actual javascript code in there

5 (edited by Jimi 2006-06-16 22:01)

Re: Java

Its there twicw because one is collapse and the other is expand.


When you click on either one, one dissapears and the code  works normally after that but i can't figure out how to get just one to apear when you veiw the page.

Re: Java

Don't have it twice in your code? Have it expanded (or not) by default