1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
// |
5
|
|
|
// ------------------------------------------------------------------------ // |
6
|
|
|
// XOOPS - PHP Content Management System // |
7
|
|
|
// Copyright (c) 2000-2020 XOOPS.org // |
8
|
|
|
// <https://xoops.org> // |
9
|
|
|
// ------------------------------------------------------------------------ // |
10
|
|
|
// This program is free software; you can redistribute it and/or modify // |
11
|
|
|
// it under the terms of the GNU General Public License as published by // |
12
|
|
|
// the Free Software Foundation; either version 2 of the License, or // |
13
|
|
|
// (at your option) any later version. // |
14
|
|
|
// // |
15
|
|
|
// You may not change or alter any portion of this comment or credits // |
16
|
|
|
// of supporting developers from this source code or any supporting // |
17
|
|
|
// source code which is considered copyrighted (c) material of the // |
18
|
|
|
// original comment or credit authors. // |
19
|
|
|
// // |
20
|
|
|
// This program is distributed in the hope that it will be useful, // |
21
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
22
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
23
|
|
|
// GNU General Public License for more details. // |
24
|
|
|
// // |
25
|
|
|
// You should have received a copy of the GNU General Public License // |
26
|
|
|
// along with this program; if not, write to the Free Software // |
27
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
28
|
|
|
// ------------------------------------------------------------------------ // |
29
|
|
|
// comment callback functions |
30
|
|
|
/** |
31
|
|
|
* @param $downloadId |
32
|
|
|
* @param $totalNumber |
33
|
|
|
*/ |
34
|
|
|
function tdmdownloads_com_update($downloadId, $totalNumber) |
35
|
|
|
{ |
36
|
|
|
/** @var \XoopsMySQLDatabase $db */ |
37
|
|
|
$db = \XoopsDatabaseFactory::getDatabaseConnection(); |
38
|
|
|
$sql = 'UPDATE ' . $db->prefix('tdmdownloads_downloads') . ' SET comments = ' . $totalNumber . ' WHERE lid = ' . $downloadId; |
39
|
|
|
$db->query($sql); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @param $comment |
44
|
|
|
*/ |
45
|
|
|
function tdmdownloads_com_approve(&$comment) |
|
|
|
|
46
|
|
|
{ |
47
|
|
|
// notification mail here |
48
|
|
|
} |
49
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.