1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* **************************************************************************** |
4
|
|
|
* marquee - MODULE FOR XOOPS |
5
|
|
|
* Copyright (c) Hervé Thouzard (http://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 (http://www.herve-thouzard.com) |
15
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
16
|
|
|
* @package marquee |
17
|
|
|
* @author Hervé Thouzard (http://www.herve-thouzard.com) |
18
|
|
|
* |
19
|
|
|
* Version : |
20
|
|
|
* **************************************************************************** |
21
|
|
|
* |
22
|
|
|
* @param $limit |
23
|
|
|
* @param $dateFormat |
24
|
|
|
* @param $itemsSize |
25
|
|
|
* |
26
|
|
|
* @return array |
27
|
|
|
*/ |
28
|
|
|
|
29
|
|
|
// Script to list recent clips from the smartmedia module (tested with smartmedia 0.85) |
30
|
|
|
function b_marquee_smartmedia($limit, $dateFormat, $itemsSize) |
|
|
|
|
31
|
|
|
{ |
32
|
|
|
$block = []; |
33
|
|
|
if (!defined('SMARTMEDIA_DIRNAME')) { |
34
|
|
|
define('SMARTMEDIA_DIRNAME', 'smartmedia'); |
35
|
|
|
} |
36
|
|
|
require_once XOOPS_ROOT_PATH . '/modules/' . SMARTMEDIA_DIRNAME . '/include/common.php'; |
|
|
|
|
37
|
|
|
$title_length = 99999; |
|
|
|
|
38
|
|
|
if ($itemsSize > 0) { |
39
|
|
|
$title_length = $itemsSize; |
40
|
|
|
} |
41
|
|
|
$maxClips = $limit; |
42
|
|
|
|
43
|
|
|
$smartmediaClipHandler = smartmedia_gethandler('clip'); |
|
|
|
|
44
|
|
|
|
45
|
|
|
$clipsArray =& $smartmediaClipHandler->getClipsFromAdmin(0, $maxClips, 'clips.created_date', 'DESC', 'all'); |
46
|
|
|
|
47
|
|
|
if ($clipsArray) { |
48
|
|
|
foreach ($clipsArray as $clipArray) { |
49
|
|
|
$clip = []; |
50
|
|
|
$block[] = [ |
51
|
|
|
'date' => '', |
52
|
|
|
'category' => '', |
53
|
|
|
'author' => '', |
54
|
|
|
'title' => $clipArray['title'], |
55
|
|
|
'link' => '<a href="' . SMARTMEDIA_URL . 'clip.php?categoryid=' . $clipArray['categoryid'] . '&folderid=' . $clipArray['folderid'] . '&clipid=' . $clipArray['clipid'] . '">' . $clipArray['title'] . '</a>' |
|
|
|
|
56
|
|
|
]; |
57
|
|
|
unset($clip); |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
return $block; |
62
|
|
|
} |
63
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.