PDA

View Full Version : Change Style Drop-Down


Admin
12-21-2001, 10:00 PM
This is exactly what you see here, on this board's main page.
It allows you to easily change the style you are using.
Please note that it does not update your user profile as well, it simply sets a cookie, and until it expires you will see the style you selected.
Anyhow, download the attached .txt file and do what it says.

Scroll down to a post by me if you'd like the hack to update the user setting in the database!
The attached version does NOT do that!

Have fun and happy holidays! :)

-.valkyre
12-22-2001, 06:16 AM
Nice, but I got an improvement idea!

Have a link on the main page saying "Change Style", when clicked it would popup a pre-defined window with a little box saying something to the degree of "Switch your current style with:", then you could either put a drop down menu your the user could have direct text links (He would probably have to manually add them though).

Sound good FireFly old buddy? ;)

floleb7
12-22-2001, 06:39 AM
i have some prob with this hack
i made a screen so look the prob :D

http://www.latriade.net/div/drop.jpg

i have delete some style so maybe it's the reason

-.valkyre
12-22-2001, 06:42 AM
Ah glitches, gotta love em' :D

OOO! Can I choose the 3 users style? :stupid:

floleb7
12-22-2001, 06:44 AM
sure you can :D


it's anonymous style they don't want to be publicy known :D

Admin
12-22-2001, 07:08 AM
valkyre, why make it so complicated?

floleb7, bug fixed. Re-apply changes to index.php.

squawell
12-22-2001, 07:14 AM
FireFly thankz~~

u did a great hack again~~:D

and i love this hack~~~ :D

-.valkyre
12-22-2001, 07:14 AM
Because complicated is good :D

If you look at my forum, you'll know why :)

floleb7
12-22-2001, 08:12 AM
i still have the bug


http://forum.latriade.net/index.php?s=&styleid=33

Lesane
12-22-2001, 09:55 AM
Nice hack, well done. Thanks.

Admin
12-22-2001, 11:02 AM
floleb7, something must be wrong with your style setup.
If you want I'm willing to take a look at the Admin CP, if you'd like.

floleb7
12-22-2001, 12:19 PM
i create an admin account and send you by pm

Kumaro
12-22-2001, 06:51 PM
this is an excellent hack. Thanks a million!

VolsReport
12-22-2001, 07:16 PM
This is a good hack...thanx firefly...

Baratator
12-22-2001, 09:37 PM
Hi firefly :)

i've already posted it on the beta hack of supreemball...

okay that's what i needed but i have one question :

I use different group of users ===> diff levels
Is that possible :

The first grade see in the dropdown
-Trouffion style

The second grade see in the dropdown
-trouffion style
-Soldat style

The third
-trouffion style
-soldat style
-sergent style
etc ....

PLUS when you are trouffion you got the trouffion style and when you get one more grade (soldat), automaticly it sets you the soldat style (but after you can choose to get back the old style : you'll have the choice) but this is not abolutly needed because as you only change usergroup of one user on the admpinCP, at the same time i could change his style too...

Please i REALLY need this modification, REALLY REALLY REALLY :)

your hack make the same tjing than the other but in a different way no?
so i think that my question can apply your hack too :)

vertex
12-22-2001, 09:57 PM
great hack sl used that since a while ago:

http://www.somethingleet.com/index.php

hondastyle
12-23-2001, 01:21 AM
Wow, this is almost freaky weird. I just finished making a few available style sets for my users, so I came here a couple of days ago to see if anybody had a hack like this available. There wasn't one. I was actually returning today to see if someone could tell me how to do this and *viola* here it is!

Most excellent work. I've got it up and running in my forums. Looks great.

http://www.hondastyle.com/forums/index.php

Thank you,
Chris

Bop2Bop
12-23-2001, 10:21 AM
all bow to firefly :lol:
nice one ;)

LuBi
12-23-2001, 03:04 PM
I think it would just be some html to make this popup and effect the parent window... anyone wanna try this because I lack the skill but I'm sure that would be a great addition :D. Great one FireFly!

Matt
12-23-2001, 09:31 PM
I don't know if its just me, but does it show up all style sets regardless of whether or not you select for them to be selectable by users? Cause tahst hwo its looking on my board.

hypedave
12-24-2001, 12:20 AM
this is such a great hack, I wish all hack installs were easy like installing this one, keep up the good work

SirSteve
12-24-2001, 05:42 AM
What about the Style Set option in the User CP? It doesn't change that if you change it via this pull-down.

SirSteve
12-24-2001, 05:47 AM
Also, it looks like a few of my members have set their options to load a certain style but when I turn that particular style off (not user selectable), it still shows up in the pull-down hack.

hypedave
12-24-2001, 09:11 AM
well I have noticed that the styel selector over rides what the user has chosen for that login session only, nowif they do a complete logout, and then logout back in, they have the style that was chosen from the control panel, and as far as selection to load a style when its disabled I havent sen that one yet, but I will ask around

Graphic-Forums
12-24-2001, 07:43 PM
What could be my problem here, I did everything as said..
http://www.graphic-forums.com/index.php?styleid=5

Im running vb 2.2.1

Graphic-Forums
12-24-2001, 08:05 PM
Here what i did in the index, about 15 lines down (surrounding code to give you a idea)

userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];

// style drop

down box (by FireFly)
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL

GROUP BY user.styleid");
$dropdownbits='';
while ($thisstyle=$DB_site->fetch_array($allstyles)) {
if ($styleid==$thisstyle[styleid]) {
$stylesel='selected';
} else {
$stylesel='';
}
eval("\$dropdownbits .= \"".gettemplate('forumhome_dropdownbit')."\";");
}
// style drop down box (by FireFly)
// if user is know, then welcome
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext =

nuno
12-25-2001, 08:18 PM
by looking at your page source code you are missing the <option> tags
check template name, maybe you have made a typo :)

Graphic-Forums
12-27-2001, 01:29 AM
The option tags are included in the dropdown bits.

SirSteve
12-27-2001, 03:03 AM
This doesn't work on Netscape... I believe because there are no <FORM> </FORM> tags...

exodus
12-27-2001, 03:22 PM
This is a real sweet hack but it would be much better if it updated the information in the user profile. Is there any way to have it do that? Any way at all? That's the only thing stopping me from installing it.

SirSteve
12-27-2001, 03:38 PM
[QUOTE]Originally posted by exodus
This is a real sweet hack but it would be much better if it updated the information in the user profile. Is there any way to have it do that? Any way at all? That's the only thing stopping me from installing it.

floleb7
12-28-2001, 11:43 AM
some news for my bug :confused:

Admin
12-28-2001, 11:52 AM
[QUOTE]Originally posted by Matt
I don't know if its just me, but does it show up all style sets regardless of whether or not you select for them to be selectable by users? Cause tahst hwo its looking on my board.

Admin
12-28-2001, 11:55 AM
[QUOTE]Originally posted by hypedave
well I have noticed that the styel selector over rides what the user has chosen for that login session only, nowif they do a complete logout, and then logout back in, they have the style that was chosen from the control panel, and as far as selection to load a style when its disabled I havent sen that one yet, but I will ask around

Admin
12-28-2001, 11:55 AM
[QUOTE]Originally posted by floleb7
some news for my bug :confused:

Admin
12-28-2001, 12:00 PM
[QUOTE]Originally posted by FireFly
True. Easy fix, I'll post it in a bit.

Admin
12-28-2001, 12:13 PM
[QUOTE]Originally posted by FireFly
I will post a new version of this hack for users that want the profile to be updated.
It will be more complicated though.

floleb7
12-28-2001, 01:47 PM
i use the latest change the dropdown works but when i try to change i have this


Database error in vBulletin 2.2.0:

Invalid SQL: UPDATE user SET styleid=30 WHERE userid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

Date: Friday 28th of December 2001 10:42:19 AM
Script: http://forum.latriade.net/index.php?changestyle=30
Referer:

Admin
12-28-2001, 04:35 PM
Ok, my bad. It is a bit complicated. Re-install the hack, it should be ok now.

floleb7
12-28-2001, 06:53 PM
with your change i cannot login in my forum :D

DarkReaper
12-29-2001, 03:10 AM
It logged me out, and I can't get back in...lol.

Also, its only giving me one result when it should be giving me 4...

Admin
12-29-2001, 11:45 AM
Try now. *sigh*
Sorry. :(

floleb7
12-29-2001, 12:28 PM
global in root directory or admin ?

cause in root i have only this

if (!$servertoobusy) {
require('./admin/sessions.php');
} else {
$session = array();
$bbuserinfo = array();
}

Admin
12-29-2001, 12:39 PM
In global.php, find this:
=========================
require('./admin/sessions.php');

DarkReaper
12-29-2001, 04:28 PM
Which version are we trying?

floleb7
12-29-2001, 06:16 PM
2.2.0

and if the code is in
if (!$servertoobusy) {
require('./admin/sessions.php');
} else {
$session = array();
$bbuserinfo = array();
}

i don't think it will work

Admin
12-30-2001, 11:13 AM
[QUOTE]Originally posted by floleb7
2.2.0


and if the code is in
if (!$servertoobusy) {
require('./admin/sessions.php');
} else {
$session = array();
$bbuserinfo = array();
}

i don't think it will work

Chrysalis
12-31-2001, 12:30 AM
installed the initial version and it works great, thanks :)

Dalius
01-02-2002, 06:43 PM
Bug:
I have 69 members ( :D ), and one style currently active

But it says only 24 members are using that style

reason for this? :confused:

SirSteve
01-02-2002, 06:46 PM
[QUOTE]Originally posted by Dalius
Bug:
I have 69 members ( :D ), and one style currently active

But it says only 24 members are using that style

reason for this? :confused:

pahbi
01-02-2002, 07:56 PM
I keep having trouble to:

When I make more than 2 styles, only the first 2 styles are shown in the drop down box.

When I looked at this bit of the code:

// style drop down box (by FireFly)
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
while ($thisstyle=$DB_site->fetch_array($allstyles)) {
print "test";
if ($styleid==$thisstyle[styleid]) {
$stylesel='selected';
} else {
$stylesel='';
}
eval("\$dropdownbits .= \"".gettemplate('forumhome_dropdownbit')."\";");
}
// style drop down box (by FireFly)

I added the "print 'test';" within the while loop to see how many times it was cycleing, and it seems that the while loop only cycles 2 times, even though I have 3 styles that I've entered.

If I go to my user cp, and choose the last style that I added, and then reload the web page, the while loop then cycles 3 times and shows all available styles.

Is there anyway to configure the mySQL query that is reading the available styles, to print out all the styles that are available?

Thanks,
- Pahbi

Dalius
01-03-2002, 03:46 PM
:confused:

Dalius
01-03-2002, 11:33 PM
Come on FireFly, help us out here :(

pahbi
01-05-2002, 05:07 PM
I fixed my problem, and it works fine now.

First I changed in index.php: (its the bit of code for this hack)

$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");

To:

$allstyles=$DB_site->query("SELECT styleid,title FROM style ORDER BY title");

And then in the forumhome_dropdownbit template I changed the text to read:

<option value="$thisstyle[styleid]" $stylesel>$thisstyle[title]</option>

I don't get a users count anymore, but that really wasn't very important to me anyways. The most important thing is that it lists all of the styles available, and allows the person to choose one, and in that regard, this works perfect for me.

- Pahbi

Graphic-Forums
01-05-2002, 05:15 PM
Firefly, if you get some time, can you add this to my siote, ive tried. I wouldnt normally ask for help, but I can figure it out.

Admin
01-05-2002, 05:21 PM
E-Mail me with your site info (FTP and admin account for vBulletin).

Graphic-Forums
01-05-2002, 06:09 PM
Firefly, I emailed you.

Admin
01-05-2002, 06:14 PM
Done.

UtilityGeek
01-10-2002, 03:15 AM
Sweet hack. Applied it with no problems. Thanks! :)

patvdv
01-29-2002, 12:02 PM
When applying the second version of the hack, I get this error:

[QUOTE]Fatal error: Call to undefined function: getuserinfo() in /opt/apache/htdocs/baan/baanboard/admin/sessions.php on line 323

patvdv
01-29-2002, 12:13 PM
never mind the previous post. I solved the problem :)

My second remark still stands. I have 7 styles and can only see 3 of them as only 3 of them are currently in use. At the same time I would still like to see how many users are using which style.

monitox
02-01-2002, 04:08 PM
Well.. the hack works ok ONLY on the main page of this forum !?
I tryed and have same problems.. doesn't show OK the number of users wich use a style :(

Anyone can help me with AN WORKING version ? Just like this one from here !? Pls :(

PS: from over 600 members ONLY 32 are using the "default" template and 2 the second one :stoned:
I want to see exactly HOW MANY users are using the templates..:(

Justice
02-05-2002, 02:34 AM
is there a way I can add this hack and make it unknown how many people are using the default style? In other words, let's say I don't want my user total to be so obvious, and I have...

default (all others)
style 1 (10 users)
style 2 (15 users)
etc.

I'm guessing this can be done by a simple If statement, but I'm not as proficient as I'd like to be.

TELEK
02-06-2002, 02:34 AM
This Hack only shows User-selectable styles right? Because I have a lot of Styles for certain sections of the Board that aren't user selectable anc I don't want those showing up in there.

Admin
02-06-2002, 06:37 AM
Yes TELEK.

cihangir
02-09-2002, 10:25 PM
[QUOTE]Originally posted by monitox
Well.. the hack works ok ONLY on the main page of this forum !?
I tryed and have same problems.. doesn't show OK the number of users wich use a style :(

Anyone can help me with AN WORKING version ? Just like this one from here !? Pls :(

PS: from over 600 members ONLY 32 are using the "default" template and 2 the second one :stoned:
I want to see exactly HOW MANY users are using the templates..:(

cihangir
02-10-2002, 06:35 AM
i ran this query: UPDATE user SET styleid='1'

it works now :)

Birdie501
03-01-2002, 06:44 AM
Hi,

could it be that you can only choose a style if at least one member choosed this in his user cp options?

I installed the hack! All the 4 test members just had the default in her options. So in the style drop down there was only the default style shown! Then i changed the style in the options of member A! Then it was also shown in forumhome!???

Is that normal?

+Thanks

Admin
03-01-2002, 11:22 AM
Try changing this:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
to this:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM style LEFT JOIN user USING (styleid) WHERE style.userselect=1 GROUP BY user.styleid");

Jakeman
03-02-2002, 05:36 AM
installed the "user option changing" version that is attached mid-way through this thread. works fine. jake happy.

Admin
03-02-2002, 05:45 AM
Do I get good Jake karma?

Jakeman
03-02-2002, 06:01 AM
[QUOTE]Originally posted by FireFly
Do I get good Jake karma?

Birdie501
03-04-2002, 10:36 PM
[QUOTE]Originally posted by FireFly
Try changing this:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
to this:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM style LEFT JOIN user USING (styleid) WHERE style.userselect=1 GROUP BY user.styleid");

Dalius
03-10-2002, 01:20 AM
When I have 1 member in one style, and another member in an other, and i swtich to the other, it still says 1-1

Admin
03-10-2002, 10:22 AM
Install the version that updates users profile.

Dalius
03-10-2002, 01:09 PM
Orkeh Thankees Firecat

hidjra
03-15-2002, 10:39 AM
Is it possible to set all my members to use style id 1 in the database

grtzz

Admin
03-15-2002, 11:43 AM
Query:
UPDATE user SET styleid=1;

Birdie501
03-20-2002, 10:43 AM
@firefly

its me again! i installed your newer version. i have two styles.
The problem i have is that i can change from 1st to second style , but if i try changing back it doesn't work. It only reloads the page!

Any suggestion?

Thanks

KCardinalart
03-24-2002, 04:49 PM
Thank you for another great hack!

I think most all the hacks I'm using on my site are one's you've written.

BTW: The search for custom fields worked perfect to help me set up an address book. :D

I'm sure all the visitors to everyone's sites thanks you also for making their lives easier.

I just wish I knew how to put the drop-down in the header like Jakeman did.
I'm going to have very seperate sections of my site with a log-in on my home page (which won't be the forum index page), so not everyone going to my site will even go to the forum home.

Well... anyway...
Thanks again! I'm looking forward to the next hack. :D

Jakeman
03-24-2002, 05:43 PM
i just pmed you too. but i'll post instructions here as well.

a couple things:

1. the mods that the hack has you add into index.php... instead add those to global.php just above the part where it sets the phpinclude, header, and footer templates. in my 2.2.1 global.php it looks like this:

$header='';
$footer='';

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");
eval("\$footer .= \"".gettemplate('footer')."\";");

add the index.php mods just above this section.

2. the templates: in your header use this instead of what the insturctions say to use in your forumhome templates:

<select name="styleid" onchange="window.location=('index.php?s=$session[sessionhash]&changestyle='+this.options[this.selectedIndex].value)">
<option>Select Style...</option>
$dropdownbits
</select>

and in your forumhome_dropdownbit use this instead of what the instructions say:

<option value="$thisstyle[styleid]">$thisstyle[title] ($thisstyle[count] users)</option>

that should do it.

TaP
04-17-2002, 10:25 PM
this is impossible i cannot get all the styles showing up... and when i do they cannot select them

pHAZE_1
04-21-2002, 04:49 AM
um it didnt work for me. www.hiphoptechnicz.com/forums i did everything right i think, but only the drop shows up, not the styles????

Lorddraco98
04-21-2002, 03:24 PM
I seem to be having a problem. I followed all the install steps(I tried both the version that updates user's CP and the one that doesn't, but I get the drop down menu to show on my forum home, but it lists no styles. It's just blank. I have currently 3 user selectable styles so something should show up. Also, how can I get that box(when it does show my styles) to align itself to the left side?

pHAZE_1
04-21-2002, 08:22 PM
[QUOTE]Originally posted by pHAZE_1
um it didnt work for me. www.hiphoptechnicz.com/forums i did everything right i think, but only the drop shows up, not the styles????

Lorddraco98
04-21-2002, 11:23 PM
phaze_1 what did you do wrong? mine don't show up maybe you can help me!

pHAZE_1
04-21-2002, 11:24 PM
AIM= XXGHOZTLYXX

Lorddraco98
04-22-2002, 06:49 PM
can anyone else offer some help? I made sure I did all the code correctly. and I placed the new template and the stuff in index.php as well as as the edit in the forum home template. Still nothing shows up in my drop down box, and it's about 1 inch wide. I do have styles that users can select because they are avalable in the user CP under the change styles menu. Also, once I get the styles to show up, how to I get it to center to the left because I want it right under the login area in my welcome panel!

E
05-04-2002, 12:59 AM
I have 5 styles on my board. It shows 4 of them. I had a style, which I deleted, which was id#5. I got another one which is id#6. The #6 will not show up. I have went over it all day, and cant figure out what is wrong. I have went over the templates several times. Can someone help?
Thanks in advance,
E

Cynthia Blue
05-05-2002, 05:33 PM
Just installed this hack.. it's working great! Thanks! :)

YIKES! I just noticed though.. I use PHPPortals, and there was an option to turn the left menu on and off.. and it is gone. I must have typed over it with the hack. Anyone know the code I can put it back in with? Maybe a variable or so...

Thanks. :p

RDX1
05-14-2002, 10:39 AM
im having a problem on my 2.2.5 board, for some reason it only shows 1 style, yet i have two.. and if i change to style 2 in UserCP it shows both, whats up?

pHAZE_1
05-14-2002, 11:29 AM
[QUOTE]im having a problem on my 2.2.5 board, for some reason it only shows 1 style, yet i have two.. and if i change to style 2 in UserCP it shows both, whats up?

RDX1
05-14-2002, 11:50 AM
ah, lol :devious:

ZeRtEr
05-14-2002, 01:56 PM
[QUOTE]Originally posted by pHAZE_1

there has to be atleast 1 user using that style or it will not show up in the drop box..

filburt1
06-03-2002, 07:20 PM
Uh, Chen? Look at my styles dropdown...128 members but fewer members than that with style sets defined? :confused:

The only thing I did recently was change two styleids in the db manually to force one of them to be the default.

Lucrecia
06-03-2002, 09:34 PM
Nice, I gotta question, if I upload a new style, it doesn't show up on the drop down style option, what do I do to fix this. Is there anyway to have it so it shows even style that no one is using?

Stylez
06-04-2002, 03:27 AM
alright, i got a 2.2.6 forum and with 2 styles, it says 137 members on default and 5 on the other. problem is.....well, there are 700 members. help? i got the txt file from the hacks thing.

robin1233
06-10-2002, 01:58 PM
This hack is really good, but is there a way to get it to work on the vbportal homepage as well?

ladyfyre
06-18-2002, 08:55 PM
Actually FireFly, Could you tell us how to modify it so that we can place the drop-down box in our header, rather than simply on the ForumHome?

please please please????

(ok...so i am a brat...but i DO beg nicely!!!!!)

Admin
06-19-2002, 09:10 AM
Place the code in global.php instead of index.php, then use it in the header instead of forumhome.

ladyfyre
06-19-2002, 02:46 PM
Nope....that didn't work...i actually tried that one first ;)

It just creates a blank drop down menu with nothing in it.

N9ne
06-24-2002, 05:45 PM
AWESOME HACK! Thanks!

chr@nox
07-02-2002, 01:43 AM
GREAT hack buddy been looking for this one for ages! thanx

BigJohnson
07-02-2002, 03:27 AM
Can someone fix this issue with the styles not showing up when no users are using it please. I really hate to see this hack do this because most people count on the drop down instead of going to there Cp to do it. Thanks so much.

BigJohnson
07-02-2002, 04:26 AM
I really think that someone should look into this prob with it not showing up on the switching when you have no users on that style in the forum home. Just read threw the last couple of posts to understand the prob in detail. This really needs to be fixed. Can someone help out and please try to fix this prob. Thanks.

BigJohnson
07-02-2002, 02:10 PM
bump

Travis641
07-03-2002, 07:12 PM
*bump*

BigJohnson
07-03-2002, 10:28 PM
BUMP UMP AND AGIAN AND AGAIN!!!!!!!!!!!!!!

BigJohnson
07-05-2002, 12:15 PM
Lets see how many times i can bump this thread.

Roody
07-08-2002, 02:31 AM
bump

JJR512
07-10-2002, 07:34 PM
I would just like to have the number of users using each style show up by the style name in the drop-down box in the user cp->Edit Options screen. Could someone show me how to do that?

futureal
07-10-2002, 08:47 PM
It's very simple, actually.

In member.php, search for $thisstylename to get you near the correct area (exact like is 739 in my modified file in 2.2.6).

Replace:

$stylesets=$DB_site->query("SELECT * FROM style WHERE userselect=1 ORDER BY title");

With this query from FireFly (line break added):

$stylesets=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user
LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");

A few lines down, right after this:

$thisstylename = $thisset['title'];

Add this:

$thisstylecount = $thisset['count'];

Then change the template modifyoptions_styleset to look something like:

<option value="$thisid" $selected> $thisstylename ($thisstylecount users)</option>

And that should do it. At least, that worked in my forums (I just tried it).

JJR512
07-10-2002, 10:31 PM
Thanks! You know, I had tried that EXACTLY, and it didn't work for me...until I saw in your directions that I had one little mistake. I had used $thisstylecount = $thisstyle['count']; instead of $thisstylecount = $thisset['count'];. Oops! Thanks. :)

BigJohnson
07-11-2002, 01:47 PM
That works great but still how do you fix that prob if no one is using that style it wont show up in the drop down? HUH. And I don't want to place each style maually in the drop down because I like the feature where it says how many people are using that style. Unless there is another way please help me. Tell me my options. Thanks.

Smoothie
07-12-2002, 04:21 AM
register a user for each style that has no users. :)

BigJohnson
07-12-2002, 05:48 AM
lol hehehe. What about a real way to fix the prob hehe.

Angelus
07-16-2002, 03:01 PM
Hello. Thus only times I excuse for my bad English and secondly legend I thank myself for this hack. But unfortunately I have thereby a problem. If I change thereby the Style, in the User Controll Pannel unfortunately nothing one changes. Thus if someone changes and stores attitudes, he gets the default back Style. Then one there perhaps which make?

countryboy713
07-22-2002, 05:38 AM
Can someone Post here on how to fix the un-selected style problem?

A real one, lol, i dont want more empty users on my board than there is already! :D

Kasper_H
07-22-2002, 03:43 PM
I love this hack!
Working perfectly :D I don't mind the "bug" which does that styles not used won't show up... I actually think that's good :p

HappyPike
08-16-2002, 02:47 PM
I did what futureal wrote in post #112 but the how many users are using each style number is still not accurate. :( Can someone help? I am running 2.26.

My forum (http://forums.civfanatics.com)

Liz
08-20-2002, 12:47 AM
I'm lost. I want to put it into the Header instead of Forumhome. Firefly....you said take the coding out of index.php and put it into global.php....but....where exactly do we put it?

I looked for "// if user is know, then welcome" in global.php but there wasn't anything that fit that. So I'm kind of....lost? :) Any help would be greatly appreciated.

Liz
08-20-2002, 08:55 PM
Anyone?

N9ne
08-26-2002, 07:08 PM
Hi, If I want the drop down to say "Change Style" normally and when you click on the arrow you get the list up, how can I do that? I tried putting <option value="">Change Style</option> in forumhome_dropdownbit before the contents of it and it still showed Default [2 Users] as the default view for the dropdown

So basically I want the name of the dropdown to be Change Style...

N9ne
08-27-2002, 06:32 PM
bump!!!

Kamui Shirou
09-14-2002, 07:41 PM
hello. i've a problem. i read trough the tex but nothing worked.
Example:
I have two Styles. one Dark and one purple.
when i change the style with the quickchange it dont update
the users currently use this style. only i`ve you change the style in your CP it updates it.

help me

Malice
09-24-2002, 07:14 PM
Does this hack, work on the current versions, 2.2.7 or 2.2.8?

Anyone?

NTLDR
09-24-2002, 09:43 PM
Should work fine :)

Smoothie
10-02-2002, 03:41 AM
What is need to get this hack to work with Netscape?

Smoothie
10-04-2002, 02:36 AM
^^ bump

\ \ - Speedy - / /
10-10-2002, 08:06 PM
where do you put the code in the forumcome, cuz I want it like this fourm has it, but I cant figure it out :(

ZiRu$
10-14-2002, 06:58 PM
installing it RIGHT NOW :) hope it works good

N9ne
10-14-2002, 07:15 PM
[QUOTE]Originally posted by ZiRu$
installing it RIGHT NOW :) hope it works good

Velocd
10-19-2002, 11:14 PM
This hack works fine, but the only problem I've noticed after installing (and everyone else has also) is that when you select a style it doesn't update it in the database.

I also have the "show style in postbit" hack, and the style shown is not being updated after I update it through the drop down.

It would be great if somebody attach the version of this hack that works precisely as it does here on vBulletin.org, in the next post.

Velocd
10-19-2002, 11:16 PM
Edit: my bad, vBulletin.org doesn't update either! so that's just a bug that hasn't been fixed then..or has anybody got the postbit style showing to update with the dropdown-style change as well?

Velocd
10-20-2002, 12:02 AM
Ah ha! Figured it out...ok, just ignore my above two posts.
I was lazy and left out a very important variable in the 2nd hack on page #3 that was replaced as something different on the 1st hack on page #1.

/me shrugs, then walks away.

Tony DiMera
10-20-2002, 02:01 AM
I have never had a problem with it ever.

Dynamic One
11-05-2002, 09:53 AM
Thanks for this great hack m8.

Dolamite
11-07-2002, 03:53 AM
nobody has fixed the problem with the style not showing up unless a member is using it.....i assume?

seems like a common request...... :banana:

fataldreams
11-17-2002, 06:13 AM
Hi,

I installed this tonight, and found the fixing the problem most people are having with not all the styles showing up (only the "in use" ones), is quite simple. Nothing technical... I just created a username in my CP for each of my styles (currently 4) and set each username to one of the four styles. So I have 4 unused usernames, big deal. It works :D And everything is updating properly.

wolfe
11-17-2002, 03:59 PM
firefly m8 is there a way to add it to the functions.php file so i can have the dropdown on all pages of my site :D

Smoothie
11-17-2002, 11:46 PM
There is a better way. At vbtemplates there is a template only mod which will display all styles, regardless if no one uses it. It's easier to install, and requires 2 template edits. Also requires 1 less query on your forumhome page. I've used both, and the one with just template edits is much better. The only downside is that it does not show how many members are using which style, hence one less query. :)

Mathiau
11-22-2002, 09:06 AM
^^^^

does it update it in the database??

Anitah
12-10-2002, 02:22 AM
[QUOTE]Originally posted by Smoothie
There is a better way. At vbtemplates there is a template only mod which will display all styles, regardless if no one uses it. It's easier to install, and requires 2 template edits. Also requires 1 less query on your forumhome page. I've used both, and the one with just template edits is much better. The only downside is that it does not show how many members are using which style, hence one less query. :)

N9ne
12-10-2002, 03:58 PM
I'm not sure if this has been posted in this thread yet, but everyone should make sure forumhome_dropdownbit (or something like that) is placed in the templatesused variable, to reduce a query on forumhome...I just got done cutting down loads of queries from forumhome and that was one of them.

Bison
12-10-2002, 04:34 PM
N9ne, Could you name a few other's that you found to minimize queries in you forumdisplay.php?

N9ne
12-10-2002, 05:05 PM
forumhome is the one I modified ;)

Bison
12-10-2002, 08:00 PM
You don't add templates to a template ... you add them into the php code right?

If you did this ... could you share with us some of the templates that you added to your index,php and forumdisplay ... mate?

N9ne
12-10-2002, 08:38 PM
I think you misunderstood. See in any vB file, when a call to a template is made, it adds one extra query. Now in most vB files, there is a $templatesused variable, should you call a template in the file somewhere, you must take the name of the template and add it to the list of templatesused in the file...this will ensure that it's not running an extra query.

Open index.php and find $templatesused and add forumhome_dropdownbit to the list (I think it is forumhome_dropdownbit).

Bison
12-10-2002, 08:46 PM
I figured that out dude ... but you mentioned that you curved a lot a queries placing templates into your php files ... that's waht i'm looking for ...

N9ne
12-10-2002, 08:51 PM
That depends on what hacks you have installed, etc. Just go through showthread.php, forumdisplay.php, index.php, newreply.php, editpost.php, newthread.php (the main files) and find all gettemplate calls, look at the template name and see if its in a templatesused variable in the file, if not, add it.

Taco
12-11-2002, 08:58 PM
i read about 5 pages and didnt find my answer. I have about 15 styles that are on my board (Different style for each board). What i'd like to have it so on the drop down list, it only shows 3 of the ones i choose, instead of ALL my styles. What would i have to change to do this?

tccra
12-29-2002, 04:14 AM
Ver. 2 (the one that updates the database) is working flawlessly from the User CP. Updating the style, updating the database every time.

However, from the home page, it only works sporadically. It updates the style every time, but only updates the database intermittently. Sometimes when changing the style from the home page, and then going to User CP, the change has taken effect in the database. Other times when changing the style from the home page and then going to User CP, the change has not taken effect in the database.

???

http://www.tccra.org/forums

Units
12-29-2002, 08:07 PM
The style drop down box is empty for me!
:(!

Jean147
12-30-2002, 03:07 AM
[QUOTE]Originally posted by Units
The style drop down box is empty for me!
:(!

Smoothie
12-30-2002, 04:37 AM
[QUOTE]Originally posted by Anitah


smoothie, you wouldn't have a direct link to that mod, would you? Because I've searched at vbtemplates and only see posts directing people back to vbulletin.org for the hack.

Tony DiMera
12-30-2002, 08:51 PM
I was wondering if it were possible to have it have styles that no one is using? So therefore it will say 0 next the the styles that are not being used.

ToXiC
12-31-2002, 07:18 AM
ok, heres the latest fix. It fixes the problem when no one has the style selected, you cannot change to that style..

Change this line

$allstyles=$DB_site->query("SELECT style.title, user.styleid, count(*) AS count FROM style LEFT JOIN user USING (styleid) WHERE style.userselect=1 GROUP BY user.styleid");

To
$allstyles=$DB_site->query("SELECT style.title, style.styleid, count(*) AS count FROM style LEFT JOIN user USING (styleid) WHERE style.userselect=1 GROUP BY user.styleid");

Hope it helps out.. :)

Anitah
01-01-2003, 12:16 AM
[QUOTE]Originally posted by Smoothie
Here ya go, must register to download:
http://www.vbulletintemplates.com/mods/showthread.php?s=&threadid=1814&highlight=style+dropdown

Smoothie
01-01-2003, 03:41 AM
[QUOTE]Originally posted by Anitah


Wow, smoothie, you're always so helpful :knockedout:

Thank you!

HAPPY NEW YEAR! :)

incarnus
01-03-2003, 08:31 AM
I've installed the second version that updates the User CP, and everything is displayed as it should be, but when I click on a new style nothing happens. I'm on 2.2.8. Any ideas?

Thanks in advance.

www.rivercityf-bodies.com/forums

EDIT: Nevermind, I reinstalled it and it works fine. Evidently I'm just stupid. :rolleyes:

yesfans
01-04-2003, 11:57 PM
Well I couldnt get it top work, I pulled it off my site. Just a empty box!

Schorsch
01-08-2003, 01:24 PM
I installed it, but now I can't change the style on the regular way over the control panel!!

What's wrong ??

Thanks,
Schorsch

incarnus
01-12-2003, 09:57 PM
[QUOTE]Originally posted by Schorsch
I installed it, but now I can't change the style on the regular way over the control panel!!

What's wrong ??

Thanks,
Schorsch

leviw
01-18-2003, 03:54 PM
Well.. I installed it and it works, but is definatly buggy.

If no one has a particular style selected it disappears from my drop down box. The only way to get it back is to go into the cp, options, reselect the style, submit, go BACK to the home forum and reselect the style.

Aside from this problem its great, I used the most recently posted dl link to get the info, was there a different link to dl the final hack that resolved this problem?

I doubt all you skillfull people put up with this bug, what am I doing wrong?

leviw
01-20-2003, 09:38 PM
Okay, I'm pretty new at PHP but I think I see at least where the soloution is.

In the index.php file if I changed this:

$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");

To this:

$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) style.userselect=1 GROUP BY user.styleid");

Would that correct the problem of the list only showing styles that a user is actually on?

ego
01-22-2003, 08:46 AM
I want to use the drop down out of the first post.

i have the Problem that the pull down menue only show one style.

What am I to do??

I use the 2.2.9 vb.

Can somebody post the whole scrips?? Thanks

leviw
01-22-2003, 09:01 PM
The hack has a bug that allows only styles that have at least 1 user on them to show up under the drop down list.

So far the band-aid fix is to create one dummy user specifically for each style.

I hope someone more knowledgable about php will come along and suggest an actual code fix.

ego
01-23-2003, 09:29 PM
I hope this too :smoke:

Destee
01-25-2003, 09:44 PM
Thanks again FireFly :)

*clicking installed*

Destee

Destee
01-25-2003, 09:48 PM
hmmmm ... i do have one question ...

i want the "Default" choice to say "Destee" instead of "Default"

i can't see where to change this, if someone could direct me please.

i've already renamed the default template set to "Destee" but that made no difference.

Thanks,

Destee

leviw
01-28-2003, 12:54 AM
Rename the style not the template. :o

Destee
01-28-2003, 03:04 AM
Thank you LeviW ... :)

I'm having one more issue if there is someone who would be so kind as to help me with this.

When choosing a different style from the dropdown, the change is made and reflected in the number of users for that style. My problem is that when a new Member joins the forum, they are not added to either of the total style users.

For example, I now have 1202 Members using one style and 4 using the other (for a total of 1206), but I have 1212 Members. The last 6 joined since installing this hack and they are not being counted in those totals.

During the installation I had the same problem as others, not all the Members being represented. I ran the query: UPDATE user SET styleid='1' and got all the Members showing up ... but the hack doesn't want to count the New Members now.

I know I could have this hack without those numbers, but I like those numbers ... just hoping they can be correct. :)

Any suggestions?

Thanks

Destee

leviw
01-28-2003, 04:21 PM
Interesting problem..

I havnt had this situation happen at all, my new users come on and are immediately counted under the default style.

You said you ran a query to update the user set, I'm wondering if that threw off the process somehow. In what context did you run the query?

:pirate: Arrg. Its a pirate! (Its official, I'm bored.)

Destee
01-29-2003, 12:40 AM
Hi LeviW ... and thanks again! :)

I ran the query as shown via PhpMyAdmin:

UPDATE user SET styleid=1;

Prior to running it, only a small number of Members were displayed (23 using one style and 2 using the other). The following posts seemed to suggest that running it would get all Members displayed ... and it did.

Post#66 (https://vborg.vbsupport.ru/showthread.php?postid=219349#post219349) - Post#67 (https://vborg.vbsupport.ru/showthread.php?postid=219405#post219405) - Post#77 (https://vborg.vbsupport.ru/showthread.php?postid=229641#post229641) - Post#78 (https://vborg.vbsupport.ru/showthread.php?postid=229669#post229669)

I now have 1219 Members with only 1207 reflected in the styledropdown. New Members are not being counted.

I hope the above is what you meant when asking ... in what context I ran the query. Thanks Again. :)

Destee

leviw
01-29-2003, 06:21 PM
That answers my question, but unfortunatly not yours.

Sorry, I dont know why its not showing correctly. :paranoid: Mine's working just fine.

Maybe one of the more profecient hackers can tell ya.

Destee
01-31-2003, 08:27 AM
LeviW ... thanks again :)

I'll adjust or remove if I can't get it solved ... it's no real big biggie.

Destee

KuraFire
02-03-2003, 08:20 AM
I had this hack for a while but I've removed it -somewhat-. I hardcoded my styles in <option > tags and placed the dropdown box in my Header template, adjusted global.php to make sure to put the right querystring into the <select > form action, and now you can change the style on Any given page on my site (if it's generated through the vB engine anyway). Took one query off of forumhome and the only thing I lost with it is knowing how many users have what style....

Neat eh? :D

leviw
02-03-2003, 08:01 PM
Dont spose you feel up for listing your changes as a seperate hack, Kurafire?

I really like your site by the way, especially the different style graphics.

KuraFire
02-04-2003, 09:08 PM
I'll see if I can trace back all the changes I've made to make it work, and if I can, I'll release it as a new hack :)

ego
02-04-2003, 11:40 PM
thats cool

make it please

SONOFSAM
02-05-2003, 01:30 AM
I didnt make it, but i had it on my forums:

add to the end of the phpinclude template:

if (strpos($_SERVER['PHP_SELF'], 'index.php') != false)
{
$result = mysql_query("SELECT styleid,title FROM style WHERE userselect=1 ORDER BY title");
if (!$result)
{
$styledropdown = 'Couldn\'t get a list of styles';
}
else
{
$s = mysql_fetch_row($result);
while ($s != false)
{
$styleid = $s[0];
$title = htmlspecialchars($s[1]);
$selected = ($styleid == $bbuserinfo[styleid]) ? " selected" : "";

$styledropdown .= "<option value=\"$styleid\"$selected>$title</option>";
$s = mysql_fetch_row($result);
}
$shash = $session[sessionhash];
$styledropdown = "
<select name=\"newstyleid\" onChange=\"window.location='index.php?s=$shash&styleid=' + this.value\">
$styledropdown
</select>";
}
}



Then add to forumhome template where you wish to show:

<td align="center">
<smallfont><b>Change Style</b></smallfont><br>$styledropdown<br>

or you can put in the header to show on every page generated.

KuraFire
02-06-2003, 10:59 AM
SONOFSAM: that will always take them to the forumhome page, not to their current page :p

KuraFire
02-06-2003, 12:38 PM
leviw, ego:

https://vborg.vbsupport.ru/showthread.php?s=&threadid=48596

and:

https://vborg.vbsupport.ru/showthread.php?s=&threadid=48597

Enjoy! :):up:

leviw
02-06-2003, 05:18 PM
Thanks Kura! Still checking out all the diferences and deciding which is best for my situation.

The first has an extra query and is simpler, shows # of users on each style?

The second has no query, requires more setup and doesnt show # of users. Loads quicker but extra work.

Just wanted to simplify the differences. =)

KuraFire
02-06-2003, 10:17 PM
Yup, those are the differences.

First one requires a query for every page load, second one doesn't, though "more setup" - it's 1 step, in which you upload a file to your admin directory and run it, that's about it for `more setup`.....

If you don't constantly add / remove more Styles to/from your site, or if you don't have much space for the drop down box in your header (me for both) then the hardcoded version is your best choice :)

jancarlo
02-26-2003, 02:31 PM
Premetto that is Italian and use a translator in order to write to
you, I hope that you understand to me.

A question: how never I that I have 2500 user it is I have installed 3
stily I see on one style 603 user on one 7 users alone and last the 31
users?

And like never when change quati style I do not see the variation of
they use it in real time?

Practically the contatore not conteggia, that it is for that one?

I know that in all these post could are to us the solution but they
are many and of English I understand some little:)

Thanks and Hello jancarlo

gengar003
04-01-2003, 08:51 PM
I installed the style drop-down... but none of my styles showed up... why is that?

InfiniteWebby
04-13-2003, 03:10 AM
how do you change it so that on vb 2.3.0 when a user signs up his styleid is not 0 but soemthing different, so Default Vb Style Doesn't show in the drop down?

groovesalad
04-14-2003, 07:55 PM
I had this installed on 2.2.8, but when I install it on 2.3.0, it doesn't seem to change the styles...any ideas?

Rapdis
04-17-2003, 07:46 PM
oh my god... lol

is there a final version?

Rapdis
04-17-2003, 07:47 PM
Everything worked fine, until i uploaded anotha style, its not in the drop down box but is in the user cp... any ideaz?

StealthAnime
04-17-2003, 09:11 PM
thanks chen was looking for this :)

Alien
04-19-2003, 01:39 AM
Is this confirmed working in a fresh copy of vB 2.3.0? :)

gengar003
04-19-2003, 11:07 PM
It works on my vb 2.3.0

Just installed it, it's woderful! THanks!

gengar003
04-19-2003, 11:08 PM
Oh, and rapdis, I think i know what the problem is, though I'm relatively inexperienced... does the new style have any users? if not, change your style to it, via CP and it should show up.

Edit: Drat, I double-posted... I thouth VB.org had the stop double post hack, oh well...

Mr. Brian
05-03-2003, 04:03 PM
anyone out there have any ideal as why i'm keep getting this error in my showthread after installing this hack

Warning: Cannot modify header information - headers already sent by (output started at /home/soccerwi/public_html/forum/global.php:379) in /home/soccerwi/public_html/forum/admin/functions.php on line xxxx

thanks

Mr. Brian
05-03-2003, 11:30 PM
Anyone can help? :ermm:



[QUOTE]Yesterday at 06:03 PM Matthew Lam said this in Post #196 (https://vborg.vbsupport.ru/showthread.php?postid=390891#post390891)
anyone out there have any ideal as why i'm keep getting this error in my showthread after installing this hack

Warning: Cannot modify header information - headers already sent by (output started at /home/soccerwi/public_html/forum/global.php:379) in /home/soccerwi/public_html/forum/admin/functions.php on line xxxx

thanks

BustaCap
05-05-2003, 04:07 PM
The last part of the instructions says to modify the forumhome template. when I go to edit the forumhome template, it wants to know for which template set to change it. It looks like there is one for every style set I have installed. Do I have to change it for each one?

Also, when I make the new template cal'ed forumhome_dropdownbit, do i put that template in the default template set?

S.Shady
05-16-2003, 02:21 PM
Hello. I once had this installed on like 2.2.5 and it worked perfect. After awhile with not making and working on sites i've come back and now use 2.3.0

What i have going on here is. It works but with a few bugs.

1. I have 3 styles 2 will switch and the other the dropdown doesnt have its styleid. (so it will try to load index.php?styleid= )
2. The user count is messed up.

I really like this hack and see it working here perfectly. I would also like to use the perfect one :) any help ?

bluecat
05-28-2003, 10:46 PM
I've added a 4th a style template but it won't show up on the home page drop down menu, only in the user's usercp. How can I fix this? Thank you.

Liz
07-15-2003, 04:59 AM
I'm getting a weird problem wih 2.3.0.

First the default style wasn't showing up. So I went in and selected it for my style. And it worked.

But now it only says that one person is using it when in reality over 200 are. Any ideas on how to get the correct user count?

Edited: I think I figured out what the problem was. I'm just not sure how to fix it.

on 2.3.0 - when you go to select a style in your user CP, the first one that shows up is "use forum default" - I think that's what the problem is. I've also installed the "What styles are we all using" hack, and that comes up blank for all the people who had Default since that's the spot where "use forum default" now is. But if I go into someones account through the admin CP and I change their style to the Default one, it adds a number and it shows up on postbit (what styles are we all using).

Any ideas on how to get rid of the "use forum default" thing? I took it out of the template it was in through the admin CP, but it still isn't working. So I'm guessing I need to take it out of one of the php files. I just don't want to mess anything up. Anyone have any ideas?

Edited Again: bluecat - Try going into your own User CP and selecting the style that doesn't show up. It probably isn't selected, so I'd try using it yourself, and then it should work.

TutorialForums
08-06-2003, 08:38 AM
Mine stopped working correctly after upgrading to 2.30 as well. Hopefully someone can post a fix.... a lot of my users are a bit confused about it suddenly not working as usual haha :D

Peace.

willyfoo
09-11-2003, 02:22 AM
[QUOTE=N9ne]For me it has worked in 2.2.4, 2.2.5, 2.2.6, 2.2.7 AND 2.2.8...so there should be no problems :)

deathemperor
10-07-2003, 03:32 AM
ok, look like i got a same problem as every1 might get.
I added the code as instructions, but it only show the current style, not the drop down one. so i cant chose them :(
any suggestions ?

MaDCaT75
10-07-2003, 06:43 AM
What about if you wanna put in the dropdown thing: "Choose your style here:" ?

ronb
11-04-2003, 03:12 PM
I'm having a problem installing this hack. We're using the .php3 versions of the files for our board. I added the codes and created the template as suggested in the text but when i went from one screen to another i got a 'parse' error. I do not have the full context of the message. We list all the templates in the beginning of the index.php3 file. Do i need to put the new template in that list also? What else could i be doing wrong?

I was able to correct this error but i do not see any drop down box.

SVTOA
11-05-2003, 12:41 PM
[QUOTE=pahbi]I fixed my problem, and it works fine now.

First I changed in index.php: (its the bit of code for this hack)

$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");

To:

$allstyles=$DB_site->query("SELECT styleid,title FROM style ORDER BY title");


And then in the forumhome_dropdownbit template I changed the text to read:

<option value="$thisstyle[styleid]" $stylesel>$thisstyle[title]</option>


I don't get a users count anymore, but that really wasn't very important to me anyways. The most important thing is that it lists all of the styles available, and allows the person to choose one, and in that regard, this works perfect for me.

- Pahbi

Red Blaze
11-20-2003, 01:52 PM
Problem, I'm using 2.3.3 software and now it won't switch styles. The address bar says it switched but nothing really happend. It only refreshed the page.

deathemperor
11-21-2003, 02:55 AM
well, is this default in vb3 ? I cant see it AdminCP, how can I make it changeable for users ?

Aceman
03-03-2004, 01:45 AM
I had this working in VB3 but today when I reverted some templates everything went to hell. I've recoded in the the forumhome, forumhome_dropdownbit, and forumhome_styleselect. I have also tried to code into the index.php file but every single time I put this code:

// style drop down box (by FireFly)
$allstyles = $DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
$dropdownbits='';
while ($thisstyle=$DB_site->fetch_array($allstyles)) {
if ($styleid==$thisstyle[styleid]) {
$stylesel='selected';
} else {
$stylesel='';
}
eval("\$dropdownbits .= \"".gettemplate('forumhome_dropdownbit')."\";");
}
// style drop down box (by FireFly)

The EVAL line gives an error and in VB3 there is no line in the index.php that reads "// if user is know, then welcome" so I don't know where to place this script.. and infact.. get rid of the error.

HELP ME!

Aceman

Aceman
03-03-2004, 02:24 AM
Fixed my own problem VERY easily without needing to recode alot.

Moved the footer code upto my table on FORUMHOME:

<td class="alt2" width="150"><div align="center"><select style="font-family:verdana,arial,helvetica,sans-serif;font-size:9px;color:#000000;background-color:#ffffff" name="styleid" id="ressel" onchange="window.location=('$vboptions[forumhome].php?$session[sessionurl]styleid='+this.options[this.selectedIndex].value)"><optgroup label="$vbphrase[quick_style_chooser]">$quickchooserbits</optgroup></select></div></td>

Forumhome_dropdownbit:

<option value="$thisstyle[styleid]" $stylesel>$thisstyle[title]</option>

Forumhome_styleselect:

<option value="$thisstyle[styleid]" $stylesel>$thisstyle[title]</option>

This is now working on VB3 R4.
Aceman

007
04-29-2004, 12:32 AM
Did you get it working with counts for each style? (X users) next to each style? I am coming close but haven't found where VB3 creates the dropdown menu yet.

Once I can convert this line while ($thisstyle=$DB_site->fetch_array($allstyles)) to VB3 lingo then I will have a working user count in VB3.

Feel free to PM me if you see this and have any useful information for me. :)

kermit_criminal
07-14-2004, 09:20 PM
does this hack work for the latest version of vbulletin?

[QUOTE]In index.php, find this:
=========================
// if user is know, then welcome

And add this right before that:
================================
// style drop down box (by FireFly)
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
$dropdownbits='';
while ($thisstyle=$DB_site->fetch_array($allstyles)) {
if ($styleid==$thisstyle[styleid]) {
$stylesel='selected';
} else {
$stylesel='';
}
eval("\$dropdownbits .= \"".gettemplate('forumhome_dropdownbit')."\";");
}
// style drop down box (by FireFly)

In global.php, find this:
=========================
require('./admin/sessions.php');

And replace that with this:
================================
// style drop down box (by FireFly)
if (isset($changestyle)) {
$styleid=verifyid('style',$changestyle,0);
}
require('./admin/sessions.php');
if (isset($changestyle)) {
if ($styleid!=0)
$DB_site->query("UPDATE user SET styleid=$styleid WHERE userid=$bbuserinfo[userid]");
}
// style drop down box (by FireFly)

Now create a new template, call it forumhome_dropdownbit with this in it:
================================================== ========================
<option value="$thisstyle[styleid]" $stylesel>$thisstyle[title] ($thisstyle[count] users)</option>

And last but not least, add the following to your forumhome template anywhere you want:
================================================== ======================================
<select name="styleid" onchange="window.location=('index.php?s=$session[sessionhash]&changestyle='+this.options[this.selectedIndex].value)">
$dropdownbits
</select>

=========================
Happy holidays everyone!
=========================

ElementalReborn
09-22-2004, 01:45 PM
Can anyone tell me how to change the color of the dropdown box? I'd like to to match my forum, if possible.

CFF RA's
01-05-2006, 07:01 AM
Can someone explain a detailed how-to way to use this for version 2.3.7'

Thanks