vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Change Style Drop-Down (https://vborg.vbsupport.ru/showthread.php?t=33418)

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
PHP Code:

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


All times are GMT. The time now is 04:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01356 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete