vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Social Groups - Post Count (https://vborg.vbsupport.ru/showthread.php?t=259136)

Brandy-Dw 02-19-2011 07:52 PM

Social Groups - Post Count
 
I'm currently using vbulletin version 4.1.0

And i'm curious how to make it so that social group posts add to a members post count and how social group posts add to the forum post count.

Would be very helpful if someone could help me with this...

thank you

--------------- Added [DATE]1298222000[/DATE] at [TIME]1298222000[/TIME] ---------------

anyone?... please..

induslady 08-18-2011 02:47 AM

Hello,

As am too interested in this feature? Any ideas?

Badshah93 08-18-2011 03:39 AM

To count social group posts in user total posts

Create New Plugin

HooK: group_message_post_complete

Title: ur wish

Code

Code:

$db->query_write("UPDATE ".TABLE_PREFIX."user set posts = posts+1
where userid = ".$vbulletin->userinfo['userid']."");


and don't forgot to make plugin active.

induslady 08-18-2011 02:49 PM

Hello Sherif,

Thanks for sharing the plugin code.

After activating this plugin do I need to run "Maintenance>Update Counters > Update Post Counts"?

Badshah93 08-18-2011 02:53 PM

Quote:

Originally Posted by induslady (Post 2234958)
Hello Sherif,

Thanks for sharing the plugin code.

After activating this plugin do I need to run "Maintenance>Update Counters > Update Post Counts"?

no it will count the social group post as main post from now onwards..

induslady 08-18-2011 04:10 PM

Hello,

Can you tell me SQL query that I could run it one time so that the user's post count includes the social group messages prior to this plugin?

Mooff 08-18-2011 05:08 PM

Wouldn't 'Update Post Counts' remove all +1 numbers the plugin added?

Lynne 08-18-2011 08:45 PM

Quote:

Originally Posted by Mooff (Post 2235012)
Wouldn't 'Update Post Counts' remove all +1 numbers the plugin added?

Yep.

If you wanted to really do this right, you would create a new field in the user table to keep track of the number of group posts. Then just add them together for the template. That will be a bit more involved though and won't just be a couple of little plugins.

induslady 08-19-2011 04:22 PM

Hi Lynne, I tried this plugin :


Hook Location : postbit_display_start

code:
PHP Code:

$usersid $this->post['userid'];
$fpost $this->post['posts'];
$gmessage mysql_query("SELECT gmid FROM " TABLE_PREFIX "groupmessage WHERE postuserid='$usersid' AND state='visible'");
    
$gpost mysql_num_rows($gmessage);
        
$totalpost $fpost $gpost

Here post.posts is the total post count of user from forum postings and the query gets the post count from social group message an both are added.
Used this variable totalpost in the postbit template but not getting the desired result.

Can you let me know how to fix this.

Lynne 08-19-2011 10:15 PM

What exactly seems to be the problem?

You do realize that that will create one additional query per post per page, correct?


All times are GMT. The time now is 12:54 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.01136 seconds
  • Memory Usage 1,738KB
  • 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_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
  • (1)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