Code Duplication    Length = 8-9 lines in 2 locations

class/Utility.php 1 location

@@ 1316-1324 (lines=9) @@
1313
     * @param $table
1314
     * @return mixed
1315
     */
1316
public static function isTermPresent($term, $table)
1317
{
1318
    global $xoopsDB;
1319
    $sql    = sprintf('SELECT COUNT(*) FROM %s WHERE term = %s', $table, $xoopsDB->quoteString(addslashes($term)));
1320
    $result = $xoopsDB->query($sql);
1321
    list($count) = $xoopsDB->fetchRow($result);
1322
1323
    return $count;
1324
}
1325
1326
    // Static method to get author data block authors - from AMS
1327
    /**

include/functions.php 1 location

@@ 750-757 (lines=8) @@
747
}
748
749
// Verify that a term does not exist for submissions and requests (both user frontend and admin backend)
750
function lx_TermExists($term, $table) {
751
    global $xoopsDB;
752
    $sql = sprintf('SELECT COUNT(*) FROM %s WHERE term = %s', $table, $xoopsDB->quoteString(addslashes($term)));
753
    $result = $xoopsDB->query($sql);
754
    list($count) = $xoopsDB->fetchRow($result);
755
756
    return($count);
757
}
758
759
// Static method to get author data block authors - from AMS
760
function lexikon_block_getAuthors($limit = 5, $sort = "count", $name = 'uname', $compute_method = "average") {