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
  #42  
Old 04-01-2004, 10:02 PM
Mike_XBLW Mike_XBLW is offline
 
Join Date: Dec 2003
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK...for everyone who is having the "Style:" problem...here's the fix...

In the style manager...display order, make sure they don't all have the same number...actually number them 1, 2, 3, 4, etc....

I had all of mine set to 1, but when I changed it, magically, it started working
Reply With Quote
  #43  
Old 04-01-2004, 11:33 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 Mike_XBLW
OK...for everyone who is having the "Style:" problem...here's the fix...

In the style manager...display order, make sure they don't all have the same number...actually number them 1, 2, 3, 4, etc....

I had all of mine set to 1, but when I changed it, magically, it started working
Ah yes, thanks for this
Reply With Quote
  #44  
Old 04-02-2004, 06:16 PM
Vivi Ornitier's Avatar
Vivi Ornitier Vivi Ornitier is offline
 
Join Date: Nov 2001
Location: Black Mage Village
Posts: 442
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice, lol, what an easy fix too. Seems like you coded it very well, just a small little thing t hat you diddn't expect your fellow hack users to do. good job on the hack gary and good correction on that mike
Reply With Quote
  #45  
Old 04-14-2004, 03:05 AM
calvinnguyen calvinnguyen is offline
 
Join Date: Nov 2003
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mike_XBLW
OK...for everyone who is having the "Style:" problem...here's the fix...

In the style manager...display order, make sure they don't all have the same number...actually number them 1, 2, 3, 4, etc....

I had all of mine set to 1, but when I changed it, magically, it started working
Yeah, this is working.

But some users display:
Style: xxxxxxx
some users display:
Style:

some users display:

Style: not specified


***I know why for user had display Style: not specified, but how come some users still have display
Style:
Reply With Quote
  #46  
Old 04-14-2004, 03:10 AM
calvinnguyen calvinnguyen is offline
 
Join Date: Nov 2003
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do we count each style have many users used it?
Reply With Quote
  #47  
Old 04-14-2004, 12:53 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 calvinnguyen
How do we count each style have many users used it?
That's somewhat a new hack altogether; although if you know how to code it yourself, here's a query to get you started:

[sql]SELECT styleid, COUNT(styleid) AS count FROM user GROUP BY styleid[/sql]
Reply With Quote
  #48  
Old 04-21-2004, 12:53 AM
lazserus's Avatar
lazserus lazserus is offline
 
Join Date: Mar 2004
Location: Planet Earth
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason this is not working for me. I'm not getting any errors, but nothing happens. It's weird. It's simple enough and I followed the directions to the T. Yet, the style doesn't show up at all.

I tried to post a screenshot, but the server kept getting reset. It's not really necessary, though. Imagine what your board looks like w/o this hack installed and you've got my problem. I've got the hack installed, but nothing has changed.
Reply With Quote
  #49  
Old 04-21-2004, 11:15 AM
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 lazserus
For some reason this is not working for me. I'm not getting any errors, but nothing happens. It's weird. It's simple enough and I followed the directions to the T. Yet, the style doesn't show up at all.

I tried to post a screenshot, but the server kept getting reset. It's not really necessary, though. Imagine what your board looks like w/o this hack installed and you've got my problem. I've got the hack installed, but nothing has changed.
If you're using old style postbits, then modify postbit_legacy instead of the postbit template
Reply With Quote
  #50  
Old 04-21-2004, 04:11 PM
lazserus's Avatar
lazserus lazserus is offline
 
Join Date: Mar 2004
Location: Planet Earth
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You know what, that must be it! I am using legacy and I didn't even put it together. Thanks! :surprised:
Reply With Quote
  #51  
Old 04-21-2004, 10:29 PM
lazserus's Avatar
lazserus lazserus is offline
 
Join Date: Mar 2004
Location: Planet Earth
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is working just like it was designed and I love it. I have one question, however. Is there a way to make is to that someone who uses "Forum Default" is not classified as "unspecified"? Say if the forum default style is called "Bob" and the standard user just uses the forum default -- is there some kind of if condition that could be put in place that would point it to whichever style is the forum default? I hope I'm making sense. So, if user Joe is using forum default the postbit would display "Bob" instead of unspecified.

Also, what does it mean if the Style: is blank? I apologize if this has all been mentioned before in this thread. I thought I read everything, I swear. :nervous:
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:39 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.04871 seconds
  • Memory Usage 2,327KB
  • 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
  • (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
  • (4)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