Code Duplication    Length = 8-8 lines in 2 locations

admin/main.php 2 locations

@@ 813-820 (lines=8) @@
810
    $lid   = mylinksUtility::mylinks_cleanVars($_GET, 'lid', 0, 'int', array('min'=>0));
811
812
    $dbTables = array( 'links', 'text', 'votedata', 'broken', 'mod' );
813
    foreach ($dbTables as $thisTable) {
814
        $sql = sprintf('DELETE FROM %s WHERE lid = %u', $xoopsDB->prefix("mylinks_{$thisTable}"), $lid);
815
        $result = $xoopsDB->query($sql);
816
        if (!$result) {
817
            mylinksUtility::show_message(_MD_MYLINKS_DBNOTUPDATED);
818
            exit();
819
        }
820
    }
821
    // delete comments & notifications
822
    xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
823
    xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $lid);
@@ 964-971 (lines=8) @@
961
        if ( $lidArray ) {
962
            $linkIDs = '(' . implode(',', $lidArray) . ')';
963
            $dbTables = array( 'links', 'text', 'votedata', 'broken', 'mod' );
964
            foreach ($dbTables as $thisTable) {
965
                $sql = sprintf('DELETE FROM %s WHERE lid IN %s', $xoopsDB->prefix("mylinks_{$thisTable}"), $linkIDs);
966
                $result = $xoopsDB->query($sql);
967
                if (!result) {
968
                    mylinksUtility::show_message(_MD_MYLINKS_NORECORDFOUND);
969
                    exit();
970
                }
971
            }
972
            // remove any notifications and comments for these listings
973
            foreach ($lidArray as $this_lid) {
974
                xoops_comment_delete($xoopsModule->getVar('mid'), $this_lid);