1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /* |
||
6 | * You may not change or alter any portion of this comment or credits |
||
7 | * of supporting developers from this source code or any supporting source code |
||
8 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||
9 | * |
||
10 | * This program is distributed in the hope that it will be useful, |
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
13 | */ |
||
14 | |||
15 | /** |
||
16 | * @copyright XOOPS Project (https://xoops.org) |
||
17 | * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||
18 | * @author XOOPS Development Team |
||
19 | * @author Pascal Le Boustouller: original author ([email protected]) |
||
20 | * @author Luc Bizet (www.frxoops.org) |
||
21 | * @author jlm69 (www.jlmzone.com) |
||
22 | * @author mamba (www.xoops.org) |
||
23 | */ |
||
24 | |||
25 | use Xmf\Module\Admin; |
||
26 | use Xmf\Request; |
||
27 | use XoopsModules\Adslight\{ |
||
28 | Helper, |
||
29 | Tree, |
||
30 | Utility |
||
31 | }; |
||
32 | |||
33 | require_once __DIR__ . '/header.php'; |
||
34 | |||
35 | global $xoopsModule, $xoopsDB, $xoopsConfig, $xoTheme; |
||
36 | |||
37 | $myts = \MyTextSanitizer::getInstance(); // MyTextSanitizer object |
||
38 | global $xoopsModule; |
||
39 | $pathIcon16 = Admin::iconUrl('', '16'); |
||
40 | xoops_load('XoopsLocal'); |
||
41 | $moduleDirName = \basename(__DIR__); |
||
42 | |||
43 | $helper = Helper::getInstance(); |
||
44 | $mytree = new Tree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid'); |
||
45 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_members.tpl'; |
||
46 | require_once XOOPS_ROOT_PATH . '/header.php'; |
||
47 | require_once XOOPS_ROOT_PATH . '/include/comment_view.php'; |
||
48 | |||
49 | $lid = Request::getInt('lid', 0, 'GET'); |
||
50 | $usid = Request::getInt('usid', 0, 'GET'); |
||
51 | $moduleId = $xoopsModule->getVar('mid'); |
||
52 | if (is_object($GLOBALS['xoopsUser'])) { |
||
53 | $groups = $GLOBALS['xoopsUser']->getGroups(); |
||
54 | } else { |
||
55 | $groups = XOOPS_GROUP_ANONYMOUS; |
||
56 | } |
||
57 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
||
58 | $grouppermHandler = xoops_getHandler('groupperm'); |
||
59 | $perm_itemid = Request::getInt('item_id', 0, 'POST'); |
||
60 | |||
61 | //If no access |
||
62 | $permit = !$grouppermHandler->checkRight('adslight_premium', $perm_itemid, $groups, $moduleId) ? '0' : '1'; |
||
63 | |||
64 | $GLOBALS['xoopsTpl']->assign('permit', $permit); |
||
65 | $isadmin = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
||
66 | && $GLOBALS['xoopsUser']->isAdmin($xoopsModule->mid()); |
||
67 | |||
68 | $GLOBALS['xoopsTpl']->assign('add_from', _ADSLIGHT_ADDFROM . ' ' . $xoopsConfig['sitename']); |
||
69 | $GLOBALS['xoopsTpl']->assign('add_from_title', _ADSLIGHT_ADDFROM); |
||
70 | $GLOBALS['xoopsTpl']->assign('add_from_sitename', $xoopsConfig['sitename']); |
||
71 | $GLOBALS['xoopsTpl']->assign('mydirname', $moduleDirName); |
||
72 | $GLOBALS['xoopsTpl']->assign('comments_head', _ADSLIGHT_COMMENTS_HEAD); |
||
73 | $GLOBALS['xoopsTpl']->assign('lang_user_rating', _ADSLIGHT_USER_RATING); |
||
74 | $GLOBALS['xoopsTpl']->assign('lang_ratethisuser', _ADSLIGHT_RATETHISUSER); |
||
75 | $GLOBALS['xoopsTpl']->assign('title_head', _ADSLIGHT_TITLE); |
||
76 | $GLOBALS['xoopsTpl']->assign('date_head', _ADSLIGHT_ADDED_ON); |
||
77 | $GLOBALS['xoopsTpl']->assign('views_head', _ADSLIGHT_VIEW2); |
||
78 | $GLOBALS['xoopsTpl']->assign('replies_head', _ADSLIGHT_REPLIES); |
||
79 | $GLOBALS['xoopsTpl']->assign('expires_head', _ADSLIGHT_EXPIRES_ON); |
||
80 | $GLOBALS['xoopsTpl']->assign('all_user_listings', _ADSLIGHT_ALL_USER_LISTINGS); |
||
81 | $GLOBALS['xoopsTpl']->assign('nav_main', '<a href="index.php">' . _ADSLIGHT_MAIN . '</a>'); |
||
82 | $GLOBALS['xoopsTpl']->assign('mydirname', $moduleDirName); |
||
83 | $GLOBALS['xoopsTpl']->assign('xoops_module_header', '<link rel="stylesheet" href="' . XOOPS_URL . '/modules/adslight/assets/css/adslight.css" type="text/css" media="all" >'); |
||
84 | |||
85 | $GLOBALS['xoopsTpl']->assign('adslight_active_menu', $helper->getConfig('adslight_active_menu')); |
||
86 | $GLOBALS['xoopsTpl']->assign('adslight_active_rss', $helper->getConfig('adslight_active_rss')); |
||
87 | $GLOBALS['xoTheme']->addMeta('meta', 'robots', 'noindex, nofollow'); |
||
88 | |||
89 | $show = 4; |
||
90 | $min = Request::getInt('min', 0, 'GET'); |
||
91 | if (!isset($max)) { |
||
92 | $max = $min + $show; |
||
93 | } |
||
94 | $orderby = 'date_created ASC'; |
||
95 | $rate = '1' === $helper->getConfig('adslight_rate_user') ? '1' : '0'; |
||
96 | $GLOBALS['xoopsTpl']->assign('rate', $rate); |
||
97 | |||
98 | if ($GLOBALS['xoopsUser']) { |
||
99 | $member_usid = $GLOBALS['xoopsUser']->getVar('uid', 'E'); |
||
100 | $istheirs = $usid === $member_usid ? 1 : ''; |
||
101 | } |
||
102 | |||
103 | $cat_perms = ''; |
||
104 | $categories = Utility::getMyItemIds('adslight_view'); |
||
105 | if (is_array($categories) && count($categories) > 0) { |
||
106 | $cat_perms .= ' AND cid IN (' . implode(',', $categories) . ') '; |
||
107 | } |
||
108 | |||
109 | if (1 === $istheirs) { |
||
110 | $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE usid=' . $xoopsDB->escape($usid) . " AND valid='Yes' ${cat_perms}"; |
||
111 | $countresult = $xoopsDB->query($sql); |
||
112 | [$trow] = $xoopsDB->fetchRow($countresult); |
||
113 | |||
114 | $sql = 'SELECT lid, cid, title, status, expire, type, desctext, tel, price, typeprice, date_created, email, submitter, usid, town, country, contactby, premium, valid, photo, hits, item_rating, item_votes, user_rating, user_votes, comments FROM ' |
||
115 | . $xoopsDB->prefix('adslight_listing') |
||
116 | . ' WHERE usid = ' |
||
117 | . $xoopsDB->escape($usid) |
||
118 | . " AND valid='Yes' ${cat_perms} ORDER BY ${orderby}"; |
||
119 | $result = $xoopsDB->query($sql, $show, $min); |
||
120 | } else { |
||
121 | $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . ' WHERE usid=' . $xoopsDB->escape($usid) . " AND valid='Yes' AND status!='1' ${cat_perms}"; |
||
122 | $countresult = $xoopsDB->query($sql); |
||
123 | [$trow] = $xoopsDB->fetchRow($countresult); |
||
124 | |||
125 | $sql = 'SELECT lid, cid, title, status, expire, type, desctext, tel, price, typeprice, date_created, email, submitter, usid, town, country, contactby, premium, valid, photo, hits, item_rating, item_votes, user_rating, user_votes, comments FROM ' |
||
126 | . $xoopsDB->prefix('adslight_listing') |
||
127 | . ' WHERE usid = ' |
||
128 | . $xoopsDB->escape($usid) |
||
129 | . " AND valid='Yes' AND status!='1' ${cat_perms} ORDER BY ${orderby}"; |
||
130 | $result = $xoopsDB->query($sql, $show, $min); |
||
131 | } |
||
132 | |||
133 | $trows = $trow; |
||
134 | $pagenav = ''; |
||
135 | if ($trows > '0') { |
||
136 | $GLOBALS['xoopsTpl']->assign('min', $min); |
||
137 | $rank = 1; |
||
138 | |||
139 | if ($trows > '1') { |
||
140 | $GLOBALS['xoopsTpl']->assign('show_nav', true); |
||
141 | $GLOBALS['xoopsTpl']->assign('lang_sortby', _ADSLIGHT_SORTBY); |
||
142 | $GLOBALS['xoopsTpl']->assign('lang_title', _ADSLIGHT_TITLE); |
||
143 | $GLOBALS['xoopsTpl']->assign('lang_titleatoz', _ADSLIGHT_TITLEATOZ); |
||
144 | $GLOBALS['xoopsTpl']->assign('lang_titleztoa', _ADSLIGHT_TITLEZTOA); |
||
145 | $GLOBALS['xoopsTpl']->assign('lang_date', _ADSLIGHT_DATE); |
||
146 | $GLOBALS['xoopsTpl']->assign('lang_dateold', _ADSLIGHT_DATEOLD); |
||
147 | $GLOBALS['xoopsTpl']->assign('lang_datenew', _ADSLIGHT_DATENEW); |
||
148 | $GLOBALS['xoopsTpl']->assign('lang_popularity', _ADSLIGHT_POPULARITY); |
||
149 | $GLOBALS['xoopsTpl']->assign('lang_popularityleast', _ADSLIGHT_POPULARITYLTOM); |
||
150 | $GLOBALS['xoopsTpl']->assign('lang_popularitymost', _ADSLIGHT_POPULARITYMTOL); |
||
151 | } |
||
152 | while (false !== [$lid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $date_created, $email, $submitter, $usid, $town, $country, $contactby, $premium, $valid, $photo, $hits, $item_rating, $item_votes, $user_rating, $user_votes, $comments] = $xoopsDB->fetchRow( |
||
153 | $result |
||
154 | )) { |
||
155 | $newitem = ''; |
||
156 | $newcount = $helper->getConfig('adslight_countday'); |
||
157 | $startdate = time() - (86400 * $newcount); |
||
158 | if ($startdate < $date_created) { |
||
159 | //@todo move "New" alt text to language file |
||
160 | $newitem = '<img src="' . XOOPS_URL . '/modules/adslight/assets/images/newred.gif" alt="New" >'; |
||
161 | } |
||
162 | if (0 === (int)$status) { |
||
163 | $status_is = _ADSLIGHT_ACTIVE; |
||
164 | } |
||
165 | if (1 === (int)$status) { |
||
166 | $status_is = _ADSLIGHT_INACTIVE; |
||
167 | } |
||
168 | if (2 === (int)$status) { |
||
169 | $status_is = _ADSLIGHT_SOLD; |
||
170 | } |
||
171 | $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_replies') . " WHERE lid='" . $xoopsDB->escape($lid) . "'"; |
||
172 | $countresult = $xoopsDB->query($sql); |
||
173 | [$rrow] = $xoopsDB->fetchRow($countresult); |
||
174 | $rrows = $rrow; |
||
175 | $GLOBALS['xoopsTpl']->assign('reply_count', $rrows); |
||
176 | |||
177 | $sql = 'SELECT r_lid, lid, date_created, submitter, message, email, r_usid FROM ' . $xoopsDB->prefix('adslight_replies') . ' WHERE lid =' . $xoopsDB->escape($lid); |
||
178 | $result2 = $xoopsDB->query($sql); |
||
179 | [$r_lid, $rlid, $rdate, $rsubmitter, $message, $remail, $r_usid] = $xoopsDB->fetchRow($result2); |
||
180 | |||
181 | //Fix bug for type and typeprice |
||
182 | $sql = 'SELECT nom_type FROM ' . $xoopsDB->prefix('adslight_type') . ' WHERE id_type=' . (int)$type; |
||
183 | $result7 = $xoopsDB->query($sql); |
||
184 | [$nom_type] = $xoopsDB->fetchRow($result7); |
||
185 | |||
186 | // $sql = 'SELECT nom_price FROM ' . $xoopsDB->prefix('adslight_price') . " WHERE id_price='" . $xoopsDB->escape($typeprice) . "'"; |
||
187 | // $result8 = $xoopsDB->query($sql); |
||
188 | // [$nom_price] = $xoopsDB->fetchRow($result8); |
||
189 | |||
190 | $sql = 'SELECT nom_price FROM ' . $xoopsDB->prefix('adslight_price') . ' WHERE id_price=' . (int)$typeprice; |
||
191 | $result8 = $xoopsDB->query($sql); |
||
192 | [$nom_price] = $xoopsDB->fetchRow($result8); |
||
193 | |||
194 | if ($isadmin) { |
||
195 | $adminlink = "<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>'; |
||
196 | $GLOBALS['xoopsTpl']->assign('isadmin', $isadmin); |
||
197 | } else { |
||
198 | $adminlink = ''; |
||
199 | } |
||
200 | $modify_link = ''; |
||
201 | if ($GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
||
202 | $member_usid = $GLOBALS['xoopsUser']->getVar('uid', 'E'); |
||
203 | if ($usid === $member_usid) { |
||
204 | $istheirs = true; |
||
205 | $GLOBALS['xoopsTpl']->assign('istheirs', $istheirs); |
||
206 | $modify_link = "<a href='modify.php?op=modad&lid=" . $lid . "'><img src='" . $pathIcon16 . "/edit.png' border=0 alt=\"" . _ADSLIGHT_MODADMIN . '" ></a>'; |
||
207 | } else { |
||
208 | $istheirs = false; |
||
209 | $GLOBALS['xoopsTpl']->assign('istheirs', ''); |
||
210 | } |
||
211 | } |
||
212 | |||
213 | $GLOBALS['xoopsTpl']->assign('submitter', $submitter); |
||
214 | $GLOBALS['xoopsTpl']->assign('usid', $usid); |
||
215 | $GLOBALS['xoopsTpl']->assign('read', "${hits} " . _ADSLIGHT_VIEW2); |
||
216 | $GLOBALS['xoopsTpl']->assign('rating', number_format((float)$user_rating, 2)); |
||
217 | $GLOBALS['xoopsTpl']->assign('status_head', _ADSLIGHT_STATUS); |
||
218 | $tempXoopsLocal = new \XoopsLocal(); |
||
219 | // For US currency with 2 numbers after the decimal comment out if you don't want 2 numbers after decimal |
||
220 | $priceFormatted = $tempXoopsLocal->number_format($price, 2, ',', ' '); |
||
0 ignored issues
–
show
|
|||
221 | // For other countries uncomment the below line and comment out the above line |
||
222 | // $priceFormatted = $tempXoopsLocal->number_format($price); |
||
223 | |||
224 | // $GLOBALS['xoopsTpl']->assign('price', '<strong>' . _ADSLIGHT_PRICE . "</strong>$price" . $helper->getConfig('adslight_currency_symbol') . " - $typeprice"); |
||
225 | |||
226 | // $currencyCode = $helper->getConfig('adslight_currency_code'); |
||
227 | // $currencySymbol = $helper->getConfig('adslight_currency_symbol'); |
||
228 | // $currencyPosition = $helper->getConfig('currency_position'); |
||
229 | // $formattedCurrencyUtilityTemp = Utility::formatCurrencyTemp($price, $currencyCode, $currencySymbol, $currencyPosition); |
||
230 | // $priceHtml = '<strong>' . _ADSLIGHT_PRICE2 . '</strong>' . $formattedCurrencyUtilityTemp . ' - ' . $typeprice; |
||
231 | |||
232 | // $GLOBALS['xoopsTpl']->assign('price', $priceHtml); |
||
233 | |||
234 | $GLOBALS['xoopsTpl']->assign('price_head', _ADSLIGHT_PRICE); |
||
235 | $GLOBALS['xoopsTpl']->assign('money_sign', '' . $helper->getConfig('adslight_currency_symbol')); |
||
236 | $GLOBALS['xoopsTpl']->assign('price_typeprice', $typeprice); |
||
237 | |||
238 | $GLOBALS['xoopsTpl']->assign('type', htmlspecialchars($nom_type, ENT_QUOTES | ENT_HTML5)); |
||
239 | |||
240 | $priceTypeprice = \htmlspecialchars($nom_price, ENT_QUOTES | ENT_HTML5); |
||
241 | $priceCurrency = $helper->getConfig('adslight_currency_code'); |
||
242 | |||
243 | $currencyCode = $helper->getConfig('adslight_currency_code'); |
||
244 | $currencySymbol = $helper->getConfig('adslight_currency_symbol'); |
||
245 | $currencyPosition = $helper->getConfig('currency_position'); |
||
246 | $formattedCurrencyUtilityTemp = Utility::formatCurrencyTemp($price, $currencyCode, $currencySymbol, $currencyPosition); |
||
247 | $priceHtml = '<strong>' . _ADSLIGHT_PRICE2 . '</strong>' . $formattedCurrencyUtilityTemp . ' - ' . $priceTypeprice; |
||
248 | |||
249 | $GLOBALS['xoopsTpl']->assign('price_head', _ADSLIGHT_PRICE2); |
||
250 | $GLOBALS['xoopsTpl']->assign('price_price', $priceFormatted); |
||
251 | $GLOBALS['xoopsTpl']->assign('price_typeprice', $priceTypeprice); |
||
252 | $GLOBALS['xoopsTpl']->assign('price_currency', $priceCurrency); |
||
253 | $GLOBALS['xoopsTpl']->assign('price', $priceHtml); |
||
254 | $GLOBALS['xoopsTpl']->assign('priceHtml', $priceHtml); |
||
255 | |||
256 | $GLOBALS['xoopsTpl']->assign('local_town', (string)$town); |
||
257 | $GLOBALS['xoopsTpl']->assign('local_country', (string)$country); |
||
258 | $GLOBALS['xoopsTpl']->assign('local_head', _ADSLIGHT_LOCAL2); |
||
259 | $GLOBALS['xoopsTpl']->assign('edit_ad', _ADSLIGHT_EDIT); |
||
260 | |||
261 | $usid = addslashes($usid); |
||
262 | $votestring = 1 === $user_votes ? _ADSLIGHT_ONEVOTE : sprintf(_ADSLIGHT_NUMVOTES, $user_votes); |
||
263 | |||
264 | $GLOBALS['xoopsTpl']->assign('user_votes', $votestring); |
||
265 | $date2 = $date_created + ($expire * 86400); |
||
266 | $date_created = formatTimestamp($date_created, 's'); |
||
267 | $date2 = formatTimestamp($date2, 's'); |
||
268 | $path = $mytree->getPathFromId($cid, 'title'); |
||
269 | $path = mb_substr($path, 1); |
||
270 | $path = str_replace('/', ' - ', $path); |
||
271 | if ($rrows >= 1) { |
||
272 | $view_now = "<a href='replies.php?lid=" . $lid . "'>" . _ADSLIGHT_VIEWNOW . '</a>'; |
||
273 | } else { |
||
274 | $view_now = ''; |
||
275 | } |
||
276 | $sold = ''; |
||
277 | if (2 === (int)$status) { |
||
278 | $sold = _ADSLIGHT_RESERVEDMEMBER; |
||
279 | } |
||
280 | |||
281 | $GLOBALS['xoopsTpl']->assign('xoops_pagetitle', '' . _ADSLIGHT_ALL_USER_LISTINGS . ' ' . $submitter); |
||
282 | $updir = $helper->getConfig('adslight_link_upload'); |
||
283 | $sql = 'SELECT cod_img, lid, uid_owner, url FROM ' . $xoopsDB->prefix('adslight_pictures') . ' WHERE uid_owner=' . $xoopsDB->escape($usid) . ' AND lid=' . $xoopsDB->escape($lid) . ' ORDER BY date_created ASC LIMIT 1'; |
||
284 | $resultp = $xoopsDB->query($sql); |
||
285 | while ([$cod_img, $pic_lid, $uid_owner, $url] = $xoopsDB->fetchRow($resultp)) { |
||
286 | if ($photo) { |
||
287 | $photo = "<a href='viewads.php?lid=" . $lid . "'><img class=\"thumb\" src=\"${updir}/thumbs/thumb_${url}\" align=\"left\" width=\"100px\" alt=\"${title}\" ></a>"; |
||
288 | } |
||
289 | } |
||
290 | $no_photo = "<a href='viewads.php?lid=" . $lid . "'><img class=\"thumb\" src=\"assets/images/nophoto.jpg\" align=\"left\" width=\"100px\" alt=\"${title}\" ></a>"; |
||
291 | |||
292 | $GLOBALS['xoopsTpl']->append('items', [ |
||
293 | 'id' => $lid, |
||
294 | 'cid' => $cid, |
||
295 | 'title' => \htmlspecialchars($title, ENT_QUOTES | ENT_HTML5), |
||
296 | 'status' => \htmlspecialchars($status_is, ENT_QUOTES | ENT_HTML5), |
||
297 | 'expire' => \htmlspecialchars($expire, ENT_QUOTES | ENT_HTML5), |
||
298 | 'type' => \htmlspecialchars($type, ENT_QUOTES | ENT_HTML5), |
||
299 | 'desctext' => $myts->displayTarea($desctext), |
||
300 | 'tel' => \htmlspecialchars($tel, ENT_QUOTES | ENT_HTML5), |
||
301 | // 'price' => \htmlspecialchars($price, ENT_QUOTES | ENT_HTML5), |
||
302 | 'price' => \htmlspecialchars($formattedCurrencyUtilityTemp, ENT_QUOTES | ENT_HTML5), |
||
303 | 'typeprice' => \htmlspecialchars($typeprice, ENT_QUOTES | ENT_HTML5), |
||
304 | 'date_created' => \htmlspecialchars($date_created ?? '', ENT_QUOTES | ENT_HTML5), //TODO check date |
||
305 | 'email' => \htmlspecialchars($email, ENT_QUOTES | ENT_HTML5), |
||
306 | 'submitter' => \htmlspecialchars($submitter, ENT_QUOTES | ENT_HTML5), |
||
307 | 'usid' => \htmlspecialchars($usid, ENT_QUOTES | ENT_HTML5), |
||
308 | 'town' => \htmlspecialchars($town, ENT_QUOTES | ENT_HTML5), |
||
309 | 'country' => \htmlspecialchars($country, ENT_QUOTES | ENT_HTML5), |
||
310 | 'contactby' => \htmlspecialchars($contactby, ENT_QUOTES | ENT_HTML5), |
||
311 | 'premium' => \htmlspecialchars($premium, ENT_QUOTES | ENT_HTML5), |
||
312 | 'valid' => \htmlspecialchars($valid, ENT_QUOTES | ENT_HTML5), |
||
313 | 'hits' => $hits, |
||
314 | 'rlid' => \htmlspecialchars($rlid ?? '', ENT_QUOTES | ENT_HTML5), |
||
315 | 'rdate' => \htmlspecialchars($rdate ?? '', ENT_QUOTES | ENT_HTML5), |
||
316 | 'rsubmitter' => \htmlspecialchars($rsubmitter ?? '', ENT_QUOTES | ENT_HTML5), |
||
317 | 'message' => \htmlspecialchars($message ?? '', ENT_QUOTES | ENT_HTML5), |
||
318 | 'remail' => \htmlspecialchars($remail ?? '', ENT_QUOTES | ENT_HTML5), |
||
319 | 'rrows' => $rrows, |
||
320 | 'expires' => \htmlspecialchars($date2, ENT_QUOTES | ENT_HTML5), |
||
321 | 'view_now' => $view_now, |
||
322 | 'modify_link' => $modify_link, |
||
323 | 'photo' => $photo, |
||
324 | 'no_photo' => $no_photo, |
||
325 | 'adminlink' => $adminlink, |
||
326 | 'new' => $newitem, |
||
327 | 'sold' => $sold, |
||
328 | ]); |
||
329 | } |
||
330 | $usid = Request::getInt('usid', 0, 'GET'); |
||
331 | |||
332 | //Calculates how many pages exist. Which page one should be on, etc... |
||
333 | $linkpages = ceil($trows / $show); |
||
334 | //Page Numbering |
||
335 | if (1 !== (int)$linkpages && 0 !== (int)$linkpages) { |
||
336 | $prev = $min - $show; |
||
337 | if ($prev >= 0) { |
||
338 | $pagenav .= "<a href='members.php?usid=${usid}&min=${prev}&show=${show}'><strong><u>«</u></strong></a> "; |
||
339 | } |
||
340 | $counter = 1; |
||
341 | $currentpage = $max / $show; |
||
342 | while ($counter <= $linkpages) { |
||
343 | $mintemp = ($show * $counter) - $show; |
||
344 | if ($counter === $currentpage) { |
||
345 | $pagenav .= "<strong>(${counter})</strong> "; |
||
346 | } else { |
||
347 | $pagenav .= "<a href='members.php?usid=${usid}&min=${mintemp}&show=${show}'>${counter}</a> "; |
||
348 | } |
||
349 | ++$counter; |
||
350 | } |
||
351 | if ($trows > $max) { |
||
352 | $pagenav .= "<a href='members.php?usid=${usid}&min=${max}&show=${show}'>"; |
||
353 | $pagenav .= '<strong><u>»</u></strong></a>'; |
||
354 | } |
||
355 | $GLOBALS['xoopsTpl']->assign('nav_page', '<strong>' . _ADSLIGHT_PAGES . "</strong> ${pagenav}"); |
||
356 | } |
||
357 | } |
||
358 | |||
359 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
||
360 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.