Skip to content
Permalink
Browse files

2.2 Beta 3

  • Loading branch information...
mambax7 committed Sep 28, 2016
1 parent 9231214 commit f834155acd21214d22add8df9db3c4f4d55d1a60
Showing with 4,115 additions and 3,599 deletions.
  1. +31 −0 .codeclimate.yml
  2. +2 −2 404.php
  3. +0 −339 LICENSE
  4. +1 −1 README.md
  5. +47 −71 add.php
  6. +1 −1 add_photo.php
  7. +8 −9 addlisting.php
  8. +2 −4 admin/about.php
  9. +3 −2 admin/about0.php
  10. +8 −8 admin/admin_footer.php
  11. +3 −0 admin/admin_header.php
  12. +93 −89 admin/category.php
  13. +18 −21 admin/groupperms.php
  14. +16 −16 admin/header.php
  15. +10 −4 admin/install.php
  16. +12 −29 admin/main.php
  17. +2 −5 admin/map.php
  18. +4 −3 admin/menu.php
  19. +86 −75 admin/modify_ads.php
  20. +82 −105 admin/options.php
  21. +9 −8 admin/support_forum.php
  22. +8 −7 admin/upgrade.php
  23. +123 −92 admin/validate_ads.php
  24. +113 −82 admin/view_ads.php
  25. BIN assets/images/{logo_module.png → logoModule.png}
  26. +4 −4 blocks/ads.php
  27. +31 −29 blocks/ads_2.php
  28. +9 −9 blocks/maps.php
  29. +87 −87 class/classifiedstree.php
  30. +26 −11 class/pictures.php
  31. +19 −19 contact.php
  32. +355 −107 datas.xml
  33. +1 −1 display-image.php
  34. +10 −1 docs/changelog.txt
  35. +10 −10 fluxrss.php
  36. +2 −1 header.php
  37. +34 −28 include/functions.php
  38. +3 −1 include/gd.class.php
  39. +13 −9 include/gtickets.php
  40. +3 −2 include/notification.inc.php
  41. +6 −6 include/search.inc.php
  42. +3 −2 include/searchform.php
  43. +2 −2 include/update_function.php
  44. +22 −19 include/updateblock.inc.php
  45. +67 −60 index.php
  46. +6 −6 language/english/admin.php
  47. +36 −13 language/english/help/help.html
  48. +6 −0 language/english/help/helpheader.html
  49. +3 −3 language/english/main.php
  50. +15 −10 language/english/modinfo.php
  51. +4 −4 maps.php
  52. +355 −107 maps/french/datas.xml
  53. +355 −107 maps/russian/datas.xml
  54. +59 −80 members.php
  55. +78 −77 modify.php
  56. +17 −31 print.php
  57. +18 −36 rate-item.php
  58. +17 −34 rate-user.php
  59. +15 −20 replies.php
  60. +21 −29 report-abuse.php
  61. +10 −10 rss.php
  62. +27 −50 search.php
  63. +19 −30 sendfriend.php
  64. +11 −8 seo.php
  65. +158 −147 sql/bosanski/mysql.sql
  66. +157 −146 sql/english/mysql.sql
  67. +158 −147 sql/french/mysql.sql
  68. +157 −146 sql/german/mysql.sql
  69. +157 −146 sql/italian/mysql.sql
  70. +158 −147 sql/nederlands/mysql.sql
  71. +157 −146 sql/polish/mysql.sql
  72. +157 −146 sql/portuguesebr/mysql.sql
  73. +158 −147 sql/spanish/mysql.sql
  74. +1 −1 templates/adslight_members.tpl
  75. +6 −6 templates/adslight_view_photos.tpl
  76. +5 −5 templates/adslight_xpayment_form.tpl
  77. +7 −19 tips_writing_ad.php
  78. +25 −36 view_photos.php
  79. +113 −110 viewads.php
  80. +61 −61 viewcats.php
  81. +19 −7 xoops_version.php
@@ -0,0 +1,31 @@
engines:
eslint:
enabled: true
csslint:
enabled: true
duplication:
enabled: true
config:
languages:
- javascript
- php
fixme:
enabled: true
phpmd:
enabled: true
config:
file_extensions:
- php
- inc
phpcodesniffer:
enabled: true
config:
file_extensions: "php,inc,lib"
standard: "PSR1,PSR2"
ratings:
paths:
- "**.inc"
- "**.js"
- "**.lib"
- "**.php"
exclude_paths: []
@@ -27,7 +27,7 @@
} else {
include dirname(dirname(__DIR__)) . '/mainfile.php';
}
include(XOOPS_ROOT_PATH . '/header.php');
include XOOPS_ROOT_PATH . '/header.php';
$xoopsTpl->assign('xoops_showrblock', 1); // 1 = Avec blocs de droite - 0 = Sans blocs de droite
$xoopsTpl->assign('xoops_showlblock', 1); // 1 = Avec blocs de gauche - 0 = Sans blocs de gauche
@@ -36,4 +36,4 @@
echo _MN_ADSLIGHT_ERROR404_TEXT;
include(XOOPS_ROOT_PATH . '/footer.php');
include XOOPS_ROOT_PATH . '/footer.php';
339 LICENSE

This file was deleted.

@@ -10,7 +10,7 @@

Adslight module for [XOOPS CMS](http://xoops.org) is a classifieds module that allow users of XOOPS website to advertise items for sale, exchange or barter.

[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/adslight-tutorial/) Tutorial: see [here](https://www.gitbook.com/book/xoops/adslight-tutorial/).
[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/adslight-tutorial/) Tutorial: see [GitBook](https://www.gitbook.com/book/xoops/adslight-tutorial/).
To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/adslight-tutorial)

[![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops)
118 add.php
@@ -28,35 +28,26 @@
include_once __DIR__ . '/include/functions.php';
// include_once XOOPS_ROOT_PATH."/class/captcha/xoopscaptcha.php";
//@todo replace XOOPS ErrorHander (deprecated)
$erh = new ErrorHandler; //ErrorHandler object
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
$groups = $xoopsUser->getGroups();
} else {
$groups = XOOPS_GROUP_ANONYMOUS;
}
$module_id = $xoopsModule->getVar('mid');
$groups = ($xoopsUser instanceof XoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$gperm_handler = xoops_getHandler('groupperm');
if (isset($_POST['item_id'])) {
$perm_itemid = (int)$_POST['item_id'];
} else {
$perm_itemid = 0;
}
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
if (!$gperm_handler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
}
if (!$gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id)) {
$premium = 0;
} else {
$premium = 1;
}
$premium = $gperm_handler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? 1 : 0;
include_once XOOPS_ROOT_PATH . '/modules/adslight/include/functions.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
include_once XOOPS_ROOT_PATH . '/modules/adslight/class/classifiedstree.php';
$mytree = new ClassifiedsTree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');
if (empty($xoopsUser)) {
if (!$xoopsUser instanceof XoopsUser) {
redirect_header(XOOPS_URL . '/user.php', 2, _ADS_MUSTREGFIRST);
}
@@ -72,23 +63,20 @@
// if ( !$xoopsCaptcha->verify() ) {
// redirect_header( XOOPS_URL . "/modules/adslight/index.php", 2, $xoopsCaptcha->getMessage() );
// }
if ($_POST['title'] == '') {
if ('' == XoopsRequest::getString('title', '', 'POST')) {
//@todo - replace this with new error handler
$erh->show('1001');
}
if (!empty($_POST['cid'])) {
$cid = (int)$_POST['cid'];
} else {
$cid = 0;
}
$cid = XoopsRequest::getInt('cid', 0, 'POST');
$cat_perms = adslight_MygetItemIds('adslight_submit');
if (!in_array($cid, $cat_perms)) {
redirect_header(XOOPS_URL, 2, _NOPERM);
}
$title = $myts->addSlashes($_POST['title']);
$status = $myts->addSlashes($_POST['status']);
$title = $myts->addSlashes($_POST['title']);
// $status = $myts->addSlashes($_POST["status"]);
$status = (int)$status;
$expire = $myts->addSlashes($_POST['expire']);
$type = $myts->addSlashes($_POST['type']);
$desctext = $myts->displayTarea($_POST['desctext'], 1, 1, 1);
@@ -108,15 +96,15 @@
$date = time();
$newid = $xoopsDB->genId($xoopsDB->prefix('adslight_listing') . '_lid_seq');
$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')",
$xoopsDB->prefix('adslight_listing'), $newid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town, $country,
$contactby, $premium, $valid);
$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')",
$xoopsDB->prefix('adslight_listing'), $newid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town,
$country, $contactby, $premium, $valid);
//@todo - replace error handler code below...
$xoopsDB->query($sql) || $erh->show('0013');
$lid = $xoopsDB->getInsertId();
if ($valid === 'Yes') {
if ('Yes' === $valid) {
$notification_handler = xoops_getHandler('notification');
//$lid = $xoopsDB->getInsertId();
$tags = array();
@@ -158,7 +146,8 @@
$tags['CATEGORY_TITLE'] = $row['title'];
$tags['NEWAD'] = _ADSLIGHT_NEWAD;
$mail = xoops_getMailer();
$mail =& xoops_getMailer();
//@todo - add check to see if directory (and file) exists, otherwise use english
$mail->setTemplateDir(XOOPS_ROOT_PATH . '/modules/adslight/language/' . $xoopsConfig['language'] . '/mail_template/');
$mail->setTemplate('listing_notify_admin.tpl');
$mail->useMail();
@@ -172,50 +161,36 @@
echo $mail->getErrors();
}
if (!empty($_POST['addphotonow'])) {
$addphotonow = (int)$_POST['addphotonow'];
} else {
$addphotonow = '0';
}
$addphotonow = XoopsRequest::getInt('addphotonow', 0, 'POST');
if ($addphotonow) {
//$lid = $xoopsDB->getInsertId();
redirect_header("view_photos.php?lid=$lid&uid=$usid", 3, _ADSLIGHT_ADSADDED);
} else {
redirect_header('index.php', 3, _ADSLIGHT_ADSADDED);
}
} else {
$xoopsOption['template_main'] = 'adslight_addlisting.tpl';
$GLOBALS['xoopsOption']['template_main'] = 'adslight_addlisting.tpl';
include XOOPS_ROOT_PATH . '/header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
if (!empty($_POST['cid'])) {
$cid = (int)$_POST['cid'];
} else {
$cid = 0;
}
if (!empty($_POST['cat_moderate'])) {
$cat_moderate = (int)$_POST['cat_moderate'];
} else {
$cat_moderate = 0;
}
$cid = XoopsRequest::getInt('cide', 0, 'GET');
$cat_moderate = XoopsRequest::getInt('cat_moderate', 0, 'POST');
$howlong = $xoopsModuleConfig['adslight_howlong'];
$member_usid = $xoopsUser->getVar('uid', 'E');
$member_email = $xoopsUser->getVar('email', 'E');
$member_uname = $xoopsUser->getVar('uname', 'E');
$result = $xoopsDB->query('select id_type, nom_type from ' . $xoopsDB->prefix('adslight_type') . ' order by nom_type');
$result1 = $xoopsDB->query('select id_price, nom_price from ' . $xoopsDB->prefix('adslight_price') . ' order by id_price');
$result3 = $xoopsDB->query('select id_usure, nom_usure from ' . $xoopsDB->prefix('adslight_usure') . ' order by id_usure');
$result = $xoopsDB->query('SELECT id_type, nom_type FROM ' . $xoopsDB->prefix('adslight_type') . ' ORDER BY nom_type');
$result1 = $xoopsDB->query('SELECT id_price, nom_price FROM ' . $xoopsDB->prefix('adslight_price') . ' ORDER BY id_price');
$result3 = $xoopsDB->query('SELECT id_usure, nom_usure FROM ' . $xoopsDB->prefix('adslight_usure') . ' ORDER BY id_usure');
ob_start();
$form = new XoopsThemeForm(_ADSLIGHT_ADD_LISTING, 'submitform', 'add.php');
$form->setExtra('enctype="multipart/form-data"');
$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement($form, __LINE__, 1800, 'token');
//@todo - this "if" code doesn't do anything, what should happen for premium accounts?
if ($cat_moderate) {
if ($premium != '0') {
echo '';
@@ -230,20 +205,20 @@
}
}
if ($xoopsModuleConfig['adslight_diff_name'] == '1') {
if ('1' == $xoopsModuleConfig['adslight_diff_name']) {
$form->addElement(new XoopsFormText(_ADSLIGHT_SUBMITTER, 'submitter', 50, 50, $member_uname), true);
} else {
$form->addElement(new XoopsFormLabel(_ADSLIGHT_SUBMITTER, $member_uname));
$form->addElement(new XoopsFormHidden('submitter', $member_uname), true);
}
if ($xoopsModuleConfig['adslight_diff_email'] == '1') {
if ('1' == $xoopsModuleConfig['adslight_diff_email']) {
$form->addElement(new XoopsFormText(_ADSLIGHT_EMAIL, 'email', 50, 50, $member_email), true);
} else {
$form->addElement(new XoopsFormLabel(_ADSLIGHT_EMAIL, $member_email));
$form->addElement(new XoopsFormHidden('email', $member_email), true);
}
$form->addElement(new XoopsFormText(_ADSLIGHT_TOWN, 'town', 50, 50, ''), false);
if ($xoopsModuleConfig['adslight_use_country'] == '1') {
if ('1' == $xoopsModuleConfig['adslight_use_country']) {
$form->addElement(new XoopsFormText(_ADSLIGHT_COUNTRY, 'country', 50, 50, ''), false);
} else {
$form->addElement(new XoopsFormHidden('country', ''), false);
@@ -257,18 +232,18 @@
if (!in_array($cid, $cat_perms)) {
redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
}
//// Début Menu déroulant /////
// Category select box
ob_start();
$mytree->makeMySelBox('title', 'title', $cid, 'cid');
$form->addElement(new XoopsFormLabel(_ADSLIGHT_CAT3, ob_get_contents()), true);
ob_end_clean();
//// Fin Menu déroulant /////
$category = $xoopsDB->query('select title, cat_moderate from ' . $xoopsDB->prefix('adslight_categories') . ' where cid=' . $xoopsDB->escape($cid) . '');
$category = $xoopsDB->query('SELECT title, cat_moderate FROM ' . $xoopsDB->prefix('adslight_categories') . ' WHERE cid=' . $xoopsDB->escape($cid) . '');
list($cat_title, $cat_moderate) = $xoopsDB->fetchRow($category);
if ($premium == '1') {
if ('1' == $premium) {
$radio = new XoopsFormRadio(_ADSLIGHT_STATUS, 'status', '');
$options['0'] = _ADSLIGHT_ACTIVE;
$options['1'] = _ADSLIGHT_INACTIVE;
@@ -285,12 +260,13 @@
$form->addElement(new XoopsFormHidden('expire', $xoopsModuleConfig['adslight_howlong']), false);
}
/// Type d'annonce
// Type
$type_form = new XoopsFormSelect(_ADSLIGHT_TYPE, 'type', '', '1');
while (list($nom_type, $id_type) = $xoopsDB->fetchRow($result)) {
$type_form->addOption($nom_type, $id_type);
}
/// Etat de l'objet
// State of Object
$usure_form = new XoopsFormSelect(_ADSLIGHT_TYPE_USURE, 'typeusure', '', '1');
while (list($nom_usure, $id_usure) = $xoopsDB->fetchRow($result3)) {
$usure_form->addOption($nom_usure, $id_usure);
@@ -303,7 +279,7 @@
$form->addElement(adslight_getEditor(_ADSLIGHT_DESC, 'desctext', '', 5, 40), true);
$form->addElement(new XoopsFormText(_ADSLIGHT_PRICE2, 'price', 40, 50, ''), true);
/// Type de prix
// Price Type
$sel_form = new XoopsFormSelect(_ADSLIGHT_PRICETYPE, 'typeprice', '', '1');
while (list($nom_price, $id_price) = $xoopsDB->fetchRow($result1)) {
$sel_form->addOption($nom_price, $id_price);
@@ -318,18 +294,18 @@
$contactby_form->addOption(4, _ADSLIGHT_CONTACT_BY_PHONE);
$form->addElement($contactby_form, true);
$form->addElement(new XoopsFormRadioYN(_ADSLIGHT_ADD_PHOTO_NOW, 'addphotonow', 1));
//if ($xoopsModuleConfig["adslight_use_captcha"] == '1') {
// $form->addElement(new XoopsFormCaptcha(_ADSLIGHT_CAPTCHA, "xoopscaptcha", false), true);
//}
if ($premium != '0') {
/*
if ('1' == $xoopsModuleConfig["adslight_use_captcha"]) {
$form->addElement(new XoopsFormCaptcha(_ADSLIGHT_CAPTCHA, "xoopscaptcha", false), true);
}
*/
if ('0' != $premium) {
$form->addElement(new XoopsFormHidden('premium', 'yes'), false);
} else {
$form->addElement(new XoopsFormHidden('premium', 'no'), false);
}
if ($cat_moderate == '1') {
if ('1' == $cat_moderate) {
$form->addElement(new XoopsFormHidden('valid', 'No'), false);
$form->addElement(new XoopsFormHidden('cat_moderate', '1'), false);
} else {
@@ -27,7 +27,7 @@
* Xoops header ...
*/
include dirname(dirname(__DIR__)) . '/mainfile.php';
$xoopsOption['template_main'] = 'adslight_index.tpl';
$GLOBALS['xoopsOption']['template_main'] = 'adslight_index.tpl';
include_once XOOPS_ROOT_PATH . '/header.php';
/**
@@ -100,10 +100,9 @@
$date = time();
$newid = $xoopsDB->genId($xoopsDB->prefix('adslight_listing') . '_lid_seq');
$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')",
$xoopsDB->prefix('adslight_listing'), $newid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town, $country,
$contactby, $premium, $valid);
$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')",
$xoopsDB->prefix('adslight_listing'), $newid, $cid, $title, $status, $expire, $type, $desctext, $tel, $price, $typeprice, $typeusure, $date, $email, $submitter, $usid, $town,
$country, $contactby, $premium, $valid);
$xoopsDB->query($sql) || $erh->show('0013');
$lid = $xoopsDB->getInsertId();
@@ -177,7 +176,7 @@
redirect_header('index.php', 3, _ADSLIGHT_ADSADDED);
}
} else {
$xoopsOption['template_main'] = 'adslight_addlisting.tpl';
$GLOBALS['xoopsOption']['template_main'] = 'adslight_addlisting.tpl';
include XOOPS_ROOT_PATH . '/header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
@@ -198,9 +197,9 @@
$member_email = $xoopsUser->getVar('email', 'E');
$member_uname = $xoopsUser->getVar('uname', 'E');
$result = $xoopsDB->query('select id_type, nom_type from ' . $xoopsDB->prefix('adslight_type') . ' order by nom_type');
$result1 = $xoopsDB->query('select id_price, nom_price from ' . $xoopsDB->prefix('adslight_price') . ' order by id_price');
$result3 = $xoopsDB->query('select id_usure, nom_usure from ' . $xoopsDB->prefix('adslight_usure') . ' order by id_usure');
$result = $xoopsDB->query('SELECT id_type, nom_type FROM ' . $xoopsDB->prefix('adslight_type') . ' ORDER BY nom_type');
$result1 = $xoopsDB->query('SELECT id_price, nom_price FROM ' . $xoopsDB->prefix('adslight_price') . ' ORDER BY id_price');
$result3 = $xoopsDB->query('SELECT id_usure, nom_usure FROM ' . $xoopsDB->prefix('adslight_usure') . ' ORDER BY id_usure');
ob_start();
$form = new XoopsThemeForm(_ADSLIGHT_ADD_LISTING, 'submitform', 'addlisting.php');
@@ -250,7 +249,7 @@
redirect_header(XOOPS_URL . '/modules/adslight/index.php', 3, _NOPERM);
}
$category = $xoopsDB->query('select title, cat_moderate from ' . $xoopsDB->prefix('adslight_categories') . ' where cid=' . $xoopsDB->escape($cid) . '');
$category = $xoopsDB->query('SELECT title, cat_moderate FROM ' . $xoopsDB->prefix('adslight_categories') . ' WHERE cid=' . $xoopsDB->escape($cid) . '');
list($cat_title, $cat_moderate) = $xoopsDB->fetchRow($category);
$form->addElement(new XoopsFormLabel(_ADSLIGHT_CAT3, "<b>$cat_title</b>"));
@@ -21,9 +21,7 @@
xoops_cp_header();
$aboutAdmin = new ModuleAdmin();
echo $aboutAdmin->addNavigation(basename(__FILE__));
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
echo $adminObject->addNavigation(basename(__FILE__));
echo $adminObject->renderAbout('6KJ7RW5DR3VTJ', false);
include_once __DIR__ . '/admin_footer.php';
@@ -30,8 +30,9 @@
// include_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php';
// loadModuleAdminMenu (6, "");
//}
$versioninfo = $module_handler->get($xoopsModule->getVar('mid'));
/** @var XoopsModuleHandler $moduleHandler */
$moduleHandler = xoops_getHandler('module');
$versioninfo = $moduleHandler->get($xoopsModule->getVar('mid'));
echo "
<style type=\"text/css\">
label,text {

0 comments on commit f834155

Please sign in to comment.
You can’t perform that action at this time.