This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
|||||||||||
2 | /* |
|||||||||||
3 | You may not change or alter any portion of this comment or credits |
|||||||||||
4 | of supporting developers from this source code or any supporting source code |
|||||||||||
5 | which is considered copyrighted (c) material of the original comment or credit authors. |
|||||||||||
6 | ||||||||||||
7 | This program is distributed in the hope that it will be useful, |
|||||||||||
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||||||||||
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|||||||||||
10 | */ |
|||||||||||
11 | ||||||||||||
12 | /** |
|||||||||||
13 | * Alumni module for Xoops |
|||||||||||
14 | * |
|||||||||||
15 | * @copyright XOOPS Project https://xoops.org/ |
|||||||||||
16 | * @license GPL 2.0 or later |
|||||||||||
17 | * @package alumni |
|||||||||||
18 | * @since 2.6.x |
|||||||||||
19 | * @author John Mordo (jlm69) |
|||||||||||
20 | */ |
|||||||||||
21 | ||||||||||||
22 | use Xoops\Core\Request; |
|||||||||||
23 | ||||||||||||
24 | include __DIR__ . '/header.php'; |
|||||||||||
25 | ||||||||||||
26 | $moduleDirName = basename(__DIR__); |
|||||||||||
27 | $main_lang = '_MA_' . strtoupper($moduleDirName); |
|||||||||||
0 ignored issues
–
show
|
||||||||||||
28 | $myts = MyTextSanitizer::getInstance(); |
|||||||||||
29 | $xoops = Xoops::getInstance(); |
|||||||||||
30 | $module_id = $xoops->module->getVar('mid'); |
|||||||||||
0 ignored issues
–
show
$module_id does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
31 | ||||||||||||
32 | $groups = '3'; |
|||||||||||
33 | if (is_object($xoops->user)) { |
|||||||||||
34 | $groups = $xoops->user->getGroups(); |
|||||||||||
35 | } |
|||||||||||
36 | //$gperm_handler = $xoops->getHandler('groupperm'); |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
64% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
37 | $perm_itemid = 0; |
|||||||||||
0 ignored issues
–
show
$perm_itemid does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
38 | if (isset($_POST['item_id'])) { |
|||||||||||
39 | $perm_itemid = (int)$_POST['item_id']; |
|||||||||||
0 ignored issues
–
show
$perm_itemid does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
40 | } |
|||||||||||
41 | //If no access |
|||||||||||
42 | View Code Duplication | if (!$gpermHandler->checkRight('' . $moduleDirName . '_view', $perm_itemid, $groups, $module_id)) { |
||||||||||
0 ignored issues
–
show
$perm_itemid does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
||||||||||||
43 | $xoops->redirect(XOOPS_URL . '/index.php', 3, XoopsLocale::E_NO_ACCESS_PERMISSION); |
|||||||||||
44 | exit(); |
|||||||||||
45 | } |
|||||||||||
46 | $prem_perm = '1'; |
|||||||||||
0 ignored issues
–
show
$prem_perm does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
47 | if (!$gpermHandler->checkRight('' . $moduleDirName . '_premium', $perm_itemid, $groups, $module_id)) { |
|||||||||||
0 ignored issues
–
show
$perm_itemid does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
48 | $prem_perm = '0'; |
|||||||||||
0 ignored issues
–
show
$prem_perm does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
49 | } |
|||||||||||
50 | ||||||||||||
51 | $alumni = Alumni::getInstance(); |
|||||||||||
52 | ||||||||||||
53 | $gpermHandler = $xoops->getHandlerGroupPermission(); |
|||||||||||
54 | ||||||||||||
55 | // $alumni_user = $gperm_handler->getItemIds('alumni_view', $xoops->user->getGroups(), $module_id); |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
62% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
56 | // $alumni_premium = $gperm_handler->getItemIds('alumni_submit', $xoops->user->getGroups(), $module_id); |
|||||||||||
57 | ||||||||||||
58 | // if (!$alumni_user) { |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
52% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
59 | // $xoops->redirect(XOOPS_URL . "/user.php", 3, _NOPERM); |
|||||||||||
60 | // } |
|||||||||||
61 | $totalCategories = $alumni->getCategoryHandler()->getCategoriesCount(0); |
|||||||||||
62 | ||||||||||||
63 | // if there ain't no category to display, let's get out of here |
|||||||||||
64 | if (0 == $totalCategories) { |
|||||||||||
65 | $xoops->redirect(\XoopsBaseConfig::get('url'), 12, _NOPERM); |
|||||||||||
66 | } |
|||||||||||
67 | ||||||||||||
68 | $xoops->header('module:alumni/alumni_index.tpl'); |
|||||||||||
69 | Xoops::getInstance()->header(); |
|||||||||||
70 | $xoops->tpl()->assign('xmid', $xoopsModule->getVar('mid')); |
|||||||||||
71 | $xoops->tpl()->assign('add_from', AlumniLocale::ALUMNI_LISTINGS . ' ' . $xoopsConfig['sitename']); |
|||||||||||
72 | $xoops->tpl()->assign('add_from_sitename', $xoopsConfig['sitename']); |
|||||||||||
73 | $xoops->tpl()->assign('add_from_title', AlumniLocale::ALUMNI_LISTINGS); |
|||||||||||
74 | $xoops->tpl()->assign('class_of', AlumniLocale::CLASSOF); |
|||||||||||
75 | $xoops->tpl()->assign('front_intro', AlumniLocale::FINTRO); |
|||||||||||
76 | ||||||||||||
77 | if ('1' == $xoops->getModuleConfig('' . $moduleDirName . '_offer_search')) { |
|||||||||||
78 | $xoops->tpl()->assign('offer_search', true); |
|||||||||||
79 | $xoops->tpl()->assign('search_listings', AlumniLocale::SEARCH_LISTINGS); |
|||||||||||
80 | $xoops->tpl()->assign('match', AlumniLocale::MATCH); |
|||||||||||
81 | $xoops->tpl()->assign('all_words', AlumniLocale::ALL_WORDS); |
|||||||||||
82 | $xoops->tpl()->assign('any_words', AlumniLocale::ANY_WORDS); |
|||||||||||
83 | $xoops->tpl()->assign('exact_match', AlumniLocale::EXACT_MATCH); |
|||||||||||
84 | $xoops->tpl()->assign('byyear', AlumniLocale::BYYEAR); |
|||||||||||
85 | $xoops->tpl()->assign('bycategory', AlumniLocale::BYCATEGORY); |
|||||||||||
86 | $xoops->tpl()->assign('keywords', XoopsLocale::KEYWORDS); |
|||||||||||
87 | $xoops->tpl()->assign('search', XoopsLocale::SEARCH); |
|||||||||||
88 | ||||||||||||
89 | $categoriesHandler = $xoops->getModuleHandler('category', 'alumni'); |
|||||||||||
90 | ||||||||||||
91 | $alumni = Alumni::getInstance(); |
|||||||||||
92 | $helper = Xoops::getModuleHelper('alumni'); |
|||||||||||
93 | $module_id = $helper->getModule()->getVar('mid'); |
|||||||||||
0 ignored issues
–
show
$module_id does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
94 | $groups = $xoops->isUser() ? $xoops->user->getGroups() : '3'; |
|||||||||||
95 | $alumni_ids = $xoops->getHandlerGroupPermission()->getItemIds('alumni_view', $groups, $module_id); |
|||||||||||
0 ignored issues
–
show
$alumni_ids does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
96 | $cat_criteria = new CriteriaCompo(); |
|||||||||||
0 ignored issues
–
show
$cat_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
97 | $cat_criteria->add(new Criteria('cid', '(' . implode(', ', $alumni_ids) . ')', 'IN')); |
|||||||||||
0 ignored issues
–
show
$cat_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
98 | $cat_criteria->setOrder('' . $xoops->getModuleConfig('' . $moduleDirName . '_csortorder') . ''); |
|||||||||||
0 ignored issues
–
show
$cat_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
99 | $numcat = $categoriesHandler->getCount($cat_criteria); |
|||||||||||
0 ignored issues
–
show
$cat_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
100 | $category_arr = $categoriesHandler->getAll($cat_criteria); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
101 | ||||||||||||
102 | foreach (array_keys($category_arr) as $i) { |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
103 | $cid = $category_arr[$i]->getVar('cid'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
104 | $pid = $category_arr[$i]->getVar('pid'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
105 | $title = $category_arr[$i]->getVar('title', 'e'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
106 | $img = $category_arr[$i]->getVar('img'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
107 | $order = $category_arr[$i]->getVar('ordre'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
108 | $affprice = $category_arr[$i]->getVar('affprice'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
109 | $title = $myts->htmlSpecialChars($title); |
|||||||||||
110 | $xoops->tpl()->assign('title', $title); |
|||||||||||
111 | } |
|||||||||||
112 | ||||||||||||
113 | include_once XOOPS_ROOT_PATH . "/modules/{$moduleDirName}/class/alumni_tree.php"; |
|||||||||||
114 | $cattree = new AlumniObjectTree($category_arr, 'cid', 'pid'); |
|||||||||||
0 ignored issues
–
show
$category_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
115 | ||||||||||||
116 | $categories = $alumni->getCategoryHandler()->getCategoriesForSearch(); |
|||||||||||
117 | $by_cat = Request::getInt('by_cat'); |
|||||||||||
0 ignored issues
–
show
$by_cat does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
118 | $select_category = '<select name="by_cat">'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
119 | $select_category .= '<option value="all"'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
120 | if (empty($by_cat) || 0 == count($by_cat)) { |
|||||||||||
0 ignored issues
–
show
$by_cat does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
121 | $select_category .= 'selected="selected"'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
122 | } |
|||||||||||
123 | $select_category .= '>' . XoopsLocale::ALL . '</option>'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
124 | foreach ($categories as $cid => $title) { |
|||||||||||
125 | $select_category .= '<option value="' . $cid . '"'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
126 | if ($cid = $by_cat) { |
|||||||||||
0 ignored issues
–
show
$by_cat does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
127 | $select_category .= 'selected="selected"'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
128 | } |
|||||||||||
129 | $select_category .= '>' . $title . '</option>'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
130 | } |
|||||||||||
131 | $select_category .= '</select>'; |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
132 | $xoops->tpl()->assign('category_select', $select_category); |
|||||||||||
0 ignored issues
–
show
$select_category does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
133 | } |
|||||||||||
134 | ||||||||||||
135 | $index_banner = $xoops->getBanner(); |
|||||||||||
0 ignored issues
–
show
$index_banner does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
136 | $xoops->tpl()->assign('index_banner', $index_banner); |
|||||||||||
0 ignored issues
–
show
$index_banner does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
137 | $index_code_place = $xoops->getModuleConfig('' . $moduleDirName . '_code_place'); |
|||||||||||
0 ignored issues
–
show
$index_code_place does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
138 | $use_extra_code = $xoops->getModuleConfig('' . $moduleDirName . '_use_code'); |
|||||||||||
0 ignored issues
–
show
$use_extra_code does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
139 | $use_banner = $xoops->getModuleConfig('' . $moduleDirName . '_use_banner'); |
|||||||||||
0 ignored issues
–
show
$use_banner does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
140 | $index_extra_code = $xoops->getModuleConfig('' . $moduleDirName . '_index_code'); |
|||||||||||
0 ignored issues
–
show
$index_extra_code does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
141 | $xoops->tpl()->assign('use_extra_code', $use_extra_code); |
|||||||||||
0 ignored issues
–
show
$use_extra_code does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
142 | $xoops->tpl()->assign('use_banner', $use_banner); |
|||||||||||
0 ignored issues
–
show
$use_banner does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
143 | $xoops->tpl()->assign('index_extra_code', '<html>' . $index_extra_code . '</html>'); |
|||||||||||
0 ignored issues
–
show
$index_extra_code does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
144 | $xoops->tpl()->assign('index_code_place', $index_code_place); |
|||||||||||
0 ignored issues
–
show
$index_code_place does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
145 | ||||||||||||
146 | $xoops->tpl()->assign('moduleDirName', $moduleDirName); |
|||||||||||
147 | ||||||||||||
148 | $cats = $cattree->alumni_getFirstChild(0, $alumni_ids); |
|||||||||||
0 ignored issues
–
show
$alumni_ids does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
149 | $count = 0; |
|||||||||||
150 | ||||||||||||
151 | foreach (array_keys($cats) as $i) { |
|||||||||||
152 | if (in_array($cats[$i]->getVar('cid'), $alumni_ids)) { |
|||||||||||
0 ignored issues
–
show
$alumni_ids does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
153 | $cat_img = $cats[$i]->getVar('img'); |
|||||||||||
0 ignored issues
–
show
$cat_img does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
154 | if ('http://' !== $cat_img) { |
|||||||||||
0 ignored issues
–
show
$cat_img does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
155 | $cat_img = XOOPS_URL . "/modules/{$moduleDirName}/assets/images/cat/$cat_img"; |
|||||||||||
0 ignored issues
–
show
$cat_img does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
156 | } else { |
|||||||||||
157 | $cat_img = ''; |
|||||||||||
0 ignored issues
–
show
$cat_img does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
158 | } |
|||||||||||
159 | ||||||||||||
160 | $listingHandler = $xoops->getModuleHandler('listing', 'alumni'); |
|||||||||||
161 | $count_criteria = new CriteriaCompo(); |
|||||||||||
0 ignored issues
–
show
$count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
162 | $count_criteria->add(new Criteria('cid', $cats[$i]->getVar('cid'), '=')); |
|||||||||||
0 ignored issues
–
show
$count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
163 | $count_criteria->add(new Criteria('valid', 1, '=')); |
|||||||||||
0 ignored issues
–
show
$count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
164 | $count_criteria->add(new Criteria('cid', '(' . implode(', ', $alumni_ids) . ')', 'IN')); |
|||||||||||
0 ignored issues
–
show
$count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
165 | $listings = $listingHandler->getCount($count_criteria); |
|||||||||||
0 ignored issues
–
show
$count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
166 | ||||||||||||
167 | $publishdate = isset($listings['date'][$cats[$i]->getVar('cid')]) ? $listings['date'][$cats[$i]->getVar('cid')] : 0; |
|||||||||||
168 | $all_subcats = $cattree->alumni_getAllChild($cats[$i]->getVar('cid')); |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
169 | if (count($all_subcats) > 0) { |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
170 | foreach (array_keys($all_subcats) as $k) { |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
171 | if (in_array($all_subcats[$k]->getVar('cid'), $alumni_ids)) { |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
172 | $publishdate = (isset($listings['date'][$all_subcats[$k]->getVar('cid')]) and $listings['date'][$all_subcats[$k]->getVar('cid')] > $publishdate) ? $listings['date'][$all_subcats[$k]->getVar('cid')] : $publishdate; |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() Comprehensibility
Best Practice
introduced
by
Using logical operators such as
and instead of && is generally not recommended.
PHP has two types of connecting operators (logical operators, and boolean operators):
The difference between these is the order in which they are executed. In most cases,
you would want to use a boolean operator like Let’s take a look at a few examples: // Logical operators have lower precedence:
$f = false or true;
// is executed like this:
($f = false) or true;
// Boolean operators have higher precedence:
$f = false || true;
// is executed like this:
$f = (false || true);
Logical Operators are used for Control-FlowOne case where you explicitly want to use logical operators is for control-flow such as this: $x === 5
or die('$x must be 5.');
// Instead of
if ($x !== 5) {
die('$x must be 5.');
}
Since // The following is currently a parse error.
$x === 5
or throw new RuntimeException('$x must be 5.');
These limitations lead to logical operators rarely being of use in current PHP code. ![]() |
||||||||||||
173 | } |
|||||||||||
174 | } |
|||||||||||
175 | } |
|||||||||||
176 | } |
|||||||||||
177 | $subcategories = []; |
|||||||||||
178 | ||||||||||||
179 | $count++; |
|||||||||||
180 | ||||||||||||
181 | $listingHandler = $xoops->getModuleHandler('listing', 'alumni'); |
|||||||||||
182 | $listing_criteria = new CriteriaCompo(); |
|||||||||||
0 ignored issues
–
show
$listing_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
183 | $listing_criteria->add(new Criteria('cid', $cats[$i]->getVar('cid'), '=')); |
|||||||||||
0 ignored issues
–
show
$listing_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
184 | $listing_criteria->add(new Criteria('valid', 1, '=')); |
|||||||||||
0 ignored issues
–
show
$listing_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
185 | $listing_criteria->add(new Criteria('cid', '(' . implode(', ', $alumni_ids) . ')', 'IN')); |
|||||||||||
0 ignored issues
–
show
$listing_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
186 | $alumni_count = $listingHandler->getCount($listing_criteria); |
|||||||||||
0 ignored issues
–
show
$alumni_count does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
187 | ||||||||||||
188 | if (count($all_subcats) > 0) { |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
189 | foreach (array_keys($all_subcats) as $k) { |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
190 | if (in_array($all_subcats[$k]->getVar('cid'), $alumni_ids)) { |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
191 | $listingHandler = $xoops->getModuleHandler('listing', 'alumni'); |
|||||||||||
192 | $sub_count_criteria = new CriteriaCompo(); |
|||||||||||
0 ignored issues
–
show
$sub_count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
193 | $sub_count_criteria->add(new Criteria('cid', $all_subcats[$k]->getVar('cid'), '=')); |
|||||||||||
0 ignored issues
–
show
$sub_count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
194 | $sub_count_criteria->add(new Criteria('valid', 1, '=')); |
|||||||||||
0 ignored issues
–
show
$sub_count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
195 | $sub_count_criteria->add(new Criteria('cid', '(' . implode(', ', $alumni_ids) . ')', 'IN')); |
|||||||||||
0 ignored issues
–
show
$sub_count_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
196 | $alumni_subcount = $listingHandler->getCount($sub_count_criteria); |
|||||||||||
0 ignored issues
–
show
$alumni_subcount does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
197 | ||||||||||||
198 | if (1 == $xoops->getModuleConfig('alumni_showsubcat') and $all_subcats[$k]->getVar('pid') == $cats[$i]->getVar('cid')) { // if we are collecting subcat info for displaying, and this subcat is a first level child... |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() Comprehensibility
Best Practice
introduced
by
Using logical operators such as
and instead of && is generally not recommended.
PHP has two types of connecting operators (logical operators, and boolean operators):
The difference between these is the order in which they are executed. In most cases,
you would want to use a boolean operator like Let’s take a look at a few examples: // Logical operators have lower precedence:
$f = false or true;
// is executed like this:
($f = false) or true;
// Boolean operators have higher precedence:
$f = false || true;
// is executed like this:
$f = (false || true);
Logical Operators are used for Control-FlowOne case where you explicitly want to use logical operators is for control-flow such as this: $x === 5
or die('$x must be 5.');
// Instead of
if ($x !== 5) {
die('$x must be 5.');
}
Since // The following is currently a parse error.
$x === 5
or throw new RuntimeException('$x must be 5.');
These limitations lead to logical operators rarely being of use in current PHP code. ![]() |
||||||||||||
199 | $subcategories[] = ['id' => $all_subcats[$k]->getVar('cid'), 'title' => $all_subcats[$k]->getVar('title'), 'count' => $alumni_subcount]; |
|||||||||||
0 ignored issues
–
show
$all_subcats does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
200 | } |
|||||||||||
201 | } |
|||||||||||
202 | } |
|||||||||||
203 | } |
|||||||||||
204 | ||||||||||||
205 | if (1 != $xoops->getModuleConfig('alumni_showsubcat')) { |
|||||||||||
206 | unset($subcategories); |
|||||||||||
207 | ||||||||||||
208 | $xoops->tpl()->append('categories', [ |
|||||||||||
209 | 'image' => $cat_img, |
|||||||||||
0 ignored issues
–
show
$cat_img does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
210 | 'id' => (int)$cats[$i]->getVar('cid'), |
|||||||||||
211 | 'title' => $cats[$i]->getVar('title'), |
|||||||||||
212 | 'totalcats' => $alumni_count, |
|||||||||||
0 ignored issues
–
show
$alumni_count does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
213 | 'count' => $count |
|||||||||||
214 | ]); |
|||||||||||
215 | } else { |
|||||||||||
216 | $xoops->tpl()->append('categories', [ |
|||||||||||
217 | 'image' => $cat_img, |
|||||||||||
0 ignored issues
–
show
$cat_img does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
218 | 'id' => (int)$cats[$i]->getVar('cid'), |
|||||||||||
219 | 'title' => $cats[$i]->getVar('title'), |
|||||||||||
220 | 'subcategories' => $subcategories, |
|||||||||||
221 | 'totalcats' => $alumni_count, |
|||||||||||
0 ignored issues
–
show
$alumni_count does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
222 | 'count' => $count |
|||||||||||
223 | ]); |
|||||||||||
224 | } |
|||||||||||
225 | } |
|||||||||||
226 | $xoops->tpl()->assign('total_confirm', ''); |
|||||||||||
227 | ||||||||||||
228 | $listingHandler = $xoops->getModuleHandler('listing', 'alumni'); |
|||||||||||
229 | ||||||||||||
230 | $xoops->tpl()->assign('moderated', false); |
|||||||||||
231 | if ('1' == $xoops->getModuleConfig('' . $moduleDirName . '_moderated')) { |
|||||||||||
232 | $xoops->tpl()->assign('moderated', true); |
|||||||||||
233 | $moderate_criteria = new CriteriaCompo(); |
|||||||||||
0 ignored issues
–
show
$moderate_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
234 | $moderate_criteria->add(new Criteria('valid', 0, '=')); |
|||||||||||
0 ignored issues
–
show
$moderate_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
235 | $moderate_criteria->add(new Criteria('cid', '(' . implode(', ', $alumni_ids) . ')', 'IN')); |
|||||||||||
0 ignored issues
–
show
$moderate_criteria does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
236 | $moderate_rows = $listingHandler->getCount($moderate_criteria); |
|||||||||||
0 ignored issues
–
show
$moderate_rows does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
237 | $moderate_arr = $listingHandler->getAll($moderate_criteria); |
|||||||||||
0 ignored issues
–
show
$moderate_arr does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
238 | ||||||||||||
239 | if ($xoops->isUser()) { |
|||||||||||
240 | if ($xoops->user->isAdmin()) { |
|||||||||||
241 | $xoops->tpl()->assign('user_admin', true); |
|||||||||||
242 | ||||||||||||
243 | $xoops->tpl()->assign('admin_block', AlumniLocale::ADMIN_PANEL); |
|||||||||||
244 | View Code Duplication | if (0 == $moderate_rows) { |
||||||||||
0 ignored issues
–
show
$moderate_rows does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
||||||||||||
245 | $xoops->tpl()->assign('confirm_alumni', AlumniLocale::NO_LISTING_TO_APPROVE); |
|||||||||||
246 | } else { |
|||||||||||
247 | $xoops->tpl()->assign('confirm_alumni', AlumniLocale::THERE_ARE . " $moderate_rows " . AlumniLocale::WAITING . '<br><a href="admin/alumni.php?op=list_moderated">' . constant($main_lang . '_SEEIT') . '</a>'); |
|||||||||||
0 ignored issues
–
show
$moderate_rows does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
248 | } |
|||||||||||
249 | $xoops->tpl()->assign('total_confirm', AlumniLocale::THIS_AND . " $moderate_rows " . AlumniLocale::WAITING); |
|||||||||||
0 ignored issues
–
show
$moderate_rows does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
250 | } |
|||||||||||
251 | } |
|||||||||||
252 | } |
|||||||||||
253 | ||||||||||||
254 | $criteria = new CriteriaCompo(); |
|||||||||||
255 | $criteria->add(new Criteria('valid', 1, '=')); |
|||||||||||
256 | $criteria->add(new Criteria('cid', '(' . implode(', ', $alumni_ids) . ')', 'IN')); |
|||||||||||
0 ignored issues
–
show
$alumni_ids does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
257 | $criteria->setLimit($xoops->getModuleConfig('' . $moduleDirName . '_per_page')); |
|||||||||||
258 | $numrows = $listingHandler->getCount($criteria); |
|||||||||||
259 | ||||||||||||
260 | $xoops->tpl()->assign('total_listings', AlumniLocale::THERE_ARE . ' ' . $numrows . ' ' . AlumniLocale::ALUMNI_LISTINGS . ' ' . AlumniLocale::IN . ' ' . $numcat . ' ' . AlumniLocale::CATEGORIES); |
|||||||||||
261 | $xoops->tpl()->assign('last_head', AlumniLocale::THE . ' ' . $xoops->getModuleConfig('' . $moduleDirName . '_newalumni') . ' ' . AlumniLocale::LASTADD); |
|||||||||||
262 | $xoops->tpl()->assign('last_head_name', AlumniLocale::NAME_2); |
|||||||||||
263 | $xoops->tpl()->assign('last_head_school', AlumniLocale::SCHOOL_2); |
|||||||||||
264 | $xoops->tpl()->assign('last_head_studies', AlumniLocale::STUDIES_2); |
|||||||||||
265 | $xoops->tpl()->assign('last_head_year', AlumniLocale::YEAR_2); |
|||||||||||
266 | $xoops->tpl()->assign('last_head_date', XoopsLocale::DATE); |
|||||||||||
267 | $xoops->tpl()->assign('last_head_local', AlumniLocale::TOWN_2); |
|||||||||||
268 | $xoops->tpl()->assign('last_head_views', AlumniLocale::HITS); |
|||||||||||
269 | $xoops->tpl()->assign('last_head_photo', AlumniLocale::PHOTO); |
|||||||||||
270 | ||||||||||||
271 | $listingArray = $listingHandler->getAll($criteria); |
|||||||||||
272 | ||||||||||||
273 | foreach (array_keys($listingArray) as $i) { |
|||||||||||
274 | $lid = $listingArray[$i]->getVar('lid'); |
|||||||||||
275 | $cid = $listingArray[$i]->getVar('cid'); |
|||||||||||
276 | $name = $listingArray[$i]->getVar('name'); |
|||||||||||
277 | $mname = $listingArray[$i]->getVar('mname'); |
|||||||||||
278 | $lname = $listingArray[$i]->getVar('lname'); |
|||||||||||
279 | $school = $listingArray[$i]->getVar('school'); |
|||||||||||
280 | $year = $listingArray[$i]->getVar('year'); |
|||||||||||
281 | $studies = $listingArray[$i]->getVar('studies'); |
|||||||||||
282 | $activities = $listingArray[$i]->getVar('activities'); |
|||||||||||
283 | $extrainfo = $listingArray[$i]->getVar('extrainfo'); |
|||||||||||
284 | $occ = $listingArray[$i]->getVar('occ'); |
|||||||||||
285 | $date = $listingArray[$i]->getVar('date'); |
|||||||||||
286 | $email = $listingArray[$i]->getVar('email'); |
|||||||||||
287 | $submitter = $listingArray[$i]->getVar('submitter'); |
|||||||||||
288 | $usid = $listingArray[$i]->getVar('usid'); |
|||||||||||
289 | $town = $listingArray[$i]->getVar('town'); |
|||||||||||
290 | $valid = $listingArray[$i]->getVar('valid'); |
|||||||||||
291 | $photo = $listingArray[$i]->getVar('photo'); |
|||||||||||
292 | $photo2 = $listingArray[$i]->getVar('photo2'); |
|||||||||||
293 | $view = $listingArray[$i]->getVar('view'); |
|||||||||||
294 | ||||||||||||
295 | $a_item = []; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
296 | $a_item['new'] = ''; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
297 | ||||||||||||
298 | $newcount = $xoops->getModuleConfig('' . $moduleDirName . '_countday'); |
|||||||||||
299 | $startdate = (time() - (86400 * $newcount)); |
|||||||||||
300 | View Code Duplication | if ($startdate < $date) { |
||||||||||
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
||||||||||||
301 | $newitem = '<img src="' . XOOPS_URL . "/modules/{$moduleDirName}/assets/images/newred.gif\">"; |
|||||||||||
302 | $a_item['new'] = $newitem; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
303 | } |
|||||||||||
304 | ||||||||||||
305 | $useroffset = ''; |
|||||||||||
306 | View Code Duplication | if ($xoops->user) { |
||||||||||
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
||||||||||||
307 | $timezone = $xoops->user->timezone(); |
|||||||||||
308 | if (isset($timezone)) { |
|||||||||||
309 | $useroffset = $xoops->user->timezone(); |
|||||||||||
310 | } else { |
|||||||||||
311 | $useroffset = $xoopsConfig['default_TZ']; |
|||||||||||
312 | } |
|||||||||||
313 | } |
|||||||||||
314 | $date = ($useroffset * 3600) + $date; |
|||||||||||
315 | ||||||||||||
316 | $date = XoopsLocale::formatTimestamp($date, 's'); |
|||||||||||
317 | ||||||||||||
318 | View Code Duplication | if ($xoops->user) { |
||||||||||
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
||||||||||||
319 | if ($xoops->user->isAdmin()) { |
|||||||||||
320 | $a_item['admin'] = "<a href='admin/alumni.php?op=edit_listing&lid=$lid&cid=$cid'><img src='images/modif.gif' border=0 alt=\"" . AlumniLocale::MODADMIN . '"></a>'; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
321 | } |
|||||||||||
322 | } |
|||||||||||
323 | ||||||||||||
324 | $a_item['name'] = "<a href='listing.php?lid=$lid'><b>$name $mname $lname</b></a>"; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
325 | $a_item['school'] = $school; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
326 | $a_item['year'] = $year; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
327 | $a_item['studies'] = $studies; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
328 | $a_item['date'] = $date; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
329 | $a_item['local'] = ''; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
330 | if ($town) { |
|||||||||||
331 | $a_item['local'] .= $town; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
332 | } |
|||||||||||
333 | ||||||||||||
334 | if ($photo) { |
|||||||||||
335 | $a_item['photo'] = "<a href=\"javascript:CLA('display-image.php?lid=$lid')\"><img src=\"" . XOOPS_URL . "/modules/{$moduleDirName}/assets/images/photo.gif\" border=\"0\" width=\"15\" height=\"11\" alt='" . AlumniLocale::PHOTO_AVAILABLE . "'></a>"; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
336 | } else { |
|||||||||||
337 | $a_item['photo'] = ''; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
338 | } |
|||||||||||
339 | ||||||||||||
340 | $a_item['views'] = $view; |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
341 | ||||||||||||
342 | $xoops->tpl()->append('items', $a_item); |
|||||||||||
0 ignored issues
–
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$ ).
This check examines a number of code elements and verifies that they conform to the given naming conventions. You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods. ![]() |
||||||||||||
343 | } |
|||||||||||
344 | ||||||||||||
345 | Xoops::getInstance()->footer(); |
|||||||||||
346 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.