Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Change style on index with UPDATE Details »»
Change style on index with UPDATE
Version: 1.00, by grog6 grog6 is offline
Developer Last Online: Dec 2008 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 05-01-2003 Last Update: Never Installs: 23
 
No support by the author.


This hack displays a small box at the top of your forum's index, where you can change easily of style.
The number of users who used is too displayed just next the Style's name.

This hacks was already existed :

https://vborg.vbsupport.ru/showthrea...tyle+AND+index

but it didn't updat the user's table in the database, and if you use others hacks which display the user's style in the postbit, or an other hack to list hacks used on your board (such as mine or Lesane's), information which was displayed was false ! Now, it's updated when the user uses this scroll menu, and so, no pb with other hacks :-)

Moreover, the style directly shown in the scroll menu, is the style that the user uses, so he knows which style he used
A simple changement in this scroll menu, and the user is automatically redirected to the forum's index with the new style selected





Ce hack affiche en haut de votre forum une petite boite, ou vous pouvez facilement changer de style.
Le nombre d'utilisateurs utilisant ce style est egalement montre a cote du nom du style.

Ce genre de hack existait deja :

https://vborg.vbsupport.ru/showthrea...tyle+AND+index

mais il ne mettait pas a jour les infos du membre dans la table user, et si vous utilisez d'autres hacks qui montre le style de chaque membre dans le postbit, ou mon hack qui liste les styles utilises sur votre forum, les infos affichees auraient alors pu etre fausses ! Maintenant c'est mis a jour quand le user utilise ce petit menu, et ainsi, plus de pb avec les autres hacks :-)

De plus, le style actuellement utilis? par le membre est directement affiche, ainsi il sait quel style il utilise a tout moment.
Un simple changement dans ce menu, redirige le membre vers l'accueil du forum avec le nouveau style choisi




[HIGH]Here is the english version.
I could understand a mod or Firefly want to remove this hack (which is only a modification of an other one)


Voici la version anglaise.
Je pourrais comprendre qu'un modo ou un Firefly veuille supprimer ce hack, etant donne que ce n'est que la modification d'un hack de Firefly
[/HIGH]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 06-11-2003, 11:48 AM
grog6's Avatar
grog6 grog6 is offline
 
Join Date: Apr 2002
Location: France
Posts: 328
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can nothing for you at the moment ... haven't any time ...

See it later (at the end of the week ! )
Reply With Quote
  #43  
Old 06-23-2003, 06:40 PM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a security issue with this hack. I won't release the detail just yet, but here is what mine currently looks like:
PHP Code:
if ($bbuserinfo['userid'] > and $_GET['styleid'] > 0) {
        
$newstyleset intval($_GET['styleid']);
        if (
$allowchangestyles==1) {
                        
$DB_site->query("UPDATE session SET styleid='$newstyleset' WHERE sessionhash='".addslashes($session['dbsessionhash'])."'");
                        
$DB_site->query("UPDATE user SET styleid='$newstyleset' WHERE userid='$bbuserinfo[userid]' LIMIT 1");
                        
vbsetcookie("bbstyleid","",1);
        }
          
standardredirect("Style settings have been updated."$bburl);
        exit;

There extra code is how vB itself deals with changing styles i.e. expiring the style cookie and updating the sessions table.
Reply With Quote
  #44  
Old 06-28-2003, 02:18 PM
BigJohnson BigJohnson is offline
 
Join Date: Nov 2001
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey SideKick. I have fixed that problem you have been tlaking about with the having to sumbit twice. Well that problem is due to this hack.

I have fixed it. And I think vbulletin.org should actually use this hack as well.

Ok go to member.php.

change this

Code:
  $stylesetlist = "";
  if ($allowchangestyles==1) {
    $stylesets=$DB_site->query("SELECT * FROM style WHERE userselect=1 ORDER BY title");
    if ( !isset($bbuserinfo['realstyleid']) ) {
      $bbuserinfo['realstyleid'] = $bbuserinfo['styleid'];
    }
    while($thisset=$DB_site->fetch_array($stylesets)) {
      if ($bbuserinfo['realstyleid']==$thisset['styleid']) {
        $selected = "selected";
      } else {
        $selected = "";
      }
      $thisid = $thisset['styleid'];
      $thisstylename = $thisset['title'];
      eval ("\$stylesetlist .= \"".gettemplate("modifyoptions_styleset")."\";");
      eval ("\$stylecell = \"".gettemplate("modifyoptions_stylecell")."\";");
    }
  } else {
    $stylecell = "";
  }
to this

Code:
 $stylesetlist = "";
  if ($allowchangestyles==1) {
$styles=$DB_site->query("SELECT styleid,title FROM `style` WHERE userselect='1'  ORDER by styleid");
while ($style=$DB_site->fetch_array($styles)) {

$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='';

eval ("\$stylesetlist .= \"".gettemplate("modifyoptions_styleset")."\";");

}
eval ("\$stylecell = \"".gettemplate("modifyoptions_stylecell")."\";");

if ($styleid!='')
{
$DB_site->query("UPDATE user SET styleid='$styleid' WHERE userid='$bbuserinfo[userid]'");
}
}else{
$stylecell = "";
  }
and then change in the templates

modifyoptions_styleset
to this

Code:
<option value="$style[styleid]" $select> $style[title] ($nombre)</option>
This works 100%. I hope u enjoy it.
Reply With Quote
  #45  
Old 06-29-2003, 02:34 AM
-Sidekick- -Sidekick- is offline
 
Join Date: May 2002
Location: Cudahy, Wi
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much for looking into it Big, but I think I'm gonna hold off untill this security issue is looked into, and someone can modify it so it will work in the header as well.
Reply With Quote
  #46  
Old 06-29-2003, 05:14 PM
Kamui Shirou's Avatar
Kamui Shirou Kamui Shirou is offline
 
Join Date: Sep 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

now ive got 45 queries instead of 35
Reply With Quote
  #47  
Old 06-29-2003, 06:37 PM
Kamui Shirou's Avatar
Kamui Shirou Kamui Shirou is offline
 
Join Date: Sep 2002
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hm some kind of wierd. with out this hack i've got 33 queries, with it i've got 45 queries. with the one firefly posted 41 queries..... what the hell please help me ^^
Reply With Quote
  #48  
Old 08-12-2003, 03:30 AM
DB8 MissingLink DB8 MissingLink is offline
 
Join Date: May 2003
Location: Los Angeles, CA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this has been asked and vaguely responded to, but it would be awesome if I could add this to the header instead of forumhome...

Anyone...?

Please

jEd
Reply With Quote
  #49  
Old 08-14-2003, 04:23 AM
-Sidekick- -Sidekick- is offline
 
Join Date: May 2002
Location: Cudahy, Wi
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
08-11-03 at 11:30 PM DB8 MissingLink said this in Post #47
I know this has been asked and vaguely responded to, but it would be awesome if I could add this to the header instead of forumhome...

Anyone...?

Please

jEd
This hack was ditched by the hacker a couple of months ago. =\
Reply With Quote
  #50  
Old 01-16-2004, 06:32 PM
trinitym's Avatar
trinitym trinitym is offline
 
Join Date: Jan 2004
Location: between hell & insanity
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is someone distributing this hack for vb3? I'd love to add this type of functionality to my board. I noticed it's on this [vb.org] board.

[I did a search and all I could find were vb2x versions, sorry if I'm blind.]
Reply With Quote
  #51  
Old 01-17-2004, 01:15 AM
grog6's Avatar
grog6 grog6 is offline
 
Join Date: Apr 2002
Location: France
Posts: 328
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hurm, haven't you seen at the bottom of each page on vb3 a similar thing ??
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05038 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete