Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Theme Selector in Preferences Dropdown
Topic Started: Jul 18 2008, 07:02 PM (1,284 Views)
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Works in FF3.0, IE7.0, IE8.0 beta, Opera 9.0, Safari 3 (windows). Only browsers I have tried.

What this does: When you hover over Preferences it shows an extra option called "Theme". If you hover over that, it shows all of the themes enabled on the forum, except the one in use.

Code: HTML
 
<script>
// http://www.zetaresources.com << Panacea >> Viral
if($("select#setskin")){
var remove = 0; // 1 to remove default themechooser, 0 to leave as is
function zbLoggedIn(){var l=$("#top_info strong").html();if(l=="Guest"){return false;}else{return true;}}
if(zbLoggedIn()){
var skins=[];sk=0;var t = $("select#setskin option");
for(var s=0;s<t.length;s++){skins[sk++]=[t[s].value,t[s].innerHTML,t[s].selected];}
if(remove==1)$("#foot_themechooser").remove();
var sontent="<li><a href='javascript:void(0);' id='themes'>Theme</a>";
for(var i in skins){if(skins[i][2]!==true){sontent+="<li class='othemes' style='display:none;'><a href='"+main_url+"index/?setskin="+skins[i][0]+"'>"+skins[i][1]+"</a></li>";}}
sontent+="</li>";
$("li#menu_ucp ul li:contains('Update Profile')").after(sontent);
$("#themes,.othemes").mouseover(function(){$("li.othemes").show();});
$("#themes,.othemes").mouseout(function(){$("li.othemes").hide();});}}
</script>


Code Updated. Change the "var remove = 0" to "var remove = 1" if you want the default themechooser to stay where it is. Now leaves the default theme chooser for guests.

Above the copyright.
Preview: http://s1.zetaboards.com/quick_pm/index/ (no test account)
Edited by Viral, Jul 19 2008, 04:55 AM.
Offline Profile Quote Post Goto Top
 
obxbiker
Member Avatar
U.S.M.C.R.
[ *  *  * ]
Excellent !! using at my test account.

This does Replace the other theme selector.
So since its in preferances this will also hide that function from guests.
Offline Profile Quote Post Goto Top
 
Test999
Member
[ * ]
Works great!
Offline Profile Quote Post Goto Top
 
kotton
Member
[ * ]
100% pure columbian nose candy Viral - another dope drop - thanks for this
Offline Profile Quote Post Goto Top
 
Kity
Member
[ * ]
Great code..... :)
Thankyou....
Offline Profile Quote Post Goto Top
 
Cen
Member Avatar
Member
[ * ]
This code is great, I love all your codes! tyvm :)
Offline Profile Quote Post Goto Top
 
Nicola
Darth Vader's Sewing Instructor

kotton
Jul 18 2008, 11:12 PM
100% pure columbian nose candy Viral
Most random thing I've read all week :ph34r: (for a brit anyway)
Offline Profile Quote Post Goto Top
 
Fried Korn
Member Avatar
Why so serious?
[ *  *  * ]
Nice code :)
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Thanks for the comments :) . Yes, it does replace the old theme chooser, I will update it later to stop it removing it from guest's view, and the choice of replacing it, or just an addition.

Updated.
Edited by Viral, Jul 19 2008, 04:55 AM.
Offline Profile Quote Post Goto Top
 
jameswgw
Member
[ *  * ]
Great code man, thanks.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply