The Arcive of vBulletin Modifications Site. |
|
Style Switcher like on vB.org Details »»
|
|||||||||||||||||||||||||
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! Show Your Support
|
|||||||||||||||||||||||||
| Благодарность от: | ||
| DePReM11 | ||
| Comments |
|
#2
|
||||
|
||||
|
thank
|
|
#3
|
|||
|
|||
|
and what happens with styles that are only viewable by admins ?
|
|
#4
|
||||
|
||||
|
you can give some screenshots ?
|
|
#5
|
|||
|
|||
|
Quote:
You can view a demo here on vB.org - just try the style switcher. My implementation is the same, except that it's JS-powered. |
|
#6
|
||||
|
||||
|
Gonna try this in vb4.1.4
|
|
#7
|
||||
|
||||
|
Hmm. Doesn't work.
|
|
#8
|
||||
|
||||
|
|
|
#9
|
||||
|
||||
|
|
|
#10
|
||||
|
||||
|
I don't believe so.....not at the moment anyway.....
|
![]() |
|
|