![]() |
[release] Dynamic Style Set Dropdown
Author: filburt1
Description: Chen's style set dropdown hack, extended description below. Demo: None yet Screenshot: http://www.vbulletintemplates.com/mo...=&postid=14502 Be sure to apply this mod to every template set you have! Otherwise the dropdown will disappear when you change style sets. This is Chen's style dropdown without hacking. Unlike the style set dropdown mod released here, it doesn't require updating the code each time a style set is added/deleted. The tradeoff is that it adds one query to forumhome. Unlike Chen's hack, this will not show how many people are using each style set (would mean more queries). But, just like his, this does not update your user CP style set, it only cookies you with a new style set. |
Screenshot:
|
I've been looking for this for about 2months i had to create in manually :D
|
I did it in an hour :p
|
theres already a hack like this, but u did it very very differentlly :)
|
I know there's a hack but the point is that this doesn't require hacking.
Unless you're talking about the existing template mod here which I already said how this one is far superi--I mean, different--than that one ;) |
The one released before this one here needed manual updating of the dropdown. The hack is like this one but requires file hacking. This mod does the same thing but only via template modifying.
Hope that helps. Nice mod. :) |
Nice job m8
|
Just saved 1 query on forumhome by using this instead of Chens style dropdown hack
|
Well the extra query Chen probably used would be for the user table to find out how many people were using the style set...:)
|
great template mod! thanks.
|
Bit of a pain to change over, but works well, and I'm 1 less query then before.
|
another great hack Filburt :)
*clicks install* |
Filburt
How could I make the combo box to change styles with a button next to it, and not automaticaly? I mean - I would like the combo box to only be used for selecting the style and a button on the right with which you apply the change... how can this be done? :) thanx in advance |
Untested but try replacing $styledropdown on forumhome with:
Code:
$styledropdown <input type="button" value="Go" |
A Run Time error :
when I press Go: |
Maybe document.all['newstyleid'] instead of document.newstyleid?
|
Yeah :)
It seems that it works ok now :) Something more: (please don't shoot me...) Is there a way I can make the GO button smaller? Or even better instead of this common GO button I would like to use another one... like this : http://www.synthpopavenue.gr/eimages/go.gif u know a gif I have... that goes better with my styles... thanx anyway |
Try:
Code:
$styledropdown <a href="javascript:window.location = |
Thanx
problem inow s that although it works with IE... and everything is fine... there are 2 probs with netscape: 1) The button does not work at all. You press it - it does not do anything. 2) The button seems to be wrongly aligned - its lower that what it should be look at the screenshot |
1. document.all only works in IE ;)
2. absmiddle just never works in NS |
thanx again
I guess i will have to go with the standard GO button... But is there a way to make it at least "smaller? |
Smaller?
The image is just vB's go button. |
I meant the initial GO button - shown with this code:
Code:
$styledropdown <input type="button" value="Go" |
Filburt.
I'd like the combo box to have as default text the "choose style"... instead of a style name... so when a guest or a member sees the board, the thing he sees in the box is *not* a style name, but the text "choose style" can we do this? |
The reason why I'm asking for this is because ....
I had 3 styles. (for example) 1) Blue (default) 2) Emerge 3) Dark Now after I installed the dropdown box, I changed the default style. Actually what I wanted to do was to make the Emerge default - but without deleting/overwriting the Blue (ex-default). So I did this: I created a new style called Default2. I pointed it to take the templates and replacements of the Blue style. Then I went to the Blue style and pointed it to take the Emerge templates and replacements. Then I renamed the Blue to "Emerge" and I renamed the Default2 to Blue... this way the default now is the Emerge ;) But there is a small bug... Lets say that I'm logged in. And I have chosen the Emerge (default) style on the combo box.... Then I loggout. Now (here is the bug) the style of the board is still the Emerge (because it is now the default one), but in the combo box the "blue" is shown!!!!! Can you figure out why this happens? It seems like the combo box has kept as default style the blue? or somthing like that... Clearing the cookies did not help. Im thinking of 2 solutions 1) Uninstalling the combo box and reinstall it. or 2) Making the combo to always display a non-selectable text "choose style" will any of these solutions work? thanx in advance I will appreciate it if you look into this |
I did this:
I disabled the (new) Blue. Now when I log out, the Dark is shown in the combo box... although I have the Emerge on the board... I enabled again the Blue and renamed it to WBlue then I logged out... Now the Dark is again in the box, athough the board is no the Emerge style. And the Wblue is last on the box... So maybe afte all the combo box juts displays the styles alphabeticaly?!! ?? maybe this is why a logged out user sees in the box the Blue as first style ? :confused: |
No idea why it's doing that, the only thing that will change across users is which one is initially selected. The contents of the dropdown will always be identical.
|
When a user is logged out.... from where does the combo take the style that it shows as first?
does it just display the styles alphabetically? Code:
$result = mysql_query("SELECT styleid,title FROM style WHERE userselect=1 ORDER BY title"); |
Here is what I did:
I renamed my styles like this: 1. Emerge 2. Blue 3. Dark Now when I'm a guest... the 1.Emerge is shown on the combo (as it should) and the other come sorted by the number... so it has to be that the combo box displays the styles alphabetically... and not according to which is the default.... just my 2 cents - I might be wrong... |
No offense but I think you are. The query will always return an alphabetical listing of style sets and their ids.
Run the query in PMA or the MySQL console and you'll see what phpinclude is getting and parsing to create the dropdown. |
No offense at all by me :)
I appreciate it that you sit here and help me on this... but I admit that now I'm even more confused... Quote:
sorry but my English is not so good so I dont easily understand :( |
It sorts it by title alphabetically, but it probably would get confused by different case (i.e., uppercase and lowercase) and sort them differently.
|
Ok.
The "thing" in my case is that I cannot really reproduce the... problem... because back when I had the "Blue" as default... it would be displayed first *anyway* because the name starts with "b" which is a letter alphabeticaly first in the order than D and E. But what I have done is that I placed those numbers in front of the style names... so I guess now I'm ok... thanx for the support Filburt I really appreciate it. |
works great thx!
I added it to my header though so it can be changed on any page. =) |
Thanks a lot Now me and my members don't have to go into my usercp whenever I put in a new style to view it.
|
They really should though because this is just a cheap hack. Updating your User CP pref will always stick, this will not.
|
Great
Gibts in addition one chop where one on a new side to see can which user of which Style benuzt?? Gibts dazu einen Hack wo man auf einer neuen Seite sehen kann welcher User Welches Style benuzt ?? |
English?
|
Quote:
do you think we could do this? :) |
All times are GMT. The time now is 01:03 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|