View Full Version : Add PM's To The Postcount!
SgtSling
08-13-2002, 02:55 AM
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?
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.php?threadid=110647
I have not released this hack. I can release it if anyone is interested. :)
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:
if ($post['receivepm'] and $enablepms==1) {
eval("\$post[pmlink] = \"".gettemplate("postbit_sendpm")."\";");
} else {
$post[pmlink] = "";
}
Add under that:
$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:
$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.
Here is the hack: https://vborg.vbsupport.ru/showthread.php?s=&threadid=42360
[D]Vincent
08-16-2002, 08:53 AM
Vincent]Okay install that hack and after:
$pmratio = 100 * $pmcount[msgs] / $pmquota;
Add:
$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...)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.