Style Switcher like on vB.org
I've written a simple JS function that can be used if you want to implement a style selector like on vB.org (using colored icons instead of a dropdown).
Simply add this to vbulletin_global.js, or include it in your footer template: Code:
function switch_style(F) { E = "style"; if(F == "") { return; } var B=new String(window.location); var A=new String(""); B=B.split("#"); if(B[1]) { A="#"+B[1] } B=B[0]; if(B.indexOf(E+"id=")!=-1&&is_regexp) { var D=new RegExp(E+"id=\\d+&?"); B=B.replace(D,"") } if(B.indexOf("?")==-1) { B+="?" } else { lastchar=B.substr(B.length-1); if(lastchar!="&"&&lastchar!="?") { B+="&" } } window.location=B+E+"id="+F+A } HTML Code:
<a onclick="switch_style('9');return false;" href="$vboptions[bburl]/index.php?styleid=9" rel="nofollow"><img src="$vboptions[bburl]/images/redstyle.gif" alt="" title="Red Layout" border="0" width="13" height="13" class="inlineimg" /></a> Hope someone will find this useful! Enjoy! Download No files for download. |
Similar Mods
Add-On Releases Easy Style Color switcher | vBulletin 3.8 Add-ons |
Style Bnat Syria way Sheet Switcher | vBulletin 3.7 Styles |