Code Duplication    Length = 53-54 lines in 2 locations

index.php 1 location

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

viewcats.php 1 location

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