Has anyone figured out a way to make a "goal thermometer" that will interface with this?

vagrant - January 9, 2009 - 16:25
Project:Donation
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Has anyone figured out a way to make a "goal thermometer" that will interface with this?

It would be a cool feature to graphically show the donations on a meter of some kind.

Thanks for any input

#1

Mark_Watson27 - July 9, 2009 - 09:37

Hello,

I used donations thermometer (http://drupal.org/project/donations_thermometer) and modified the donations module to set the donations_thermometer_amount everytime a donation was updated/inserted using:

variable_set('donations_thermometer_amount', donation_total());

and added a function to get the total of the donations.

function donation_total() {
  $sql = 'SELECT SUM(d.Amount) FROM {donations} d WHERE d.status=1';
  $result = db_result(db_query($sql));
  $result = check_plain(sprintf('%.2f',$result));
  return $result;
}

I don't know enough about Drupal development to officially do this as a patch etc.

Thanks
Mark

#2

kbahey - July 9, 2009 - 15:52
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:active» needs work

Can you please submit your changes as a patch, and make it configurable?

This would be useful to others.

We also need to document it.

#3

Mark_Watson27 - July 9, 2009 - 16:26

I really don't know enough about Drupal coding yet to be able to supply a patch but will do some reading on it and see if I can figure it out.

#4

kbahey - July 9, 2009 - 16:55

Start reading here http://drupal.org/patch

It may be overwhelming at first, but give it a shot.

#5

Mark_Watson27 - July 10, 2009 - 08:33

Okay this is the first patch I've ever created, so apologies if I've not done it correctly.

AttachmentSize
donation-356576-5.patch 3.38 KB

#6

Mark_Watson27 - July 10, 2009 - 16:37
Status:needs work» needs review

#7

kbahey - July 18, 2009 - 21:58
Status:needs review» fixed

Committed.

Thanks.

#8

System Message - August 1, 2009 - 22:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.