XoopsModules25x /
xoopstube
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-2013 The XOOPS Project |
||
| 16 | * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
||
| 17 | * @version $Id$ |
||
| 18 | * @link http://sourceforge.net/projects/xoops/ |
||
| 19 | * @since 1.0.6 |
||
| 20 | */ |
||
| 21 | |||
| 22 | // $module_video = ''; |
||
|
0 ignored issues
–
show
|
|||
| 23 | |||
| 24 | //include_once __DIR__ . '/admin_header.php'; |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
50% 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...
|
|||
| 25 | |||
| 26 | //global $pathIcon16; |
||
| 27 | |||
| 28 | $video['id'] = intval($video_arr['lid']); |
||
| 29 | $video['cid'] = intval($video_arr['cid']); |
||
| 30 | $video['published'] = intval($video_arr['published']) ? true : false; |
||
| 31 | |||
| 32 | $path = $mytree->getPathFromId($video_arr['cid'], 'title'); |
||
| 33 | $path = substr($path, 1); |
||
| 34 | $path = basename($path); |
||
| 35 | $path = str_replace('/', '', $path); |
||
| 36 | $video['category'] = $path; |
||
| 37 | |||
| 38 | $rating = round(number_format($video_arr['rating'], 0) / 2); |
||
| 39 | $video['rateimg'] = "rate$rating.png"; |
||
| 40 | unset($rating); |
||
| 41 | |||
| 42 | $video['votes'] = ($video_arr['votes'] == 1) ? _MD_XOOPSTUBE_ONEVOTE : sprintf(_MD_XOOPSTUBE_NUMVOTES, $video_arr['votes']); |
||
| 43 | $video['hits'] = sprintf(_MD_XOOPSTUBE_VIDEOHITS, intval($video_arr['hits'])); |
||
| 44 | $xoopsTpl->assign('lang_dltimes', $video['hits']); |
||
| 45 | $publisher = (isset($video_arr['publisher']) |
||
| 46 | && !empty($video_arr['publisher'])) ? $xtubemyts->htmlSpecialCharsStrip( |
||
| 47 | $video_arr['publisher'] |
||
| 48 | ) : _MD_XOOPSTUBE_NOTSPECIFIED; |
||
| 49 | $video['title'] = $xtubemyts->htmlSpecialCharsStrip($video_arr['title']); |
||
| 50 | $video['vidid'] = $video_arr['vidid']; |
||
| 51 | $video['videothumb'] = xtubeGetVideoThumb( |
||
| 52 | $video_arr['vidid'], |
||
| 53 | $video_arr['title'], |
||
| 54 | $video_arr['vidsource'], |
||
| 55 | $video_arr['picurl'], |
||
| 56 | $xoopsModuleConfig['videoimgdir'] . '/' . $video_arr['screenshot'] |
||
| 57 | ); |
||
| 58 | $video['publisher'] = xtubeGetVideoPublisher($video_arr['vidid'], $video_arr['publisher'], $video_arr['vidsource']); |
||
| 59 | |||
| 60 | if ($moderate == 0) { |
||
| 61 | $time = ($video_arr['updated'] != 0) ? $video_arr['updated'] : $video_arr['published']; |
||
| 62 | $is_updated = ($video_arr['updated'] != 0) ? _MD_XOOPSTUBE_UPDATEDON : _MD_XOOPSTUBE_PUBLISHDATE; |
||
| 63 | $xoopsTpl->assign('lang_subdate', $is_updated); |
||
| 64 | } else { |
||
| 65 | $time = $video_arr['date']; |
||
| 66 | $is_updated = _MD_XOOPSTUBE_SUBMITDATE; |
||
| 67 | $xoopsTpl->assign('lang_subdate', $is_updated); |
||
| 68 | } |
||
| 69 | |||
| 70 | $video['adminvideo'] = ''; |
||
| 71 | $video['isadmin'] = ((is_object($xoopsUser) && !empty($xoopsUser)) |
||
| 72 | && $xoopsUser->isAdmin( |
||
| 73 | $xoopsModule->mid() |
||
| 74 | )) ? true : false; |
||
| 75 | if ($video['isadmin'] == true && $moderate == 0) { |
||
| 76 | $video['adminvideo'] |
||
| 77 | = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') |
||
| 78 | . '/assets/images/icon/computer.png" alt="' . _MD_XOOPSTUBE_ADMINSECTION . '" title="' . _MD_XOOPSTUBE_ADMINSECTION . '" style="vertical-align: middle;" /></a> '; |
||
| 79 | |||
| 80 | if ($video_arr['vidsource'] == 200) { |
||
| 81 | $video['adminvideo'] |
||
| 82 | .= |
||
| 83 | '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=edit&lid=' . $video_arr['lid'] . '"><img src="' . XOOPS_URL . '/' . $xoopsModule->getInfo( |
||
| 84 | 'icons16' |
||
| 85 | ) . '/edit.png" alt="' . _MD_XOOPSTUBE_EDIT . '" title="' . _MD_XOOPSTUBE_EDIT . '" style="vertical-align: middle;" /></a> '; |
||
| 86 | } else { |
||
| 87 | $video['adminvideo'] |
||
| 88 | .= |
||
| 89 | '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=edit&lid=' . $video_arr['lid'] . '"><img src="' . XOOPS_URL . '/' . $xoopsModule->getInfo( |
||
| 90 | 'icons16' |
||
| 91 | ) . '/edit.png" alt="' . _MD_XOOPSTUBE_EDIT . '" title="' . _MD_XOOPSTUBE_EDIT . '" style="vertical-align: middle;" /></a> '; |
||
| 92 | } |
||
| 93 | $video['adminvideo'] |
||
| 94 | .= |
||
| 95 | '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=delete&lid=' . $video_arr['lid'] . '"><img src="' . XOOPS_URL . '/' . $xoopsModule->getInfo( |
||
| 96 | 'icons16' |
||
| 97 | ) . '/delete.png" alt="' . _MD_XOOPSTUBE_DELETE . '" title="' . _MD_XOOPSTUBE_DELETE . '" style="vertical-align: middle;" /></a>'; |
||
| 98 | } else { |
||
| 99 | $video['adminvideo'] |
||
| 100 | = '[ <a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=edit&lid=' . $video_arr['lid'] . '&approve=1">' . _MD_XOOPSTUBE_APPROVE . '</a> | '; |
||
| 101 | $video['adminvideo'] |
||
| 102 | .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=delete&lid=' . $video_arr['lid'] . '">' . _MD_XOOPSTUBE_DELETE . '</a> ]'; |
||
| 103 | } |
||
| 104 | $votestring = ($video_arr['votes'] == 1) ? _MD_XOOPSTUBE_ONEVOTE : sprintf(_MD_XOOPSTUBE_NUMVOTES, $video_arr['votes']); |
||
| 105 | |||
| 106 | $video['useradminvideo'] = 0; |
||
| 107 | if (is_object($xoopsUser) && !empty($xoopsUser)) { |
||
| 108 | $_user_submitter = ($xoopsUser->getvar('uid') == $video_arr['submitter']) ? true : false; |
||
| 109 | if (true == xtubeCheckGroups($cid)) { |
||
| 110 | $video['useradminvideo'] = 1; |
||
| 111 | if ($xoopsUser->getvar('uid') == $video_arr['submitter']) { |
||
| 112 | $video['usermodify'] |
||
| 113 | = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?lid=' . $video_arr['lid'] . '"> ' . _MD_XOOPSTUBE_MODIFY . '</a> |'; |
||
| 114 | } |
||
| 115 | } |
||
| 116 | } |
||
| 117 | |||
| 118 | $description = $xtubemyts->displayTarea($video_arr['description'], 1, 1, 1, 1, 1); |
||
| 119 | $video['description'] = xoops_substr($description, 0, $xoopsModuleConfig['totalchars'], '...'); |
||
| 120 | |||
| 121 | $video['updated'] = xtubeGetTimestamp(formatTimestamp($time, $xoopsModuleConfig['dateformat'])); |
||
| 122 | $video['submitter'] = xtubeGetLinkedUserNameFromId($video_arr['submitter']); |
||
| 123 | $video['time'] = $video_arr['time']; |
||
| 124 | $video['mail_subject'] = rawurlencode(sprintf(_MD_XOOPSTUBE_INTFILEFOUND, $xoopsConfig['sitename'])); |
||
| 125 | $video['mail_body'] = rawurlencode( |
||
| 126 | sprintf(_MD_XOOPSTUBE_INTFILEFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->getVar( |
||
| 127 | 'dirname' |
||
| 128 | ) . '/singlevideo.php?cid=' . $video_arr['cid'] . '&lid=' . $video_arr['lid'] |
||
| 129 | ); |
||
| 130 | $video['comments'] = $video_arr['comments']; |
||
| 131 | $video['icons'] = xtubeDisplayIcons($video_arr['published'], $video_arr['status'], $video_arr['hits']); |
||
| 132 | $video['allow_rating'] = (xtubeCheckGroups($cid, 'XTubeRatePerms')) ? true : false; |
||
| 133 | $video['screen_shot'] = $xoopsModuleConfig['screenshot']; |
||
| 134 | $video['total_chars'] = $xoopsModuleConfig['totalchars']; |
||
| 135 | $video['module_dir'] = $xoopsModule->getVar('dirname'); |
||
| 136 | $video['comment_rules'] = $xoopsModuleConfig['com_rule']; |
||
| 137 | $video['showrating'] = $xoopsModuleConfig['showrating']; |
||
| 138 | $video['showsubmitterx'] = $xoopsModuleConfig['showsubmitter']; |
||
| 139 |
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.