Code Duplication    Length = 5-5 lines in 4 locations

add.php 1 location

@@ 102-106 (lines=5) @@
99
                       $xoopsDB->prefix('adslight_listing'), $newid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town,
100
                       $country, $contactby, $premium, $valid);
101
    $success = $xoopsDB->query($sql);
102
    if (!$success) {
103
        $modHandler = xoops_getModuleHandler('module');
104
        $myModule   = $modHandler->getByDirname('adslight');
105
        $myModule->setErrors('Could not query the database.');
106
    }
107
108
    $lid = $xoopsDB->getInsertId();
109

addlisting.php 1 location

@@ 108-112 (lines=5) @@
105
                   $country, $contactby, $premium, $valid);
106
    // $xoopsDB->query($sql) || $erh->show('0013'); //            '0013' => 'Could not query the database.', // <br>Error: ' . mysql_error() . '',
107
    $success = $xoopsDB->query($sql);
108
    if (!$success) {
109
        $modHandler = xoops_getModuleHandler('module');
110
        $myModule   = $modHandler->getByDirname('adslight');
111
        $myModule->setErrors('Could not query the database.');
112
    }
113
114
    $lid = $xoopsDB->getInsertId();
115

rate-item.php 1 location

@@ 82-86 (lines=5) @@
79
                        $lid, $ratinguser, $rating, $ip, $datetime);
80
    // $xoopsDB->query($sql) || $erh->show('0013'); //            '0013' => 'Could not query the database.', // <br>Error: ' . mysql_error() . '',
81
    $success = $xoopsDB->query($sql);
82
    if (!$success) {
83
        $modHandler = xoops_getModuleHandler('module');
84
        $myModule   = $modHandler->getByDirname('adslight');
85
        $myModule->setErrors('Could not query the database.');
86
    }
87
88
    //All is well.  Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
89
    //    updateIrating($lid);

rate-user.php 1 location

@@ 83-87 (lines=5) @@
80
                        $usid, $ratinguser, $rating, $ip, $datetime);
81
    // $xoopsDB->query($sql) || $erh->show('0013'); //            '0013' => 'Could not query the database.', // <br>Error: ' . mysql_error() . '',
82
    $success = $xoopsDB->query($sql);
83
    if (!$success) {
84
        $modHandler = xoops_getModuleHandler('module');
85
        $myModule   = $modHandler->getByDirname('adslight');
86
        $myModule->setErrors('Could not query the database.');
87
    }
88
89
    //All is well.  Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
90
    //    updateUrating($usid);