vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   {vb:raw post.threads}? (https://vborg.vbsupport.ru/showthread.php?t=322070)

Inked_Mono 03-10-2016 12:29 AM

{vb:raw post.threads}?
 
Does anybody know if such a thing exists? I'm looking to keep count of threads created by members in their postbit_legacy, but have tried a few variations and can't seem to find one that works.

squidsk 03-10-2016 12:40 AM

That statistic doesn't exist in stock vb. I think a few products add it in but I don't have links.

Inked_Mono 03-10-2016 12:44 AM

Quote:

Originally Posted by squidsk (Post 2566905)
That statistic doesn't exist in stock vb. I think a few products add it in but I don't have links.

Ack, that's really unfortunate. I think there's a few plugins that might as well. Do you know, off hand, if they'd allow for such a feed to exist? I'd like to maintain the same design structure of my postbit_legacy, and being able to just have the number generated would be fantastic.

MarkFL 03-10-2016 01:34 AM

Create the following plugin:

Product: vBulletin

Hook Location: postbit_display_complete

Title: Get the number of threads started by a user

Execution Order: 5

Plugin PHP Code:

PHP Code:

global $db$vbulletin;

$user_threads $vbulletin->db->query_read("
    SELECT COUNT(*) AS thread_count
    FROM " 
TABLE_PREFIX "thread AS thread
    where postuserid = " 
$post['userid']
);

$user_thread $db->fetch_array($user_threads);

$post['threads'] = $user_thread['thread_count']; 

Plugin is Active: Yes

Click "Save".

Now, in your postbit template (whichever you use), you can use {vb:raw post.threads} to display the number of threads started by users.

Inked_Mono 03-10-2016 04:49 AM

You're a hero, Mark, thank you. I'll give it a shot as soon as I can.
Edit: It works perfectly, thank you!

MarkFL 03-10-2016 05:03 AM

After editing my post above, the OP reports it now works. :o

setishock 03-10-2016 09:13 AM

I don't use legacy. Will this work in the normal mode?

Dave 03-10-2016 12:14 PM

It shouldn't matter if you use postbit or postbit_legacy. The only difference between those templates is the HTML inside of it.


All times are GMT. The time now is 04:13 PM.

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.01004 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete