JamesRage Posted May 26, 2013 Posted May 26, 2013 Hey, I wanted this specific Donate Mod...Was hoping the community will help make one... :) Files I think are needed. - Donator.php - Staff_donator.php - ipn_donator.php What does the module do? It allows staff to create Donator Packs, with unlimited items (so theres no limit). And another thing is staff can set up a limited stock on any DP if they want. This mod should also credit Players instantly after Payment. Thanks MWG! :) Quote
SilvaTungDevil Posted May 26, 2013 Posted May 26, 2013 http://store.davemacaulay.com/cart.php?suggest=51a24ab978257 Use that! Its pretty dam solid and easy as plug and play for $10 cant go wrong. Ive installed it and used it for ages. 5* Quote
JamesRage Posted May 26, 2013 Author Posted May 26, 2013 I like Daves, but I'm looking for something different, and less advanced. Quote
Smokey Posted May 26, 2013 Posted May 26, 2013 Daves is good, I own that one, and Cronus's isnt too bad either, a bit simpler than Daves, I own that one too. Both have good qualities, Daves looks more professional by far in my opinion. Cronus's is a bit easier for the user BUT Daves has a shopping cart. So it really depends on your preference. Quote
JamesRage Posted May 26, 2013 Author Posted May 26, 2013 Daves is good, I own that one, and Cronus's isnt too bad either, a bit simpler than Daves, I own that one too. Both have good qualities, Daves looks more professional by far in my opinion. Cronus's is a bit easier for the user BUT Daves has a shopping cart. So it really depends on your preference. I have both, well one bought, and one I've used (friends mod). I'm looking for something different like the one described on my Original Post. But thanks. :) Quote
MNG Posted May 26, 2013 Posted May 26, 2013 Dave system is over use in Mccode Games, I see it every day. Think outside the box. Quote
JamesRage Posted May 26, 2013 Author Posted May 26, 2013 Another reason why I want the one in my original Post, just to give me a peace of mind knowing when a user who is familiar with MCCodes registers on my game and looks on the donator.php thinks 'Hmmm...Never seen this one before.' ;) Quote
KyleMassacre Posted May 26, 2013 Posted May 26, 2013 (edited) honestly your trying to reinvent the wheel here. dave's mod can/does everything you require plus more. You want unlimited amounts of items in a pack? Dave's does it. You want instant credit? Daves does it or doesn't which ever you prefer. You want it sent in a package or added to their stats or inventory automatically? Daves does it. You want to use a different gateway along with other than paypal? daves can do it. if you want people to not "have seen this before" change the styles. if you want a limited quantity make a few alters the the code and the database, I don't think its that hard in fact I would be stoked if he ported it over to NWE. hint hint dave Edited May 26, 2013 by KyleMassacre Quote
Dominion Posted May 26, 2013 Posted May 26, 2013 http://makewebgames.io/showthread.php/36523-Paypal-donation-package-creation?highlight=admin+donator Haven't really looked at it, but it's a starting point for you. Quote
JamesRage Posted May 27, 2013 Author Posted May 27, 2013 http://makewebgames.io/showthread.php/36523-Paypal-donation-package-creation?highlight=admin+donator Haven't really looked at it, but it's a starting point for you. Thanks, I'll play around with that, if I get any errors or need advice, I'll post here. Thanks again. Quote
JamesRage Posted May 27, 2013 Author Posted May 27, 2013 CREATE TABLE IF NOT EXISTS `packages` ( **`id` int(11) NOT NULL AUTO_INCREMENT, **`money` int(11) NOT NULL, **`crystals` int(11) NOT NULL, **`iq` int(11) NOT NULL, **`ddays` int(11) NOT NULL, **`name` varchar(32) NOT NULL, **`cost` int(11) NOT NULL, **`deleted` int(1) NOT NULL, **PRIMARY KEY (`id`) ) ENGINE=MyISAM* DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; With the SQL above, I get this error on PHPMyAdmin: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`money` int(11) NOT NULL, Â Â `crystals` int(11) NOT NULL, Â Â `iq` int(11) NO' at line 2 Anyone know the issue(s)? Thanks! Quote
KyleMassacre Posted May 27, 2013 Posted May 27, 2013 Try This: CREATE TABLE IF NOT EXISTS `packages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `money` int(11) NOT NULL, `crystals` int(11) NOT NULL, `iq` int(11) NOT NULL, `ddays` int(11) NOT NULL, `name` varchar(32) NOT NULL, `cost` int(11) NOT NULL, `deleted` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM* DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; There was a grip of "*" in there and there is not supposed to be Quote
JamesRage Posted May 27, 2013 Author Posted May 27, 2013 Yeah the ** adds itself, as the forums mess up the code :) And I get this error now: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* DEFAULT CHARSET=latin1 AUTO_INCREMENT=1' at line 11 Quote
KyleMassacre Posted May 27, 2013 Posted May 27, 2013 remove the "*" there too after MyISAM. I must have missed that one Quote
JamesRage Posted May 27, 2013 Author Posted May 27, 2013 Hmmm...On the Donator.php I get this error: Parse error: syntax error, unexpected T_IF in /home/chaosc52/public_html/new/donator1.php on line 11 Using this code: <?php include "globals.php"; print <<<EOF <h3>Donations</h3> <b>[<a href=willpotion.php>Buy Will Potions</a>]</b> * If you become a <span class="highlight">donator</span> to {$set['game_name']}, you will receive (each time you donate): * EOF; * if($db->num_rows($db->query("SELECT id FROM packages")) < 1): ****echo "Sorry, but there are currently no packages in the game yet."; else: ****$q=$db->query("SELECT * FROM packages WHERE deleted!='1' ORDER BY cost ASC"); ****while($r=$db->fetch_row($q)): ********echo "<fieldset><legend>$r[name] (\$$r[cost],--)</legend><ul>"; ********if($r[money] > 0) echo "[*]\$".number_format($r[money])." game money."; ********if($r[crystals] > 0) echo "[*]$r[crystals] crystals."; ********if($r[iq] > 0) echo "[*]$r[iq] IQ, the hardest stat in the game to get."; ********if($r[ddays] > 0) echo "[*]$r[ddays] days <span class="highlight">Donator</span> Status: Red name + cross next to your name."; ********* ********* ********echo "[*]17% Energy every 5 minutes instead of 8%. (For aslong as you have <span class="highlight">Donator</span> Status)[*]Access to Friends and Black lists[/list]"; ********* ********echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">'; ********echo '<input type=hidden name=cmd value=_xclick>'; ********echo '<input type="hidden" name="business" value="'.$set[paypal].'">'; ********echo '<input type="hidden" name="item_name" value="'.$domain.'|DP|'.$r[id].'|'.$userid.'">'; ********echo '<input type="hidden" name="amount" value="'.$r[cost].'.00">'; ********echo '<input type="hidden" name="no_shipping" value="1">'; ********echo '<input type="hidden" name="return" value="http://'.$domain.'/donatordone.php?action=done&type=standard">'; ********echo '<input type="hidden" name="cancel_return" value="http://'.$domain.'/donatordone.php?action=cancel">'; ********echo '<input type="hidden" name="notify_url" value="http://'.$domain.'/ipn_donator.php">'; ********echo '<input type="hidden" name="cn" value="Your Player ID">'; ********echo '<input type="hidden" name="currency_code" value="USD">'; ********echo '<input type="hidden" name="tax" value="0">'; ********echo '<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">'; ********echo '</form>'; ********* ********echo "</fieldset>"; ****endwhile; endif; $h->endpage(); I tried playing around with it earlier to no avail... Any ideas? :/ Quote
KyleMassacre Posted May 27, 2013 Posted May 27, 2013 im looking at the script right now so give me a few minutes Quote
JamesRage Posted May 27, 2013 Author Posted May 27, 2013 im looking at the script right now so give me a few minutes Thanks man! Appreciated :) Quote
KyleMassacre Posted May 27, 2013 Posted May 27, 2013 its not tested but try this: <?php include "globals.php"; print " <h3>Donations</h3> <strong>[<a href='willpotion.php'>Buy Will Potions</a>]</strong> If you become a donator to ". $set['game_name'] ." you will receive (each time you donate):"; if($db->num_rows($db->query("SELECT id FROM packages")) < 1) echo "Sorry, but there are currently no packages in the game yet."; else $q=$db->query("SELECT * FROM packages WHERE deleted!='1' ORDER BY cost ASC"); while($r=$db->fetch_row($q)) echo "<fieldset><legend>$r['name'] (".money_formatter($r['cost'])."--)</legend><ul>"; if($r['money'] > 0) echo "<li>".money_formatter($r['money'])." game money.</li>"; if($r['crystals'] > 0) echo "<li>".number_format($r['crystals'])." crystals</li>."; if($r['iq'] > 0) echo "<li>".number_format($r['iq'])." IQ, the hardest stat in the game to get.</li>"; if($r['ddays'] > 0) echo "<li>".number_format($r['ddays'])." days Donator Status: Red name + cross next to your name.</li>"; echo "<li>17% Energy every 5 minutes instead of 8%. (For aslong as you have Donator Status)<li>Access to Friends and Black lists</li></ul>"; echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">'; echo '<input type=hidden name=cmd value=_xclick>'; echo '<input type="hidden" name="business" value="'.$set['paypal'].'">'; echo '<input type="hidden" name="item_name" value="'.$domain.'|DP|'.$r[id].'|'.$userid.'">'; echo '<input type="hidden" name="amount" value="'.$r['cost'].'.00">'; echo '<input type="hidden" name="no_shipping" value="1">'; echo '<input type="hidden" name="return" value="http://'.$domain.'/donatordone.php?action=done&type=standard">'; echo '<input type="hidden" name="cancel_return" value="http://'.$domain.'/donatordone.php?action=cancel">'; echo '<input type="hidden" name="notify_url" value="http://'.$domain.'/ipn_donator.php">'; echo '<input type="hidden" name="cn" value="Your Player ID">'; echo '<input type="hidden" name="currency_code" value="USD">'; echo '<input type="hidden" name="tax" value="0">'; echo '<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">'; echo '</form>'; echo "</fieldset>"; endwhile; endif; $h->endpage(); Quote
JamesRage Posted May 27, 2013 Author Posted May 27, 2013 Thanks but still an error: Parse error: syntax error, unexpected T_IF in /home/chaosc52/public_html/new/donator1.php on line 8 <?php include "globals.php"; print " <h3>Donations</h3> <strong>[<a href='willpotion.php'>Buy Will Potions</a>]</strong> If you become a donator to ". $set['game_name'] ." you will receive (each time you donate):"; ** if($db->num_rows($db->query("SELECT id FROM packages")) < 1) ****echo "Sorry, but there are currently no packages in the game yet."; else ****$q=$db->query("SELECT * FROM packages WHERE deleted!='1' ORDER BY cost ASC"); ****while($r=$db->fetch_row($q)) ********echo "<fieldset><legend>$r['name'] (".money_formatter($r['cost'])."--)</legend><ul>"; ********if($r['money'] > 0) echo "<li>".money_formatter($r['money'])." game money.</li>"; ********if($r['crystals'] > 0) echo "<li>".number_format($r['crystals'])." crystals</li>."; ********if($r['iq'] > 0) echo "<li>".number_format($r['iq'])." IQ, the hardest stat in the game to get.</li>"; ********if($r['ddays'] > 0) echo "<li>".number_format($r['ddays'])." days Donator Status: Red name + cross next to your name.</li>"; ***** ********echo "<li>17% Energy every 5 minutes instead of 8%. (For aslong as you have Donator Status)<li>Access to Friends and Black lists</li></ul>"; ********** ********echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">'; ********echo '<input type=hidden name=cmd value=_xclick>'; ********echo '<input type="hidden" name="business" value="'.$set['paypal'].'">'; ********echo '<input type="hidden" name="item_name" value="'.$domain.'|DP|'.$r[id].'|'.$userid.'">'; ********echo '<input type="hidden" name="amount" value="'.$r['cost'].'.00">'; ********echo '<input type="hidden" name="no_shipping" value="1">'; ********echo '<input type="hidden" name="return" value="http://'.$domain.'/donatordone.php?action=done&type=standard">'; ********echo '<input type="hidden" name="cancel_return" value="http://'.$domain.'/donatordone.php?action=cancel">'; ********echo '<input type="hidden" name="notify_url" value="http://'.$domain.'/ipn_donator.php">'; ********echo '<input type="hidden" name="cn" value="Your Player ID">'; ********echo '<input type="hidden" name="currency_code" value="USD">'; ********echo '<input type="hidden" name="tax" value="0">'; ********echo '<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">'; ********echo '</form>'; ********** ********echo "</fieldset>"; ****endwhile; endif; $h->endpage(); I think the issue relies here: if($db->num_rows($db->query("SELECT id FROM packages")) < 1) ****echo "Sorry, but there are currently no packages in the game yet."; Maybe an alternative statement that carries out the same function might work? Quote
KyleMassacre Posted May 27, 2013 Posted May 27, 2013 try changing it to this: if($db->num_rows($db->query("SELECT id FROM packages") < 1)) if not do it the long way $res = $db->query("SELECT id FROM packages"); if($db->num_rows($res) < 1) Quote
SRB Posted May 27, 2013 Posted May 27, 2013 Try using a better database engine, like InnoDB CREATE TABLE IF NOT EXISTS `packages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `money` int(11) NOT NULL, `crystals` int(11) NOT NULL, `iq` int(11) NOT NULL, `ddays` int(11) NOT NULL, `name` varchar(32) NOT NULL, `cost` int(11) NOT NULL, `deleted` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; And do it the right way: $sql = mysql_query("SELECT `id` FROM `packages`"); if (mysql_num_rows($sql) == 0) { echo 'Sorry, but there are no packages in the game yet.'; } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.