Code Duplication    Length = 14-14 lines in 2 locations

blocks/xoopstube_top.php 2 locations

@@ 311-324 (lines=14) @@
308
    $xtubeModuleConfig = $configHandler->getConfigsByCat(0, $xtubeModule->getVar('mid'));
309
    $xtubemyts         = MyTextSanitizer:: getInstance();
310
311
    if (isset($options[4]) && ($options[4] > 0)) {
312
        $result2 = $GLOBALS['xoopsDB']->query('SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0
313
                                    AND published<=' . time() . '
314
                                    AND (expired=0 OR expired>' . time() . ')
315
                                    AND offline=0
316
                                    AND cid=' . $options[4] . '
317
                                    ORDER BY RAND() LIMIT ' . $options[1]);
318
    } else {
319
        $result2 = $GLOBALS['xoopsDB']->query('SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0
320
                                    AND published<=' . time() . '
321
                                    AND (expired=0 OR expired>' . time() . ')
322
                                    AND offline=0
323
                                    ORDER BY RAND() LIMIT ' . $options[1]);
324
    }
325
326
    require_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/include/video.php';
327
    require_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/class/utility.php';
@@ 377-390 (lines=14) @@
374
    $xtubeModuleConfig = $configHandler->getConfigsByCat(0, $xtubeModule->getVar('mid'));
375
    $xtubemyts         = MyTextSanitizer:: getInstance();
376
377
    if (isset($options[4]) && ($options[4] > 0)) {
378
        $result2 = $GLOBALS['xoopsDB']->query('SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0
379
                                    AND published<=' . time() . '
380
                                    AND (expired=0 OR expired>' . time() . ')
381
                                    AND offline=0
382
                                    AND cid=' . $options[4] . '
383
                                    ORDER BY RAND() LIMIT ' . $options[1]);
384
    } else {
385
        $result2 = $GLOBALS['xoopsDB']->query('SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0
386
                                    AND published<=' . time() . '
387
                                    AND (expired=0 OR expired>' . time() . ')
388
                                    AND offline=0
389
                                    ORDER BY RAND() LIMIT ' . $options[1]);
390
    }
391
392
    require_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/include/video.php';
393
    require_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/class/utility.php';