Download & Extend

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

Project:Donation
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

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

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

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

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

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

#5

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

Status:needs work» needs review

#7

Status:needs review» fixed

Committed.

Thanks.

#8

Status:fixed» closed (fixed)

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

nobody click here