5
yeah thanks guys.. i figured it out by viewin his source on his page.. been tryin to implement into my own theme.. and i've just about done it..
so if anyone else wants to implement into their existing theme then >
enter this into the head section of theme.html
<script type="text/javascript">
<!--
var getById = (typeof document.getElementById != "undefined");
function toggleDisplay(objname, display1, display2) {
if (!getById) {
return;
}
obj = getRef(objname);
if (obj.style.display == display2) {
obj.style.display = display1;
}
else
{
obj.style.display = display2;
}
// Set cookie
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
ckstr = escape(obj.style.display);
SetCookie("disp_" + objname, ckstr, expdate, "/");
}
function getRef(obj) {
if (getById) {
return(typeof obj == "string") ? document.getElementById(obj) : obj;
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf(";", offset);
if (endstr == -1) {
endstr = document.cookie.length;
}
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg) {
return getCookieVal (j);
}
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) {
break;
}
}
return null;
}
function SetCookie(name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
//-->
</script>
then where u want the switch buttons in the main body use something similar to this >
<td id="headerbar" width=5%><img src="<{$xoops_imageurl}>images/swich.gif" width="23" height="24" alt="Left Block Control" style="cursor: pointer" onclick="toggleDisplay('leftcolumn', 'block', 'none')" /></td>
<td id="headerbar" width=5%><img src="<{$xoops_imageurl}>images/swich.gif" width="23" height="24" alt="Right Block Control" style="cursor: pointer" onclick="toggleDisplay('rightcolumn', 'block', 'none')" /></td>
& finally the columns section (will vary depending on your theme tho) >
<{if $xoops_lblocks}>
<td id="leftcolumn" width=150 height=100%>
<script type="text/javascript">
<!--
if (GetCookie("disp_leftcolumn")) {
obj = getRef("leftcolumn");
obj.style.display = GetCookie("disp_leftcolumn");
}
// -->
</script>
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{include file="<theme name>/theme_blockleft.html"}>
<{/foreach}>
<{/if}>
<!-- End left blocks loop -->
</td>
<td id="centercolumn">
<div id="content">
<{$xoops_contents}>
</div>
<!-- Display center blocks if any -->
<{if $xoops_showcblock == 1}>
<table cellspacing="0">
<tr>
<td id="centerCcolumn" colspan="2">
<!-- Start center-center blocks loop -->
<{foreach item=block from=$xoops_ccblocks}>
<{include file="<theme name>/theme_blockcenter_c.html"}>
<{/foreach}>
<!-- End center-center blocks loop -->
</td>
</tr>
<tr>
<td id="centerLcolumn">
<!-- Start center-left blocks loop -->
<{foreach item=block from=$xoops_clblocks}>
<{include file="<theme name>/theme_blockcenter_l.html"}>
<{/foreach}>
<!-- End center-left blocks loop -->
</td><td id="centerRcolumn">
<!-- Start center-right blocks loop -->
<{foreach item=block from=$xoops_crblocks}>
<{include file="<theme name>/theme_blockcenter_r.html"}>
<{/foreach}>
<!-- End center-right blocks loop -->
</td>
</tr>
</table>
<{/if}>
<!-- End display center blocks -->
<br />
</td>
<{if $xoops_showrblock == 1}>
<td id="rightcolumn" width=180 height=100%>
<script type="text/javascript">
<!--
if (GetCookie("disp_rightcolumn")) {
obj = getRef("rightcolumn");
obj.style.display = GetCookie("disp_rightcolumn");
}
// -->
</script>
<!-- Start right blocks loop -->
<{foreach item=block from=$xoops_rblocks}>
<{include file="<theme name>/theme_blockright.html"}>
<{/foreach}>
<!-- End right blocks loop -->
</td>
<{/if}>
</tr>
</table>
again thanks, and thanks to koudanshi for the source code ;)