Code Duplication    Length = 5-8 lines in 4 locations

blocks/items_new.php 2 locations

@@ 72-76 (lines=5) @@
69
                $images             = $itemsObj[$i]->getImages();
70
                if (is_object($images['main'])) {
71
                    // check to see if GD function exist
72
                    if (!function_exists('imagecreatetruecolor')) {
73
                        $item['image'] = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
74
                    } else {
75
                        $item['image'] = PUBLISHER_URL . '/thumb.php?src=' . XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name') . '&w=50';
76
                    }
77
                    $item['image_name'] = $images['main']->getVar('image_nicename');
78
                }
79
            } elseif ('category' === $image) {
@@ 86-93 (lines=8) @@
83
                if ('0' == $itemsObj[$i]->uid()) {
84
                    $item['image'] = XOOPS_URL . '/uploads/blank.gif';
85
                    $images        = $itemsObj[$i]->getImages();
86
                    if (is_object($images['main'])) {
87
                        // check to see if GD function exist
88
                        if (!function_exists('imagecreatetruecolor')) {
89
                            $item['image'] = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
90
                        } else {
91
                            $item['image'] = PUBLISHER_URL . '/thumb.php?src=' . XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name') . '&w=50';
92
                        }
93
                    }
94
                } else {
95
                    // check to see if GD function exist
96
                    if (!function_exists('imagecreatetruecolor')) {

class/item.php 2 locations

@@ 830-834 (lines=5) @@
827
            $item['image_height'] = $dimensions[1];
828
            $item['image_path']   = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
829
            // check to see if GD function exist
830
            if (!function_exists('imagecreatetruecolor')) {
831
                $item['image_thumb'] = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
832
            } else {
833
                $item['image_thumb'] = PUBLISHER_URL . '/thumb.php?src=' . XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name') . '&h=180';
834
            }
835
            $item['image_name'] = $images['main']->getVar('image_nicename');
836
        }
837
@@ 857-861 (lines=5) @@
854
            $item['images'][$i]['height'] = $dimensions[1];
855
            $item['images'][$i]['path']   = XOOPS_URL . '/uploads/' . $image->getVar('image_name');
856
            // check to see if GD function exist
857
            if (!function_exists('imagecreatetruecolor')) {
858
                $item['images'][$i]['thumb'] = XOOPS_URL . '/uploads/' . $image->getVar('image_name');
859
            } else {
860
                $item['images'][$i]['thumb'] = PUBLISHER_URL . '/thumb.php?src=' . XOOPS_URL . '/uploads/' . $image->getVar('image_name') . '&w=240';
861
            }
862
            $item['images'][$i]['name'] = $image->getVar('image_nicename');
863
            ++$i;
864
        }