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

Reply
 
Thread Tools
What style are we all using? Details »»
What style are we all using?
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-27-2004 Last Update: Never Installs: 86
 
No support by the author.

NOTE: Make sure all your styles have different display orders (only if they are in the same grouping). For instance, don't have 2 styles each with the display order of '1' otherwise this hack will just show 'Style: ' and no style shown.

This hack will show each users current selected style when viewing a post.
If you want to see how this looks, take a look at the screenshot attached.

The style system is a little more complex than the vBulletin 2 one, but it's still pretty simple and straightforward.

My apologies if this has already been released! I must also note that all of this code is original, meaning I made it all myself, I didn't look at someone else's code if anyone was wondering, so that we don't play the 'blame game' later on.

NOTE: For those who are wondering, this hack adds NO EXTRA QUERIES to your pages! Meaning the load and processing time are about the same as usual, they don't change much

Okay anyhow, here we go:

Instructions

Open includes/functions_showthread.php and find
PHP Code:
    static $gotrank$sigcache$sigperms$gotage$month$day$year$counter
Above, add:
PHP Code:
    global $stylechoosercache$vbphrase
Find
PHP Code:
    eval('$retval = "' fetch_template($maintemplatename) . '";'); 
Above add
PHP Code:
    // check what style the user is viewing
    
if (!$post['styleid'])
    {
        
$post['style'] = '(' $vbphrase['not_specified'] . ')';
    }
    else
    {
        
// loop thru the $stylechoosercache to see which style the user is using, has to loop thru a few times
        
foreach ($stylechoosercache as $parentstyle)
        {
            foreach (
$parentstyle as $innerstyleid)
            {
                if (
$innerstyleid[0]['styleid'] == $post['styleid'])
                {
                    
$post['style'] = '<a href="' $vboptions['forumhome'] . '.php?' $session['sessionurl'] . 'styleid=' $post['styleid'] . '">' $innerstyleid[0]['title'] . '</a>';
                    continue;
                }
            }    
        }
    } 
Open the postbit template (or postbit_legacy if you're using old-style postbits) and find
HTML Code:
					<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>
Above, add
HTML Code:
					<!-- user forum style -->
<div>$vbphrase[style]: <if condition="$post[style] == '$vbphrase[not_specified]'"><a href="$vboptions[forumhome].php?styleid=$vboptions[styleid]">Default Style</a><else />$post[style]</if></div>
					<!-- / user forum style -->
Now add the following phrase:

Phrase Type: GLOBAL

Title: not_specified
Text: not specified

Title: style
Text: Style

All done!

Show Your Support

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

Comments
  #12  
Old 03-28-2004, 08:55 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Matthew Lam
Well done!

BTW, is there any way that could be able to made that as a link? Whereby user can click on it ? Exactly like what Vb.org having now.

thanks
vb.org is using the quick and dirty way, like i call it.
the Style part is not generated, but it's a big if condition test in postbit, (as it was done during the Beta when we didn't want to hack where not needed)
Reply With Quote
  #13  
Old 03-28-2004, 09:02 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ryancooper
The phrase is definatly there. jsut tryed to add it again and got There is already a phrase named 'not_specified'. You may not create duplicate names

there is only 1 phrase correct?

Any other ideas?
Thanks for bringing this to my attention. I fixed it now, for upgrading, just replace global $stylechoosercache;

with global $stylechoosercache, $vbphrase;
Reply With Quote
  #14  
Old 03-28-2004, 09:29 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary W
Thanks for bringing this to my attention. I fixed it now, for upgrading, just replace global $stylechoosercache;

with global $stylechoosercache, $vbphrase;
Oh good so i wasn't going nutz!! LOL Thanks for a great hack!

Updated but still get teh same thing??
Reply With Quote
  #15  
Old 03-28-2004, 09:58 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes the same here. Or you see a : (when a child style whas chosen) or the phrase '(not_specified)' but if they choose a master style it's correct displayed.
Reply With Quote
  #16  
Old 03-28-2004, 10:43 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry about that guys

Add the following phrase:

Title: style
Text: Style
Reply With Quote
  #17  
Old 03-28-2004, 10:59 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well...it's the same only now it;s: Style:
Reply With Quote
  #18  
Old 03-28-2004, 11:05 PM
Mr. Brian's Avatar
Mr. Brian Mr. Brian is offline
 
Join Date: Jan 2003
Location: Internet
Posts: 300
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about this? Is it possible or not?


Thanks.

Quote:
Originally Posted by Matthew Lam
Well done!

BTW, is there any way that could be able to made that as a link? Whereby user can click on it ? Exactly like what Vb.org having now.

thanks
Reply With Quote
  #19  
Old 03-28-2004, 11:23 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Matthew Lam
How about this? Is it possible or not?


Thanks.
Done, just replace the old code w/new code now.
Reply With Quote
  #20  
Old 03-28-2004, 11:24 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NuclioN
Well...it's the same only now it;s: Style:
Works fine for me.
Reply With Quote
  #21  
Old 03-28-2004, 11:44 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't see the chosen styles (see attach)
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 09:05 AM.


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.07235 seconds
  • Memory Usage 2,329KB
  • 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
  • (2)bbcode_html
  • (4)bbcode_php
  • (6)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
  • (1)pagenav_pagelinkrel
  • (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