- Kod: Tümünü seç
##############################################################
## MOD Title: Mesajı silinince üye mesaj sayısı düşmesin
## MOD Author: Yakusha < yakusha@tnn.net > (sabri ünal) http://www.canver.net
## MOD Description: Üyelerin modcp.php üzerinden mesajları silinince mesaj sayılarının eksilmemesini sağlamaktadır.
## MOD Version: 1.0.0
##
## Installation Level: easy
## Installation Time: 1 Minutes
## Files To Edit: (1) modcp.php
## Included Files: n/a
############################################################
#
## Güvenliğiniz için mod güncellemelerini http://canver.net sitesi üzerinden takip ediniz.
#
############################################################
## MOD History:
##
## 2006-05-10 - Version 1.0.1
## - Initial Release
##
#############################################################
#
## Mod yüklemeden önce dosyalarınızın yedeğini almayı ihmal etmeyiniz.
#
#############################################################
#
#-----[ AÇ ]------------------------------------------
#
modcp.php
#
#-----[ BUL VE SİL ]------------------------------------------
#
$sql = "SELECT poster_id, COUNT(post_id) AS posts
FROM " . POSTS_TABLE . "
WHERE topic_id IN ($topic_id_sql)
GROUP BY poster_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql);
}
$count_sql = array();
while ( $row = $db->sql_fetchrow($result) )
{
$count_sql[] = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts - " . $row['posts'] . "
WHERE user_id = " . $row['poster_id'];
}
$db->sql_freeresult($result);
if ( sizeof($count_sql) )
{
for($i = 0; $i < sizeof($count_sql); $i++)
{
if ( !$db->sql_query($count_sql[$i]) )
{
message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
}
}
}
#
#-----[ KAYDET ]--------------------------
#
# EoM