Code Duplication    Length = 5-5 lines in 6 locations

class/answer.php 2 locations

@@ 439-443 (lines=5) @@
436
            $sql = sprintf('UPDATE %s SET status = %u, faqid = %s, answer = %s, uid = %u, datesub = %u, notifypub = %u WHERE answerid = %u', $this->db->prefix('smartfaq_answers'), $status, $faqid, $this->db->quoteString($answer), $uid, $datesub, $notifypub, $answerid);
437
        }
438
439
        if (false != $force) {
440
            $result = $this->db->queryF($sql);
441
        } else {
442
            $result = $this->db->query($sql);
443
        }
444
445
        if (!$result) {
446
            return false;
@@ 474-478 (lines=5) @@
471
472
        //echo "<br />" . $sql . "<br />";
473
474
        if (false != $force) {
475
            $result = $this->db->queryF($sql);
476
        } else {
477
            $result = $this->db->query($sql);
478
        }
479
        if (!$result) {
480
            return false;
481
        }

class/category.php 2 locations

@@ 339-343 (lines=5) @@
336
        } else {
337
            $sql = sprintf('UPDATE %s SET parentid = %u, name = %s, description = %s, total = %s, weight = %u, created = %u WHERE categoryid = %u', $this->db->prefix('smartfaq_categories'), $parentid, $this->db->quoteString($name), $this->db->quoteString($description), $total, $weight, $created, $categoryid);
338
        }
339
        if (false != $force) {
340
            $result = $this->db->queryF($sql);
341
        } else {
342
            $result = $this->db->query($sql);
343
        }
344
        if (!$result) {
345
            return false;
346
        }
@@ 386-390 (lines=5) @@
383
        $smartModule = sf_getModuleInfo();
384
        $module_id   = $smartModule->getVar('mid');
385
386
        if (false != $force) {
387
            $result = $this->db->queryF($sql);
388
        } else {
389
            $result = $this->db->query($sql);
390
        }
391
392
        xoops_groupperm_deletebymoditem($module_id, 'category_read', $category->categoryid());
393
        //xoops_groupperm_deletebymoditem ($module_id, "category_admin", $categoryObj->categoryid());

class/faq.php 2 locations

@@ 774-778 (lines=5) @@
771
        } else {
772
            $sql = sprintf('UPDATE %s SET categoryid = %u, question = %s, howdoi = %s, diduno = %s, uid = %u, datesub = %u, `status` = %u, counter = %u, weight = %u, html = %u, smiley = %u, xcodes = %u, cancomment = %u, comments = %u, notifypub = %u, modulelink = %s, contextpage = %s, exacturl = %u, partialview = %u  WHERE faqid = %u', $this->db->prefix('smartfaq_faq'), $categoryid, $this->db->quoteString($question), $this->db->quoteString($howdoi), $this->db->quoteString($diduno), $uid, $datesub, $status, $counter, $weight, $html, $smiley, $xcodes, $cancomment, $comments, $notifypub, $this->db->quoteString($modulelink), $this->db->quoteString($contextpage), $exacturl, $partialview, $faqid);
773
        }
774
        if (false != $force) {
775
            $result = $this->db->queryF($sql);
776
        } else {
777
            $result = $this->db->query($sql);
778
        }
779
780
        if (!$result) {
781
            return false;
@@ 818-822 (lines=5) @@
815
816
        $sql = sprintf('DELETE FROM %s WHERE faqid = %u', $this->db->prefix('smartfaq_faq'), $faq->getVar('faqid'));
817
818
        if (false != $force) {
819
            $result = $this->db->queryF($sql);
820
        } else {
821
            $result = $this->db->query($sql);
822
        }
823
        if (!$result) {
824
            return false;
825
        }