Code Duplication    Length = 14-14 lines in 2 locations

blocks/xoopstube_top.php 2 locations

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