mambax7 /
adslight
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | /* |
||
| 6 | ------------------------------------------------------------------------- |
||
| 7 | ADSLIGHT 2 : Module for Xoops |
||
| 8 | |||
| 9 | Redesigned and ameliorate By iluc user at www.frxoops.org |
||
| 10 | Started with the Classifieds module and made MANY changes |
||
| 11 | Website : http://www.limonads.com |
||
| 12 | Contact : [email protected] |
||
| 13 | ------------------------------------------------------------------------- |
||
| 14 | Original credits below Version History |
||
| 15 | ########################################################################## |
||
| 16 | # Classified Module for Xoops # |
||
| 17 | # By John Mordo user jlm69 at www.xoops.org and www.jlmzone.com # |
||
| 18 | # Started with the MyAds module and made MANY changes # |
||
| 19 | ########################################################################## |
||
| 20 | Original Author: Pascal Le Boustouller |
||
| 21 | Author Website : [email protected] |
||
| 22 | Licence Type : GPL |
||
| 23 | ------------------------------------------------------------------------- |
||
| 24 | */ |
||
| 25 | |||
| 26 | use Xmf\Module\Admin; |
||
| 27 | use Xmf\Request; |
||
| 28 | use XoopsModules\Adslight\{ |
||
| 29 | Tree, |
||
| 30 | Helper, |
||
| 31 | Utility |
||
| 32 | }; |
||
| 33 | |||
| 34 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_category.tpl'; |
||
| 35 | |||
| 36 | global $xoopsModule; |
||
| 37 | |||
| 38 | require_once __DIR__ . '/header.php'; |
||
| 39 | |||
| 40 | $myts = \MyTextSanitizer::getInstance(); |
||
| 41 | $module_id = $xoopsModule->getVar('mid'); |
||
| 42 | $groups = $GLOBALS['xoopsUser'] instanceof \XoopsUser ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS; |
||
| 43 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
||
| 44 | $grouppermHandler = xoops_getHandler('groupperm'); |
||
| 45 | |||
| 46 | $perm_itemid = Request::getInt('item_id', 0, 'POST'); |
||
| 47 | |||
| 48 | if (!$grouppermHandler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) { |
||
| 49 | redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM); |
||
| 50 | } |
||
| 51 | $prem_perm = !$grouppermHandler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? '0' : '1'; |
||
| 52 | $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid'); |
||
| 53 | |||
| 54 | # function index |
||
| 55 | ##################################################### |
||
| 56 | |||
| 57 | function index(): void |
||
| 58 | { |
||
| 59 | global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $mytree, $meta, $mid, $prem_perm; |
||
| 60 | $pathIcon16 = Admin::iconUrl('', 16); |
||
| 61 | $moduleDirName = \basename(__DIR__); |
||
| 62 | |||
| 63 | $helper = Helper::getInstance(); |
||
| 64 | |||
| 65 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
||
| 66 | require_once $GLOBALS['xoops']->path('class/template.php'); |
||
| 67 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
||
| 68 | } |
||
| 69 | |||
| 70 | // $GLOBALS['xoopsOption']['template_main'] = 'adslight_index.tpl'; |
||
| 71 | |||
| 72 | require_once XOOPS_ROOT_PATH . '/header.php'; |
||
| 73 | |||
| 74 | $GLOBALS['xoopsTpl']->assign('xmid', $xoopsModule->getVar('mid')); |
||
| 75 | $GLOBALS['xoopsTpl']->assign('add_from', _ADSLIGHT_ADDFROM . ' ' . $xoopsConfig['sitename']); |
||
| 76 | $GLOBALS['xoopsTpl']->assign('add_from_title', _ADSLIGHT_ADDFROM); |
||
| 77 | $GLOBALS['xoopsTpl']->assign('add_from_sitename', $xoopsConfig['sitename']); |
||
| 78 | $GLOBALS['xoopsTpl']->assign('only_pix', _ADSLIGHT_ONLYPIX); |
||
| 79 | $GLOBALS['xoopsTpl']->assign('adslight_logolink', _ADSLIGHT_LOGOLINK); |
||
| 80 | $GLOBALS['xoopsTpl']->assign('permit', $prem_perm); |
||
| 81 | |||
| 82 | $GLOBALS['xoopsTpl']->assign('xoops_module_header', '<link rel="stylesheet" href="' . XOOPS_URL . '/modules/adslight/assets/css/adslight.css" type="text/css" media="all" >'); |
||
| 83 | |||
| 84 | $banner = xoops_getbanner(); |
||
| 85 | $GLOBALS['xoopsTpl']->assign('banner', $banner); |
||
| 86 | $GLOBALS['xoopsTpl']->assign('use_extra_code', $GLOBALS['xoopsModuleConfig']['adslight_use_index_code']); |
||
| 87 | $GLOBALS['xoopsTpl']->assign('adslight_use_banner', $GLOBALS['xoopsModuleConfig']['adslight_use_banner']); |
||
| 88 | $GLOBALS['xoopsTpl']->assign('index_extra_code', $GLOBALS['xoopsModuleConfig']['adslight_index_code']); |
||
| 89 | $GLOBALS['xoopsTpl']->assign('index_code_place', $GLOBALS['xoopsModuleConfig']['adslight_index_code_place']); |
||
| 90 | $GLOBALS['xoopsTpl']->assign('category_title2', _ADSLIGHT_ANNONCES); |
||
| 91 | // adslight 2 |
||
| 92 | $GLOBALS['xoopsTpl']->assign('adslight_active_menu', $GLOBALS['xoopsModuleConfig']['adslight_active_menu']); |
||
| 93 | $GLOBALS['xoopsTpl']->assign('adslight_active_rss', $GLOBALS['xoopsModuleConfig']['adslight_active_rss']); |
||
| 94 | |||
| 95 | // ExpireAd(); |
||
| 96 | Utility::expireAd(); |
||
| 97 | |||
| 98 | if ($GLOBALS['xoopsUser']) { |
||
| 99 | $member_usid = $GLOBALS['xoopsUser']->getVar('uid'); |
||
| 100 | $usid = $member_usid; |
||
| 101 | if ($usid) { |
||
| 102 | $GLOBALS['xoopsTpl']->assign('istheirs', true); |
||
| 103 | |||
| 104 | [$show_user] = $xoopsDB->fetchRow($xoopsDB->query('SELECT SQL_CACHE COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE usid=' . $member_usid . ' ')); |
||
| 105 | |||
| 106 | $GLOBALS['xoopsTpl']->assign('show_user', $show_user); |
||
| 107 | $GLOBALS['xoopsTpl']->assign('show_user_link', 'members.php?usid=' . $member_usid . ''); |
||
| 108 | } |
||
| 109 | } |
||
| 110 | |||
| 111 | $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE valid="No"'; |
||
| 112 | $result = $xoopsDB->query($sql); |
||
| 113 | [$propo] = $xoopsDB->fetchRow($result); |
||
| 114 | |||
| 115 | if ($propo > 0) { |
||
| 116 | $GLOBALS['xoopsTpl']->assign('moderated', true); |
||
| 117 | } |
||
| 118 | if ($GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
||
| 119 | if ($GLOBALS['xoopsUser']->isAdmin()) { |
||
| 120 | $GLOBALS['xoopsTpl']->assign('admin_block', _ADSLIGHT_ADMINCADRE); |
||
| 121 | if (0 === $propo) { |
||
| 122 | $GLOBALS['xoopsTpl']->assign('confirm_ads', _ADSLIGHT_NO_CLA); |
||
| 123 | } else { |
||
| 124 | $GLOBALS['xoopsTpl']->assign('confirm_ads', _ADSLIGHT_THEREIS . ' ' . $propo . ' ' . _ADSLIGHT_WAIT . '<br><a href="' . XOOPS_URL . '/modules/adslight/admin/validate_ads.php">' . _ADSLIGHT_SEEIT . '</a>'); |
||
| 125 | } |
||
| 126 | } |
||
| 127 | |||
| 128 | $categories = Utility::getMyItemIds('adslight_submit'); |
||
| 129 | $intro = is_array($categories) |
||
| 130 | && (count($categories) > 0) ? _ADSLIGHT_INTRO : ''; |
||
| 131 | $GLOBALS['xoopsTpl']->assign('intro', $intro); |
||
| 132 | } |
||
| 133 | |||
| 134 | $sql = 'SELECT SQL_CACHE cid, title, img FROM ' . $xoopsDB->prefix('adslight_categories') . ' WHERE pid = 0 '; |
||
| 135 | |||
| 136 | $categories = Utility::getMyItemIds('adslight_view'); |
||
| 137 | if (is_iterable($categories) && count($categories) > 0) { |
||
| 138 | $sql .= ' AND cid IN (' . implode(',', $categories) . ') '; |
||
| 139 | } else { |
||
| 140 | redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM); |
||
| 141 | } |
||
| 142 | $sql .= 'cat_order' === $GLOBALS['xoopsModuleConfig']['adslight_csortorder'] ? 'ORDER BY cat_order' : 'ORDER BY title'; |
||
| 143 | $result = $xoopsDB->query($sql); |
||
| 144 | |||
| 145 | $count = 1; |
||
| 146 | $content = ''; |
||
| 147 | while (false !== ($myrow = $xoopsDB->fetchArray($result))) { |
||
| 148 | $title = \htmlspecialchars($myrow['title'], ENT_QUOTES | ENT_HTML5); |
||
| 149 | |||
| 150 | if ($myrow['img'] && 'http://' !== $myrow['img']) { |
||
| 151 | $cat_img = \htmlspecialchars($myrow['img'], ENT_QUOTES | ENT_HTML5); |
||
| 152 | $img = "<a href=\"viewcats.php?cid={$myrow['cid']}\"><img src=\"" . XOOPS_URL . "/modules/adslight/assets/images/img_cat/{$cat_img}\" align=\"middle\" alt=\"{$title}\"></a>"; |
||
| 153 | } else { |
||
| 154 | $img = ''; |
||
| 155 | } |
||
| 156 | |||
| 157 | $totallisting = Utility::getTotalItems($myrow['cid'], 1); |
||
| 158 | $content .= $title . ' '; |
||
| 159 | |||
| 160 | $arr = []; |
||
| 161 | if (in_array($myrow['cid'], $categories, true)) { |
||
| 162 | $arr = $mytree->getFirstChild($myrow['cid'], 'title'); |
||
| 163 | $space = 0; |
||
| 164 | $chcount = 1; |
||
| 165 | $subcategories = ''; |
||
| 166 | if (1 === $GLOBALS['xoopsModuleConfig']['adslight_souscat']) { |
||
| 167 | foreach ($arr as $ele) { |
||
| 168 | if (in_array($ele['cid'], $categories, true)) { |
||
| 169 | $chtitle = \htmlspecialchars($ele['title'], ENT_QUOTES | ENT_HTML5); |
||
| 170 | if ($chcount > $GLOBALS['xoopsModuleConfig']['adslight_nbsouscat']) { |
||
| 171 | $subcategories .= "<a href=\"viewcats.php?cid={$myrow['cid']}\">" . _ADSLIGHT_CATPLUS . '</a>'; |
||
| 172 | break; |
||
| 173 | } |
||
| 174 | if ($space > 0) { |
||
| 175 | $subcategories .= '<br>'; |
||
| 176 | } |
||
| 177 | $subcategories .= '- <a href="' . XOOPS_URL . "/modules/adslight/viewcats.php?cid={$ele['cid']}\">{$chtitle}</a>"; |
||
| 178 | ++$space; |
||
| 179 | ++$chcount; |
||
| 180 | $content .= $ele['title'] . ' '; |
||
| 181 | } |
||
| 182 | } |
||
| 183 | } |
||
| 184 | $GLOBALS['xoopsTpl']->append('categories', [ |
||
| 185 | 'image' => $img, |
||
| 186 | 'id' => $myrow['cid'], |
||
| 187 | 'title' => htmlspecialchars($myrow['title'], ENT_QUOTES | ENT_HTML5), |
||
| 188 | 'new' => categorynewgraphic($myrow['cid']), |
||
| 189 | 'subcategories' => $subcategories, |
||
| 190 | 'totallisting' => $totallisting, |
||
| 191 | 'count' => $count, |
||
| 192 | ]); |
||
| 193 | ++$count; |
||
| 194 | } |
||
| 195 | } |
||
| 196 | $cat_perms = ''; |
||
| 197 | if (is_iterable($categories) && count($categories) > 0) { |
||
| 198 | $cat_perms .= ' AND cid IN (' . implode(',', $categories) . ') '; |
||
| 199 | } |
||
| 200 | |||
| 201 | [$ads] = $xoopsDB->fetchRow($xoopsDB->query('SELECT SQL_CACHE COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . " WHERE valid='Yes' AND status!='1' {$cat_perms}")); |
||
| 202 | |||
| 203 | [$catt] = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix("{$moduleDirName}_categories"))); |
||
| 204 | |||
| 205 | $submit_perms = Utility::getMyItemIds('adslight_submit'); |
||
| 206 | |||
| 207 | if ($GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
||
| 208 | // $add_listing = '' . _ADSLIGHT_ADD_LISTING_BULLOK . '<a href="add.php">' . _ADSLIGHT_ADD_LISTING_SUBOK . '</a>'; |
||
| 209 | $add_listing = '' . _ADSLIGHT_ADD_LISTING_BULLOK . '<a rel="nofollow" class="btn btn-success text-right" title="submit your ad" href="add.php">' . _ADSLIGHT_ADD_LISTING_SUBOK . '</a>'; |
||
| 210 | } else { |
||
| 211 | $add_listing = '' . _ADSLIGHT_ADD_LISTING_BULL . '<a href="' . XOOPS_URL . '/register.php">' . _ADSLIGHT_ADD_LISTING_SUB . '</a>.'; |
||
| 212 | } |
||
| 213 | |||
| 214 | $GLOBALS['xoopsTpl']->assign('bullinfotext', _ADSLIGHT_ACTUALY . ' ' . $ads . ' ' . _ADSLIGHT_ADVERTISEMENTS . '<br>' . $add_listing); |
||
| 215 | $GLOBALS['xoopsTpl']->assign('total_confirm', _ADSLIGHT_AND . " ${propo} " . _ADSLIGHT_WAIT3); |
||
| 216 | |||
| 217 | if (1 === $GLOBALS['xoopsModuleConfig']['adslight_newad']) { |
||
| 218 | $cat_perms = ''; |
||
| 219 | if (is_iterable($categories) && count($categories) > 0) { |
||
| 220 | $cat_perms .= ' AND cid IN (' . implode(',', $categories) . ') '; |
||
| 221 | } |
||
| 222 | |||
| 223 | $sql = 'SELECT SQL_CACHE lid, title, status, type, price, typeprice, date_created, town, country, usid, premium, valid, photo, hits FROM ' |
||
| 224 | . $xoopsDB->prefix('adslight_listing') |
||
| 225 | . " WHERE valid='Yes' and status!='1' {$cat_perms} ORDER BY date_created DESC LIMIT {$GLOBALS['xoopsModuleConfig']['adslight_newcount']}"; |
||
| 226 | $result = $xoopsDB->query($sql); |
||
| 227 | if ($result) { |
||
| 228 | $GLOBALS['xoopsTpl']->assign('last_head', _ADSLIGHT_THE . ' ' . $GLOBALS['xoopsModuleConfig']['adslight_newcount'] . ' ' . _ADSLIGHT_LASTADD); |
||
| 229 | $GLOBALS['xoopsTpl']->assign('last_head_title', _ADSLIGHT_TITLE); |
||
| 230 | $GLOBALS['xoopsTpl']->assign('last_head_price', _ADSLIGHT_PRICE); |
||
| 231 | $GLOBALS['xoopsTpl']->assign('last_head_date', _ADSLIGHT_DATE); |
||
| 232 | $GLOBALS['xoopsTpl']->assign('last_head_local', _ADSLIGHT_LOCAL2); |
||
| 233 | $GLOBALS['xoopsTpl']->assign('last_head_hits', _ADSLIGHT_VIEW); |
||
| 234 | $GLOBALS['xoopsTpl']->assign('last_head_photo', _ADSLIGHT_PHOTO); |
||
| 235 | $rank = 1; |
||
| 236 | while ([$lid, $title, $status, $type, $price, $typeprice, $date, $town, $country, $usid, $premium, $valid, $photo, $hits] = $xoopsDB->fetchRow( |
||
| 237 | $result |
||
| 238 | )) { |
||
| 239 | $title = \htmlspecialchars($title, ENT_QUOTES | ENT_HTML5); |
||
| 240 | $type = \htmlspecialchars($type, ENT_QUOTES | ENT_HTML5); |
||
| 241 | // $price = number_format($price, 2, ',', ' '); |
||
| 242 | $town = \htmlspecialchars($town, ENT_QUOTES | ENT_HTML5); |
||
| 243 | $country = \htmlspecialchars($country, ENT_QUOTES | ENT_HTML5); |
||
| 244 | $premium = \htmlspecialchars($premium, ENT_QUOTES | ENT_HTML5); |
||
| 245 | $a_item = []; |
||
| 246 | $newcount = $GLOBALS['xoopsModuleConfig']['adslight_countday']; |
||
| 247 | $startdate = time() - (86400 * $newcount); |
||
| 248 | |||
| 249 | if ($startdate < $date_created) { |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 250 | $newitem = '<img src="' . XOOPS_URL . '/modules/adslight/assets/images/newred.gif" alt="new" >'; |
||
| 251 | $a_item['new'] = $newitem; |
||
| 252 | } |
||
| 253 | |||
| 254 | $useroffset = ''; |
||
| 255 | if ($GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
||
| 256 | $timezone = $GLOBALS['xoopsUser']->timezone(); |
||
| 257 | $useroffset = !empty($timezone) ? $GLOBALS['xoopsUser']->timezone() : $xoopsConfig['default_TZ']; |
||
| 258 | if ($GLOBALS['xoopsUser']->isAdmin()) { |
||
| 259 | $a_item['admin'] = '<a href="' . XOOPS_URL . "/modules/adslight/admin/validate_ads.php?op=modifyAds&lid={$lid}\"><img src=\"{$pathIcon16}/edit.png\" border=\"0\" alt=\"" . _ADSLIGHT_MODADMIN . '"></a>'; |
||
| 260 | } |
||
| 261 | } |
||
| 262 | |||
| 263 | $date_created = ($useroffset * 3600) + $date_created; |
||
| 264 | $date_created = formatTimestamp($date_created, 's'); |
||
| 265 | |||
| 266 | $result7 = $xoopsDB->query('SELECT nom_type FROM ' . $xoopsDB->prefix('adslight_type') . ' WHERE id_type=' . (int)$type); |
||
| 267 | [$nom_type] = $xoopsDB->fetchRow($result7); |
||
| 268 | |||
| 269 | $a_item['type'] = \htmlspecialchars($nom_type, ENT_QUOTES | ENT_HTML5); |
||
| 270 | $a_item['title'] = '<a href="' . XOOPS_URL . "/modules/adslight/viewads.php?lid={$lid}\"><strong>{$title}</strong></a>"; |
||
| 271 | |||
| 272 | $result8 = $xoopsDB->query('SELECT nom_price FROM ' . $xoopsDB->prefix('adslight_price') . ' WHERE id_price=' . (int)$typeprice); |
||
| 273 | [$nom_price] = $xoopsDB->fetchRow($result8); |
||
| 274 | |||
| 275 | if ($price > 0) { |
||
| 276 | // $a_item['price'] = $price . ' ' . $GLOBALS['xoopsModuleConfig']['adslight_currency_symbol'] . ''; |
||
| 277 | $currencyCode = $helper->getConfig('adslight_currency_code'); |
||
| 278 | $currencySymbol = $helper->getConfig('adslight_currency_symbol'); |
||
| 279 | $currencyPosition = $helper->getConfig('currency_position'); |
||
| 280 | $formattedCurrencyUtilityTemp = Utility::formatCurrencyTemp($price, $currencyCode, $currencySymbol, $currencyPosition); |
||
| 281 | |||
| 282 | $priceHtml = '<strong>' . _ADSLIGHT_PRICE2 . '</strong>' . $formattedCurrencyUtilityTemp . ' - ' . $nom_price; |
||
| 283 | $a_item['price'] = $priceHtml; |
||
| 284 | |||
| 285 | $a_item['price_typeprice'] = \htmlspecialchars($nom_price, ENT_QUOTES | ENT_HTML5); |
||
| 286 | } else { |
||
| 287 | $a_item['price'] = ''; |
||
| 288 | $a_item['price_typeprice'] = \htmlspecialchars($nom_price, ENT_QUOTES | ENT_HTML5); |
||
| 289 | } |
||
| 290 | |||
| 291 | $a_item['premium'] = $premium; |
||
| 292 | $a_item['date_created'] = $date_created; |
||
| 293 | $a_item['local'] = $town ?: ''; |
||
| 294 | $a_item['country'] = $country ?: ''; |
||
| 295 | |||
| 296 | if (2 === $status) { |
||
| 297 | $a_item['sold'] = _ADSLIGHT_RESERVEDMEMBER; |
||
| 298 | } |
||
| 299 | |||
| 300 | if ($helper->getConfig('active_thumbsindex') > 0) { |
||
| 301 | $a_item['no_photo'] = '<a href="' . XOOPS_URL . "/modules/adslight/viewads.php?lid={$lid}\"><img class=\"thumb\" src=\"" . XOOPS_URL . "/modules/adslight/assets/images/nophoto.jpg\" align=\"left\" width=\"100px\" alt=\"{$title}\"></a>"; |
||
| 302 | |||
| 303 | $updir = $GLOBALS['xoopsModuleConfig']['adslight_link_upload']; |
||
| 304 | $sql = 'SELECT cod_img, lid, uid_owner, url FROM ' . $xoopsDB->prefix('adslight_pictures') . ' WHERE uid_owner=' . (int)$usid . " AND lid={$lid} ORDER BY date_created ASC LIMIT 1"; |
||
| 305 | |||
| 306 | $resultp = $xoopsDB->query($sql); |
||
| 307 | |||
| 308 | while ([$cod_img, $pic_lid, $uid_owner, $url] = $xoopsDB->fetchRow($resultp)) { |
||
| 309 | if ($photo) { |
||
| 310 | $a_item['photo'] = '<a href="' . XOOPS_URL . "/modules/adslight/viewads.php?lid={$lid}\"><img class=\"thumb\" src=\"{$updir}/thumbs/thumb_{$url}\" align=\"left\" width=\"100px\" alt=\"{$title}\"></a>"; |
||
| 311 | } |
||
| 312 | } |
||
| 313 | } else { |
||
| 314 | $a_item['no_photo'] = '<img src="' . XOOPS_URL . "/modules/adslight/assets/images/camera_nophoto.png\" align=\"left\" width=\"24px\" alt=\"{$title}\">"; |
||
| 315 | $updir = $GLOBALS['xoopsModuleConfig']['adslight_link_upload']; |
||
| 316 | $sql = 'SELECT cod_img, lid, uid_owner, url FROM ' . $xoopsDB->prefix('adslight_pictures') . ' WHERE uid_owner=' . (int)$usid . " AND lid={$lid} ORDER BY date_created ASC LIMIT 1"; |
||
| 317 | $resultp = $xoopsDB->query($sql); |
||
| 318 | while ([$cod_img, $pic_lid, $uid_owner, $url] = $xoopsDB->fetchRow($resultp)) { |
||
| 319 | if ($photo) { |
||
| 320 | $a_item['photo'] = '<img src="' . XOOPS_URL . "/modules/adslight/assets/images/camera_photo.png\" align=\"left\" width=\"24\" alt=\"{$title}\">"; |
||
| 321 | } |
||
| 322 | } |
||
| 323 | } |
||
| 324 | $a_item['hits'] = $hits; |
||
| 325 | ++$rank; |
||
| 326 | $GLOBALS['xoopsTpl']->append('items', $a_item); |
||
| 327 | } |
||
| 328 | } |
||
| 329 | } |
||
| 330 | } |
||
| 331 | |||
| 332 | # function categorynewgraphic |
||
| 333 | ##################################################### |
||
| 334 | /** |
||
| 335 | * @param $cid |
||
| 336 | */ |
||
| 337 | function categorynewgraphic($cid): void |
||
| 338 | { |
||
| 339 | global $xoopsDB; |
||
| 340 | } |
||
| 341 | |||
| 342 | ###################################################### |
||
| 343 | |||
| 344 | $pa = Request::getInt('pa', null, 'GET'); |
||
| 345 | $lid = Request::getInt('lid', null, 'GET'); |
||
| 346 | $cid = Request::getInt('cid', null, 'GET'); |
||
| 347 | $usid = Request::getString('usid', '', 'GET'); |
||
| 348 | $min = Request::getInt('min', null, 'GET'); |
||
| 349 | $show = Request::getInt('show', null, 'GET'); |
||
| 350 | $orderby = Request::getInt('orderby', null, 'GET'); |
||
| 351 | |||
| 352 | switch ($pa) { |
||
| 353 | case 'adsview': |
||
| 354 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_category.tpl'; |
||
| 355 | adsView($cid, $min, $orderby, $show); |
||
| 356 | break; |
||
| 357 | case 'viewads': |
||
| 358 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_item.tpl'; |
||
| 359 | viewAds($lid); |
||
| 360 | break; |
||
| 361 | default: |
||
| 362 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_index.tpl'; |
||
| 363 | // $GLOBALS['xoopsOption']['template_main'] = 'adslight_category.tpl'; |
||
| 364 | index(); |
||
| 365 | break; |
||
| 366 | } |
||
| 367 | |||
| 368 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
||
| 369 |