Code Duplication    Length = 8-9 lines in 2 locations

include/functions.php 1 location

@@ 902-909 (lines=8) @@
899
}
900
901
// Verify that a term does not exist for submissions and requests (both user frontend and admin backend)
902
function lx_TermExists($term, $table) {
903
    global $xoopsDB;
904
    $sql = sprintf('SELECT COUNT(*) FROM %s WHERE term = %s', $table, $xoopsDB->quoteString(addslashes($term)));
905
    $result = $xoopsDB->query($sql);
906
    list($count) = $xoopsDB->fetchRow($result);
907
908
    return($count);
909
}
910
911
// Static method to get author data block authors - from AMS
912
function lexikon_block_getAuthors($limit = 5, $sort = "count", $name = 'uname', $compute_method = "average") {

class/Utility.php 1 location

@@ 1342-1350 (lines=9) @@
1339
     * @param $table
1340
     * @return mixed
1341
     */
1342
public static function isTermPresent($term, $table)
1343
{
1344
    global $xoopsDB;
1345
    $sql    = sprintf('SELECT COUNT(*) FROM %s WHERE term = %s', $table, $xoopsDB->quoteString(addslashes($term)));
1346
    $result = $xoopsDB->query($sql);
1347
    list($count) = $xoopsDB->fetchRow($result);
1348
1349
    return $count;
1350
}
1351
1352
    // Static method to get author data block authors - from AMS
1353
    /**