mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-20 17:58:24 +03:00
fix convert talk
This commit is contained in:
parent
a0ffa136b6
commit
7a5b54406e
|
@ -1309,6 +1309,18 @@ class Install {
|
|||
mysql_free_result($aResults);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Обновляем количество комментариев к письмам
|
||||
*/
|
||||
$sTalkSql = "SELECT talk_id FROM {$aParams['prefix']}talk";
|
||||
if($aResults = mysql_query($sTalkSql)){
|
||||
while($aRow = mysql_fetch_assoc($aResults)) {
|
||||
$sTalkCountSql = "SELECT count(comment_id) as c FROM {$aParams['prefix']}comment WHERE `target_id`={$aRow['talk_id']} AND `target_type`='talk'";
|
||||
if($aResultsCount = mysql_query($sTalkCountSql) and $aRowCount = mysql_fetch_assoc($aResultsCount)){
|
||||
mysql_query("UPDATE {$aParams['prefix']}talk SET talk_count_comment = {$aRowCount['c']} WHERE talk_id = {$aRow['talk_id']} ");
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Для каждого комментария к топику указываем соответствующий ему идентификатор блога
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue