1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | /* |
||
5 | You may not change or alter any portion of this comment or credits |
||
6 | of supporting developers from this source code or any supporting source code |
||
7 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
8 | |||
9 | This program is distributed in the hope that it will be useful, |
||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
12 | */ |
||
13 | |||
14 | /** |
||
15 | * @category Module |
||
16 | * @package suico |
||
17 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||
18 | * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||
19 | * @author Marcello Brandão aka Suico, Mamba, LioMJ <https://xoops.org> |
||
20 | */ |
||
21 | |||
22 | use XoopsModules\Suico; |
||
23 | |||
24 | if (!defined('XOOPS_ROOT_PATH')) { |
||
25 | exit(); |
||
26 | } |
||
27 | //include_once(XOOPS_ROOT_PATH."/class/criteria.php"); |
||
28 | //require_once XOOPS_ROOT_PATH . '/modules/suico/class/Image.php'; |
||
29 | /** |
||
30 | * @param $options |
||
31 | * @return array |
||
32 | */ |
||
33 | function b_suico_lastpictures_show($options) |
||
34 | { |
||
35 | global $xoopsDB, $xoopsModule, $xoopsModuleConfig; |
||
36 | $myts = MyTextSanitizer::getInstance(); |
||
37 | $block = []; |
||
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
38 | /** |
||
39 | * Filter for fetch votes ishot and isnothot |
||
40 | */ |
||
41 | $criteria = new Criteria('image_id', 0, '>'); |
||
42 | $criteria->setSort('image_id'); |
||
43 | $criteria->setOrder('DESC'); |
||
44 | $criteria->setLimit($options[0]); |
||
45 | /** |
||
46 | * Creating factories of pictures and votes |
||
47 | */ |
||
48 | //$albumFactory = new ImagesHandler($xoopsDB); |
||
49 | $imageFactory = new Suico\ImageHandler($xoopsDB); |
||
50 | return $imageFactory->getLastPicturesForBlock($options[0]); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param $options |
||
55 | * @return string |
||
56 | */ |
||
57 | function b_suico_lastpictures_edit($options) |
||
58 | { |
||
59 | return "<input type='text' value='" . $options['0'] . "'id='options[]' name='options[]'>"; |
||
60 | } |
||
61 |