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 on index with UPDATE (https://vborg.vbsupport.ru/showthread.php?t=52491)

grog6 05-03-2003 09:30 AM

@ Metrosports82 : Replace in the index.php

PHP Code:

$styles=$DB_site->query("SELECT styleid,title FROM `style` ORDER by styleid"); 

by
PHP Code:

$styles=$DB_site->query("SELECT styleid,title FROM `style` WHERE userselect='1'  ORDER by styleid"); 

[HIGH]Archive updated ;) [/HIGH]

MetroSports82 05-03-2003 01:28 PM

thanks mate. great job on the hack. ;)

Alien 05-03-2003 05:30 PM

Hey nice work.

May I ask exactly what needs to be removed to take out the number of users using a style? Thanks!

-Jason

Quote:

Yesterday at 07:26 PM grog6 said this in Post #8
1 query to get the number of styles,

1 other which is run X times (depends of your number of styles to display how many users use the style, but you can remove this query and not show the number of users who use styles,

and 1 to update the user's table which is ONLY run if the user modify his style ;)


grog6 05-03-2003 05:59 PM

@ Alien : Remove it from the index.php modification :

PHP Code:

$listes=$DB_site->query_first("SELECT COUNT(*) AS nombre FROM `user` WHERE styleid='$style[styleid]'");
$nombre=$listes[nombre];

if (
$bbuserinfo[styleid] == $style[styleid]) $select='selected'; else $select=''

And it from the style_liste template : ($nombre)

-Sidekick- 05-03-2003 11:28 PM

Here is a problem I'm having with this hack...

If I use the style change hack to change my style, then I go into my usercp options and try to change it to something else, it won't take effect on the style I pick in my usercp options unless I pick it twice in a row.

Did I explain that okay? -.-

o0stephane0o 05-05-2003 08:50 AM

Side click, the bug you are experioencing have nothing to see with that hack, you have just noticed it now but it was there before installing that hack.

Edgar 05-05-2003 11:16 AM

Nice hack, but the numbers are not coming up correct for me.
To see what I mean see: http://www.avalancheonline.com/forums/index.php?s=
I have close to 1900 members yet only 200 or so users are showing up in the menu. And these are the only 3 styles there are.

grog6 05-05-2003 11:30 AM

@ Edgar : Take a look into your database, and look if other users don't have a wrong styleid recorded in their profile which may correspond to an old style you could have removed ;)

Edgar 05-05-2003 12:19 PM

Ah, that will probably be it. I had a duplicate on one of my styles I later removed. So I guess the number will only update when people use that dropdownbox now or change it in their profile again, I see it already increased by a few numbers.

But I can live with it. Nice job with your hacks man, I already installed a few of them. They're small but usefull hacks, I like it that way.

grog6 05-05-2003 12:27 PM

Cliks install if you like it :)


All times are GMT. The time now is 08:18 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
  • Page Generation 0.01168 seconds
  • Memory Usage 1,739KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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