Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, somewhere along the line - the actual query text was changed making that $Totalposts = $user['U_Totalposts'] + 1 bit in the code kind of redundant - except for figuring out the next title they get.

HERE is how it's done. ;0

In addpost.php

Find this:
Code
<br />      $Totalposts = $user['U_Totalposts'] + 1;<br />


Change to this:

Code
<br />if ($Board == "whateverkeyword") {<br />     $Totalposts = $user['U_Totalposts'];<br />} else {<br />     $Totalposts = $user['U_Totalposts'] + 1;<br />}<br /><br /><br />Then in the query - find this line:<br />[code]<br />        SET    U_Totalposts = U_Totalposts + 1,<br />


And change to this:
Code
<br />        SET    U_Totalposts = $Totalposts,<br />




If you need to exclude more than one forum from post counts, then you'd need to alter the if line:
Code
<br />if (($Board == "whateverkeyword") || ($Board == "thatkeyword")) {<br />

Sponsored Links
Joined: Dec 2003
Posts: 107
Journeyman
Journeyman
Joined: Dec 2003
Posts: 107
Hurray! Now it works!

Thanks!

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
[]slayer60 said:
I *think* that should be right. This is totally untested, my skillz are...limited, and I haven't applied this myself. [/]
Like I said...limited.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Since I'm not a huge fan of hard coding things like this, in case I wanted to add another board later, I took this one step farther.

Code
 <br /><br />   // ------------------------<br />   // Up their totalposts by 1 unless it's a specified board<br />	if (stristr(",{$config['no_post_count']},",",$Board,")) {<br />		$Totalposts = $user['U_Totalposts'];<br />		$CurrTitle  = $user['U_Title'];<br />		$Color      = $user['U_Color'];<br />	}<br />    	else {<br />    		$Totalposts = $user['U_Totalposts'] + 1;<br />		$CurrTitle  = $user['U_Title'];<br />		$Color      = $user['U_Color'];<br />	}<br /> 


no_post_count is set in my admin config, with 3 boards being used, as follows:

Code
 <br />$config['no_post_count'] = 'testinggrounds,guildarchive,test';<br /> 


I thought this had been released as an "official" mod and spent a lot of time looking for it. hehe

Guess someone could write it up and post it in there. I will probably do that if no one objects.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609

Sponsored Links
Joined: Mar 2004
Posts: 26
Junior Member
Junior Member
Offline
Joined: Mar 2004
Posts: 26
Am I right in saying that you will also be needing the conditional statement for the 'query' alteration? i.e. you will need to repeat the 'if' statement used to adjust $Totalposts?

So you will need to have the following code:
Code
<br />if ($Board == "whateverkeyword") {     <br />	$query = "<br />		UPDATE {$config['tbprefix']}Users<br />		SET    U_Totalposts = U_Totalposts,<br />		U_Title      = '$UserTitle_q',<br />		U_LastOn = '$date',<br />		U_LastPostTime = '$date',<br />		U_LastPostIP = '$IP',<br />		U_LastPost = '$Mnumber'<br />		WHERE  U_Number   = '{$user['U_Number']}'<br />	";<br />} else {     <br />	$query = "<br />		UPDATE {$config['tbprefix']}Users<br />		SET    U_Totalposts = U_Totalposts + 1,<br />		U_Title      = '$UserTitle_q',<br />		U_LastOn = '$date',<br />		U_LastPostTime = '$date',<br />		U_LastPostIP = '$IP',<br />		U_LastPost = '$Mnumber'<br />		WHERE  U_Number   = '{$user['U_Number']}'<br />	";<br />}<br />



Is this right?

Page 2 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)