20 require(
'../../../../mainfile.php');
21 require(XOOPS_ROOT_PATH.
'/header.php');
23 if (!defined(
'XOOPS_ROOT_PATH')) { die(
'Error'); }
39 $GLOBALS[
'xoopsLogger']->activated =
false;
41 include_once XOOPS_ROOT_PATH .
'/include/comment_constants.php';
42 include_once XOOPS_ROOT_PATH .
'/kernel/module.php';
43 include_once XOOPS_ROOT_PATH .
'/modules/system/include/functions.php';
49 if (XoopsModule::getByDirname(
"newbb")) {
50 $tables[] = array (
'table_name' =>
'bb_posts',
'uid_column' =>
'uid');
58 if (!empty($table[
'criteria'])) {
61 $sql =
"SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix($table[
'table_name']) .
' ' .
$criteria->renderWhere();
63 if ($row = $xoopsDB->fetchArray(
$result)) {
64 $total_posts = $total_posts + $row[
'total'];
69 $sql =
"UPDATE ".$xoopsDB->prefix(
"users").
" SET posts = '".$total_posts.
"' WHERE uid = '".
$uid.
"'";