@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | $false = false; |
49 | 49 | if ((int)$id > 0) { |
50 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories') . ' WHERE categoryid=' . $id; |
|
50 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories').' WHERE categoryid='.$id; |
|
51 | 51 | if (!$result = $this->db->query($sql)) { |
52 | 52 | return $false; |
53 | 53 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | // Deleteing the sub categories |
152 | - $subcats =& $this->getCategories(0, 0, $category->categoryid()); |
|
152 | + $subcats = & $this->getCategories(0, 0, $category->categoryid()); |
|
153 | 153 | foreach ($subcats as $subcat) { |
154 | 154 | $this->delete($subcat); |
155 | 155 | } |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | { |
187 | 187 | $ret = []; |
188 | 188 | $limit = $start = 0; |
189 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
189 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories'); |
|
190 | 190 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
191 | - $sql .= ' ' . $criteria->renderWhere(); |
|
191 | + $sql .= ' '.$criteria->renderWhere(); |
|
192 | 192 | if ('' != $criteria->getSort()) { |
193 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
193 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
194 | 194 | } |
195 | 195 | $limit = $criteria->getLimit(); |
196 | 196 | $start = $criteria->getStart(); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission'); |
248 | 248 | |
249 | 249 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
250 | - $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
250 | + $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
251 | 251 | } |
252 | 252 | $criteria->setStart($start); |
253 | 253 | $criteria->setLimit($limit); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission'); |
287 | 287 | |
288 | 288 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
289 | - $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
289 | + $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | $criteria->add(new \Criteria('f.status', Constants::SF_STATUS_OPENED)); |
@@ -295,11 +295,11 @@ discard block |
||
295 | 295 | |
296 | 296 | $ret = []; |
297 | 297 | $limit = $start = 0; |
298 | - $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
298 | + $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid'; |
|
299 | 299 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
300 | - $sql .= ' ' . $criteria->renderWhere(); |
|
300 | + $sql .= ' '.$criteria->renderWhere(); |
|
301 | 301 | if ('' != $criteria->getSort()) { |
302 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
302 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
303 | 303 | } |
304 | 304 | $limit = $criteria->getLimit(); |
305 | 305 | $start = $criteria->getStart(); |
@@ -328,9 +328,9 @@ discard block |
||
328 | 328 | */ |
329 | 329 | public function getCount($criteria = null) |
330 | 330 | { |
331 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_categories'); |
|
331 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_categories'); |
|
332 | 332 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
333 | - $sql .= ' ' . $criteria->renderWhere(); |
|
333 | + $sql .= ' '.$criteria->renderWhere(); |
|
334 | 334 | } |
335 | 335 | $result = $this->db->query($sql); |
336 | 336 | if (!$result) { |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission'); |
359 | 359 | |
360 | 360 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
361 | - $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
361 | + $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
362 | 362 | } |
363 | 363 | } |
364 | 364 | |
@@ -382,16 +382,16 @@ discard block |
||
382 | 382 | $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission'); |
383 | 383 | |
384 | 384 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
385 | - $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
385 | + $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
386 | 386 | } |
387 | 387 | } |
388 | 388 | |
389 | 389 | $criteria->add(new \Criteria('f.status', Constants::SF_STATUS_OPENED)); |
390 | 390 | |
391 | - $sql = 'SELECT COUNT(c.categoryid) FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
391 | + $sql = 'SELECT COUNT(c.categoryid) FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid'; |
|
392 | 392 | |
393 | 393 | if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) { |
394 | - $sql .= ' ' . $criteria->renderWhere(); |
|
394 | + $sql .= ' '.$criteria->renderWhere(); |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | $result = $this->db->query($sql); |
@@ -409,16 +409,16 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function getSubCats($categories) |
411 | 411 | { |
412 | - $criteria = new \CriteriaCompo(new \Criteria('parentid', '(' . implode(',', array_keys($categories)) . ')'), 'IN'); |
|
412 | + $criteria = new \CriteriaCompo(new \Criteria('parentid', '('.implode(',', array_keys($categories)).')'), 'IN'); |
|
413 | 413 | $ret = []; |
414 | 414 | if (!Smartfaq\Utility::userIsAdmin()) { |
415 | 415 | /** @var Smartfaq\PermissionHandler $smartPermHandler */ |
416 | 416 | $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission'); |
417 | 417 | |
418 | 418 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
419 | - $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
419 | + $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
420 | 420 | } |
421 | - $subcats =& $this->getObjects($criteria, true); |
|
421 | + $subcats = & $this->getObjects($criteria, true); |
|
422 | 422 | foreach ($subcats as $subcat_id => $subcat) { |
423 | 423 | $ret[$subcat->getVar('parentid')][$subcat->getVar('categoryid')] = $subcat; |
424 | 424 | } |
@@ -434,9 +434,9 @@ discard block |
||
434 | 434 | */ |
435 | 435 | public function deleteAll($criteria = null) |
436 | 436 | { |
437 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_categories'); |
|
437 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_categories'); |
|
438 | 438 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
439 | - $sql .= ' ' . $criteria->renderWhere(); |
|
439 | + $sql .= ' '.$criteria->renderWhere(); |
|
440 | 440 | } |
441 | 441 | if (!$this->db->query($sql)) { |
442 | 442 | return false; |
@@ -458,10 +458,10 @@ discard block |
||
458 | 458 | **/ |
459 | 459 | public function updateAll($fieldname, $fieldvalue, \CriteriaElement $criteria = null) |
460 | 460 | { |
461 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
462 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_categories') . ' SET ' . $set_clause; |
|
461 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
462 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_categories').' SET '.$set_clause; |
|
463 | 463 | if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) { |
464 | - $sql .= ' ' . $criteria->renderWhere(); |
|
464 | + $sql .= ' '.$criteria->renderWhere(); |
|
465 | 465 | } |
466 | 466 | if (!$this->db->queryF($sql)) { |
467 | 467 | return false; |
@@ -21,61 +21,61 @@ |
||
21 | 21 | $moduleDirName = basename(dirname(dirname(__DIR__))); |
22 | 22 | $moduleDirNameUpper = strtoupper($moduleDirName); |
23 | 23 | |
24 | -define('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS', 'GD library support: '); |
|
25 | -define('CO_' . $moduleDirNameUpper . '_GDLIBVERSION', 'GD Library version: '); |
|
26 | -define('CO_' . $moduleDirNameUpper . '_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)"); |
|
27 | -define('CO_' . $moduleDirNameUpper . '_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)"); |
|
28 | -define('CO_' . $moduleDirNameUpper . '_IMAGEINFO', 'Server status'); |
|
29 | -define('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): '); |
|
30 | -define('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): '); |
|
31 | -define('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): '); |
|
32 | -define('CO_' . $moduleDirNameUpper . '_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> "); |
|
33 | -define('CO_' . $moduleDirNameUpper . '_OFF', "<span style='font-weight: bold;'>OFF</span>"); |
|
34 | -define('CO_' . $moduleDirNameUpper . '_ON', "<span style='font-weight: bold;'>ON</span>"); |
|
35 | -define('CO_' . $moduleDirNameUpper . '_SERVERPATH', 'Server path to XOOPS root: '); |
|
36 | -define('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS', 'Server uploads status: '); |
|
37 | -define('CO_' . $moduleDirNameUpper . '_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>"); |
|
38 | -define('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.'); |
|
24 | +define('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS', 'GD library support: '); |
|
25 | +define('CO_'.$moduleDirNameUpper.'_GDLIBVERSION', 'GD Library version: '); |
|
26 | +define('CO_'.$moduleDirNameUpper.'_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)"); |
|
27 | +define('CO_'.$moduleDirNameUpper.'_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)"); |
|
28 | +define('CO_'.$moduleDirNameUpper.'_IMAGEINFO', 'Server status'); |
|
29 | +define('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): '); |
|
30 | +define('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): '); |
|
31 | +define('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): '); |
|
32 | +define('CO_'.$moduleDirNameUpper.'_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> "); |
|
33 | +define('CO_'.$moduleDirNameUpper.'_OFF', "<span style='font-weight: bold;'>OFF</span>"); |
|
34 | +define('CO_'.$moduleDirNameUpper.'_ON', "<span style='font-weight: bold;'>ON</span>"); |
|
35 | +define('CO_'.$moduleDirNameUpper.'_SERVERPATH', 'Server path to XOOPS root: '); |
|
36 | +define('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS', 'Server uploads status: '); |
|
37 | +define('CO_'.$moduleDirNameUpper.'_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>"); |
|
38 | +define('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.'); |
|
39 | 39 | |
40 | -define('CO_' . $moduleDirNameUpper . '_PRINT', "<span style='font-weight: bold;'>Print</span>"); |
|
41 | -define('CO_' . $moduleDirNameUpper . '_PDF', "<span style='font-weight: bold;'>Create PDF</span>"); |
|
40 | +define('CO_'.$moduleDirNameUpper.'_PRINT', "<span style='font-weight: bold;'>Print</span>"); |
|
41 | +define('CO_'.$moduleDirNameUpper.'_PDF', "<span style='font-weight: bold;'>Create PDF</span>"); |
|
42 | 42 | |
43 | 43 | |
44 | -define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'"); |
|
45 | -define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED1', "Update failed - couldn't add new fields"); |
|
46 | -define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'"); |
|
47 | -define('CO_' . $moduleDirNameUpper . '_ERROR_COLUMN', 'Could not create column in database : %s'); |
|
48 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)'); |
|
49 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)'); |
|
50 | -define('CO_' . $moduleDirNameUpper . '_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module'); |
|
44 | +define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'"); |
|
45 | +define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED1', "Update failed - couldn't add new fields"); |
|
46 | +define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'"); |
|
47 | +define('CO_'.$moduleDirNameUpper.'_ERROR_COLUMN', 'Could not create column in database : %s'); |
|
48 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)'); |
|
49 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)'); |
|
50 | +define('CO_'.$moduleDirNameUpper.'_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module'); |
|
51 | 51 | |
52 | -define('CO_' . $moduleDirNameUpper . '_FOLDERS_DELETED_OK', 'Upload Folders have been deleted'); |
|
52 | +define('CO_'.$moduleDirNameUpper.'_FOLDERS_DELETED_OK', 'Upload Folders have been deleted'); |
|
53 | 53 | |
54 | 54 | // Error Msgs |
55 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH', 'Could not delete %s directory'); |
|
56 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_REMOVE', 'Could not delete %s'); |
|
57 | -define('CO_' . $moduleDirNameUpper . '_ERROR_NO_PLUGIN', 'Could not load plugin'); |
|
55 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH', 'Could not delete %s directory'); |
|
56 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_REMOVE', 'Could not delete %s'); |
|
57 | +define('CO_'.$moduleDirNameUpper.'_ERROR_NO_PLUGIN', 'Could not load plugin'); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | //Help |
61 | -define('CO_' . $moduleDirNameUpper . '_DIRNAME', basename(dirname(dirname(__DIR__)))); |
|
62 | -define('CO_' . $moduleDirNameUpper . '_HELP_HEADER', __DIR__.'/help/helpheader.tpl'); |
|
63 | -define('CO_' . $moduleDirNameUpper . '_BACK_2_ADMIN', 'Back to Administration of '); |
|
64 | -define('CO_' . $moduleDirNameUpper . '_OVERVIEW', 'Overview'); |
|
61 | +define('CO_'.$moduleDirNameUpper.'_DIRNAME', basename(dirname(dirname(__DIR__)))); |
|
62 | +define('CO_'.$moduleDirNameUpper.'_HELP_HEADER', __DIR__.'/help/helpheader.tpl'); |
|
63 | +define('CO_'.$moduleDirNameUpper.'_BACK_2_ADMIN', 'Back to Administration of '); |
|
64 | +define('CO_'.$moduleDirNameUpper.'_OVERVIEW', 'Overview'); |
|
65 | 65 | |
66 | 66 | //define('CO_' . $moduleDirNameUpper . '_HELP_DIR', __DIR__); |
67 | 67 | |
68 | 68 | //help multi-page |
69 | -define('CO_' . $moduleDirNameUpper . '_DISCLAIMER', 'Disclaimer'); |
|
70 | -define('CO_' . $moduleDirNameUpper . '_LICENSE', 'License'); |
|
71 | -define('CO_' . $moduleDirNameUpper . '_SUPPORT', 'Support'); |
|
69 | +define('CO_'.$moduleDirNameUpper.'_DISCLAIMER', 'Disclaimer'); |
|
70 | +define('CO_'.$moduleDirNameUpper.'_LICENSE', 'License'); |
|
71 | +define('CO_'.$moduleDirNameUpper.'_SUPPORT', 'Support'); |
|
72 | 72 | |
73 | 73 | //Sample Data |
74 | -define('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA', 'Import Sample Data (will delete ALL current data)'); |
|
75 | -define('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully'); |
|
76 | -define('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA', 'Export Tables to YAML'); |
|
77 | -define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', 'Show Sample Button?'); |
|
78 | -define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.'); |
|
79 | -define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA', 'Export DB Schema to YAML'); |
|
80 | -define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS', 'Export DB Schema to YAML was a success'); |
|
81 | -define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR', 'ERROR: Export of DB Schema to YAML failed'); |
|
74 | +define('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA', 'Import Sample Data (will delete ALL current data)'); |
|
75 | +define('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully'); |
|
76 | +define('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA', 'Export Tables to YAML'); |
|
77 | +define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', 'Show Sample Button?'); |
|
78 | +define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.'); |
|
79 | +define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA', 'Export DB Schema to YAML'); |
|
80 | +define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_SUCCESS', 'Export DB Schema to YAML was a success'); |
|
81 | +define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR', 'ERROR: Export of DB Schema to YAML failed'); |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | |
20 | 20 | use XoopsModules\Smartfaq\Constants; |
21 | 21 | |
22 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
23 | -require_once __DIR__ . '/admin_header.php'; |
|
22 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
23 | +require_once __DIR__.'/admin_header.php'; |
|
24 | 24 | |
25 | 25 | xoops_cp_header(); |
26 | 26 | |
@@ -76,34 +76,34 @@ discard block |
||
76 | 76 | $adminObject->addInfoBox(_AM_SF_INVENTORY); |
77 | 77 | |
78 | 78 | if ($totalcategories > 0) { |
79 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="category.php">' . _AM_SF_TOTALCAT . '</a><b>' . '</infolabel>', $totalcategories), '', 'Green'); |
|
79 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'.'<a href="category.php">'._AM_SF_TOTALCAT.'</a><b>'.'</infolabel>', $totalcategories), '', 'Green'); |
|
80 | 80 | } else { |
81 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SF_TOTALCAT . '</infolabel>', $totalcategories), '', 'Green'); |
|
81 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'._AM_SF_TOTALCAT.'</infolabel>', $totalcategories), '', 'Green'); |
|
82 | 82 | } |
83 | 83 | if ($totalasked > 0) { |
84 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_SF_TOTALASKED . '</a><b>' . '</infolabel>', $totalasked), '', 'Green'); |
|
84 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'.'<a href="main.php">'._AM_SF_TOTALASKED.'</a><b>'.'</infolabel>', $totalasked), '', 'Green'); |
|
85 | 85 | } else { |
86 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SF_TOTALASKED . '</infolabel>', $totalasked), '', 'Green'); |
|
86 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'._AM_SF_TOTALASKED.'</infolabel>', $totalasked), '', 'Green'); |
|
87 | 87 | } |
88 | 88 | if ($totalopened > 0) { |
89 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="question.php">' . _AM_SF_TOTALOPENED . '</a><b>' . '</infolabel>', $totalopened), '', 'Red'); |
|
89 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'.'<a href="question.php">'._AM_SF_TOTALOPENED.'</a><b>'.'</infolabel>', $totalopened), '', 'Red'); |
|
90 | 90 | } else { |
91 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SF_TOTALOPENED . '</infolabel>', $totalopened), '', 'Green'); |
|
91 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'._AM_SF_TOTALOPENED.'</infolabel>', $totalopened), '', 'Green'); |
|
92 | 92 | } |
93 | 93 | if ($totalsubmitted > 0) { |
94 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="category.php">' . _AM_SF_TOTALSUBMITTED . '</a><b>' . '</infolabel>', $totalsubmitted), '', 'Green'); |
|
94 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'.'<a href="category.php">'._AM_SF_TOTALSUBMITTED.'</a><b>'.'</infolabel>', $totalsubmitted), '', 'Green'); |
|
95 | 95 | } else { |
96 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SF_TOTALSUBMITTED . '</infolabel>', $totalsubmitted), '', 'Green'); |
|
96 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'._AM_SF_TOTALSUBMITTED.'</infolabel>', $totalsubmitted), '', 'Green'); |
|
97 | 97 | } |
98 | 98 | if ($totalpublished > 0) { |
99 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="faq.php">' . _AM_SF_TOTALPUBLISHED . '</a><b>' . '</infolabel>', $totalpublished), '', 'Green'); |
|
99 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'.'<a href="faq.php">'._AM_SF_TOTALPUBLISHED.'</a><b>'.'</infolabel>', $totalpublished), '', 'Green'); |
|
100 | 100 | } else { |
101 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SF_TOTALPUBLISHED . '</infolabel>', $totalpublished), '', 'Green'); |
|
101 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'._AM_SF_TOTALPUBLISHED.'</infolabel>', $totalpublished), '', 'Green'); |
|
102 | 102 | } |
103 | 103 | if ($totalnewanswers > 0) { |
104 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_SF_TOTALNEWANSWERS . '</a><b>' . '</infolabel>', $totalnewanswers), '', 'Red'); |
|
104 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'.'<a href="main.php">'._AM_SF_TOTALNEWANSWERS.'</a><b>'.'</infolabel>', $totalnewanswers), '', 'Red'); |
|
105 | 105 | } else { |
106 | - $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_SF_TOTALNEWANSWERS . '</infolabel>', $totalnewanswers), '', 'Green'); |
|
106 | + $adminObject->addInfoBoxLine(sprintf('<infolabel>'._AM_SF_TOTALNEWANSWERS.'</infolabel>', $totalnewanswers), '', 'Green'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | //---------------------- |
@@ -113,4 +113,4 @@ discard block |
||
113 | 113 | |
114 | 114 | echo $utility::getServerStats(); |
115 | 115 | |
116 | -require_once __DIR__ . '/admin_footer.php'; |
|
116 | +require_once __DIR__.'/admin_footer.php'; |
@@ -8,10 +8,10 @@ discard block |
||
8 | 8 | |
9 | 9 | use XoopsModules\Smartfaq; |
10 | 10 | |
11 | -require_once __DIR__ . '/admin_header.php'; |
|
12 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
|
11 | +require_once __DIR__.'/admin_header.php'; |
|
12 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; |
|
13 | 13 | |
14 | -if (! Smartfaq\Utility::userIsAdmin()) { |
|
14 | +if (!Smartfaq\Utility::userIsAdmin()) { |
|
15 | 15 | redirect_header('javascript:history.go(-1)', 1, _NOPERM); |
16 | 16 | } |
17 | 17 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // echo "<h3 style='color: #2F5376; '>"._AM_SF_PERMISSIONSADMIN."</h3>\n" ; |
40 | 40 | Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
41 | 41 | |
42 | - $result_view = $xoopsDB->query('SELECT categoryid, name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' '); |
|
42 | + $result_view = $xoopsDB->query('SELECT categoryid, name FROM '.$xoopsDB->prefix('smartfaq_categories').' '); |
|
43 | 43 | if ($xoopsDB->getRowsNum($result_view)) { |
44 | 44 | while (false !== ($myrow_view = $xoopsDB->fetchArray($result_view))) { |
45 | 45 | $item_list_view['cid'] = $myrow_view['categoryid']; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" |
54 | 54 | . _AM_SF_VIEW_CATS |
55 | 55 | . '</span>', 'admin/permissions.php'); |
56 | - $block_view[] = $item_list_view; |
|
56 | + $block_view[] = $item_list_view; |
|
57 | 57 | foreach ($block_view as $itemlists) { |
58 | 58 | $form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title'])); |
59 | 59 | } |
@@ -75,4 +75,4 @@ discard block |
||
75 | 75 | echo "<br>\n"; |
76 | 76 | } |
77 | 77 | |
78 | -require_once __DIR__ . '/admin_footer.php'; |
|
78 | +require_once __DIR__.'/admin_footer.php'; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use XoopsModules\Smartfaq; |
10 | 10 | use XoopsModules\Smartfaq\Constants; |
11 | 11 | |
12 | -require_once __DIR__ . '/header.php'; |
|
12 | +require_once __DIR__.'/header.php'; |
|
13 | 13 | |
14 | 14 | global $xoopsUser, $xoopsConfig, $xoopsModule; |
15 | 15 | /** @var Smartfaq\Helper $helper */ |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | switch ($op) { |
57 | 57 | case 'preview': |
58 | 58 | |
59 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
59 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
60 | 60 | |
61 | 61 | $faqObj = $faqHandler->create(); |
62 | 62 | $answerObj = $answerHandler->create(); |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | global $xoopsUser, $myts; |
92 | 92 | |
93 | 93 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
94 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
95 | - require_once __DIR__ . '/footer.php'; |
|
94 | + require_once XOOPS_ROOT_PATH.'/header.php'; |
|
95 | + require_once __DIR__.'/footer.php'; |
|
96 | 96 | |
97 | 97 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
98 | 98 | |
99 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
99 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
100 | 100 | $faq = $faqObj->toArray(null, $categoryObj, false); |
101 | 101 | $faq['categoryPath'] = $categoryObj->getCategoryPath(true); |
102 | 102 | $faq['answer'] = $answerObj->answer(); |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
110 | 110 | |
111 | 111 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
112 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
112 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO); |
|
113 | 113 | |
114 | - require_once __DIR__ . '/include/submit.inc.php'; |
|
114 | + require_once __DIR__.'/include/submit.inc.php'; |
|
115 | 115 | |
116 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
116 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
117 | 117 | |
118 | 118 | exit(); |
119 | 119 | break; |
120 | 120 | |
121 | 121 | case 'post': |
122 | 122 | |
123 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
123 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
124 | 124 | |
125 | 125 | $newFaqObj = $faqHandler->create(); |
126 | 126 | $newAnswerObj = $answerHandler->create(); |
@@ -177,14 +177,14 @@ discard block |
||
177 | 177 | $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp'])); |
178 | 178 | if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) { |
179 | 179 | foreach ($_POST['delete_tmp'] as $key) { |
180 | - unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0]); |
|
180 | + unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attachments_tmp[$key][0]); |
|
181 | 181 | unset($attachments_tmp[$key]); |
182 | 182 | } |
183 | 183 | } |
184 | 184 | } |
185 | 185 | if (count($attachments_tmp)) { |
186 | 186 | foreach ($attachments_tmp as $key => $attach) { |
187 | - if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0])) { |
|
187 | + if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attachments_tmp[$key][0])) { |
|
188 | 188 | $post_obj->setAttachment($attach[0], $attach[1], $attach[2]); |
189 | 189 | } |
190 | 190 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name'] |
195 | 195 | && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) { |
196 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'; |
|
196 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php'; |
|
197 | 197 | $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024; |
198 | 198 | $uploaddir = XOOPS_CACHE_PATH; |
199 | 199 | |
@@ -215,19 +215,19 @@ discard block |
||
215 | 215 | $uploader->setCheckMediaTypeByExt(); |
216 | 216 | |
217 | 217 | if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { |
218 | - $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_'; |
|
218 | + $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid().'_' : 'newbb_'; |
|
219 | 219 | $uploader->setPrefix($prefix); |
220 | 220 | if (!$uploader->upload()) { |
221 | - $error_message[] = $error_upload =& $uploader->getErrors(); |
|
221 | + $error_message[] = $error_upload = & $uploader->getErrors(); |
|
222 | 222 | } else { |
223 | 223 | if (is_file($uploader->getSavedDestination())) { |
224 | - if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $uploader->getSavedFileName())) { |
|
224 | + if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$uploader->getSavedFileName())) { |
|
225 | 225 | $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
226 | 226 | } |
227 | 227 | } |
228 | 228 | } |
229 | 229 | } else { |
230 | - $error_message[] = $error_upload =& $uploader->getErrors(); |
|
230 | + $error_message[] = $error_upload = & $uploader->getErrors(); |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } else { |
261 | 261 | // Subscribe the user to On Published notification, if requested |
262 | 262 | if (1 == $notifypub) { |
263 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
263 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
264 | 264 | $notificationHandler = xoops_getHandler('notification'); |
265 | 265 | $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
266 | 266 | } |
@@ -283,20 +283,20 @@ discard block |
||
283 | 283 | $categoryObj = $categoryHandler->create(); |
284 | 284 | |
285 | 285 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
286 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
287 | - require_once __DIR__ . '/footer.php'; |
|
286 | + require_once XOOPS_ROOT_PATH.'/header.php'; |
|
287 | + require_once __DIR__.'/footer.php'; |
|
288 | 288 | |
289 | 289 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
290 | 290 | $notifypub = 1; |
291 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
291 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
292 | 292 | $xoopsTpl->assign('whereInSection', $moduleName); |
293 | 293 | $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
294 | 294 | |
295 | 295 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
296 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
296 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO); |
|
297 | 297 | |
298 | - require_once __DIR__ . '/include/submit.inc.php'; |
|
298 | + require_once __DIR__.'/include/submit.inc.php'; |
|
299 | 299 | |
300 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
300 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
301 | 301 | break; |
302 | 302 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** @var Smartfaq\Helper $helper */ |
11 | 11 | $helper = Smartfaq\Helper::getInstance(); |
12 | 12 | |
13 | -require_once __DIR__ . '/header.php'; |
|
13 | +require_once __DIR__.'/header.php'; |
|
14 | 14 | |
15 | 15 | $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
16 | 16 | |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | } |
38 | 38 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
39 | 39 | |
40 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
41 | -require_once __DIR__ . '/footer.php'; |
|
40 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
41 | +require_once __DIR__.'/footer.php'; |
|
42 | 42 | |
43 | 43 | // At which record shall we start |
44 | 44 | $start = \Xmf\Request::getInt('start', 0, 'GET'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | $lastfaqsize = (int)$helper->getConfig('lastfaqsize'); |
80 | 80 | // Creating the sub-categories objects that belong to the selected category |
81 | -$subcatsObj =& $categoryHandler->getCategories(0, 0, $categoryid); |
|
81 | +$subcatsObj = & $categoryHandler->getCategories(0, 0, $categoryid); |
|
82 | 82 | $total_subcats = count($subcatsObj); |
83 | 83 | $total_faqs = 0; |
84 | 84 | if (0 != $total_subcats) { |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
89 | 89 | if (isset($last_qnaObj[$subcat_id])) { |
90 | 90 | $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
91 | - $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
91 | + $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]); |
95 | 95 | $subcats[$subcat_id] = $subcatsObj[$i]->toArray(); |
96 | - $total_faqs += $totalQnas[$subcat_id]; |
|
96 | + $total_faqs += $totalQnas[$subcat_id]; |
|
97 | 97 | //}replacé ligne 92 |
98 | 98 | } |
99 | 99 | $xoopsTpl->assign('subcats', $subcats); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | $memberHandler = xoops_getHandler('member'); |
119 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
119 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
120 | 120 | // Adding the Q&As of the selected category |
121 | 121 | foreach ($faqsObj as $iValue) { |
122 | 122 | $faq = $iValue->toArray(null, $categoryObj); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | if (isset($last_qnaObj) && $last_qnaObj) { |
144 | 144 | $category['last_faqid'] = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid'); |
145 | - $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>'; |
|
145 | + $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>'; |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
@@ -167,26 +167,26 @@ discard block |
||
167 | 167 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
168 | 168 | |
169 | 169 | // The Navigation Bar |
170 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
171 | -$pagenav = new \XoopsPageNav($thiscategory_faqcount, $helper->getConfig('indexperpage'), $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
170 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
171 | +$pagenav = new \XoopsPageNav($thiscategory_faqcount, $helper->getConfig('indexperpage'), $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
172 | 172 | if (1 == $helper->getConfig('useimagenavpage')) { |
173 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
173 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
174 | 174 | } else { |
175 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
175 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | $xoopsTpl->assign('category', $category); |
179 | 179 | |
180 | 180 | // Page Title Hack by marcan |
181 | 181 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
182 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
182 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
183 | 183 | // End Page Title Hack by marcan |
184 | 184 | |
185 | 185 | //code to include smartie |
186 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
187 | - require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
186 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
187 | + require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
188 | 188 | $xoopsTpl->assign('smarttie', 1); |
189 | 189 | } |
190 | 190 | //end code for smarttie |
191 | 191 | |
192 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
192 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** @var Smartfaq\Helper $helper */ |
11 | 11 | $helper = Smartfaq\Helper::getInstance(); |
12 | 12 | |
13 | -require_once __DIR__ . '/header.php'; |
|
13 | +require_once __DIR__.'/header.php'; |
|
14 | 14 | |
15 | 15 | $faqid = \Xmf\Request::getInt('faqid', 0, 'GET'); |
16 | 16 | |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | $faqObj->updateCounter(); |
50 | 50 | } |
51 | 51 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_faq.tpl'; |
52 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
53 | -require_once __DIR__ . '/footer.php'; |
|
52 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
53 | +require_once __DIR__.'/footer.php'; |
|
54 | 54 | |
55 | 55 | $faq = $faqObj->toArray(null, $categoryObj, false); |
56 | 56 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $xoopsTpl->assign('display_categoryname', false); |
86 | 86 | |
87 | 87 | $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes')); |
88 | -$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid')); |
|
88 | +$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqObj->getVar('faqid')); |
|
89 | 89 | $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY); |
90 | 90 | $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY); |
91 | 91 | $xoopsTpl->assign('faqid', $faqObj->getVar('faqid')); |
@@ -101,19 +101,19 @@ discard block |
||
101 | 101 | |
102 | 102 | // Page Title Hack by marcan |
103 | 103 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
104 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']); |
|
104 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']); |
|
105 | 105 | // End Page Title Hack by marcan |
106 | 106 | |
107 | 107 | // Include the comments if the selected FAQ supports comments |
108 | 108 | if (1 == $faqObj->cancomment()) { |
109 | - require_once XOOPS_ROOT_PATH . '/include/comment_view.php'; |
|
109 | + require_once XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | //code to include smartie |
113 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
114 | - require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
113 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
114 | + require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
115 | 115 | $xoopsTpl->assign('smarttie', 1); |
116 | 116 | } |
117 | 117 | //end code for smarttie |
118 | 118 | |
119 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
119 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | use XoopsModules\Smartfaq\Constants; |
11 | 11 | |
12 | 12 | |
13 | -require_once __DIR__ . '/header.php'; |
|
13 | +require_once __DIR__.'/header.php'; |
|
14 | 14 | |
15 | 15 | global $xoopsConfig, $xoopsModule; |
16 | 16 | /** @var Smartfaq\Helper $helper */ |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
51 | 51 | |
52 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
53 | -require_once __DIR__ . '/footer.php'; |
|
52 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
53 | +require_once __DIR__.'/footer.php'; |
|
54 | 54 | |
55 | 55 | //get all categories for future reference |
56 | 56 | $allcategories = $categoryHandler->getObjects(null, true); |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
73 | 73 | if (isset($last_qnaObj[$subcat_id])) { |
74 | 74 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
75 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
75 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
76 | 76 | } |
77 | 77 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
78 | 78 | $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true); |
79 | - $total += $totalQnas[$subcat_id]; |
|
79 | + $total += $totalQnas[$subcat_id]; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | $memberHandler = xoops_getHandler('member'); |
111 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
111 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
112 | 112 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
113 | 113 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
114 | 114 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | // Language constants |
124 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
124 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
125 | 125 | $xoopsTpl->assign([ |
126 | 126 | 'lang_on' => _MD_SF_ON, |
127 | 127 | 'lang_postedby' => _MD_SF_POSTEDBY, |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | 'lang_hits' => _MD_SF_HITS |
132 | 132 | ]); |
133 | 133 | |
134 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
134 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
135 | 135 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
136 | 136 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($helper->getConfig('openquestionintromsg'), 1)); |
137 | 137 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION); |
140 | 140 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
141 | 141 | $xoopsTpl->assign('sectionname', $moduleName); |
142 | -$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION); |
|
142 | +$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION); |
|
143 | 143 | |
144 | 144 | $xoopsTpl->assign('displayFull', false); |
145 | 145 | $xoopsTpl->assign('displaylastfaqs', $helper->getConfig('displaylastfaqs')); |
@@ -155,25 +155,25 @@ discard block |
||
155 | 155 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
156 | 156 | |
157 | 157 | // Category Navigation Bar |
158 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
158 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
159 | 159 | $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('catperpage'), $catstart, 'catstart', ''); |
160 | 160 | if (1 == $helper->getConfig('useimagenavpage')) { |
161 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
161 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
162 | 162 | } else { |
163 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
163 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | // FAQ Navigation Bar |
167 | 167 | $pagenav = new \XoopsPageNav($totalFaqs, $helper->getConfig('indexperpage'), $start, 'start', ''); |
168 | 168 | if (1 == $helper->getConfig('useimagenavpage')) { |
169 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
169 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
170 | 170 | } else { |
171 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
171 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | // Page Title Hack by marcan |
175 | 175 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
176 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name')); |
|
176 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name')); |
|
177 | 177 | // End Page Title Hack by marcan |
178 | 178 | |
179 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
179 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | /** @var Smartfaq\Helper $helper */ |
12 | 12 | $helper = Smartfaq\Helper::getInstance(); |
13 | 13 | |
14 | -require_once __DIR__ . '/header.php'; |
|
14 | +require_once __DIR__.'/header.php'; |
|
15 | 15 | |
16 | 16 | // At which record shall we start for the Categories |
17 | 17 | $catstart = \Xmf\Request::getInt('catstart', 0, 'GET'); |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | |
45 | 45 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
46 | 46 | |
47 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
48 | -require_once __DIR__ . '/footer.php'; |
|
47 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
48 | +require_once __DIR__.'/footer.php'; |
|
49 | 49 | |
50 | 50 | // Creating the categories objects |
51 | -$categoriesObj =& $categoryHandler->getCategories($helper->getConfig('catperpage'), $catstart); |
|
51 | +$categoriesObj = & $categoryHandler->getCategories($helper->getConfig('catperpage'), $catstart); |
|
52 | 52 | // If no categories are found, exit |
53 | 53 | $totalCategoriesOnPage = count($categoriesObj); |
54 | 54 | if (0 == $totalCategoriesOnPage) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
79 | 79 | if (isset($last_qnaObj[$subcat_id])) { |
80 | 80 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
81 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
81 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
82 | 82 | } |
83 | 83 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
84 | 84 | if ($helper->getConfig('displaysubcatonindex')) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if ($total > 0) { |
97 | 97 | if (isset($last_qnaObj[$cat_id])) { |
98 | 98 | $category->setVar('last_faqid', $last_qnaObj[$cat_id]->getVar('faqid')); |
99 | - $category->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$cat_id]->getVar('faqid') . "'>" . $last_qnaObj[$cat_id]->question($lastfaqsize) . '</a>'); |
|
99 | + $category->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$cat_id]->getVar('faqid')."'>".$last_qnaObj[$cat_id]->question($lastfaqsize).'</a>'); |
|
100 | 100 | } |
101 | 101 | $category->setVar('faqcount', $total); |
102 | 102 | if (!isset($categories[$cat_id])) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | $memberHandler = xoops_getHandler('member'); |
138 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
138 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
139 | 139 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
140 | 140 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
141 | 141 | |
@@ -161,14 +161,14 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | // Language constants |
164 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
164 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
165 | 165 | $xoopsTpl->assign('whereInSection', $moduleName); |
166 | 166 | $xoopsTpl->assign('displaysubcatonindex', $helper->getConfig('displaysubcatonindex')); |
167 | 167 | $xoopsTpl->assign('displaylastfaqs', $helper->getConfig('displaylastfaqs')); |
168 | 168 | $xoopsTpl->assign('display_categoryname', true); |
169 | 169 | $xoopsTpl->assign('displayFull', 'full' === $helper->getConfig('displaytype')); |
170 | 170 | |
171 | -$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD . ' ' . $moduleName); |
|
171 | +$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD.' '.$moduleName); |
|
172 | 172 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($helper->getConfig('indexwelcomemsg'), 1)); |
173 | 173 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_SMARTFAQS); |
174 | 174 | $xoopsTpl->assign('lang_home', _MD_SF_HOME); |
@@ -187,20 +187,20 @@ discard block |
||
187 | 187 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
188 | 188 | |
189 | 189 | // Category Navigation Bar |
190 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
190 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
191 | 191 | $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('catperpage'), $catstart, 'catstart', ''); |
192 | 192 | if (1 == $helper->getConfig('useimagenavpage')) { |
193 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
193 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
194 | 194 | } else { |
195 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
195 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | // FAQ Navigation Bar |
199 | 199 | $pagenav = new \XoopsPageNav($totalFaqs, $helper->getConfig('indexperpage'), $start, 'start', ''); |
200 | 200 | if (1 == $helper->getConfig('useimagenavpage')) { |
201 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
201 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
202 | 202 | } else { |
203 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
203 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | // Page Title Hack by marcan |
@@ -208,4 +208,4 @@ discard block |
||
208 | 208 | $xoopsTpl->assign('xoops_pagetitle', $module_name); |
209 | 209 | // End Page Title Hack by marcan |
210 | 210 | |
211 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
211 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |