Here is an
very basic!!!!!!!!!!!!!!!!!!!!!!!!!!!! donation addon that should work fine in 2.08
Original credit for donate,php and paypal.php goes to BigMax1.
I just modified it to be correct for just about any site and fixed some formatting.
1st: sql: add the following sql into your db with what ever you use to edit the db.
[url="
http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5729"]tt_donation.rar[/url] New Update 05/05/2012
Show Donor Info In Account-Details And Account.php
in account-details
find
1st
[url="
http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6194"]donate.php[/url]
Cleanup code to remove the donor status once it expires.
in bottom of
cleanup.php before
DROP TABLE IF EXISTS `funds`;
CREATE TABLE IF NOT EXISTS `funds` (
`id` int(10) unsigned NOT NULL auto_increment,
`cash` decimal(8,2) NOT NULL default '0.00',
`user` int(10) unsigned NOT NULL default '0',
`added` datetime NOT NULL default '0000-00-00 00:00:00',
`month` varchar(10) default NULL,
`year` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
2nd:
extract the enclosed zip file into the root of your site with folders and all.
New Update
http://devscorner.xyz/uploads/post-33545-0-28392100-1333921513.pnghttp://devscorner.xyz/uploads/post-33545-0-05794400-1333921524.png
3rd: edit backend/funds_config.php
$DONATEMAIL = 'change_this_email@change.this'; //Your Paypal email address here.
Edit: I fixed some issues if people try and donate if not logged in, in that case the person would have to pm someone to get the status set right.
List Of Most Reg Currencys
// List Of Most Reg Currencys
// Euro € EUR
// British Pound £ GBP
// Canadian Dollar $ CAD
// Polish Zloty $ PLN
// U.S. Dollar $ USD
Seems bigmax1 original post for entries that dont exist..
anyway:
in what ever you use to edit the db
ALTER TABLE `users` ADD `donoruntil` datetime NOT NULL default '0000-00-00 00:00:00';
ALTER TABLE `users` ADD `donor` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `total_donated` int(10) unsigned NOT NULL default '0';
if ($user["privacy"] != "strong" || ($CURUSER["control_panel"] == "yes")) {
after add
//Donor count down
if ($user[donor] == 'yes' && ($CURUSER[id] == $user[id] || $CURUSER["class"] >= 6)) {
$donoruntil = $user['donoruntil'];
if ($donoruntil != '0000-00-00 00:00:00') {
print("<b><p>Donated Status Until - $donoruntil");
if ($CURUSER["class"] < 6)
print(" [ " . mkprettytime(strtotime($donoruntil) - gmtime()) . " ] to go...</b><font size="-2"> to re-new donation click <a class=altlink href=donate.php>here</a>.</font></p>n");
else
print(" [ " . mkprettytime(strtotime($donoruntil) - gmtime()) . " ] to go...</b></p>n");
} //$donoruntil != '0000-00-00 00:00:00'
else {
print("<b><p>Donated Status Until Removed Via Site Owner:)");
}
} //$user[donor] == 'yes' && ($CURUSER[id] == $user[id] || $CURUSER["class"] >= 6)
//====end
then in account
find
<b><?php echo T_("PASSKEY"); ?>:</b> <?php echo $CURUSER["passkey"]; ?><br />
after add
<b>Last <?php echo T_("DONATED"); ?>:</b> <?php echo $site_config['currency_symbol']; ?><?php echo number_format($CURUSER["donated"], 2); ?><br>
<b>Total <?php echo T_("DONATED"); ?>:</b> <?php echo $site_config['currency_symbol']; ?><?php echo number_format($CURUSER["total_donated"], 2); ?><br>
<?php if ($CURUSER['donoruntil']<>"0000-00-00 00:00:00 && ".htmlspecialchars($CURUSER['donor'])." == 'yes'")
echo "<b>Donor Until: </b> ".$CURUSER['donoruntil']." [ ".mkprettytime(strtotime($CURUSER['donoruntil']) - gmtime()); ?> ] to go...<br>
Langauges:
English:
// Mode Don
$LANG["THANKS_YOU_DONATE"] = "Thank You for visiting Donations page";
$LANG["SUPPORT_DON"] = "If you like our tracker please support us to keep it alive";
$LANG["DONATE"] = "Donate";
$LANG["AND_RECEIVE"] = "And you will receive";
$LANG["WEEKS"] = "Weeks";
$LANG["WEEKS_FREE_DL"] = "Weeks Free Download";
$LANG["GB_CREDITS_UP"] = "GB Upload Credits";
$LANG["INVITES_SITE"] = "Invites on our site";
$LANG["STATUS"] = "Status";
$LANG["PM_ADMIN_DON"] = "If you don't receive anything after a donation send a PM ";
$LANG["HERE"] = "HERE";
$LANG["CONFIRMED_ACCOUNT"] = "for confirmation and upgrade your account";
$LANG["-IMPORTANT-"] = "- IMPORTANT -";
Then replace donate.php with the attached file.
//OPTIMIZE TABLES
add this code:
//=== Remove donor status if time up and set class to power user ===//
$res = SQL_Query_exec("SELECT id, modcomment,class FROM users WHERE donor='yes' AND donoruntil < NOW() AND donoruntil <> '0000-00-00 00:00:00'");
if (mysql_num_rows($res) > 0) {
$dt = sqlesc(get_date_time());
$subject = sqlesc("VIP status removed by System.");
$msg = sqlesc("Your VIP status has timed out and has been auto-removed by the System. We would like to thank you once again for supporting " . $site_config['SITENAME'] . ". If you wish to re-new your VIP, you can do so by clicking [url=".%20%24site_config%5B"] . "/donate.php]HERE[/url]. Cheers!n");
while ($arr = mysql_fetch_assoc($res)) {
///--- Autosystem modcomment ---//
$modcomment = htmlspecialchars($arr["modcomment"]);
$modcomment = gmdate("Y-m-d H:i") . " - VIP status removed by System.n" . $modcomment;
$modcom = sqlesc($modcomment);
if ($arr["class"]<=3) // Change this to your vip class if well diferent...
SQL_Query_exec("UPDATE users SET class = '2', donor = 'no', donoruntil = '0000-00-00 00:00:00', modcomment = $modcom WHERE id = $arr[id]");
else
SQL_Query_exec("UPDATE users SET donor = 'no', donoruntil = '0000-00-00 00:00:00', modcomment = $modcom WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject, poster) VALUES(0, $arr[id], $dt, $msg, $subject, 0)");
}
}
[/code]