X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffix_refsystem.php;h=6592b8061b708d689775be0ca912bfd41fc4dcad;hb=150ed402878985508f10f4e06d25831e0fb3a1f8;hp=6df29ac09edf30c1f806cae9dcaea90f8a32db10;hpb=2df9f7a53f8b1dd5164f87824a324ccb3b6634cb;p=mailer.git diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php index 6df29ac09e..6592b8061b 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 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 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 (!ifSqlHasZeroNums($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 (!ifSqlHasZeroNums($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] ?>