X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffix_refsystem.php;h=c4200c8fbc2ed4a1cf1d632eb72a708c7cf8aa0d;hp=a63edb3019fee6ec231772691ead1f2fcb91b9a6;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=cd7d344ea7007cfa20413acd3e03e50f0ab86d86 diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php index a63edb3019..c4200c8fbc 100644 --- a/inc/fix_refsystem.php +++ b/inc/fix_refsystem.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Refback-Tabelle mit allen Refs generieren * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * Copyright (c) 2009 - 2015 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -41,29 +36,29 @@ if (!defined('__SECURITY')) { } // END - if // Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one -$result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__); -if (!SQL_HASZERONUMS($result)) { +$result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__); +if (!ifSqlHasZeroNumRows($result)) { // Remove index temporaly - SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__); + sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__); // Upgrade refsystem - SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__); + sqlQuery('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__); // Add it again - SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`, `level`)', __FILE__, __LINE__); + sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`, `level`)', __FILE__, __LINE__); // Rebuild cache rebuildCache('refsystem', 'refsystem'); } // END - if // Free result -SQL_FREERESULT($result); +sqlFreeResult($result); // Reset the table -SQL_QUERY('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__); +sqlQuery('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__); // Begin with all users in level one -$result_direct = SQL_QUERY('SELECT +$result_direct = sqlQuery('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` @@ -74,9 +69,9 @@ ORDER BY `userid` ASC', __FILE__, __LINE__); // Are there entries? -if (!SQL_HASZERONUMS($result_direct)) { +if (!ifSqlHasZeroNumRows($result_direct)) { // When 'walk' through all users - while ($content = SQL_FETCHARRAY($result_direct)) { + while ($content = sqlFetchArray($result_direct)) { // Update refback table /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'userid=' . $content['userid'] . ' - BEFORE!'); updateReferralTable($content['userid']); @@ -85,7 +80,7 @@ if (!SQL_HASZERONUMS($result_direct)) { } // END - if // Free result -SQL_FREERESULT($result_direct); +sqlFreeResult($result_direct); // [EOF] ?>