|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
/** |
|
3
|
|
|
* **************************************************************************** |
|
4
|
|
|
* marquee - MODULE FOR XOOPS |
|
5
|
|
|
* Copyright (c) Hervé Thouzard (https://www.herve-thouzard.com) |
|
6
|
|
|
* |
|
7
|
|
|
* You may not change or alter any portion of this comment or credits |
|
8
|
|
|
* of supporting developers from this source code or any supporting source code |
|
9
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
10
|
|
|
* This program is distributed in the hope that it will be useful, |
|
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
13
|
|
|
* |
|
14
|
|
|
* @copyright Hervé Thouzard (https://www.herve-thouzard.com) |
|
15
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
|
16
|
|
|
* @author Hervé Thouzard (https://www.herve-thouzard.com) |
|
17
|
|
|
* |
|
18
|
|
|
* Version : |
|
19
|
|
|
* **************************************************************************** |
|
20
|
|
|
* |
|
21
|
|
|
* @param $limit |
|
22
|
|
|
* @param $dateFormat |
|
23
|
|
|
* @param $itemsSize |
|
24
|
|
|
* |
|
25
|
|
|
* @return array |
|
26
|
|
|
*/ |
|
27
|
|
|
|
|
28
|
|
|
// Script to list recent clips from the smartmedia module (tested with smartmedia 0.85) |
|
29
|
|
|
function b_marquee_smartmedia($limit, $dateFormat, $itemsSize) |
|
|
|
|
|
|
30
|
|
|
{ |
|
31
|
|
|
$block = []; |
|
32
|
|
|
if (!defined('SMARTMEDIA_DIRNAME')) { |
|
33
|
|
|
define('SMARTMEDIA_DIRNAME', 'smartmedia'); |
|
34
|
|
|
} |
|
35
|
|
|
require_once XOOPS_ROOT_PATH . '/modules/' . SMARTMEDIA_DIRNAME . '/include/common.php'; |
|
36
|
|
|
$title_length = 99999; |
|
|
|
|
|
|
37
|
|
|
if ($itemsSize > 0) { |
|
38
|
|
|
$title_length = $itemsSize; |
|
39
|
|
|
} |
|
40
|
|
|
$maxClips = $limit; |
|
41
|
|
|
$smartmediaClipHandler = smartmedia_gethandler('clip'); |
|
|
|
|
|
|
42
|
|
|
$clipsArray = &$smartmediaClipHandler->getClipsFromAdmin(0, $maxClips, 'clips.created_date', 'DESC', 'all'); |
|
43
|
|
|
if ($clipsArray) { |
|
44
|
|
|
foreach ($clipsArray as $clipArray) { |
|
45
|
|
|
$clip = []; |
|
46
|
|
|
$block[] = [ |
|
47
|
|
|
'date' => '', |
|
48
|
|
|
'category' => '', |
|
49
|
|
|
'author' => '', |
|
50
|
|
|
'title' => $clipArray['title'], |
|
51
|
|
|
'link' => '<a href="' . SMARTMEDIA_URL . 'clip.php?categoryid=' . $clipArray['categoryid'] . '&folderid=' . $clipArray['folderid'] . '&clipid=' . $clipArray['clipid'] . '">' . $clipArray['title'] . '</a>', |
|
|
|
|
|
|
52
|
|
|
]; |
|
53
|
|
|
unset($clip); |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
return $block; |
|
58
|
|
|
} |
|
59
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.