Completed
Push — master ( 954431...eec6a1 )
by Michael
12s
created

include/videoloadinfo.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Module: XoopsTube
5
 *
6
 * You may not change or alter any portion of this comment or credits
7
 * of supporting developers from this source code or any supporting source code
8
 * which is considered copyrighted (c) material of the original comment or credit authors.
9
 *
10
 * PHP version 5
11
 *
12
 * @category        Module
13
 * @package         Xoopstube
14
 * @author          XOOPS Development Team
15
 * @copyright       2001-2016 XOOPS Project (http://xoops.org)
16
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17
 * @link            http://xoops.org/
18
 * @since           1.0.6
19
 */
20
21
// $module_video = '';
22
23
//include_once __DIR__ . '/admin_header.php';
24
25
//global $pathIcon16;
26
27
$video['id']        = (int)$video_arr['lid'];
28
$video['cid']       = (int)$video_arr['cid'];
29
$video['published'] = (int)$video_arr['published'] ? true : false;
30
31
$path              = $mytree->getPathFromId($video_arr['cid'], 'title');
32
$path              = substr($path, 1);
33
$path              = basename($path);
34
$path              = str_replace('/', '', $path);
35
$video['category'] = $path;
36
37
$rating           = round(number_format($video_arr['rating'], 0) / 2);
38
$video['rateimg'] = "rating_".$rating.".gif";
39
unset($rating);
40
41
$video['votes'] = (1 == $video_arr['votes']) ? _MD_XOOPSTUBE_ONEVOTE : sprintf(_MD_XOOPSTUBE_NUMVOTES, $video_arr['votes']);
42
$video['hits']  = sprintf(_MD_XOOPSTUBE_VIDEOHITS, (int)$video_arr['hits']);
43
$xoopsTpl->assign('lang_dltimes', $video['hits']);
44
$publisher           = (isset($video_arr['publisher']) && !empty($video_arr['publisher'])) ? $xtubemyts->htmlSpecialCharsStrip($video_arr['publisher']) : _MD_XOOPSTUBE_NOTSPECIFIED;
45
$video['title']      = $xtubemyts->htmlSpecialCharsStrip($video_arr['title']);
46
$video['vidid']      = $video_arr['vidid'];
47
$video['videothumb'] =
48
    xtubeGetVideoThumb($video_arr['vidid'], $video_arr['title'], $video_arr['vidsource'], $video_arr['picurl'], $GLOBALS['xoopsModuleConfig']['videoimgdir'] . '/' . $video_arr['screenshot']);
49
$video['publisher']  = xtubeGetVideoPublisher($video_arr['vidid'], $video_arr['publisher'], $video_arr['vidsource']);
50
51
if (0 == $moderate) {
52
    $time       = ($video_arr['updated'] !== 0) ? $video_arr['updated'] : $video_arr['published'];
53
    $is_updated = ($video_arr['updated'] !== 0) ? _MD_XOOPSTUBE_UPDATEDON : _MD_XOOPSTUBE_PUBLISHDATE;
54
    $xoopsTpl->assign('lang_subdate', $is_updated);
55
} else {
56
    $time       = $video_arr['date'];
57
    $is_updated = _MD_XOOPSTUBE_SUBMITDATE;
58
    $xoopsTpl->assign('lang_subdate', $is_updated);
59
}
60
61
$video['adminvideo'] = '';
62
$video['isadmin']    = ((is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsUser'])) && $GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid())) ? true : false;
63
if (true === $video['isadmin'] && 0 == $moderate) {
64
    $video['adminvideo'] = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname')
65
                           . '/assets/images/icon/computer.png" alt="' . _MD_XOOPSTUBE_ADMINSECTION . '" title="' . _MD_XOOPSTUBE_ADMINSECTION . '" style="vertical-align: middle;" /></a>&nbsp;';
66
    if (200 == $video_arr['vidsource']) {
67
        $video['adminvideo'] .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=edit&amp;lid=' . $video_arr['lid'] . '"><img src="' . XOOPS_URL . '/'
68
                                . $xoopsModule->getInfo('systemIcons16') . '/edit.png" alt="' . _MD_XOOPSTUBE_EDIT . '" title="' . _MD_XOOPSTUBE_EDIT
69
                                . '" style="vertical-align: middle;" /></a>&nbsp;';
70
    } else {
71
        $video['adminvideo'] .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=edit&amp;lid=' . $video_arr['lid'] . '"><img src="' . XOOPS_URL . '/'
72
                                . $xoopsModule->getInfo('systemIcons16') . '/edit.png" alt="' . _MD_XOOPSTUBE_EDIT . '" title="' . _MD_XOOPSTUBE_EDIT
73
                                . '" style="vertical-align: middle;" /></a>&nbsp;';
74
    }
75
    $video['adminvideo'] .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=delete&amp;lid=' . $video_arr['lid'] . '"><img src="' . XOOPS_URL . '/'
76
                            . $xoopsModule->getInfo('systemIcons16') . '/delete.png" alt="' . _MD_XOOPSTUBE_DELETE . '" title="' . _MD_XOOPSTUBE_DELETE . '" style="vertical-align: middle;" /></a>';
77
} else {
78
    $video['adminvideo'] =
79
        '[ <a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=edit&amp;lid=' . $video_arr['lid'] . '&approve=1">' . _MD_XOOPSTUBE_APPROVE . '</a> | ';
80
    $video['adminvideo'] .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=delete&amp;lid=' . $video_arr['lid'] . '">' . _MD_XOOPSTUBE_DELETE . '</a> ]';
81
}
82
$votestring = (1 == $video_arr['votes']) ? _MD_XOOPSTUBE_ONEVOTE : sprintf(_MD_XOOPSTUBE_NUMVOTES, $video_arr['votes']);
83
84
$video['useradminvideo'] = 0;
85
if (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsUser'])) {
86
    $_user_submitter = ($GLOBALS['xoopsUser']->getVar('uid') === $video_arr['submitter']) ? true : false;
87
    if (true === XoopstubeUtilities::xtubeCheckGroups($cid)) {
88
        $video['useradminvideo'] = 1;
89
        if ($GLOBALS['xoopsUser']->getVar('uid') === $video_arr['submitter']) {
90
            $video['usermodify'] = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?lid=' . $video_arr['lid'] . '"> ' . _MD_XOOPSTUBE_MODIFY . '</a>';
91
        }
92
    }
93
}
94
95
$description          =& $xtubemyts->displayTarea($video_arr['description'], 1, 1, 1, 1, 1);
96
$video['description'] = xoops_substr($description, 0, $GLOBALS['xoopsModuleConfig']['totalchars'], '...');
97
98
$video['updated']        = XoopstubeUtilities::xtubeGetTimestamp(formatTimestamp($video_arr['date'], $GLOBALS['xoopsModuleConfig']['dateformat']));
99
//$video['updated']        = date($GLOBALS['xoopsModuleConfig']['dateformat'], $video_arr['date']);
0 ignored issues
show
Unused Code Comprehensibility introduced by
80% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
100
$video['submitter']      = XoopstubeUtilities::xtubeGetLinkedUserNameFromId($video_arr['submitter']);
101
$video['time']           = $video_arr['time'];
102
$video['mail_subject']   = rawurlencode(sprintf(_MD_XOOPSTUBE_INTFILEFOUND, $GLOBALS['xoopsConfig']['sitename']));
103
$video['mail_body']      =
104
    rawurlencode(sprintf(_MD_XOOPSTUBE_INTFILEFOUND, $GLOBALS['xoopsConfig']['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlevideo.php?cid='
105
                 . $video_arr['cid'] . '&amp;lid=' . $video_arr['lid']);
106
$video['comments']       = $video_arr['comments'];
107
$video['icons']          = XoopstubeUtilities::xtubeDisplayIcons($video_arr['published'], $video_arr['status'], $video_arr['hits']);
108
$video['allow_rating']   = XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeRatePerms') ? true : false;
109
$video['screen_shot']    = $GLOBALS['xoopsModuleConfig']['screenshot'];
110
$video['total_chars']    = $GLOBALS['xoopsModuleConfig']['totalchars'];
111
$video['module_dir']     = $xoopsModule->getVar('dirname');
112
$video['comment_rules']  = $GLOBALS['xoopsModuleConfig']['com_rule'];
113
$video['showrating']     = $GLOBALS['xoopsModuleConfig']['showrating'];
114
$video['showsubmitterx'] = $GLOBALS['xoopsModuleConfig']['showsubmitter'];
115