1 | <?php |
||||||
2 | /* |
||||||
3 | ------------------------------------------------------------------------- |
||||||
4 | ADSLIGHT 2 : Module for Xoops |
||||||
5 | |||||||
6 | Redesigned and ameliorate By Luc Bizet user at www.frxoops.org |
||||||
7 | Started with the Classifieds module and made MANY changes |
||||||
8 | Website : http://www.luc-bizet.fr |
||||||
9 | Contact : [email protected] |
||||||
10 | ------------------------------------------------------------------------- |
||||||
11 | Original credits below Version History |
||||||
12 | ########################################################################## |
||||||
13 | # Classified Module for Xoops # |
||||||
14 | # By John Mordo user jlm69 at www.xoops.org and www.jlmzone.com # |
||||||
15 | # Started with the MyAds module and made MANY changes # |
||||||
16 | ########################################################################## |
||||||
17 | Original Author: Pascal Le Boustouller |
||||||
18 | Author Website : [email protected] |
||||||
19 | Licence Type : GPL |
||||||
20 | ------------------------------------------------------------------------- |
||||||
21 | */ |
||||||
22 | |||||||
23 | use Xmf\Request; |
||||||
24 | use XoopsModules\Adslight; |
||||||
25 | |||||||
26 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_addlisting.tpl'; |
||||||
27 | |||||||
28 | require_once __DIR__ . '/header.php'; |
||||||
29 | $myts = \MyTextSanitizer::getInstance(); // MyTextSanitizer object |
||||||
30 | //require_once XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php'; |
||||||
31 | //require_once XOOPS_ROOT_PATH . '/modules/adslight/class/classifiedstree.php'; |
||||||
32 | //require_once __DIR__ . '/include/functions.php'; |
||||||
33 | // require_once XOOPS_ROOT_PATH . '/class/captcha/xoopscaptcha.php'; |
||||||
34 | |||||||
35 | $module_id = $xoopsModule->getVar('mid'); |
||||||
36 | $groups = ($GLOBALS['xoopsUser'] instanceof \XoopsUser) ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS; |
||||||
37 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
||||||
38 | $grouppermHandler = xoops_getHandler('groupperm'); |
||||||
39 | |||||||
40 | $permHelper = new \Xmf\Module\Helper\Permission(); |
||||||
41 | |||||||
42 | $perm_itemid = Request::getInt('item_id', 0, 'POST'); |
||||||
43 | |||||||
44 | if (!$grouppermHandler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) { |
||||||
45 | redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM); |
||||||
46 | } |
||||||
47 | |||||||
48 | $premium = $grouppermHandler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? 1 : 0; |
||||||
49 | |||||||
50 | require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
||||||
51 | |||||||
52 | $mytree = new Adslight\ClassifiedsTree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid'); |
||||||
53 | |||||||
54 | if (!$GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
||||||
55 | redirect_header(XOOPS_URL . '/user.php', 2, _MA_ADSLIGHT_MUSTREGFIRST); |
||||||
56 | } |
||||||
57 | |||||||
58 | if (Request::hasVar('submit', 'POST')) { |
||||||
59 | $howlong = $GLOBALS['xoopsModuleConfig']['adslight_howlong']; |
||||||
60 | |||||||
61 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||||
62 | redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsSecurity']->getErrors()); |
||||||
63 | } |
||||||
64 | |||||||
65 | // xoops_load("xoopscaptcha"); |
||||||
66 | // $xoopsCaptcha = XoopsCaptcha::getInstance(); |
||||||
67 | // if ( !$xoopsCaptcha->verify() ) { |
||||||
68 | // redirect_header( XOOPS_URL . "/modules/adslight/index.php", 2, $xoopsCaptcha->getMessage() ); |
||||||
69 | // } |
||||||
70 | if (Request::hasVar('submit', 'POST')) { |
||||||
71 | $moduleHandler = xoops_getHandler('module'); |
||||||
72 | $myModule = $moduleHandler->getByDirname('adslight'); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
73 | $myModule->setErrors('Could not connect to the database.'); |
||||||
74 | } |
||||||
75 | |||||||
76 | $cid = Request::getInt('cid', 0, 'POST'); |
||||||
77 | $cat_perms = Adslight\Utility::getMyItemIds('adslight_submit'); |
||||||
78 | if (!in_array($cid, $cat_perms, true)) { |
||||||
79 | redirect_header(XOOPS_URL, 2, _NOPERM); |
||||||
80 | } |
||||||
81 | |||||||
82 | $title = Request::getString('title', '', 'POST'); |
||||||
83 | // $status = $myts->addSlashes($_POST["status"]); |
||||||
84 | $status = (int)$status; |
||||||
85 | $expire = Request::getString('expire', '', 'POST'); |
||||||
86 | $type = Request::getString('type', '', 'POST'); |
||||||
87 | $desctext = Request::getText('desctext', '', 'POST'); // $myts->displayTarea($_POST['desctext'], 1, 1, 1); |
||||||
88 | $tel = Request::getString('tel', '', 'POST'); |
||||||
89 | $price = str_replace([' '], '', Request::getFloat('price', 0, 'POST')); |
||||||
90 | $typeprice = Request::getString('typeprice', '', 'POST'); |
||||||
91 | $typeusure = Request::getString('typeusure', '', 'POST'); |
||||||
92 | $date = Request::getInt('date', 0, 'POST'); |
||||||
93 | $email = Request::getString('email', '', 'POST'); |
||||||
94 | $submitter = Request::getString('submitter', '', 'POST'); |
||||||
95 | $usid = Request::getString('usid', '', 'POST'); |
||||||
96 | $town = Request::getString('town', '', 'POST'); |
||||||
97 | $country = Request::getString('country', 0, 'POST'); |
||||||
98 | $contactby = Request::getString('contactby', '', 'POST'); |
||||||
99 | $premium = Request::getString('premium', '', 'POST'); |
||||||
100 | $valid = Request::getString('valid', '', 'POST'); |
||||||
101 | $date = time(); |
||||||
102 | $newid = $xoopsDB->genId($xoopsDB->prefix('adslight_listing') . '_lid_seq'); |
||||||
103 | |||||||
104 | $sql = sprintf("INSERT INTO `%s` (lid, cid, title, STATUS, EXPIRE, type, desctext, tel, price, typeprice, typeusure, DATE, email, submitter, usid, town, country, contactby, premium, valid) VALUES (%u, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", |
||||||
105 | $xoopsDB->prefix('adslight_listing'), $newid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town, $country, $contactby, $premium, $valid); |
||||||
106 | $success = $xoopsDB->query($sql); |
||||||
107 | if (!$success) { |
||||||
108 | $moduleHandler = xoops_getHandler('module'); |
||||||
109 | $myModule = $moduleHandler->getByDirname('adslight'); |
||||||
110 | $myModule->setErrors('Could not query the database.'); |
||||||
111 | } |
||||||
112 | |||||||
113 | $lid = $xoopsDB->getInsertId(); |
||||||
114 | |||||||
115 | if ('Yes' === $valid) { |
||||||
116 | /** @var \XoopsNotificationHandler $notificationHandler */ |
||||||
117 | $notificationHandler = xoops_getHandler('notification'); |
||||||
118 | //$lid = $xoopsDB->getInsertId(); |
||||||
119 | $tags = []; |
||||||
120 | $tags['TITLE'] = $title; |
||||||
121 | $tags['ADDED_TO_CAT'] = _ADSLIGHT_ADDED_TO_CAT; |
||||||
122 | $tags['RECIEVING_NOTIF'] = _ADSLIGHT_RECIEVING_NOTIF; |
||||||
123 | $tags['ERROR_NOTIF'] = _ADSLIGHT_ERROR_NOTIF; |
||||||
124 | $tags['WEBMASTER'] = _ADSLIGHT_WEBMASTER; |
||||||
125 | $tags['HELLO'] = _ADSLIGHT_HELLO; |
||||||
126 | $tags['FOLLOW_LINK'] = _ADSLIGHT_FOLLOW_LINK; |
||||||
127 | $tags['TYPE'] = Adslight\Utility::getNameType($type); |
||||||
128 | $tags['LINK_URL'] = XOOPS_URL . '/modules/adslight/viewads.php?' . '&lid=' . $lid; |
||||||
129 | $sql = 'SELECT title FROM ' . $xoopsDB->prefix('adslight_categories') . ' WHERE cid=' . addslashes($cid); |
||||||
130 | $result2 = $xoopsDB->query($sql); |
||||||
131 | $row = $xoopsDB->fetchArray($result2); |
||||||
132 | $tags['CATEGORY_TITLE'] = $row['title']; |
||||||
133 | $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/adslight/viewcats.php?cid="' . addslashes($cid); |
||||||
134 | /** @var \XoopsNotificationHandler $notificationHandler */ |
||||||
135 | $notificationHandler = xoops_getHandler('notification'); |
||||||
136 | $notificationHandler->triggerEvent('global', 0, 'new_listing', $tags); |
||||||
0 ignored issues
–
show
'global' of type string is incompatible with the type integer expected by parameter $category of XoopsNotificationHandler::triggerEvent() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() 'new_listing' of type string is incompatible with the type integer expected by parameter $event of XoopsNotificationHandler::triggerEvent() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
137 | $notificationHandler->triggerEvent('category', $cid, 'new_listing', $tags); |
||||||
138 | $notificationHandler->triggerEvent('listing', $lid, 'new_listing', $tags); |
||||||
139 | } else { |
||||||
140 | $tags = []; |
||||||
141 | $subject = '' . _ADSLIGHT_NEW_WAITING_SUBJECT . ''; |
||||||
142 | $tags['TITLE'] = $title; |
||||||
143 | $tags['DESCTEXT'] = $desctext; |
||||||
144 | $tags['ADMIN'] = _ADSLIGHT_ADMIN; |
||||||
145 | $tags['NEW_WAITING'] = _ADSLIGHT_NEW_WAITING; |
||||||
146 | $tags['PLEASE_CHECK'] = _ADSLIGHT_PLEASE_CHECK; |
||||||
147 | $tags['WEBMASTER'] = _ADSLIGHT_WEBMASTER; |
||||||
148 | $tags['HELLO'] = _ADSLIGHT_HELLO; |
||||||
149 | $tags['FOLLOW_LINK'] = _ADSLIGHT_FOLLOW_LINK; |
||||||
150 | $tags['TYPE'] = Adslight\Utility::getNameType($type); |
||||||
151 | $tags['NEED_TO_LOGIN'] = _ADSLIGHT_NEED_TO_LOGIN; |
||||||
152 | $tags['ADMIN_LINK'] = XOOPS_URL . '/modules/adslight/admin/validate_ads.php'; |
||||||
153 | $sql = 'SELECT title FROM ' . $xoopsDB->prefix('adslight_categories') . ' WHERE cid=' . addslashes($cid); |
||||||
154 | $result2 = $xoopsDB->query($sql); |
||||||
155 | $row = $xoopsDB->fetchArray($result2); |
||||||
156 | $tags['CATEGORY_TITLE'] = $row['title']; |
||||||
157 | $tags['NEWAD'] = _ADSLIGHT_NEWAD; |
||||||
158 | |||||||
159 | $mail = xoops_getMailer(); |
||||||
160 | //@todo - add check to see if directory (and file) exists, otherwise use english |
||||||
161 | $mail->setTemplateDir(XOOPS_ROOT_PATH . '/modules/adslight/language/' . $xoopsConfig['language'] . '/mail_template/'); |
||||||
162 | $mail->setTemplate('listing_notify_admin.tpl'); |
||||||
163 | $mail->useMail(); |
||||||
164 | $mail->multimailer->isHTML(true); |
||||||
165 | $mail->setFromName($xoopsConfig['sitename']); |
||||||
166 | $mail->setFromEmail($xoopsConfig['adminmail']); |
||||||
167 | $mail->setToEmails($xoopsConfig['adminmail']); |
||||||
168 | $mail->setSubject($subject); |
||||||
169 | $mail->assign($tags); |
||||||
170 | $mail->send(); |
||||||
171 | echo $mail->getErrors(); |
||||||
172 | } |
||||||
173 | |||||||
174 | $addphotonow = Request::getInt('addphotonow', 0, 'POST'); |
||||||
175 | if ($addphotonow) { |
||||||
176 | //$lid = $xoopsDB->getInsertId(); |
||||||
177 | redirect_header("view_photos.php?lid=$lid&uid=$usid", 3, _ADSLIGHT_ADSADDED); |
||||||
178 | } else { |
||||||
179 | redirect_header('index.php', 3, _ADSLIGHT_ADSADDED); |
||||||
180 | } |
||||||
181 | } else { |
||||||
182 | $GLOBALS['xoopsOption']['template_main'] = 'adslight_addlisting.tpl'; |
||||||
183 | require_once XOOPS_ROOT_PATH . '/header.php'; |
||||||
184 | require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
||||||
185 | |||||||
186 | $cid = Request::getInt('cide', 0, 'GET'); |
||||||
187 | $cat_moderate = Request::getInt('cat_moderate', 0, 'POST'); |
||||||
188 | $howlong = $GLOBALS['xoopsModuleConfig']['adslight_howlong']; |
||||||
189 | $member_usid = $GLOBALS['xoopsUser']->getVar('uid', 'E'); |
||||||
190 | $member_email = $GLOBALS['xoopsUser']->getVar('email', 'E'); |
||||||
191 | $member_uname = $GLOBALS['xoopsUser']->getVar('uname', 'E'); |
||||||
192 | |||||||
193 | $result = $xoopsDB->query('SELECT id_type, nom_type FROM ' . $xoopsDB->prefix('adslight_type') . ' ORDER BY nom_type'); |
||||||
194 | $result1 = $xoopsDB->query('SELECT id_price, nom_price FROM ' . $xoopsDB->prefix('adslight_price') . ' ORDER BY id_price'); |
||||||
195 | $result3 = $xoopsDB->query('SELECT id_usure, nom_usure FROM ' . $xoopsDB->prefix('adslight_usure') . ' ORDER BY id_usure'); |
||||||
196 | |||||||
197 | ob_start(); |
||||||
198 | $form = new \XoopsThemeForm(_ADSLIGHT_ADD_LISTING, 'submitform', 'add.php', 'post', true); |
||||||
199 | $form->setExtra('enctype="multipart/form-data"'); |
||||||
200 | |||||||
201 | // $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement($form, __LINE__, 1800, 'token'); |
||||||
202 | |||||||
203 | //@todo - this 'if' code doesn't do anything, what should happen for premium accounts? |
||||||
204 | if ($cat_moderate) { |
||||||
205 | if ('0' != $premium) { |
||||||
206 | echo ''; |
||||||
207 | } else { |
||||||
208 | echo ''; |
||||||
209 | } |
||||||
210 | } else { |
||||||
211 | if ('0' != $premium) { |
||||||
212 | echo ''; |
||||||
213 | } else { |
||||||
214 | echo ''; |
||||||
215 | } |
||||||
216 | } |
||||||
217 | |||||||
218 | if ('1' == $GLOBALS['xoopsModuleConfig']['adslight_diff_name']) { |
||||||
219 | $form->addElement(new \XoopsFormText(_ADSLIGHT_SUBMITTER, 'submitter', 50, 50, $member_uname), true); |
||||||
220 | } else { |
||||||
221 | $form->addElement(new \XoopsFormLabel(_ADSLIGHT_SUBMITTER, $member_uname)); |
||||||
222 | $form->addElement(new \XoopsFormHidden('submitter', $member_uname), true); |
||||||
223 | } |
||||||
224 | if ('1' == $GLOBALS['xoopsModuleConfig']['adslight_diff_email']) { |
||||||
225 | $form->addElement(new \XoopsFormText(_ADSLIGHT_EMAIL, 'email', 50, 50, $member_email), true); |
||||||
226 | } else { |
||||||
227 | $form->addElement(new \XoopsFormLabel(_ADSLIGHT_EMAIL, $member_email)); |
||||||
228 | $form->addElement(new \XoopsFormHidden('email', $member_email), true); |
||||||
229 | } |
||||||
230 | $form->addElement(new \XoopsFormText(_ADSLIGHT_TOWN, 'town', 50, 50, ''), false); |
||||||
231 | if ('1' == $GLOBALS['xoopsModuleConfig']['adslight_use_country']) { |
||||||
232 | $form->addElement(new \XoopsFormText(_ADSLIGHT_COUNTRY, 'country', 50, 50, ''), false); |
||||||
233 | } else { |
||||||
234 | $form->addElement(new \XoopsFormHidden('country', ''), false); |
||||||
235 | } |
||||||
236 | $form->addElement(new \XoopsFormText(_ADSLIGHT_TEL, 'tel', 50, 50, ''), false); |
||||||
237 | |||||||
238 | // $cid = $_GET['cid']; |
||||||
239 | $cid = 0; |
||||||
240 | $cat_perms = Adslight\Utility::getMyItemIds('adslight_submit'); |
||||||
241 | if (is_array($cat_perms) && count($cat_perms) > 0) { |
||||||
242 | if (!in_array($cid, $cat_perms, true)) { |
||||||
243 | //mb redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM); |
||||||
244 | } |
||||||
245 | |||||||
246 | // Category select box |
||||||
247 | ob_start(); |
||||||
248 | $mytree->makeMySelBox('title', 'title', $cid, 'cid'); |
||||||
0 ignored issues
–
show
'cid' of type string is incompatible with the type integer expected by parameter $none of XoopsModules\Adslight\Cl...edsTree::makeMySelBox() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
249 | $form->addElement(new \XoopsFormLabel(_ADSLIGHT_CAT3, ob_get_contents()), true); |
||||||
250 | ob_end_clean(); |
||||||
251 | |||||||
252 | $category = $xoopsDB->query('SELECT title, cat_moderate FROM ' . $xoopsDB->prefix('adslight_categories') . " WHERE cid='" . $xoopsDB->escape($cid) . "'"); |
||||||
253 | |||||||
254 | list($cat_title, $cat_moderate) = $xoopsDB->fetchRow($category); |
||||||
255 | |||||||
256 | if ('1' == $premium) { |
||||||
257 | $radio = new \XoopsFormRadio(_ADSLIGHT_STATUS, 'status', ''); |
||||||
258 | $options['0'] = _ADSLIGHT_ACTIVE; |
||||||
259 | $options['1'] = _ADSLIGHT_INACTIVE; |
||||||
260 | $radio->addOptionArray($options); |
||||||
261 | $form->addElement($radio, true); |
||||||
262 | } else { |
||||||
263 | $form->addElement(new \XoopsFormHidden('status', '0'), true); |
||||||
264 | } |
||||||
265 | |||||||
266 | if (1 == $premium) { |
||||||
267 | $form->addElement(new \XoopsFormText(_ADSLIGHT_HOW_LONG, 'expire', 3, 3, $GLOBALS['xoopsModuleConfig']['adslight_howlong']), true); |
||||||
268 | } else { |
||||||
269 | $form->addElement(new \XoopsFormLabel(_ADSLIGHT_WILL_LAST, $GLOBALS['xoopsModuleConfig']['adslight_howlong'])); |
||||||
270 | $form->addElement(new \XoopsFormHidden('expire', $GLOBALS['xoopsModuleConfig']['adslight_howlong']), false); |
||||||
271 | } |
||||||
272 | |||||||
273 | // Type |
||||||
274 | $type_form = new \XoopsFormSelect(_ADSLIGHT_TYPE, 'type', '', '1'); |
||||||
275 | while (false !== (list($nom_type, $id_type) = $xoopsDB->fetchRow($result))) { |
||||||
276 | $type_form->addOption($nom_type, $id_type); |
||||||
277 | } |
||||||
278 | |||||||
279 | // State of Object |
||||||
280 | $usure_form = new \XoopsFormSelect(_ADSLIGHT_TYPE_USURE, 'typeusure', '', '1'); |
||||||
281 | while (false !== (list($nom_usure, $id_usure) = $xoopsDB->fetchRow($result3))) { |
||||||
282 | $usure_form->addOption($nom_usure, $id_usure); |
||||||
283 | } |
||||||
284 | |||||||
285 | $form->addElement($type_form, true); |
||||||
286 | $form->addElement($usure_form, true); |
||||||
287 | |||||||
288 | $form->addElement(new \XoopsFormText(_ADSLIGHT_TITLE2, 'title', 40, 50, ''), true); |
||||||
289 | |||||||
290 | $form->addElement(Adslight\Utility::getEditor(_ADSLIGHT_DESC, 'desctext', '', '100%', 40), true); |
||||||
291 | |||||||
292 | // $form->addElement(new \XoopsFormEditor(_ADSLIGHT_DESC, $GLOBALS['xoopsModuleConfig']['adslightEditorUser'], $options, $nohtml = FALSE, $onfailure = 'textarea')); |
||||||
293 | // $optionsTrayNote->addElement($bodynote); |
||||||
294 | |||||||
295 | $form->addElement(new \XoopsFormText(_ADSLIGHT_PRICE2, 'price', 40, 50, ''), true); |
||||||
296 | |||||||
297 | // Price Type |
||||||
298 | $sel_form = new \XoopsFormSelect(_ADSLIGHT_PRICETYPE, 'typeprice', '', '1'); |
||||||
299 | while (false !== (list($nom_price, $id_price) = $xoopsDB->fetchRow($result1))) { |
||||||
300 | $sel_form->addOption($nom_price, $id_price); |
||||||
301 | } |
||||||
302 | |||||||
303 | $form->addElement($sel_form); |
||||||
304 | |||||||
305 | $contactby_form = new \XoopsFormSelect(_ADSLIGHT_CONTACTBY, 'contactby', '', '1'); |
||||||
306 | $contactby_form->addOption(1, _ADSLIGHT_CONTACT_BY_EMAIL); |
||||||
307 | $contactby_form->addOption(2, _ADSLIGHT_CONTACT_BY_PM); |
||||||
308 | $contactby_form->addOption(3, _ADSLIGHT_CONTACT_BY_BOTH); |
||||||
309 | $contactby_form->addOption(4, _ADSLIGHT_CONTACT_BY_PHONE); |
||||||
310 | $form->addElement($contactby_form, true); |
||||||
311 | $form->addElement(new \XoopsFormRadioYN(_ADSLIGHT_ADD_PHOTO_NOW, 'addphotonow', 1)); |
||||||
312 | /* |
||||||
313 | if ('1' == $GLOBALS['xoopsModuleConfig']["adslight_use_captcha"]) { |
||||||
314 | $form->addElement(new \XoopsFormCaptcha(_ADSLIGHT_CAPTCHA, "xoopscaptcha", false), true); |
||||||
315 | } |
||||||
316 | */ |
||||||
317 | if ('0' != $premium) { |
||||||
318 | $form->addElement(new \XoopsFormHidden('premium', 'yes'), false); |
||||||
319 | } else { |
||||||
320 | $form->addElement(new \XoopsFormHidden('premium', 'no'), false); |
||||||
321 | } |
||||||
322 | |||||||
323 | if ('1' == $cat_moderate) { |
||||||
324 | $form->addElement(new \XoopsFormHidden('valid', 'No'), false); |
||||||
325 | $form->addElement(new \XoopsFormHidden('cat_moderate', '1'), false); |
||||||
326 | } else { |
||||||
327 | $form->addElement(new \XoopsFormHidden('valid', 'Yes'), false); |
||||||
328 | } |
||||||
329 | $form->addElement(new \XoopsFormHidden('usid', $member_usid), false); |
||||||
330 | $form->addElement(new \XoopsFormHidden('date', time()), false); |
||||||
331 | $form->addElement(new \XoopsFormButton('', 'submit', _ADSLIGHT_SUBMIT, 'submit')); |
||||||
332 | $form->display(); |
||||||
333 | $GLOBALS['xoopsTpl']->assign('submit_form', ob_get_contents()); |
||||||
334 | ob_end_clean(); |
||||||
335 | } else { // User can't see any category |
||||||
336 | redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM); |
||||||
337 | } |
||||||
338 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
||||||
339 | } |
||||||
340 |