|
|
| Author |
Message |
FragInc
Group: Members Joined: 22 Jun 2008 Posts: 3 Gold: 2.00

Status: Warn:  Reputation: 0
|
#1 Posted: 22 Jun 2008 08:39 pm Post subject: Prevent Total Forum Post Count Decrease MOD Fix and Question |
|
|
| Code: |
## MOD Title: Prevent total forum post count decrease when deleting post
## MOD Author: tramway <admin> http://www.d3jsp.org (go to phpbb subforum)
.....
#-----[ OPEN ]------------------------------------------------
#
/includes/functions_post.php
#
#-----[ FIND ]------------------------------------------------
#
$sign = ($mode == 'delete') ? '- 1' : '+ 1';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sign1 = ($mode == 'delete') ? '- 0' : '+ 1';
#
#-----[ FIND ]------------------------------------------------
#
$forum_update_sql = "forum_posts = forum_posts $sign";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$forum_update_sql = "forum_posts = forum_posts $sign1"
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
The REPLACE WITH line is missing the ";" at the end and causes the following error message:
Parse error: syntax error, unexpected T_VARIABLE in /home/MYSITE/public_html/includes/functions_post.php on line 458
Additionally, my user's count is still decreased after a post is deleted upon testing this code. My user's test post count was 1 and
upon deleting the test post the count returned to 0.
Last edited by FragInc on 22 Jun 2008 09:04 pm; edited 3 times in total |
|
| Back to top |
|
 |
|
 |
tramway
 Group: Admin Joined: 24 Jan 2007 Donor:  Posts: 4548 Gold: 2191.53 Clan: D3JSP

Status: Warn:  Reputation: 187

|
#2 Posted: 22 Jun 2008 10:40 pm Post subject: |
|
|
oh just a semicolon, add it after lol. And it shouldnt decrease unless you are doing something wrong. _____________________
If your gold is locked, please PM a senior moderator. They will be able to unlock you |
|
| Back to top |
|
 |
FragInc
Group: Members Joined: 22 Jun 2008 Posts: 3 Gold: 2.00

Status: Warn:  Reputation: 0
|
#3 Posted: 23 Jun 2008 12:34 am Post subject: |
|
|
| Not sure what you mean by 'doing something wrong' since I simply did a copy/paste according to the instructions. User count is reverted to lower post count for every post deleted. I am using this in phpBB v2.0.23... any code change since .22 that would affect this MOD? |
|
| Back to top |
|
 |
tramway
 Group: Admin Joined: 24 Jan 2007 Donor:  Posts: 4548 Gold: 2191.53 Clan: D3JSP

Status: Warn:  Reputation: 187

|
#4 Posted: 23 Jun 2008 12:41 am Post subject: |
|
|
When u delete a post using the delete button on the post, it wont decrease post count. (with mod cp, it will) I dont think anything with the 2.023 update will affect this _____________________
If your gold is locked, please PM a senior moderator. They will be able to unlock you |
|
| Back to top |
|
 |
FragInc
Group: Members Joined: 22 Jun 2008 Posts: 3 Gold: 2.00

Status: Warn:  Reputation: 0
|
#5 Posted: 23 Jun 2008 02:31 pm Post subject: |
|
|
This is my code snippet as per your instructions
| Code: |
//
// Update post stats and details
//
function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id)
{
global $db, $userdata;
$sign = ($mode == 'delete') ? '- 1' : '+ 1';
$sign1 = ($mode == 'delete') ? '- 0' : '+ 1';
# $forum_update_sql = "forum_posts = forum_posts $sign";
$forum_update_sql = "forum_posts = forum_posts $sign1";
$topic_update_sql = '';
|
|
|
| Back to top |
|
 |
|