Code Duplication    Length = 17-17 lines in 2 locations

class/PublicWallUpdates.php 2 locations

@@ 305-321 (lines=17) @@
302
     * @param int $ownerID
303
     * @return array|bool
304
     */
305
    public function updatesPermalink($updid, $uid, $ownerID)
306
    {
307
        $query  = 'SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_messages') . ' M, ' . $GLOBALS['xoopsDB']->prefix('smallworld_user') . " U  WHERE M.uid_fk=U.userid AND M.uid_fk='" . $ownerID . "'";
308
        $query  .= " AND M.msg_id = '" . $updid . "'";
309
        $query  .= ' order by M.created DESC LIMIT 1';
310
        $result = $GLOBALS['xoopsDB']->queryF($query);
311
        $count  = $GLOBALS['xoopsDB']->getRowsNum($result);
312
        if ($count < 1) {
313
            return false;
314
        }
315
        while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
316
            $data[] = $row;
317
        }
318
        if (!empty($data)) {
319
            return $data;
320
        }
321
    }
322
323
    /**
324
     * Get share link
@@ 331-347 (lines=17) @@
328
     * @param int $ownerID
329
     * @return array|bool
330
     */
331
    public function updatesSharelink($updid, $ownerID)
332
    {
333
        $query  = 'SELECT M.msg_id, M.uid_fk, M.message, M.created, M.priv, U.username FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_messages') . ' M, ' . $GLOBALS['xoopsDB']->prefix('smallworld_user') . " U WHERE M.uid_fk=U.userid AND M.uid_fk='" . $ownerID . "' AND M.priv = 0";
334
        $query  .= " AND M.msg_id = '" . $updid . "'";
335
        $query  .= ' order by created DESC LIMIT 1';
336
        $result = $GLOBALS['xoopsDB']->queryF($query);
337
        $count  = $GLOBALS['xoopsDB']->getRowsNum($result);
338
        if ($count < 1) {
339
            return false;
340
        }
341
        while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
342
            $data[] = $row;
343
        }
344
        if (!empty($data)) {
345
            return $data;
346
        }
347
    }
348
349
    /**
350
     * @Get sharing link