Code Duplication    Length = 21-21 lines in 2 locations

class/wall.php 1 location

@@ 374-394 (lines=21) @@
371
     * @param int $ownerID
372
     * @return array|bool
373
     */
374
    public function UpdatesSharelink($updid, $ownerID)
375
    {
376
        global $xoopsUser, $xoopsDB, $moduleConfig, $xoopsLogger;
377
        $xoopsLogger->activated = false;
378
        //error_reporting(E_ALL);
379
        $query  = 'SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM ' . $xoopsDB->prefix('smallworld_messages') . ' M, ' . $xoopsDB->prefix('smallworld_user') . " U WHERE M.uid_fk=U.userid AND M.uid_fk='" . $ownerID . "' AND M.priv = 0";
380
        $query  .= " AND M.msg_id = '" . $updid . "'";
381
        $query  .= ' order by created DESC LIMIT 1';
382
        $result = $xoopsDB->queryF($query);
383
        $count  = $xoopsDB->getRowsNum($result);
384
        if ($count < 1) {
385
            return false;
386
        } else {
387
            while ($row = $xoopsDB->fetchArray($result)) {
388
                $data[] = $row;
389
            }
390
            if (!empty($data)) {
391
                return $data;
392
            }
393
        }
394
    }
395
396
    /**
397
     * @Get sharing link

class/WallUpdates.php 1 location

@@ 379-399 (lines=21) @@
376
     * @param int $ownerID
377
     * @return array|bool
378
     */
379
    public function UpdatesSharelink($updid, $ownerID)
380
    {
381
        global $xoopsUser, $xoopsDB, $moduleConfig, $xoopsLogger;
382
        $xoopsLogger->activated = false;
383
        //error_reporting(E_ALL);
384
        $query  = 'SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM ' . $xoopsDB->prefix('smallworld_messages') . ' M, ' . $xoopsDB->prefix('smallworld_user') . " U WHERE M.uid_fk=U.userid AND M.uid_fk='" . $ownerID . "' AND M.priv = 0";
385
        $query  .= " AND M.msg_id = '" . $updid . "'";
386
        $query  .= ' order by created DESC LIMIT 1';
387
        $result = $xoopsDB->queryF($query);
388
        $count  = $xoopsDB->getRowsNum($result);
389
        if ($count < 1) {
390
            return false;
391
        } else {
392
            while ($row = $xoopsDB->fetchArray($result)) {
393
                $data[] = $row;
394
            }
395
            if (!empty($data)) {
396
                return $data;
397
            }
398
        }
399
    }
400
401
    /**
402
     * @Get sharing link