Jump to content
MakeWebGames

Recommended Posts

Posted

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! :)

Posted

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.

Posted
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. :)

Posted

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.' ;)

Posted (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 by KyleMassacre
Posted
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!

Posted

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

Posted

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

Posted

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? :/

Posted

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();
Posted

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?

Posted

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.';
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...