Author |
Message |
xbdx
New Member


Joined: Nov 09, 2005
Posts: 4
|
Posted:
Thu Dec 22, 2005 5:01 pm |
|
my Donat_o_Meter.php block is showing a negative number for the Left to go value. My donations for the month are full filled but the value for left to go is showing up as negative. Is there any way that if the donations for the month are completed and then the value for Left to go would say something like " donations for the month are fullfilled" or something like that.
any help would be appreciated..
thx
my site www.dub-land.com/home/ |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Dec 23, 2005 1:38 am |
|
In your donat-o-meter block, find code similar to this and change yours accordingly to make it look like this
Code: // Set our remaining template vars
$DM_MON = $row_Recordset1[mon];
$DM_GOAL = sprintf('$%.02f', $row_Recordset2['value']);
$DM_DUE = trim($row_Recordset1['due_by']);
$DM_NUM = $row_Recordset1['count'];
$DM_GROSS = sprintf('$%.02f',$row_Recordset1['gross']);
$DM_NET = sprintf('$%.02f',$row_Recordset1['net']);
$DM_LEFT = $row_Recordset2['value'] - $row_Recordset1['net'];
if ($DM_LEFT<=0) {
$DM_COLOR='black';
$DM_LEFT = 0;
$DM_NET = "Goal Met!";
}
else $DM_COLOR='red';
$DM_LEFT = sprintf('$%.02f', $DM_LEFT);
|
|
|
|
|
 |
xbdx

|
Posted:
Fri Dec 23, 2005 11:03 am |
|
|
|
 |
Doulos
Life Cycles Becoming CPU Cycles

Joined: Jun 06, 2005
Posts: 732
|
Posted:
Tue Dec 27, 2005 2:28 am |
|
I am trying to get the Gross amount received to say "Thank-You".
Like this:
December´s Goal: $55.00
Due Date: Dec 31
Amount in: Thank-You
Balance: Goal Met!
Left to go: $0.00
I tried just adding $DM_GROSS to the code you gave xbdx like this:
$DM_LEFT = 0;
$DM_GROSS = "Thank-You";
$DM_NET = "Goal Met!";
but it is not doing what I want. Suggestions? |
|
|
|
 |
Raven

|
Posted:
Tue Dec 27, 2005 2:44 am |
|
I see no reason why that wouldn't work. What does it produce when you try it? |
|
|
|
 |
Doulos

|
Posted:
Tue Dec 27, 2005 4:56 am |
|
It made no change at all. I even tried clearing my cache and using a different browser - nothing. Coming from a total php ignoramous, it seems like it should work, but it doesn't. |
|
|
|
 |
Raven

|
Posted:
Tue Dec 27, 2005 9:00 am |
|
Just for grins-n-giggles, try this. $DM_GROSS = "1000"; Did that work? |
|
|
|
 |
Doulos

|
Posted:
Tue Dec 27, 2005 2:27 pm |
|
Nope, that didn't work, either. Not only that but, I uploaded the stock version of block-Donat-o_Meter.php and after refreshing the browser, it still shows this:
December´s Goal: $55.00
Due Date: Dec 31
Amount $106.00
Balance: Goal Met!
Left to go: $0.00 |
|
|
|
 |
Raven

|
Posted:
Tue Dec 27, 2005 2:52 pm |
|
Then something else is going on. Using the bbcode code syntax, please post your entire block code. |
|
|
|
 |
Doulos

|
Posted:
Tue Dec 27, 2005 4:26 pm |
|
I guess when I uploaded the stock version, I did not use the correct one. When I loaded the block from vs 1.1 it went back to normal. Thanks.
Maybe I modified the 1.0 version instead of the 1.1 vs. I will try that and see if it works. |
|
|
|
 |
Doulos

|
Posted:
Fri Dec 30, 2005 1:11 pm |
|
I figured out what the problem was. The "Thank-You" was too wide for the block. I shortened it to "Thanks," and it worked fine.
However, I don't understand what this code does:Code:
else $DM_COLOR='red';
$DM_LEFT = sprintf('$%.02f', $DM_LEFT);
|
When I tried to add this to it:
Code:$DM_GROSS = sprintf('$%.02f', $DM_GROSS);
|
it wipes out the "Thanks," and puts in 0.00:
I assumed that what the first code did was say (in layman's terms) If the amount left is NOT <= to 0 then never mind and keep the original calculation.
If this is truly what it means then I don't get why adding the second bit of code would do what it does. Basically, I don't get it. Period. |
|
|
|
 |
Raven

|
Posted:
Fri Dec 30, 2005 1:30 pm |
|
It's expecting a number and is trying to format it numerically. Obviously 'Thanks' is not a number  |
|
|
|
 |
Doulos

|
Posted:
Fri Dec 30, 2005 8:45 pm |
|
Ya, but if you look up at the other code it the "else" area you see
Code:
else $DM_COLOR='red';
$DM_LEFT = sprintf('$%.02f', $DM_LEFT);
|
Isn't this expecting a number too? "Goal Met!" is not a number. I just added a line to make it look like this:Code:
else $DM_COLOR='red';
$DM_LEFT = sprintf('$%.02f', $DM_LEFT);
$DM_GROSS = sprintf('$%.02f', $DM_GROSS);
|
? |
|
|
|
 |
Raven

|
Posted:
Fri Dec 30, 2005 9:44 pm |
|
You're running me in circles. Please post your code from // Set our remaining template vars on down. |
|
|
|
 |
Doulos

|
Posted:
Sat Dec 31, 2005 1:52 pm |
|
Raven, here is the edited code.
Code: // beginning of edit Set our remaining template vars
$DM_MON = $row_Recordset1[mon];
$DM_GOAL = sprintf('$%.02f', $row_Recordset2['value']);
$DM_DUE = trim($row_Recordset1['due_by']);
$DM_NUM = $row_Recordset1['count'];
$DM_GROSS = sprintf('$%.02f',$row_Recordset1['gross']);
$DM_NET = sprintf('$%.02f',$row_Recordset1['net']);
$DM_LEFT = $row_Recordset2['value'] - $row_Recordset1['net'];
if ($DM_LEFT<=0) {
$DM_COLOR='black';
$DM_LEFT = 0;
$DM_GROSS = "Thanks,";
$DM_NET = "Goal Met!";
}
else $DM_COLOR='red';
$DM_LEFT = sprintf('$%.02f', $DM_LEFT);
// end of edit
|
This produces the changes I wish in the Donat-o-meter block, but it now the Survey block looks like this:
Survey
HELP KEEP OUR SERVERS ONLINE!
Make donations with PayPal!
Donat-o-Meter Stats
December´s Goal: $55.00
Due Date: Dec 31
Amount in: Thanks,
Balance: Goal Met!
Left to go: $0.00
©
Donations
Anonymous Dec-29
Pero Dec-26
-=]FGA[=-Doulos Dec-24
-=]FGA[=-Bushmaster Dec-20
Buffy Dec-17
-=]FGA[=-Doulos Dec-11
-=]FGA[=-Bushmaster Dec-8
What do you think about this site?
Ummmm, not bad
Nice
Cool
Terrific
what, you call this a website?
Results
Polls
Votes: 9
Comments: 0 |
|
|
|
 |
Donovan
Client

Joined: Oct 07, 2003
Posts: 735
Location: Ohio
|
Posted:
Fri Jan 06, 2006 2:52 pm |
|
Any idea why Goal Met! would not display on one line? Check out mine on my home page
http://www.3rd-infantry-division.net/
Can't get it to display on one line for anything. Messed with it for over an hour and can't figure it out.
Here is my Donatometer.html
Quote: |
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" colspan="2" align="center">
$DM_TITLE
</td>
</tr>
<tr>
<td width="100%" colspan="2" align="center">
<a href="modules.php?name=Donations">
<img src="$DM_BUTTON" border="0" alt="Make donations with PayPal!" $DM_BUTT_DIMS align="center">
</a>
</td>
</tr>
<tr>
<td width="100%" align="center" colspan="2">
<u><b>Donation Stats</b></u>
</td>
</tr>
<tr>
<td width="100" align="left">
$DM_MON´s Goal:
</td>
<td align="left">
$DM_GOAL
</td>
</tr>
<tr>
<td width="100" align="left">Due Date:</td>
<td align="left"> $DM_DUE</td>
</tr>
<tr>
<td width="100" align="left">Gross Amount:</td>
<td align="left">$DM_GROSS</td>
</tr>
<tr>
<td width="100" align="left">Net Balance:</td>
<td align="left">$DM_NET</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" colspan="1" align="center">
<b>Left to go:</b></td>
</tr>
<tr>
<td width="100%" align="center"><b>$DM_LEFT</b></td>
</tr>
</table>
|
|
|
|
 |
 |
Raven

|
Posted:
Fri Jan 06, 2006 3:17 pm |
|
It looks fine on mine. It will be a resolution size issue. I use 1280x1024. On smaller screens it will compact and over-flow/wrap as tables do  |
|
|
|
 |
Donovan

|
Posted:
Fri Jan 06, 2006 3:32 pm |
|
I use the same resolution.
hmmm... |
|
|
|
 |
Raven

|
Posted:
Fri Jan 06, 2006 3:37 pm |
|
Widen your browser. I use FF. |
|
|
|
 |
|