Skip to content

Commit 32938b0

Browse files
committed
Merge pull request #23 from mambax7/master
1.03 Beta 1 XOOPS 2.5.8, PHP7
2 parents 12318bb + 3c943ff commit 32938b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+568
-615
lines changed

admin/admin_header.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@
2020
*/
2121

2222
include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
23+
include_once $GLOBALS['xoops']->path('www/include/cp_functions.php');
24+
include_once $GLOBALS['xoops']->path('www/include/cp_header.php');
25+
include_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
26+
27+
xoops_load('XoopsRequest');
28+
2329
include_once dirname(__DIR__) . '/include/config.php';
24-
include_once $GLOBALS['xoops']->path('include/cp_header.php');
2530

2631
//xoops_loadLanguage('admin', PUBLISHER_DIRNAME);
2732
xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME);
@@ -31,8 +36,9 @@
3136
'deleteimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_delete.png' alt='" . _AM_PUBLISHER_ICO_DELETE . "' align='middle' />",
3237
'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />",
3338
'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />");
34-
include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
3539

40+
include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
41+
//ModuleAdmin::loadLanguage();
3642
/*
3743
$myts = MyTextSanitizer::getInstance();
3844

admin/category.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121

2222
include_once __DIR__ . '/admin_header.php';
2323

24-
$op = XoopsRequest::getString('op', (XoopsRequest::getString('op', '', 'POST')), 'GET');
24+
$op = XoopsRequest::getString('op', XoopsRequest::getString('op', '', 'POST'), 'GET');
2525

26-
$op = (XoopsRequest::getString('editor', '', 'POST')) ? 'mod' : $op;
27-
$op = (XoopsRequest::getString('addcategory', '', 'POST')) ? 'addcategory' : $op;
26+
$op = XoopsRequest::getString('editor', '', 'POST') ? 'mod' : $op;
27+
$op = XoopsRequest::getString('addcategory', '', 'POST') ? 'addcategory' : $op;
2828

2929
// Where do we start ?
3030
$startcategory = XoopsRequest::getInt('startcategory', 0, 'GET');
3131
$categoryid = XoopsRequest::getInt('categoryid');
3232

3333
switch ($op) {
3434
case 'del':
35-
$categoryObj =& $publisher->getHandler('category')->get($categoryid);
35+
$categoryObj = $publisher->getHandler('category')->get($categoryid);
3636
$confirm = XoopsRequest::getInt('confirm', '', 'POST');
3737
$name = XoopsRequest::getString('name', '', 'POST');
3838
if ($confirm) {
@@ -52,7 +52,7 @@
5252
case 'mod':
5353
//Added by fx2024
5454
$nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST');
55-
$nb_subcats += (XoopsRequest::getInt('nb_sub_yet', 4, 'POST'));
55+
$nb_subcats += XoopsRequest::getInt('nb_sub_yet', 4, 'POST');
5656
//end of fx2024 code
5757

5858
publisherCpHeader();
@@ -65,9 +65,9 @@
6565
$parentid = XoopsRequest::getInt('parentid');
6666

6767
if ($categoryid != 0) {
68-
$categoryObj =& $publisher->getHandler('category')->get($categoryid);
68+
$categoryObj = $publisher->getHandler('category')->get($categoryid);
6969
} else {
70-
$categoryObj =& $publisher->getHandler('category')->create();
70+
$categoryObj = $publisher->getHandler('category')->create();
7171
}
7272

7373
// Uploading the image, if any
@@ -82,7 +82,7 @@
8282
$max_imgwidth = $publisher->getConfig('maximum_image_width');
8383
$max_imgheight = $publisher->getConfig('maximum_image_height');
8484
$allowed_mimetypes = publisherGetAllowedImagesTypes();
85-
if (!is_readable($temp['tmp_name']) || ($temp['tmp_name'] == '')) {
85+
if (($temp['tmp_name'] == '') || !is_readable($temp['tmp_name'])) {
8686
redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR);
8787
// exit();
8888
}
@@ -99,7 +99,7 @@
9999
} else {
100100
$categoryObj->setVar('image', XoopsRequest::getString('image', '', 'POST'));
101101
}
102-
$categoryObj->setVar('parentid', (XoopsRequest::getInt('parentid', 0, 'POST')));
102+
$categoryObj->setVar('parentid', XoopsRequest::getInt('parentid', 0, 'POST'));
103103

104104
$applyall = XoopsRequest::getInt('applyall', 0, 'POST');
105105
$categoryObj->setVar('weight', XoopsRequest::getInt('weight', 1, 'POST'));
@@ -143,7 +143,7 @@
143143
for ($i = 0; $i < $sizeof; ++$i) {
144144
$temp = XoopsRequest::getArray('scname', array(), 'POST');
145145
if ($temp[$i] != '') {
146-
$categoryObj =& $publisher->getHandler('category')->create();
146+
$categoryObj = $publisher->getHandler('category')->create();
147147
$temp2 = XoopsRequest::getArray('scname', array(), 'POST');
148148
$categoryObj->setVar('name', $temp2[$i]);
149149
$categoryObj->setVar('parentid', $parentCat);
@@ -169,7 +169,7 @@
169169
$categoryid = 0;
170170
$nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST') + XoopsRequest::getInt('nb_sub_yet', 0, 'POST');
171171

172-
$categoryObj =& $publisher->getHandler('category')->create();
172+
$categoryObj = $publisher->getHandler('category')->create();
173173
$categoryObj->setVar('name', XoopsRequest::getString('name', '', 'POST'));
174174
$categoryObj->setVar('description', XoopsRequest::getString('description', '', 'POST'));
175175
$categoryObj->setVar('weight', XoopsRequest::getInt('weight', 0, 'POST'));
@@ -199,7 +199,7 @@
199199
echo '</div></form>';
200200

201201
// Creating the objects for top categories
202-
$categoriesObj =& $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0);
202+
$categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0);
203203

204204
publisherOpenCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC);
205205

@@ -210,7 +210,7 @@
210210
echo "<th width='60' class='bg3' width='65' align='center'><strong>" . _CO_PUBLISHER_WEIGHT . '</strong></td>';
211211
echo "<th width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . '</strong></td>';
212212
echo '</tr>';
213-
$totalCategories =& $publisher->getHandler('category')->getCategoriesCount(0);
213+
$totalCategories = $publisher->getHandler('category')->getCategoriesCount(0);
214214
if (count($categoriesObj) > 0) {
215215
foreach ($categoriesObj as $key => $thiscat) {
216216
PublisherUtilities::displayCategory($thiscat);

admin/file.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,27 @@
3030
*/
3131
function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
3232
{
33-
$publisher =& PublisherPublisher::getInstance();
33+
$publisher = PublisherPublisher::getInstance();
3434
include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
3535

3636
// if there is a parameter, and the id exists, retrieve data: we're editing a file
3737
if ($fileid != 0) {
3838
// Creating the File object
39-
$fileObj =& $publisher->getHandler('file')->get($fileid);
39+
$fileObj = $publisher->getHandler('file')->get($fileid);
4040

4141
if ($fileObj->notLoaded()) {
4242
redirect_header('javascript:history.go(-1)', 1, _AM_PUBLISHER_NOFILESELECTED);
4343
// exit();
4444
}
4545

46-
if ($showmenu) {
47-
//publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_EDITING);
48-
}
49-
5046
echo "<br />\n";
5147
echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 6px 0 0; '>" . _AM_PUBLISHER_FILE_EDITING . '</span>';
5248
echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_EDITING_DSC . '</span>';
5349
publisherOpenCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS);
5450
} else {
5551
// there's no parameter, so we're adding an item
56-
$fileObj =& $publisher->getHandler('file')->create();
52+
$fileObj = $publisher->getHandler('file')->create();
5753
$fileObj->setVar('itemid', $itemid);
58-
if ($showmenu) {
59-
//publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_FILE_ADD);
60-
}
6154
echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 6px 0 0; '>" . _AM_PUBLISHER_FILE_ADDING . '</span>';
6255
echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_ADDING_DSC . '</span>';
6356
publisherOpenCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS);
@@ -106,9 +99,9 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
10699

107100
// Creating the file object
108101
if ($fileid != 0) {
109-
$fileObj =& $publisher->getHandler('file')->get($fileid);
102+
$fileObj = $publisher->getHandler('file')->get($fileid);
110103
} else {
111-
$fileObj =& $publisher->getHandler('file')->create();
104+
$fileObj = $publisher->getHandler('file')->create();
112105
}
113106

114107
// Putting the values in the file object
@@ -130,7 +123,7 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
130123
$fileid = XoopsRequest::getInt('fileid', 0, 'POST');
131124
$fileid = XoopsRequest::getInt('fileid', $fileid, 'GET');
132125

133-
$fileObj =& $publisher->getHandler('file')->get($fileid);
126+
$fileObj = $publisher->getHandler('file')->get($fileid);
134127

135128
$confirm = XoopsRequest::getInt('confirm', 0, 'POST');
136129
$title = XoopsRequest::getString('title', '', 'POST');

admin/import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
xoops_load('XoopsFormLoader');
4343

44-
$moduleHandler =& xoops_getHandler('module');
44+
$moduleHandler = xoops_getHandler('module');
4545

4646
// WF-Section
4747
/*$wfs_version = 0;

admin/import/ams.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
// redirect_header('admin.php?fct=images', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
6262
// }
6363

64-
$imageCategoryHandler =& xoops_getHandler('imagecategory');
64+
$imageCategoryHandler = xoops_getHandler('imagecategory');
6565
$imagecategory =& $imageCategoryHandler->create();
6666
// $imagecategory->setVar('imgcat_name', $imgcat_name);
6767
$imagecategory->setVar('imgcat_name', PUBLISHER_DIRNAME); //$imgcat_name);
@@ -81,7 +81,7 @@
8181
}
8282

8383
$newid = $imagecategory->getVar('imgcat_id');
84-
$imagecategorypermHandler =& xoops_getHandler('groupperm');
84+
$imagecategorypermHandler = xoops_getHandler('groupperm');
8585
if (!isset($readgroup)) {
8686
$readgroup = array();
8787
}
@@ -158,14 +158,14 @@
158158
if ($op === 'go') {
159159
publisherCpHeader();
160160
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
161-
include_once (dirname(dirname(__DIR__))) . '/include/common.php';
161+
include_once dirname(dirname(__DIR__)) . '/include/common.php';
162162
publisherOpenCollapsableBar('amsimportgo', 'amsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);
163163

164-
$moduleHandler =& xoops_getHandler('module');
164+
$moduleHandler = xoops_getHandler('module');
165165
$moduleObj = $moduleHandler->getByDirname('ams');
166166
$ams_module_id = $moduleObj->getVar('mid');
167167

168-
$gpermHandler =& xoops_getHandler('groupperm');
168+
$gpermHandler = xoops_getHandler('groupperm');
169169

170170
$cnt_imported_cat = 0;
171171
$cnt_imported_articles = 0;
@@ -179,7 +179,7 @@
179179
$newCatArray = array();
180180
$newArticleArray = array();
181181

182-
$imageCategoryHandler =& xoops_getHandler('imagecategory');
182+
$imageCategoryHandler = xoops_getHandler('imagecategory');
183183
// $criteria = new criteriaCombo;
184184

185185
// get the total number of subcats for this category
@@ -213,7 +213,7 @@
213213
$newCat['oldid'] = $arrCat['topic_id'];
214214
$newCat['oldpid'] = $arrCat['topic_pid'];
215215

216-
$categoryObj =& $publisher->getHandler('category')->create();
216+
$categoryObj = $publisher->getHandler('category')->create();
217217

218218
$categoryObj->setVar('parentid', $arrCat['topic_pid']);
219219
$categoryObj->setVar('image', $arrCat['topic_imgurl']);
@@ -231,7 +231,7 @@
231231

232232
/*
233233
234-
$imageHandler =& xoops_getHandler('image');
234+
$imageHandler = xoops_getHandler('image');
235235
$image =& $imageHandler->create();
236236
$image->setVar('image_name', $arrCat['topic_imgurl']);//'images/' . $uploader->getSavedFileName());
237237
$image->setVar('image_nicename', substr($arrCat['topic_imgurl'],-13)); //$image_nicename);
@@ -288,7 +288,7 @@
288288
$resultArticles = $GLOBALS['xoopsDB']->query($sql);
289289
while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) {
290290
// insert article
291-
$itemObj =& $publisher->getHandler('item')->create();
291+
$itemObj = $publisher->getHandler('item')->create();
292292

293293
$itemObj->setVar('categoryid', $categoryObj->categoryid());
294294
$itemObj->setVar('title', $arrArticle['title']);
@@ -307,7 +307,7 @@
307307
$itemObj->setVar('notifypub', $arrArticle['notifypub']);
308308
//-------- image
309309

310-
$imgHandler =& xoops_getHandler('image');
310+
$imgHandler = xoops_getHandler('image');
311311

312312
// $criteria = new Criteria('image_name', $arrArticle['picture']);
313313
$imageId = $imgHandler->getObjects($criteria);
@@ -349,7 +349,7 @@
349349
$filename = $GLOBALS['xoops']->path('uploads/AMS/attached/' . $arrFile['downloadname']);
350350
if (file_exists($filename)) {
351351
if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) {
352-
$fileObj =& $publisher->getHandler('file')->create();
352+
$fileObj = $publisher->getHandler('file')->create();
353353
$fileObj->setVar('name', $arrFile['filerealname']);
354354
$fileObj->setVar('description', $arrFile['filerealname']);
355355
$fileObj->setVar('status', PublisherConstants::PUBLISHER_STATUS_FILE_ACTIVE);
@@ -410,7 +410,7 @@
410410

411411
$publisher_module_id = $publisher->getModule()->mid();
412412

413-
$commentHandler =& xoops_getHandler('comment');
413+
$commentHandler = xoops_getHandler('comment');
414414
$criteria = new CriteriaCompo();
415415
$criteria->add(new Criteria('com_modid', $ams_module_id));
416416
$comments = $commentHandler->getObjects($criteria);

admin/import/cjaycontent.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
if ($op === 'go') {
8585
publisherCpHeader();
8686
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
87-
include_once (dirname(dirname(__DIR__))) . '/include/common.php';
87+
include_once dirname(dirname(__DIR__)) . '/include/common.php';
8888
publisherOpenCollapsableBar('cjaycontentimportgo', 'cjaycontentimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);
8989

90-
$moduleHandler =& xoops_getHandler('module');
90+
$moduleHandler = xoops_getHandler('module');
9191
$moduleObj = $moduleHandler->getByDirname('cjaycontent');
9292
$cjaycontent_module_id = $moduleObj->getVar('mid');
9393

94-
$gpermHandler =& xoops_getHandler('groupperm');
94+
$gpermHandler = xoops_getHandler('groupperm');
9595

9696
$cnt_imported_articles = 0;
9797

@@ -103,7 +103,7 @@
103103
$resultArticles = $GLOBALS['xoopsDB']->query($sql);
104104
while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) {
105105
// insert article
106-
$itemObj =& $publisher->getHandler('item')->create();
106+
$itemObj = $publisher->getHandler('item')->create();
107107
$itemObj->setVar('itemid', $arrArticle['id']);
108108
// $itemObj->setVar('categoryid', $categoryObj->categoryid());
109109
$itemObj->setVar('title', $arrArticle['title']);
@@ -158,7 +158,7 @@
158158

159159
$publisher_module_id = $publisher->getModule()->mid();
160160

161-
$commentHandler =& xoops_getHandler('comment');
161+
$commentHandler = xoops_getHandler('comment');
162162
$criteria = new CriteriaCompo();
163163
$criteria->add(new Criteria('com_modid', $cjaycontent_module_id));
164164
$comments = $commentHandler->getObjects($criteria);

0 commit comments

Comments
 (0)