XOOPS  2.6.0
jquery.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
22 include dirname(dirname(__DIR__)) . '/header.php';
23 
26 
27 if (!$xoops->isUser() || !$xoops->isModule() || !$xoops->user->isAdmin($xoops->module->mid())) {
29 }
30 
31 $xoops->logger()->quiet();
32 //$xoops->disableErrorReporting();
33 
34 if (isset($_REQUEST["op"])) {
35  $op = $_REQUEST["op"];
36 } else {
37  @$op = "default";
38 }
39 
40 switch ($op) {
41 
42  // Display post
43  case 'display_post':
44  include_once $xoops->path('modules/system/include/functions.php');
45 
46  $uid = $system->cleanVars($_REQUEST, 'uid', 'int');
47  $total_posts = 0;
48 
49  /* @var $plugin SystemPluginInterface */
50  $plugins = \Xoops\Module\Plugin::getPlugins();
51  foreach ($plugins as $plugin) {
52  if ($res = $plugin->userPosts($uid)) {
53  $total_posts += $res;
54  }
55  }
56 
57  $qb = $xoops->db()->createXoopsQueryBuilder();
58  $eb = $qb->expr();
59  $sql = $qb->updatePrefix('users')
60  ->set('posts', ':posts')
61  ->where('uid = :uid')
62  ->setParameter(':posts', $total_posts)
63  ->setParameter(':uid', $uid);
64  $row_count = $sql->execute();
65  echo $row_count;
66  break;
67 }
if(!$dbm->isConnectable()) $res
static getInstance()
Definition: system.php:46
static getInstance()
Definition: Xoops.php:160
exit
Definition: browse.php:104
$system
Definition: jquery.php:25
if(!$xoops->isUser()) $uid
Definition: index.php:31
$xoops
Definition: jquery.php:24
$sql
Definition: pda.php:32
const E_NO_ACCESS_PERMISSION
Definition: en_US.php:351
$op