vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   What style are we all using? (https://vborg.vbsupport.ru/showthread.php?t=63068)

Gary King 03-27-2004 10:00 PM

What style are we all using?
 
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! :)

ryancooper 03-28-2004 03:41 PM

Alright first install. . . I love this hack!

Thanks!! :)

DarkJediKiller 03-28-2004 04:40 PM

Looks good. Excellent job ^_^

Mr. Brian 03-28-2004 05:32 PM

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

NuclioN 03-28-2004 05:46 PM

Ok :) It does not work with childstyles though :( How to do this?

ryancooper 03-28-2004 07:53 PM

strange i did everything and checked it twice but only get a ":" where it is suposed to go?

Gary King 03-28-2004 08:39 PM

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.

Gary King 03-28-2004 08:39 PM

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.

ryancooper 03-28-2004 08:44 PM

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?

NuclioN 03-28-2004 08:53 PM

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 :)


All times are GMT. The time now is 02:02 AM.

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.01233 seconds
  • Memory Usage 1,757KB
  • 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
  • (2)bbcode_html_printable
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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