Issues (884)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

index.php (114 issues)

Upgrade to new PHP Analysis Engine

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
$main_lang 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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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):

  Logical Operators Boolean Operator
AND - meaning and &&
OR - meaning or ||

The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like &&, or ||.

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-Flow

One 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 die introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined with throw at this point:

// 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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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):

  Logical Operators Boolean Operator
AND - meaning and &&
OR - meaning or ||

The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like &&, or ||.

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-Flow

One 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 die introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined with throw at this point:

// 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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
319
        if ($xoops->user->isAdmin()) {
320
            $a_item['admin'] = "<a href='admin/alumni.php?op=edit_listing&amp;lid=$lid&amp;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.

Loading history...
321
        }
322
    }
323
324
    $a_item['name']    = "<a href='listing.php?lid=$lid'><b>$name&nbsp;$mname&nbsp;$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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
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.

Loading history...
343
}
344
345
Xoops::getInstance()->footer();
346