Quote:
Originally posted by Arsenik
I was talking about the Users them selves and not only the Admin of the board.
I mean have the members edit their options and be able to use the settings the Admin selected by default or just not to use it at all if they dont want to. And also have the members be able to select what category they want collapsed or expanded like the Admin but in their own user options and be keept in the db since Collapsing and Expanding the forums on the fly doesnt work well. (the changes arent remembered)
Right now the hack keeps in the db the settings the Admin selects but not what the Members select thats what i was wanting to say. My bad if i wasnt clear.
|
Um no the users choice to expand or contract a forum
is saved in the database with the hack as it exisits currently. This is in addition to admins being able to choose the forums to collapse by default. The the defaults are just that a user overridable default.
To make it clear exactly how this is achived I'll go through the function found in the
current version line by line
PHP Code:
function dostatesaveXP (forumID, value) {
var ifrm;
if (document.getElementById("colapser")) { <- does the iframe element exist?
// okay iframe exists
document.getElementById("colapser").setAttribute("src", "updateindex.php?s=$session[sessionhash]&fid="+forumID+"&val="+value); <- set the iframe's SRC to load the preferance update.
document.getElementById("colapser").style.visibility="visible"; <- make iframe visible
document.getElementById("colapser").style.display="inline"; <- display iframe
document.getElementById("colapser").style.visibility="hidden"; <- make iframe invisible
document.getElementById("colapser").style.display="none"; <- hide iframe
} else { <- no iframe exists lets make one :)
ifrm = document.createElement("IFRAME"); <- create the iframe
ifrm.setAttribute("id","colapser"); <- set its unque identifier
ifrm.setAttribute("src", "updateindex.php?s=$session[sessionhash]&fid="+forumID+"&val="+value); <- set the iframe's SRC to load the preferance update.
ifrm.style.width = 80+"px"; <- make the iframe small
ifrm.style.height = 30+"px"; <- make the iframe small
// ifrm.onload = hideframe; <- commented out, useless currently as IE doesn't support this
document.body.appendChild(ifrm); <- append the iframe into the document
document.getElementById("colapser").style.visibility="hidden"; <- make frame invisible
document.getElementById("colapser").style.display="none"; <- hide frame
}
}
Now for clarity the diference between display and visibility is display controls the box visiblity whilst visibility controls the element visiblity.. A display value of none with visibilty of visible would still leave the element visible, but out of "flow" with the other elements. Just like a display value of inline and visibility of hidden would hide the element but leave it's box behind leaving a empty "hole" in the page.