|
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: <br /> $Totalposts = $user['U_Totalposts'] + 1;<br /> Change to this: <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: <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: <br />if (($Board == "whateverkeyword") || ($Board == "thatkeyword")) {<br />
|
|
|
|
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
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
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. <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: <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
Joined: Aug 2000
Posts: 1,609 |
|
|
|
|
Joined: Mar 2004
Posts: 26
Junior Member
|
Junior Member
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: <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?
|
|
|
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.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|