Play Legend of the Green Dragon Play BNT Play Promisance Play Alien Assault Traders Play Quantum Star Play Some Chess  
   D3jsp RPGRPG   ArcadeArcade   Multiplayer PokerD3Jsp Poker   FAQ/RulesFAQ/Rules  SearchSearch  MemberlistMemberlist   UsergroupsUsergroups   ChatroomLive Chat   Log inLog in   RegisterRegister 

Prevent Total Forum Post Count Decrease MOD Fix and Question

 
Post new topic  Reply to topic  d3jsp Forum Index -> General Chat
View previous topic :: View next topic ::  


Author Message
FragInc


Group: Members
Joined: 22 Jun 2008
Posts: 3
Gold: 2.00


us.gif

Status:
Warn:
Reputation: 0    



Post#1 Posted: 22 Jun 2008 08:39 pm    Post subject: Prevent Total Forum Post Count Decrease MOD Fix and Question Reply with quote

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
View user's profile Send private message


tramway


Group: Admin
Joined: 24 Jan 2007
Donor:
Posts: 4548
Gold: 2191.53
Clan: D3JSP


ca.gif

Status:
Warn:
Reputation: 187    


<b><font color=Red>Admin</font></b>

Post#2 Posted: 22 Jun 2008 10:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FragInc


Group: Members
Joined: 22 Jun 2008
Posts: 3
Gold: 2.00


us.gif

Status:
Warn:
Reputation: 0    



Post#3 Posted: 23 Jun 2008 12:34 am    Post subject: Reply with quote

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
View user's profile Send private message
tramway


Group: Admin
Joined: 24 Jan 2007
Donor:
Posts: 4548
Gold: 2191.53
Clan: D3JSP


ca.gif

Status:
Warn:
Reputation: 187    


<b><font color=Red>Admin</font></b>

Post#4 Posted: 23 Jun 2008 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FragInc


Group: Members
Joined: 22 Jun 2008
Posts: 3
Gold: 2.00


us.gif

Status:
Warn:
Reputation: 0    



Post#5 Posted: 23 Jun 2008 02:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
2 Members: Guest
Post new topic  Reply to topic  d3jsp Forum Index -> General Chat All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



D3jsp is proudly powered by phpBB © 2.0
Theme and Forum by tramway