vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   style name in postbit 0.3 (https://vborg.vbsupport.ru/showthread.php?t=92009)

Andreas 10-03-2005 07:48 PM

Idea to avoid the query caused by cache_styles:

showthread_start
PHP Code:

foreach ($vbulletin->stylecache AS $parentid => $parentstyles)
{
    foreach (
$parentstyles AS $displayorder => $styles)
    {
        foreach (
$styles AS $idx => $selstyle)
        {
            
$stylecache["$selstyle[styleid]"] =& $vbulletin->stylecache["$parentid"]["$displayorder"]["$idx"];
        }
    }



Cyricx 10-04-2005 04:46 PM

Better yet

Use this plugin in showthread_query

Code:

$hook_query_fields .= ",style.title";
$hook_query_joins .= " LEFT JOIN style AS style ON(user.styleid = style.styleid)";

Then in the postbit template just do

Code:

<if condition="$post['styleid'] != 0"><div class="smallfont">Style:
$post[title]
</div></if>

That's working for me now. Going to toy with it a bit more to clean it up and make it a clickable link that will change the style of the user and such, but that seems to be a good skeleton. :p

EDIT - okay, it needs a lil bit of tweaking LOL, in PMs it shows your style as the title of the pm hehehee.

murrtex 10-19-2005 03:54 AM

Quote:

Originally Posted by Cyricx
Better yet

Use this plugin in showthread_query

Code:

$hook_query_fields .= ",style.title";
$hook_query_joins .= " LEFT JOIN style AS style ON(user.styleid = style.styleid)";

Then in the postbit template just do

Code:

<if condition="$post['styleid'] != 0"><div class="smallfont">Style:
$post[title]
</div></if>

That's working for me now. Going to toy with it a bit more to clean it up and make it a clickable link that will change the style of the user and such, but that seems to be a good skeleton. :p

EDIT - okay, it needs a lil bit of tweaking LOL, in PMs it shows your style as the title of the pm hehehee.

can u tell how can i apply your codes,thanks

Cyricx 10-26-2005 12:06 AM

Murrtex, mine doesn't work at all, causes alot of bugs :), was a good idea but bad application :)

I'm going to try Andreas code :)

Cyricx 10-26-2005 12:13 AM

O awesome! It worked great, no extra queries by what I can tell :)

Just replace the showthread_start plugin with andreas code :)

Thanks Andreas!!

murrtex 10-26-2005 01:36 AM

ok cyricx..what will we do..fist i'll install style name in postbit 0.3.zip plugin than apply andreas code..can u show me the way? how ?

Cyricx 10-26-2005 02:02 AM

Admincp -> plugin system -> download / upload plugins

Scroll to the bottom, Click browse, select the xml in the first post, click import

now

admincp -> plugin system -> plugin manager

scroll down to "Hook Location : showthread_start" - "Styles in Postbit" and click Edit for that one.

Replace all the code in the "PHP Plugin Code" box with Andreas code above.

Click save.

Do the template edit.

Tada :)

murrtex 10-29-2005 12:42 PM

Quote:

Originally Posted by Cyricx
Admincp -> plugin system -> download / upload plugins

Scroll to the bottom, Click browse, select the xml in the first post, click import

now

admincp -> plugin system -> plugin manager

scroll down to "Hook Location : showthread_start" - "Styles in Postbit" and click Edit for that one.

Replace all the code in the "PHP Plugin Code" box with Andreas code above.

Click save.

Do the template edit.

Tada :)

ok thanks i did it..it works but ...some users ok ,some users no show..??

JoeWho 10-29-2005 09:38 PM

Murrtex,
Did you get this to work, I have Replace all the code in the "PHP Plugin Code" box with Andreas code but still can not see the style.

JoeWho

murrtex 10-29-2005 11:13 PM

same on me JoeWho..it works on some user,it doesnt work on some user. :(


All times are GMT. The time now is 09:50 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.01172 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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