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
  #2  
Old 03-28-2004, 03:41 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright first install. . . I love this hack!

Thanks!!
Reply With Quote
  #3  
Old 03-28-2004, 04:40 PM
DarkJediKiller DarkJediKiller is offline
 
Join Date: Jan 2004
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks good. Excellent job ^_^
Reply With Quote
  #4  
Old 03-28-2004, 05:32 PM
Mr. Brian's Avatar
Mr. Brian Mr. Brian is offline
 
Join Date: Jan 2003
Location: Internet
Posts: 300
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #5  
Old 03-28-2004, 05:46 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok It does not work with childstyles though How to do this?
Reply With Quote
  #6  
Old 03-28-2004, 07:53 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

strange i did everything and checked it twice but only get a ":" where it is suposed to go?
Reply With Quote
  #7  
Old 03-28-2004, 08:39 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
strange i did everything and checked it twice but only get a ":" where it is suposed to go?
You need the phrases to add.
Reply With Quote
  #8  
Old 03-28-2004, 08:39 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
Ok It does not work with childstyles though How to do this?
It works for me using child styles Show me a screenshot of the style manager so I can see all your styles and childs, etc.
Reply With Quote
  #9  
Old 03-28-2004, 08:44 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary W
You need the phrases to add.
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?
Reply With Quote
  #10  
Old 03-28-2004, 08:53 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gary W
It works for me using child styles Show me a screenshot of the style manager so I can see all your styles and childs, etc.
Ok
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:50 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.07472 seconds
  • Memory Usage 2,316KB
  • Queries Executed 23 (?)
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
  • (4)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
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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