Welcome, Guest. Please Login or Register.
April 27, 2025, 08:04:09 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  [Done 1.4.0][CODE] Number of posts correction with RemoveThread.php « previous next »
Pages: 1 [2] Reply Ignore Print
Author Topic: [Done 1.4.0][CODE] Number of posts correction with RemoveThread.php  (Read 3166 times)
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.0][CODE] Number of posts correction with RemoveThread.php
« Reply #15 on: March 02, 2003, 08:57:44 PM »
Reply with quote

Even better !

There is now also a possible "danger" :

members who want to be "topposter" can post topics, and delete them right away. Post, delete, post, delete......etc.

The result : a high postcount........

Sssssttt........don't tell  ;D
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Done 1.4.0][CODE] Number of posts correction with RemoveThread.php
« Reply #16 on: March 02, 2003, 09:04:35 PM »
Reply with quote

Okay, here's the full changes...

RemoveThread.php:
Find:   $request = mysql_query("DELETE FROM {$db_prefix}messages WHERE ID_TOPIC=$threadid;") or database_error(__FILE__, __LINE__);
Replace:   $request = mysql_query("DELETE FROM {$db_prefix}messages WHERE ID_TOPIC=$threadid;") or database_error(__FILE__, __LINE__);
  if (mysql_affected_rows($request) == 1)
  {
     $temp = mysql_fetch_row($request2);
     if ($temp[0] != '-1')
        mysql_query("UPDATE {$db_prefix}members SET posts=posts-1 WHERE ID_MEMBER='$temp[0]';") or database_error(__FILE__, __LINE__);
  }


Find:    while ($temp = mysql_fetch_row($request2))
      if ($temp[0] != '-1')
         $request = mysql_query("UPDATE {$db_prefix}members SET posts=posts-1 WHERE ID_MEMBER='$temp[0]';") or database_error(__FILE__, __LINE__);

   $yySetLocation = "$cgi";

Replace:   $yySetLocation = $cgi;

-[Unknown]
Logged
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.0][CODE] Number of posts correction with RemoveThread.php
« Reply #17 on: March 02, 2003, 09:07:06 PM »
Reply with quote

Changed it, but what does it exactly do or doesn't do ;) ?
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Done 1.4.0][CODE] Number of posts correction with RemoveThread.php
« Reply #18 on: March 02, 2003, 09:08:51 PM »
Reply with quote

This change makes it so that the post count will be reduced if there is only one post.

-[Unknown]
Logged
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:[Done 1.4.0][CODE] Number of posts correction with RemoveThread.php
« Reply #19 on: March 02, 2003, 09:09:42 PM »
Reply with quote

Great !

Thanx for the quick and neat solution ;)
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Henk
Noobie
*
Posts: 8


Re:[Done 1.4.0][CODE] Number of posts correction with RemoveThread.php
« Reply #20 on: March 10, 2003, 11:57:48 AM »
Reply with quote

Quote from: [Unknown] on March 02, 2003, 09:08:51 PM
This change makes it so that the post count will be reduced if there is only one post.

-[Unknown]

I´ve tried it several times, but I keep getting a MySQL error, something about a that an argument is not valid. After that the board says that the last post is n/a by n/a.

Think I keep making the same mistake in changing RemoveThreads (I have no idea how PHP works, so I only can follow your instructions, and even that is too hard for me this time)

I now simply changed SET posts=posts-1 into SET posts=posts. It works, postcounts don´t decrease anymore, but I have no idea if this can do any harm.
Logged
Pages: 1 [2] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Done 1.4.0][CODE] Number of posts correction with RemoveThread.php « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.039 seconds with 17 queries.