return is_resource($linkResource);
}
+// Checks whether given result is a valid SQL result
+function isSqlResult ($result) {
+ // TODO: Can't this be made better?
+ return is_resource($result);
+}
+
// [EOF]
?>
// Checks whether given link is a valid SQL link
function isValidSqlLink ($linkInstance) {
- // Is it a resource?
+ // Is it an object?
$isValid = (($linkInstance instanceof mysqli) || ($linkInstance instanceof mysqli_result));
// Debug message
return $isValid;
}
+// Checks whether given result is really a result
+function isSqlResult ($resultInstance) {
+ // Is it a resource?
+ $isValid = ($resultInstance instanceof mysqli_result);
+
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'resultInstance[]=' . gettype($resultInstance). ',isValid=' . intval($isValid));
+
+ // Return result
+ return $isValid;
+}
+
// [EOF]
?>
} else {
// No name found
$data['title'] = '{%message,UNKNOWN_MODULE_DETECTED_TITLE=' . $module . '%}';
- if ((is_resource($result)) && (ifSqlHasZeroNumRows($result))) {
+ if ((isSqlResult($result)) && (ifSqlHasZeroNumRows($result))) {
// Add module to database and ignore return value
checkModulePermissions($module);
} // END - if
$add = ' LIMIT ' . (bigintval(getRequestElement('offset')) * bigintval(getRequestElement('page')) - bigintval(getRequestElement('offset'))) . ', ' . bigintval(getRequestElement('offset'));
// Add limitation
-if (!empty($SQL2)) $SQL2 .= $add;
+if (!empty($SQL2)) {
+ $SQL2 .= $add;
+} // END - if
if ((isExtensionActive('bonus')) && (!ifSqlHasZeroNumRows($result_max)) && (!empty($SQL2))) {
// Run SQL query for notification mails
// Load main template
loadTemplate('admin_list_notify_emails', FALSE, $content);
}
-} elseif ((sqlNumRows($result_max) === 0) && (is_resource($result_max))) {
+} elseif ((sqlNumRows($result_max) === 0) && (isSqlResult($result_max))) {
// No notifications found
displayMessage('{--ADMIN_NO_NOTIFICATIONS--}');
}