Number Counter help please?

Mrs Malapup

Free Member
Sep 4, 2006
307
3
My forum is rasing money for Malamute rescue and I want to be able to show a running total for how much money has been raised as an ongoing thing.....does anyone know how I might be able to this......free if possible. I have looked at those ticker things but they all seem to be about counting down to birthdays etc. Thanks :)
 

Dnallov

Free Member
Jan 28, 2008
301
32
Lincolnshire
I've been looking online for you and can't find anything :redface:. But I've had an idea. Why not use a poll. Only have two choices (amount raised and amount needed). Close the poll (so no one can vote!:rolleyes:) and modify the poll yourself. So if you need £10 (just an example) you start the poll with 0 Votes for amount raised and 10 votes for amounts needed. Then when you receive £1 you add a vote to amount raised, and take one vote away from votes needed. [FONT=&quot]Your graph would then read 10% raised and 90% required. Most polls are free and highly customizable (you'll want to hide things like total number of votes).
[/FONT]
Hope that helps! :D
 
  • Like
Reactions: Mrs Malapup
Upvote 0

Diggler

Free Member
Jan 11, 2008
21
2
You obviously have use of databases since you have a forum. Store the current total raised in a database first.

I assume people can donate using paypal or similar?
If so, on your payment complete page, you can run a php script that will get the amount paid and the current total, add them together and save as new total. This can be displayed on anywhere on your site.

e.g.
on your paypal complete page or IPN script:
PHP:
$donation = $amount;//variable passed from payment processor e.g. paypal
$connection = mysql_connect($host,$usr,$pwd);
$query = mysql_db_query($db, "SELECT total from table_donations where id='1'", $connection);
$row = mysql_fetch_assoc($query);
$currenttotal = $row["total"];

$newtotal = $currenttotal + $donation;

mysql_query("UPDATE table_donations SET total= '$newtotal' WHERE id = '1'");

Then you can echo it on any php page:

PHP:
$donation = $amount;//variable passed from payment processor e.g. paypal
$connection = mysql_connect($host,$usr,$pwd);
$query = mysql_db_query($db, "SELECT total from table_donations where id='1'", $connection);
$row = mysql_fetch_assoc($query);
$currenttotal = $row["total"];

echo "Our current total is: £".$currenttotal;
 
  • Like
Reactions: Mrs Malapup
Upvote 0

Latest Articles