Code Duplication    Length = 53-54 lines in 2 locations

index.php 1 location

@@ 308-361 (lines=54) @@
305
                    $a_item['sold'] = _ADSLIGHT_RESERVEDMEMBER;
306
                }
307
308
                if ($GLOBALS['xoopsModuleConfig']['active_thumbsindex'] > 0) {
309
                    $a_item['no_photo'] = '<a href="'
310
                                          . XOOPS_URL
311
                                          . '/modules/adslight/viewads.php?lid='
312
                                          . $lid
313
                                          . '"><img class="thumb" src="'
314
                                          . XOOPS_URL
315
                                          . '/modules/adslight/assets/images/nophoto.jpg" align="left" width="100px" alt="'
316
                                          . $title
317
                                          . '" /></a>';
318
319
                    $updir   = $GLOBALS['xoopsModuleConfig']['adslight_link_upload'];
320
                    $sql     = 'SELECT cod_img, lid, uid_owner, url FROM '
321
                               . $xoopsDB->prefix('adslight_pictures')
322
                               . ' WHERE  uid_owner='
323
                               . $xoopsDB->escape($usid)
324
                               . ' AND lid='
325
                               . $xoopsDB->escape($lid)
326
                               . ' ORDER BY date_added ASC limit 1';
327
                    $resultp = $xoopsDB->query($sql);
328
329
                    while (list($cod_img, $pic_lid, $uid_owner, $url) = $xoopsDB->fetchRow($resultp)) {
330
                        if ($photo) {
331
                            $a_item['photo'] = '<a href="'
332
                                               . XOOPS_URL
333
                                               . '/modules/adslight/viewads.php?lid='
334
                                               . $lid
335
                                               . '"><img class="thumb" src="'
336
                                               . $updir
337
                                               . '/thumbs/thumb_'
338
                                               . $url
339
                                               . '" align="left" width="100px" alt="'
340
                                               . $title
341
                                               . '" /></a>';
342
                        }
343
                    }
344
                } else {
345
                    $a_item['no_photo'] = '<img src="' . XOOPS_URL . '/modules/adslight/assets/images/camera_nophoto.png" align="left" width="24" alt="' . $title . '" />';
346
                    $updir              = $GLOBALS['xoopsModuleConfig']['adslight_link_upload'];
347
                    $sql                = 'SELECT cod_img, lid, uid_owner, url FROM '
348
                                          . $xoopsDB->prefix('adslight_pictures')
349
                                          . ' WHERE  uid_owner='
350
                                          . $xoopsDB->escape($usid)
351
                                          . ' AND lid='
352
                                          . $xoopsDB->escape($lid)
353
                                          . ' ORDER BY date_added ASC limit 1';
354
                    $resultp            = $xoopsDB->query($sql);
355
356
                    while (list($cod_img, $pic_lid, $uid_owner, $url) = $xoopsDB->fetchRow($resultp)) {
357
                        if ($photo) {
358
                            $a_item['photo'] = '<img src="' . XOOPS_URL . '/modules/adslight/assets/images/camera_photo.png" align="left" width="24" alt="' . $title . '" />';
359
                        }
360
                    }
361
                }
362
                $a_item['hits'] = $hits;
363
                ++$rank;
364
                $xoopsTpl->append('items', $a_item);

viewcats.php 1 location

@@ 362-414 (lines=53) @@
359
                $a_item['sold'] = _ADSLIGHT_RESERVEDMEMBER;
360
            }
361
362
            if ($GLOBALS['xoopsModuleConfig']['active_thumbscats'] > 0) {
363
                $a_item['no_photo'] = '<a href="'
364
                                      . XOOPS_URL
365
                                      . '/modules/adslight/viewads.php?lid='
366
                                      . $lid
367
                                      . '"><img class="thumb" src="'
368
                                      . XOOPS_URL
369
                                      . '/modules/adslight/assets/images/nophoto.jpg" align="left" width="100px" alt="'
370
                                      . $title
371
                                      . '" /></a>';
372
373
                $updir   = $GLOBALS['xoopsModuleConfig']['adslight_link_upload'];
374
                $sql     = 'SELECT cod_img, lid, uid_owner, url FROM '
375
                           . $xoopsDB->prefix('adslight_pictures')
376
                           . ' WHERE  uid_owner='
377
                           . $xoopsDB->escape($usid)
378
                           . ' AND lid='
379
                           . $xoopsDB->escape($lid)
380
                           . ' ORDER BY date_added ASC limit 1';
381
                $resultp = $xoopsDB->query($sql);
382
383
                while (list($cod_img, $pic_lid, $uid_owner, $url) = $xoopsDB->fetchRow($resultp)) {
384
                    if ($photo) {
385
                        $a_item['photo'] = '<a href="'
386
                                           . XOOPS_URL
387
                                           . '/modules/adslight/viewads.php?lid='
388
                                           . $lid
389
                                           . '"><img class="thumb" src="'
390
                                           . $updir
391
                                           . '/thumbs/thumb_'
392
                                           . $url
393
                                           . '" align="left" width="100px" alt="'
394
                                           . $title
395
                                           . '" /></a>';
396
                    }
397
                }
398
            } else {
399
                $a_item['no_photo'] = '<p><img src="' . XOOPS_URL . '/modules/adslight/assets/images/camera_nophoto.png" align="left" width="24" alt="' . $title . '" /></p>';
400
                $updir              = $GLOBALS['xoopsModuleConfig']['adslight_link_upload'];
401
                $sql                = 'SELECT cod_img, lid, uid_owner, url FROM '
402
                                      . $xoopsDB->prefix('adslight_pictures')
403
                                      . ' WHERE  uid_owner='
404
                                      . $xoopsDB->escape($usid)
405
                                      . ' AND lid='
406
                                      . $xoopsDB->escape($lid)
407
                                      . ' ORDER BY date_added ASC limit 1';
408
                $resultp            = $xoopsDB->query($sql);
409
                while (list($cod_img, $pic_lid, $uid_owner, $url) = $xoopsDB->fetchRow($resultp)) {
410
                    if ($photo) {
411
                        $a_item['photo'] = '<p><img src="' . XOOPS_URL . '/modules/adslight/assets/images/camera_photo.png" align="left" width="24" alt="' . $title . '" /></p>';
412
                    }
413
                }
414
            }
415
416
            $a_item['hits'] = $hits;
417
            ++$rank;