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-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 | include __DIR__ . '/header.php'; |
||
| 22 | include XOOPS_ROOT_PATH . '/header.php'; |
||
| 23 | include XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
||
| 24 | |||
| 25 | $mytree = new XoopstubeTree($GLOBALS['xoopsDB']->prefix('xoopstube_cat'), 'cid', 'pid'); |
||
| 26 | |||
| 27 | global $xoopsModule, $xtubemyts; |
||
| 28 | |||
| 29 | $xoopsTpl->assign('xoops_module_header', '<link rel="stylesheet" type="text/css" href="' . $moduleDirName . '/assets/css/xtubestyle.css" />'); |
||
| 30 | |||
| 31 | $cid = XoopsRequest::getInt('cid', 0); //(int) xtubeCleanRequestVars($_REQUEST, 'cid', 0); |
||
| 32 | $lid = XoopsRequest::getInt('lid', 0); //(int) xtubeCleanRequestVars($_REQUEST, 'lid', 0); |
||
| 33 | |||
| 34 | if (false === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeSubPerm')) { |
||
| 35 | redirect_header('index.php', 1, _MD_XOOPSTUBE_NOPERMISSIONTOPOST); |
||
| 36 | } |
||
| 37 | |||
| 38 | |||
| 39 | if (true === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeSubPerm')) { |
||
| 40 | echo '<div class="row"> |
||
| 41 | <div class="col-md-12">'; |
||
| 42 | echo '<ol class="breadcrumb"> |
||
| 43 | <li><a href="index.php">'.$moduleDirName.'</a></li> |
||
| 44 | <li>'._MD_XOOPSTUBE_SUBMITCATHEAD.'</li> |
||
| 45 | </ol> |
||
| 46 | '; |
||
| 47 | // if (xtubeCleanRequestVars($_REQUEST, 'submit', 0)) { |
||
| 48 | if (XoopsRequest::getString('submit', '')) { |
||
| 49 | if (false === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeSubPerm')) { |
||
| 50 | redirect_header('index.php', 1, _MD_XOOPSTUBE_NOPERMISSIONTOPOST); |
||
| 51 | } |
||
| 52 | |||
| 53 | $submitter = (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsUser'])) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
||
| 54 | $vidsource = XoopsRequest::getInt('vidsource', 0, 'POST'); // xtubeCleanRequestVars($_REQUEST, 'vidsource', 0); |
||
| 55 | $offline = XoopsRequest::getInt('offline', 0, 'POST'); // xtubeCleanRequestVars($_REQUEST, 'offline', 0); |
||
| 56 | $notifypub = XoopsRequest::getInt('notifypub', 0, 'POST'); // xtubeCleanRequestVars($_REQUEST, 'notifypub', 0); |
||
| 57 | $approve = XoopsRequest::getInt('approve', 0, 'POST'); // xtubeCleanRequestVars($_REQUEST, 'approve', 0); |
||
| 58 | $vidrating = XoopsRequest::getInt('vidrating', 0, 'POST'); // xtubeCleanRequestVars($_REQUEST, 'vidrating', 0); |
||
| 59 | $vidid = XoopsRequest::getString('vidid', 0, 'POST'); // $xtubemyts->addslashes(ltrim(XoopsRequest::getInt('vidid', 0, 'POST'))); |
||
| 60 | $title = XoopsRequest::getString('title', '', 'POST'); // $xtubemyts->addslashes(ltrim($_REQUEST['title'])); |
||
| 61 | $descriptionb = XoopsRequest::getString('descriptionb', '', 'POST'); // $xtubemyts->addslashes(ltrim($_REQUEST['descriptionb'])); |
||
| 62 | $publisher = XoopsRequest::getString('publisher', '', 'POST'); // $xtubemyts->addslashes(trim($_REQUEST['publisher'])); |
||
| 63 | $time = XoopsRequest::getString('time', '', 'POST'); // $xtubemyts->addslashes(ltrim($_REQUEST['time'])); |
||
| 64 | $keywords = XoopsRequest::getString('keywords', '', 'POST'); // $xtubemyts->addslashes(trim($_REQUEST['keywords'])); |
||
| 65 | $item_tag = XoopsRequest::getString('item_tag', '', 'POST'); // $xtubemyts->addslashes(ltrim($_REQUEST['item_tag'])); |
||
| 66 | $picurl = XoopsRequest::getString('picurl', '', 'POST'); // $xtubemyts->addslashes(ltrim($_REQUEST['picurl'])); |
||
| 67 | $date = time(); |
||
| 68 | $publishdate = 0; |
||
| 69 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
||
| 70 | |||
| 71 | if (0 == $lid) { |
||
| 72 | $status = 0; |
||
| 73 | $publishdate = 0; |
||
| 74 | $message = _MD_XOOPSTUBE_THANKSFORINFO; |
||
| 75 | if (true === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeAutoApp')) { |
||
| 76 | $publishdate = time(); |
||
| 77 | $status = 1; |
||
| 78 | $message = _MD_XOOPSTUBE_ISAPPROVED; |
||
| 79 | } |
||
| 80 | $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') |
||
| 81 | . ' (lid, cid, title, vidid, submitter, publisher, status, date, hits, rating, votes, comments, vidsource, published, expired, offline, description, ipaddress, notifypub, vidrating, time, keywords, item_tag, picurl) '; |
||
| 82 | $sql .= " VALUES ('', $cid, '$title', '$vidid', '$submitter', '$publisher', '$status', '$date', 0, 0, 0, 0, '$vidsource', '$publishdate', 0, '$offline', '$descriptionb', '$ipaddress', '$notifypub', '$vidrating', '$time', '$keywords', '$item_tag', '$picurl')"; |
||
| 83 | View Code Duplication | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
| 84 | $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno(); |
||
| 85 | XoopsErrorHandler_HandleError(E_USER_WARNING, $_error, __FILE__, __LINE__); |
||
| 86 | } |
||
| 87 | $newid = $GLOBALS['xoopsDB']->getInsertId(); |
||
| 88 | |||
| 89 | // Add item_tag to Tag-module |
||
| 90 | View Code Duplication | if ($lid == 0) { |
|
| 91 | $tagupdate = XoopstubeUtilities::xtubeUpdateTag($newid, $item_tag); |
||
|
0 ignored issues
–
show
|
|||
| 92 | } else { |
||
| 93 | $tagupdate = XoopstubeUtilities::xtubeUpdateTag($lid, $item_tag); |
||
|
0 ignored issues
–
show
Are you sure the assignment to
$tagupdate is correct as \XoopstubeUtilities::xtu...ateTag($lid, $item_tag) (which targets XoopstubeUtilities::xtubeUpdateTag()) seems to always return null.
This check looks for function or method calls that always return null and whose return value is assigned to a variable. class A
{
function getObject()
{
return null;
}
}
$a = new A();
$object = $a->getObject();
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes. Loading history...
|
|||
| 94 | } |
||
| 95 | |||
| 96 | // Notify of new link (anywhere) and new link in category |
||
| 97 | $notificationHandler = xoops_getHandler('notification'); |
||
| 98 | |||
| 99 | $tags = array(); |
||
| 100 | $tags['VIDEO_NAME'] = $title; |
||
| 101 | $tags['VIDEO_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlevideo.php?cid=' . $cid . '&lid=' . $newid; |
||
| 102 | |||
| 103 | $sql = 'SELECT title FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE cid=' . $cid; |
||
| 104 | $result = $GLOBALS['xoopsDB']->query($sql); |
||
| 105 | $row = $GLOBALS['xoopsDB']->fetchArray($result); |
||
| 106 | |||
| 107 | $tags['CATEGORY_NAME'] = $row['title']; |
||
| 108 | $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid; |
||
| 109 | if (true === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeAutoApp')) { |
||
| 110 | $notificationHandler->triggerEvent('global', 0, 'new_video', $tags); |
||
| 111 | $notificationHandler->triggerEvent('category', $cid, 'new_video', $tags); |
||
| 112 | redirect_header('index.php', 2, _MD_XOOPSTUBE_ISAPPROVED); |
||
| 113 | } else { |
||
| 114 | $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/newvideos.php'; |
||
| 115 | $notificationHandler->triggerEvent('global', 0, 'video_submit', $tags); |
||
| 116 | $notificationHandler->triggerEvent('category', $cid, 'video_submit', $tags); |
||
| 117 | if ($notifypub) { |
||
| 118 | include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
||
| 119 | $notificationHandler->subscribe('video', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
||
| 120 | } |
||
| 121 | redirect_header('index.php', 2, _MD_XOOPSTUBE_THANKSFORINFO); |
||
| 122 | } |
||
| 123 | } else { |
||
| 124 | if (true === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeAutoApp') || $approve === 1) { |
||
| 125 | $updated = time(); |
||
| 126 | $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') |
||
| 127 | . " SET cid=$cid, title='$title', vidid='$vidid', publisher='$publisher', updated='$updated', offline='$offline', description='$descriptionb', ipaddress='$ipaddress', notifypub='$notifypub', vidrating='$vidrating', time='$time', keywords='$keywords', item_tag='$item_tag', picurl='$picurl' WHERE lid =" |
||
| 128 | . $lid; |
||
| 129 | View Code Duplication | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
| 130 | $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno(); |
||
| 131 | XoopsErrorHandler_HandleError(E_USER_WARNING, $_error, __FILE__, __LINE__); |
||
| 132 | } |
||
| 133 | |||
| 134 | $notificationHandler = xoops_getHandler('notification'); |
||
| 135 | $tags = array(); |
||
| 136 | $tags['VIDEO_NAME'] = $title; |
||
| 137 | $tags['VIDEO_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlevideo.php?cid=' . $cid . '&lid=' . $lid; |
||
| 138 | $sql = 'SELECT title FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE cid=' . $cid; |
||
| 139 | $result = $GLOBALS['xoopsDB']->query($sql); |
||
| 140 | $row = $GLOBALS['xoopsDB']->fetchArray($result); |
||
| 141 | $tags['CATEGORY_NAME'] = $row['title']; |
||
| 142 | $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid; |
||
| 143 | |||
| 144 | $notificationHandler->triggerEvent('global', 0, 'new_video', $tags); |
||
| 145 | $notificationHandler->triggerEvent('category', $cid, 'new_video', $tags); |
||
| 146 | $_message = _MD_XOOPSTUBE_ISAPPROVED; |
||
| 147 | } else { |
||
| 148 | $submitter_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query('SELECT submitter FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . (int)$lid)); |
||
| 149 | $modifysubmitter = $GLOBALS['xoopsUser']->uid(); |
||
| 150 | $requestid = $modifysubmitter; |
||
| 151 | $requestdate = time(); |
||
| 152 | $updated = XoopsRequest::getInt('up_dated', time(), 'POST'); //xtubeCleanRequestVars($_REQUEST, 'up_dated', time()); |
||
| 153 | if ($modifysubmitter === $submitter_array['submitter']) { |
||
| 154 | $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('xoopstube_mod') |
||
| 155 | . ' (requestid, lid, cid, title, vidid, publisher, vidsource, description, modifysubmitter, requestdate, time, keywords, item_tag, picurl)'; |
||
| 156 | $sql .= " VALUES ('', $lid, $cid, '$title', '$vidid', '$publisher', '$vidsource', '$descriptionb', '$modifysubmitter', '$requestdate', '$time', '$keywords', '$item_tag', '$picurl')"; |
||
| 157 | View Code Duplication | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
| 158 | $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno(); |
||
| 159 | XoopsErrorHandler_HandleError(E_USER_WARNING, $_error, __FILE__, __LINE__); |
||
| 160 | } |
||
| 161 | } else { |
||
| 162 | redirect_header('index.php', 2, _MD_XOOPSTUBE_MODIFYNOTALLOWED); |
||
| 163 | } |
||
| 164 | |||
| 165 | $tags = array(); |
||
| 166 | $tags['MODIFYREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listModReq'; |
||
| 167 | $notificationHandler = xoops_getHandler('notification'); |
||
| 168 | $notificationHandler->triggerEvent('global', 0, 'video_modify', $tags); |
||
| 169 | |||
| 170 | $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listNewvideos'; |
||
| 171 | $notificationHandler->triggerEvent('global', 0, 'video_submit', $tags); |
||
| 172 | $notificationHandler->triggerEvent('category', $cid, 'video_submit', $tags); |
||
| 173 | if ($notifypub) { |
||
| 174 | include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
||
| 175 | $notificationHandler->subscribe('video', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
||
| 176 | } |
||
| 177 | $_message = _MD_XOOPSTUBE_THANKSFORINFO; |
||
| 178 | } |
||
| 179 | redirect_header('index.php', 2, $_message); |
||
| 180 | } |
||
| 181 | } else { |
||
| 182 | $approve = XoopsRequest::getInt('approve', 0, 'POST'); // xtubeCleanRequestVars($_REQUEST, 'approve', 0); |
||
| 183 | |||
| 184 | // Show disclaimer |
||
| 185 | if ($GLOBALS['xoopsModuleConfig']['showdisclaimer'] && !XoopsRequest::getInt('agree', '', 'GET') && 0 == $approve) { |
||
| 186 | echo '<br><div style="text-align: center;">' . XoopstubeUtilities::xtubeRenderImageHeader() . '</div><br>'; |
||
| 187 | echo '<h4>' . _MD_XOOPSTUBE_DISCLAIMERAGREEMENT . '</h4>'; |
||
| 188 | echo '<div>' . $xtubemyts->displayTarea($GLOBALS['xoopsModuleConfig']['disclaimer'], 1, 1, 1, 1, 1) . '</div>'; |
||
| 189 | echo '<form action="submit.php" method="post">'; |
||
| 190 | echo '<div style="text-align: center;">' . _MD_XOOPSTUBE_DOYOUAGREE . '</b><br><br>'; |
||
| 191 | echo '<input type="button" onclick="location=\'submit.php?agree=1\'" class="formButton" value="' . _MD_XOOPSTUBE_AGREE . '" alt="' . _MD_XOOPSTUBE_AGREE . '" />'; |
||
| 192 | echo ' '; |
||
| 193 | echo '<input type="button" onclick="location=\'index.php\'" class="formButton" value="' . _CANCEL . '" alt="' . _CANCEL . '" />'; |
||
| 194 | echo '</div></form>'; |
||
| 195 | include XOOPS_ROOT_PATH . '/footer.php'; |
||
| 196 | exit(); |
||
| 197 | } |
||
| 198 | echo '<div>' . _MD_XOOPSTUBE_SUB_SNEWMNAMEDESC . '</div>'; |
||
| 199 | // echo "<div class='xoopstube_singletitle'>" . _MD_XOOPSTUBE_SUBMITCATHEAD . "</div>\n"; |
||
| 200 | |||
| 201 | $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . (int)$lid; |
||
| 202 | $video_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
||
| 203 | |||
| 204 | $lid = $video_array['lid'] ?: 0; |
||
| 205 | $cid = $video_array['cid'] ?: 0; |
||
| 206 | $title = $video_array['title'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['title']) : ''; |
||
| 207 | $vidid = $video_array['vidid'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['vidid']) : ''; |
||
| 208 | $publisher = $video_array['publisher'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['publisher']) : ''; |
||
| 209 | $screenshot = $video_array['screenshot'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['screenshot']) : ''; |
||
| 210 | $descriptionb = $video_array['description'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['description']) : ''; |
||
| 211 | $published = $video_array['published'] ?: 0; |
||
| 212 | $expired = $video_array['expired'] ?: 0; |
||
| 213 | $updated = $video_array['updated'] ?: 0; |
||
| 214 | $offline = $video_array['offline'] ?: 0; |
||
| 215 | $vidsource = $video_array['vidsource'] ?: 0; |
||
| 216 | $ipaddress = $video_array['ipaddress'] ?: 0; |
||
| 217 | $notifypub = $video_array['notifypub'] ?: 0; |
||
| 218 | $vidrating = $video_array['vidrating'] ?: 1; |
||
| 219 | $time = $video_array['time'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['time']) : '0:00:00'; |
||
| 220 | $keywords = $video_array['keywords'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['keywords']) : ''; |
||
| 221 | $item_tag = $video_array['item_tag'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['item_tag']) : ''; |
||
| 222 | $picurl = $video_array['picurl'] ? $xtubemyts->htmlSpecialCharsStrip($video_array['picurl']) : 'http://'; |
||
| 223 | |||
| 224 | $sform = new XoopsThemeForm(_MD_XOOPSTUBE_SUBMITCATHEAD, 'storyform', xoops_getenv('PHP_SELF')); |
||
| 225 | $sform->setExtra('enctype="multipart/form-data"'); |
||
| 226 | |||
| 227 | XoopstubeUtilities::xtubeSetNoIndexNoFollow(); |
||
| 228 | |||
| 229 | // Video title form |
||
| 230 | $sform->addElement(new XoopsFormText(_MD_XOOPSTUBE_FILETITLE, 'title', 70, 255, $title), true); |
||
| 231 | |||
| 232 | // Video source form |
||
| 233 | $vidsource_array = array( |
||
| 234 | 0 => _MD_XOOPSTUBE_YOUTUBE, |
||
| 235 | 1 => _MD_XOOPSTUBE_METACAFE, |
||
| 236 | 2 => _MD_XOOPSTUBE_IFILM, |
||
| 237 | 3 => _MD_XOOPSTUBE_PHOTOBUCKET, |
||
| 238 | 4 => _MD_XOOPSTUBE_VIDDLER, |
||
| 239 | 100 => _MD_XOOPSTUBE_GOOGLEVIDEO, |
||
| 240 | 101 => _MD_XOOPSTUBE_MYSPAVETV, |
||
| 241 | 102 => _MD_XOOPSTUBE_DAILYMOTION, |
||
| 242 | 103 => _MD_XOOPSTUBE_BLIPTV, |
||
| 243 | 104 => _MD_XOOPSTUBE_CLIPFISH, |
||
| 244 | 105 => _MD_XOOPSTUBE_LIVELEAK, |
||
| 245 | 106 => _MD_XOOPSTUBE_MAKTOOB, |
||
| 246 | 107 => _MD_XOOPSTUBE_VEOH, |
||
| 247 | 108 => _MD_XOOPSTUBE_VIMEO, |
||
| 248 | 109 => _MD_XOOPSTUBE_MEGAVIDEO, |
||
| 249 | 200 => _MD_XOOPSTUBE_XOOPSTUBE |
||
| 250 | ); |
||
| 251 | $vidsource_select = new XoopsFormSelect(_MD_XOOPSTUBE_VIDSOURCE, 'vidsource', $vidsource); |
||
| 252 | $vidsource_select->addOptionArray($vidsource_array); |
||
| 253 | $sform->addElement($vidsource_select, false); |
||
| 254 | |||
| 255 | // Video code form |
||
| 256 | $videocode = new XoopsFormText(_MD_XOOPSTUBE_DLVIDID, 'vidid', 70, 512, $vidid); |
||
| 257 | $videocode->setDescription('<br><span style="font-size: small;">' . _MD_XOOPSTUBE_VIDEO_DLVIDIDDSC . '</span>'); |
||
| 258 | $sform->addElement($videocode, true); |
||
| 259 | $sform->addElement(new XoopsFormLabel('', _MD_XOOPSTUBE_VIDEO_DLVIDID_NOTE)); |
||
| 260 | |||
| 261 | // Picture url form |
||
| 262 | $picurl = new XoopsFormText(_MD_XOOPSTUBE_VIDEO_PICURL, 'picurl', 70, 255, $picurl); |
||
| 263 | $picurl->setDescription('<br><span style="font-weight: normal;">' . _MD_XOOPSTUBE_VIDEO_PICURLNOTE . '</span>'); |
||
| 264 | $sform->addElement($picurl, false); |
||
| 265 | |||
| 266 | // Video publisher form |
||
| 267 | $sform->addElement(new XoopsFormText(_MD_XOOPSTUBE_VIDEO_PUBLISHER, 'publisher', 70, 255, $publisher), true); |
||
| 268 | |||
| 269 | // Category tree |
||
| 270 | $mytree = new XoopstubeTree($GLOBALS['xoopsDB']->prefix('xoopstube_cat'), 'cid', 'pid'); |
||
| 271 | |||
| 272 | $submitcats = array(); |
||
| 273 | $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' ORDER BY title'; |
||
| 274 | $result = $GLOBALS['xoopsDB']->query($sql); |
||
| 275 | while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) { |
||
| 276 | if (true === XoopstubeUtilities::xtubeCheckGroups($myrow['cid'], 'XTubeSubPerm')) { |
||
| 277 | $submitcats[$myrow['cid']] = $myrow['title']; |
||
| 278 | } |
||
| 279 | } |
||
| 280 | |||
| 281 | // Video time form |
||
| 282 | $timeform = new XoopsFormText(_MD_XOOPSTUBE_TIME, 'time', 7, 7, $time); |
||
| 283 | $timeform->setDescription('<span style="font-size: small;">(h:mm:ss)</span>'); |
||
| 284 | $sform->addElement($timeform, false); |
||
| 285 | |||
| 286 | // Video category form |
||
| 287 | ob_start(); |
||
| 288 | $mytree->makeMySelBox('title', 'title', $cid, 0); |
||
| 289 | $sform->addElement(new XoopsFormLabel(_MD_XOOPSTUBE_CATEGORYC, ob_get_contents())); |
||
| 290 | ob_end_clean(); |
||
| 291 | |||
| 292 | // Video description form |
||
| 293 | // $editor = xtube_getWysiwygForm( _MD_XOOPSTUBE_DESCRIPTIONC, 'descriptionb', $descriptionb, 10, 50, ''); |
||
| 294 | // $sform -> addElement( $editor, true ); |
||
| 295 | |||
| 296 | $optionsTrayNote = new XoopsFormElementTray(_MD_XOOPSTUBE_DESCRIPTIONC, '<br>'); |
||
| 297 | View Code Duplication | if (class_exists('XoopsFormEditor')) { |
|
| 298 | $options['name'] = 'descriptionb'; |
||
| 299 | $options['value'] = $descriptionb; |
||
| 300 | $options['rows'] = 5; |
||
| 301 | $options['cols'] = '100%'; |
||
| 302 | $options['width'] = '100%'; |
||
| 303 | $options['height'] = '200px'; |
||
| 304 | $editor = new XoopsFormEditor('', $GLOBALS['xoopsModuleConfig']['form_optionsuser'], $options, $nohtml = false, $onfailure = 'textarea'); |
||
| 305 | $optionsTrayNote->addElement($editor); |
||
| 306 | } else { |
||
| 307 | $editor = new XoopsFormDhtmlTextArea('', 'descriptionb', $item->getVar('descriptionb', 'e'), '100%', '100%'); |
||
| 308 | $optionsTrayNote->addElement($editor); |
||
| 309 | } |
||
| 310 | |||
| 311 | $sform->addElement($optionsTrayNote, false); |
||
| 312 | |||
| 313 | // Meta keywords form |
||
| 314 | $keywords = new XoopsFormTextArea(_MD_XOOPSTUBE_KEYWORDS, 'keywords', $keywords, 5, 50, false); |
||
| 315 | $keywords->setDescription('<br><span style="font-size: smaller;">' . _MD_XOOPSTUBE_KEYWORDS_NOTE . '</span>'); |
||
| 316 | $sform->addElement($keywords); |
||
| 317 | |||
| 318 | if ($GLOBALS['xoopsModuleConfig']['usercantag'] == 1) { |
||
| 319 | // Insert tags if Tag-module is installed |
||
| 320 | if (XoopstubeUtilities::xtubeIsModuleTagInstalled()) { |
||
| 321 | include_once XOOPS_ROOT_PATH . '/modules/tag/include/formtag.php'; |
||
| 322 | $text_tags = new XoopsFormTag('item_tag', 70, 255, $video_array['item_tag'], 0); |
||
| 323 | $sform->addElement($text_tags); |
||
| 324 | } |
||
| 325 | } else { |
||
| 326 | $sform->addElement(new XoopsFormHidden('item_tag', $video_array['item_tag'])); |
||
| 327 | } |
||
| 328 | |||
| 329 | $submitter2 = (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsUser'])) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
||
| 330 | if ($submitter2 > 0) { |
||
| 331 | $option_tray = new XoopsFormElementTray(_MD_XOOPSTUBE_OPTIONS, '<br>'); |
||
| 332 | |||
| 333 | if (!$approve) { |
||
| 334 | $notify_checkbox = new XoopsFormCheckBox('', 'notifypub'); |
||
| 335 | $notify_checkbox->addOption(1, _MD_XOOPSTUBE_NOTIFYAPPROVE); |
||
| 336 | $option_tray->addElement($notify_checkbox); |
||
| 337 | } else { |
||
| 338 | $sform->addElement(new XoopsFormHidden('notifypub', 0)); |
||
| 339 | } |
||
| 340 | } |
||
| 341 | |||
| 342 | if (true === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeAppPerm') && $lid > 0) { |
||
| 343 | $approve_checkbox = new XoopsFormCheckBox('', 'approve', $approve); |
||
| 344 | $approve_checkbox->addOption(1, _MD_XOOPSTUBE_APPROVE); |
||
| 345 | $option_tray->addElement($approve_checkbox); |
||
| 346 | } else { |
||
| 347 | if (true === XoopstubeUtilities::xtubeCheckGroups($cid, 'XTubeAutoApp')) { |
||
| 348 | $sform->addElement(new XoopsFormHidden('approve', 1)); |
||
| 349 | } else { |
||
| 350 | $sform->addElement(new XoopsFormHidden('approve', 0)); |
||
| 351 | } |
||
| 352 | } |
||
| 353 | $sform->addElement($option_tray); |
||
| 354 | |||
| 355 | $button_tray = new XoopsFormElementTray('', ''); |
||
| 356 | $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
||
| 357 | $button_tray->addElement(new XoopsFormHidden('lid', $lid)); |
||
| 358 | |||
| 359 | $sform->addElement($button_tray); |
||
| 360 | $sform->display(); |
||
| 361 | |||
| 362 | echo '</div></div>'; |
||
| 363 | |||
| 364 | include XOOPS_ROOT_PATH . '/footer.php'; |
||
| 365 | } |
||
| 366 | |||
| 367 | } else { |
||
| 368 | redirect_header('index.php', 2, _MD_XOOPSTUBE_NOPERMISSIONTOPOST); |
||
| 369 | } |
||
| 370 | |||
| 371 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.