vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Add PM's To The Postcount! (https://vborg.vbsupport.ru/showthread.php?t=42225)

SgtSling 08-13-2002 02:55 AM

Add PM's To The Postcount!
 
Add PM's To The Postcount!

How can this be done?
anyone?

[D]Vincent 08-13-2002 04:23 AM

This wouldnt be to hard but your members would start sending pointless messages to each other and getting it added to their postcount.

SgtSling 08-13-2002 11:24 AM

Anyone?
Can this be done?

[D]Vincent 08-13-2002 11:30 AM

Vincent]I just said it can :rolleyes: If you want it that badly I'll do it later today when I get a new keyboard.

SgtSling 08-13-2002 11:32 AM

Dude I would love that
.. hopefully it will work with 2.21

SgtSling 08-14-2002 10:05 PM

any news?

Zzed 08-15-2002 05:31 AM

I have done that in my forums. It does not require any template modifications.

Check out this thread for an example: http://www.ls1.com/forums/showthread...hreadid=110647

I have not released this hack. I can release it if anyone is interested. :)

Neo 08-15-2002 09:17 AM

Neo
ultimate loser

Online
Registered: May 2304
Local Time: 99.99 ZM
Style: Pimp
PM Count To Freddie: 435,834,395

[D]Vincent 08-15-2002 10:29 AM

Vincent]Okay so you want the postcount to be total posts plus total PMs correct? If so then use this.

Open admin/functions.php
Find:
PHP Code:

        if ($post['receivepm'] and $enablepms==1) {
            eval(
"\$post[pmlink] = \"".gettemplate("postbit_sendpm")."\";");
        } else {
            
$post[pmlink] = "";
        } 

Add under that:
PHP Code:

$pmcount $DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$touserinfo[userid]");
$postspms $post[posts] + $pmcount[messages]; 

Then login to Admin CP, go to Templates > Modify > Template Set[expand] > Postbit[expand] > postbit
Find:
$post[posts]

Replace that with:
$postspms

And you're done, it adds your PM count to your post count. If I'm wrong then sorry =\

SgtSling 08-15-2002 03:41 PM

that doesn't work bro...

SgtSling 08-15-2002 03:47 PM

Invalid SQL: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

FlyingDutchman 08-15-2002 04:35 PM

yupz, this line:

PHP Code:

$pmcount $DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$touserinfo[userid]"); 

doesn't work... non-object, so plz check the db ;) (don't have phpmyadmin running right now so can't check really...

FlyingDutchman 08-15-2002 05:05 PM

the only thing i can think of is that userid="$touserinfo[userid]" needs to be userid="$bbuserinfo[userid]"...
but still it doesn't work...

exact error for me:

Fatal error: Call to a member function on a non-object in functions.php on line 209

everytime thesame ++++ :( :bored: :dead:

[D]Vincent 08-15-2002 05:39 PM

That's weird because that's the exact query used in private.php. Get Zzed to release his hack or something.

[D]Vincent 08-15-2002 05:49 PM

Okay try:
$pmcount = mysql_query("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid='$touserinfo[userid]'");

If that doesn't work try:
$pmcount = mysql_query("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid='$bbuserinfo[userid]'");

If that doesn't work then get Zzed to release his hack.

Zzed 08-16-2002 08:20 AM

Here is the hack: https://vborg.vbsupport.ru/showthrea...threadid=42360

[D]Vincent 08-16-2002 08:53 AM

Vincent]Okay install that hack and after:
PHP Code:

 $pmratio 100 $pmcount[msgs] / $pmquota

Add:
PHP Code:

 $postspms $pmcount[msgs] + $post[posts]; 

And open the template postbit and replace $post[posts] with $postspms. Then it should work.

FlyingDutchman 08-16-2002 12:09 PM

why doesn't it work when i just put $pmcount[msgs] in the templates? i should get the number of pm's right? but i get nothing! (talking about Zzeg's hack...)


All times are GMT. The time now is 04:01 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.01413 seconds
  • Memory Usage 1,755KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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