// SELECT query string from table, columns and so on... ;-)
function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) {
// Is columns an array?
- if (!is_array($columns) {
+ if (!is_array($columns)) {
// No array
trigger_error(sprintf("columns is not array. %s!=array", gettype($columns)));
- }
+ } // END - if
// Prepare the SQL statement
$SQL = "SELECT `".implode("`, `", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1";
array($tableName, $columnName), $F, $L);
// Do we have no entry on ADD or an entry on DROP?
+ // 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321
if (((SQL_NUMROWS($result) == 0) && (eregi("ADD", $sql) > 0)) || ((SQL_NUMROWS($result) == 1) && (eregi("DROP", $sql) > 0))) {
// Do the query
$result = SQL_QUERY($sql, $F, $L, false);
if ((!$NO_UPDATE) && (IS_ADMIN()) && ($GLOBALS['what'] == "add_sponsor")) {
// Only allowed for admin
$DATA['values'][] = "PENDING";
- } elsen{
+ } else {
// Guest area
$DATA['values'][] = "UNCONFIRMED";
$SQL = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_data` (".$KEYS.") VALUES ('".$VALUES."%s')";
// Generate message
- $MSG = SPONSOR_GET_MESSAGE(ADMIN_SPONSOR_ADDED, "added", $MSGs);
+ $MSG = SPONSOR_GET_MESSAGE(getMessage('ADMIN_SPONSOR_ADDED'), "added", $MSGs);
$ret = "added";
} elseif ((!$NO_UPDATE) && (IS_ADMIN())) {
// Add all data as hidden data
foreach ($POST as $k => $v) {
// Do not add 'force' !
if ($k != "force") {
- $OUT .= "<INPUT type=\"hidden\" name=\"".$k."\" value=\"".stripslashes($v)."\">\n";
+ $OUT .= "<input type=\"hidden\" name=\"".$k."\" value=\"".stripslashes($v)."\" />\n";
}
}
define('__HIDDEN_DATA', $OUT);
function IS_SPONSOR () {
// Failed...
$ret = false;
- if ((isSessionVariableSet('sponsorid'))) && (isSessionVariableSet('sponsorpass')))) {
+ if ((isSessionVariableSet('sponsorid')) && (isSessionVariableSet('sponsorpass'))) {
// Check cookies against database records...
$result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE id='%s' AND password='%s' AND `status`='CONFIRMED' LIMIT 1",
);
}
-if ((!empty($FQFN)) && (FILE_READABLE($FQFN) {
+if ((!empty($FQFN)) && (FILE_READABLE($FQFN))) {
// @TODO This code is double, see LOAD_TEMPLATE and LOAD_EMAIL_TEMPLATE in functions.php
$tmpl_file = READ_FILE($FQFN);
$tmpl_file = addslashes($tmpl_file);
define('DEBUG_SQL', false);
// Non-database functions
-LOAD_INC_ONCE("inc/functions.php");
+require("inc/functions.php");
// Filter functions
LOAD_INC_ONCE("inc/filters.php");
mxchange_die("Error message written to debug.log. Please try to call <a href=\"{!URL!}\">the main page</a> to continue.");
} else {
// No debug extension found, so regular output
- debug_report_bug();
+ debug_report_bug($msg);
}
}