Code Duplication    Length = 5-6 lines in 5 locations

add.php 1 location

@@ 108-112 (lines=5) @@
105
    //@todo - replace error handler code below...
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

addlisting.php 2 locations

@@ 68-73 (lines=6) @@
65
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
66
    }
67
68
    if ($_POST['title'] == '') {
69
        //        $erh->show('1001'); //'0001' => 'Could not connect to the forums database.',
70
        $modHandler = xoops_getModuleHandler('module');
71
        $myModule   = $modHandler->getByDirname('adslight');
72
        $myModule->setErrors('Could not connect to the database.');
73
    }
74
75
    if (!empty($_POST['cid'])) {
76
        $cid = (int)$_POST['cid'];
@@ 111-115 (lines=5) @@
108
                   $country, $contactby, $premium, $valid);
109
    // $xoopsDB->query($sql) || $erh->show('0013'); //            '0013' => 'Could not query the database.', // <br>Error: ' . mysql_error() . '',
110
    $success = $xoopsDB->query($sql);
111
    if (!$success) {
112
        $modHandler = xoops_getModuleHandler('module');
113
        $myModule   = $modHandler->getByDirname('adslight');
114
        $myModule->setErrors('Could not query the database.');
115
    }
116
117
    $lid = $xoopsDB->getInsertId();
118

rate-item.php 1 location

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

rate-user.php 1 location

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