Gutschein Mod

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Gutschein Mod

      Sorry, ich brauche leider nochmal eure Hilfe,

      Habe einen Gutschein Mod ( Voucher ) eingebaut.
      Das Anlegen der Codes mit wie oft nutzbar oder wie lange gültig klappt super.

      Wenn ich aber den Code eintrage wird dem Benutzer zwar angezeigt was er für den Code bekommt aber es wird nichts auf Seinen Ressourcen hinzugefügt

      die class.ShowGutscheinEinloesePage.php hat folgenden Inhalt :
      Display Spoiler



      PHP Source Code

      1. $GLOBALS['DATABASE']->query("
      2. UPDATE
      3. ".DMGut." as dm,
      4. ".PLANETS." as p,
      5. ".USERS." as u
      6. SET
      7. dm.`useable` = '".$GLOBALS['DATABASE']->sql_escape($Useable)."',
      8. dm.`usedby` = '".$GLOBALS['DATABASE']->sql_escape($LastUser)."',
      9. p.`metal` = p.`metal` + ".$Gutschein['metall'].",
      10. p.`crystal` = p.`crystal` + ".$Gutschein['kristall'].",
      11. p.`deuterium` = p.`deuterium` + ".$Gutschein['deuterium'].",
      12. u.`darkmatter` = u.`darkmatter` + ".$Gutschein['matter']."
      13. WHERE
      14. dm.`key` = '".$GLOBALS['DATABASE']->sql_escape($gkey)."' AND
      15. p.`id` = '".$PLANET['id']."' AND
      16. u.`id` = '".$USER['id']."';");
      17. // Code by Robbyn - Thanks for this =)
      18. $mod_gutscheine_success = 1;
      Display All
      das ist nur der Code wo es wahrscheinlich drum geht





      die passende tpl (ShowGutscheinEinloesePage.tpl ) sieht so aus :

      Display Spoiler

      HTML Source Code

      1. {block name="content"}
      2. <table class="table569">
      3. <center>
      4. <form action="" method="post">
      5. <input type="hidden" name="opt_save" value="1">
      6. <table width="70%" cellpadding="2" cellspacing="2">
      7. <tr>
      8. <th colspan="10">{$mod_gutscheine_user_headline}</th>
      9. <th colspan="1" width="5%"><img src="./styles/images/Adm/i.gif" width="16" height="16" alt="" class="tooltip" name="Gutschein Info"></th>
      10. </tr><tr>
      11. <td>{$mod_gutscheine_user_key}
      12. <td><input name="gutscheine_key" type="text" maxlength="60" style="background:gold;color:black;"></td>
      13. </tr><tr>
      14. <td colspan="2"><input value="{$mod_user_refund}" type="submit"></td>
      15. </tr>
      16. </table>
      17. </form>
      18. </center>
      19. </table>
      20. {/block}
      Display All

      die Error tpl ( ShowGutscheinError.tpl ) hat folgenden Eintrag :

      Display Spoiler

      HTML Source Code

      1. {block name="content"}
      2. <table class="table569">
      3. <center>
      4. <form action="" method="post">
      5. <input type="hidden" name="opt_save" value="1">
      6. <table width="70%" cellpadding="2" cellspacing="2">
      7. <tr>
      8. <th colspan="2">{$mod_gutscheine_user_headline}</th>
      9. </tr>
      10. {if $mod_gutscheine_success == 1}
      11. <tr>
      12. <th colspan="2">{$mod_gutscheine_user_Successhead}</th>
      13. </tr><tr>
      14. <td>{$mod_gutscheine_recieve1}{$mod_gutschein_name}
      15. <br><b>{$mod_gutscheine_metall}</b> {$mod_metal}
      16. <br><b>{$mod_gutscheine_crystall}</b> {$mod_crystall}
      17. <br><b>{$mod_gutscheine_deuterium}</b> {$mod_deuterium}
      18. <br><b>{$mod_gutscheine_matter}</b> {$mod_darkmatter} {$mod_gutscheine_recieve2}</td>
      19. </tr>
      20. {/if}
      21. <tr>
      22. {if $mod_gutscheine_success == 0}
      23. <td>{$mod_gutscheine_user_Fail}</td>
      24. </tr>{if $mod_gutscheine_errorcode == 1}<tr>
      25. <td>{$mod_gutscheine_user_Fail1}</td>
      26. </tr>{/if}{if $mod_gutscheine_errorcode == 2}<tr>
      27. <td>{$mod_gutscheine_user_Fail2}</td>
      28. </tr>{/if}{if $mod_gutscheine_errorcode == 3}<tr>
      29. <td>{$mod_gutscheine_user_Fail3}</td>
      30. </tr>{/if}{if $mod_gutscheine_errorcode == 4}<tr>
      31. <td>{$mod_gutscheine_user_Fail4}</td>
      32. </tr>{/if}{if $mod_gutscheine_errorcode == 5}<tr>
      33. <td>{$mod_gutscheine_user_Fail5}</td>
      34. </tr>{/if}<tr>
      35. {/if}
      36. <td colspan="2"><a href="javascript:history.back()">{$mod_gutscheine_user_back}</a></td>
      37. </tr>
      38. </table>
      39. </form>
      40. </center>
      41. </table>
      42. {/block}
      Display All

      Wie gesagt, es geht sich darum das dem Benutzer auch die Ressourcen gutgeschrieben werden. Alles andere funktioniert damit

      Danke für eure Hilfe
      Files
      • Gutschein.zip

        (2.76 kB, downloaded 413 times, last: )
    • 1.7.3
      2Moons is based on Beta7-master ( Stellar Wars ) github.com/joancefet/Beta7

      I have uploaded the whole mod .......

      without lang and db

      the user see what he will get for the code...... but he got nothing

      this is the db structur :

      SQL-Query

      1. --
      2. -- Tabellenstruktur für Tabelle `uni1_gutscheine`
      3. --
      4. DROP TABLE IF EXISTS `uni1_gutscheine`;
      5. CREATE TABLE IF NOT EXISTS `uni1_gutscheine` (
      6. `id` int(255) NOT NULL AUTO_INCREMENT,
      7. `name` varchar(255) NOT NULL,
      8. `gkey` varchar(255) NOT NULL,
      9. `metall` bigint(255) NOT NULL,
      10. `kristall` bigint(255) NOT NULL,
      11. `deuterium` bigint(255) NOT NULL,
      12. `darkmatter` bigint(255) NOT NULL,
      13. `useable` tinyint(11) NOT NULL DEFAULT '1',
      14. `userid` int(255) UNSIGNED NOT NULL DEFAULT '0',
      15. `usedby` varchar(255) DEFAULT NULL,
      16. `createday` date NOT NULL,
      17. `expireday` varchar(255) NOT NULL,
      18. `expiredayrl` date NOT NULL,
      19. PRIMARY KEY (`id`),
      20. UNIQUE KEY `gkey` (`gkey`)
      21. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
      Display All
      Files
      • voucher.zip

        (7.18 kB, downloaded 377 times, last: )

      The post was edited 1 time, last by Darkside ().

    • 2moons.de/index.php?attachment…e6cd229150505e58e8215ead9

      This my admin menu
      2moons.de/index.php?attachment…e6cd229150505e58e8215ead9

      here i can put the code



      and gere is the overview





      the code is automatically generated


      I can specify how often this code can be used or how long it is valid
      in DB i can see who has the code used ......

      The post was edited 3 times, last by Darkside ().

    • Hello I will write all the mod of 0 cart your is a big brothel.
      There is something to optimize the code to do.

      It will be done in the morning