Code Duplication    Length = 4-4 lines in 3 locations

submit.php 3 locations

@@ 81-84 (lines=4) @@
78
            }
79
            $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . '  (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) ';
80
            $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')";
81
            if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
82
                $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno();
83
                XoopsErrorHandler_HandleError(E_USER_WARNING, $_error, __FILE__, __LINE__);
84
            }
85
            $newid = $GLOBALS['xoopsDB']->getInsertId();
86
87
            // Add item_tag to Tag-module
@@ 127-130 (lines=4) @@
124
                $sql     = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos')
125
                           . " 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 ="
126
                           . $lid;
127
                if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
128
                    $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno();
129
                    XoopsErrorHandler_HandleError(E_USER_WARNING, $_error, __FILE__, __LINE__);
130
                }
131
132
                $notificationHandler   = xoops_getHandler('notification');
133
                $tags                  = array();
@@ 154-157 (lines=4) @@
151
                if ($modifysubmitter === $submitter_array['submitter']) {
152
                    $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('xoopstube_mod') . ' (requestid, lid, cid, title, vidid, publisher, vidsource, description, modifysubmitter, requestdate, time, keywords, item_tag, picurl)';
153
                    $sql .= " VALUES ('', $lid, $cid, '$title', '$vidid', '$publisher', '$vidsource', '$descriptionb', '$modifysubmitter', '$requestdate', '$time', '$keywords', '$item_tag', '$picurl')";
154
                    if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
155
                        $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno();
156
                        XoopsErrorHandler_HandleError(E_USER_WARNING, $_error, __FILE__, __LINE__);
157
                    }
158
                } else {
159
                    redirect_header('index.php', 2, _MD_XOOPSTUBE_MODIFYNOTALLOWED);
160
                }