Code Duplication    Length = 22-22 lines in 2 locations

blocks/xoopstube_top.php 2 locations

@@ 347-368 (lines=22) @@
344
    $xtubeModuleConfig = $config_handler->getConfigsByCat(0, $xtubeModule->getVar('mid'));
345
    $xtubemyts         = & MyTextSanitizer :: getInstance();
346
347
    if (isset($options[4]) && ($options[4] > 0)) {
348
        $result2 = $xoopsDB->query(
349
            'SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $xoopsDB->prefix(
350
                'xoopstube_videos'
351
            ) . ' WHERE published > 0
352
                                    AND published<=' . time() . '
353
                                    AND (expired=0 OR expired>' . time() . ')
354
                                    AND offline=0
355
                                    AND cid=' . $options[4] . '
356
                                    ORDER BY RAND() LIMIT ' . $options[1]
357
        );
358
    } else {
359
        $result2 = $xoopsDB->query(
360
            'SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $xoopsDB->prefix(
361
                'xoopstube_videos'
362
            ) . ' WHERE published > 0
363
                                    AND published<=' . time() . '
364
                                    AND (expired=0 OR expired>' . time() . ')
365
                                    AND offline=0
366
                                    ORDER BY RAND() LIMIT ' . $options[1]
367
        );
368
    }
369
370
    include_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/include/video.php';
371
    include_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/include/functions.php';
@@ 427-448 (lines=22) @@
424
    $xtubeModuleConfig = $config_handler->getConfigsByCat(0, $xtubeModule->getVar('mid'));
425
    $xtubemyts         = & MyTextSanitizer :: getInstance();
426
427
    if (isset($options[4]) && ($options[4] > 0)) {
428
        $result2 = $xoopsDB->query(
429
            'SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $xoopsDB->prefix(
430
                'xoopstube_videos'
431
            ) . ' WHERE published > 0
432
                                    AND published<=' . time() . '
433
                                    AND (expired=0 OR expired>' . time() . ')
434
                                    AND offline=0
435
                                    AND cid=' . $options[4] . '
436
                                    ORDER BY RAND() LIMIT ' . $options[1]
437
        );
438
    } else {
439
        $result2 = $xoopsDB->query(
440
            'SELECT lid, cid, title, vidid, screenshot, published, vidsource, picurl FROM ' . $xoopsDB->prefix(
441
                'xoopstube_videos'
442
            ) . ' WHERE published > 0
443
                                    AND published<=' . time() . '
444
                                    AND (expired=0 OR expired>' . time() . ')
445
                                    AND offline=0
446
                                    ORDER BY RAND() LIMIT ' . $options[1]
447
        );
448
    }
449
450
    include_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/include/video.php';
451
    include_once XOOPS_ROOT_PATH . '/modules/' . $xtubeModule->getVar('dirname') . '/include/functions.php';