Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Nuke Treasury
Author Message
xbdx
New Member
New Member



Joined: Nov 09, 2005
Posts: 4

PostPosted: Thu Dec 22, 2005 5:01 pm Reply with quote

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 [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Fri Dec 23, 2005 1:38 am Reply with quote

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);
 
View user's profile Send private message
xbdx







PostPosted: Fri Dec 23, 2005 11:03 am Reply with quote

thx man that worked
 
Doulos
Life Cycles Becoming CPU Cycles



Joined: Jun 06, 2005
Posts: 732

PostPosted: Tue Dec 27, 2005 2:28 am Reply with quote

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?
 
View user's profile Send private message
Raven







PostPosted: Tue Dec 27, 2005 2:44 am Reply with quote

I see no reason why that wouldn't work. What does it produce when you try it?
 
Doulos







PostPosted: Tue Dec 27, 2005 4:56 am Reply with quote

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







PostPosted: Tue Dec 27, 2005 9:00 am Reply with quote

Just for grins-n-giggles, try this. $DM_GROSS = "1000"; Did that work?
 
Doulos







PostPosted: Tue Dec 27, 2005 2:27 pm Reply with quote

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







PostPosted: Tue Dec 27, 2005 2:52 pm Reply with quote

Then something else is going on. Using the bbcode code syntax, please post your entire block code.
 
Doulos







PostPosted: Tue Dec 27, 2005 4:26 pm Reply with quote

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







PostPosted: Fri Dec 30, 2005 1:11 pm Reply with quote

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. Smile

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







PostPosted: Fri Dec 30, 2005 1:30 pm Reply with quote

It's expecting a number and is trying to format it numerically. Obviously 'Thanks' is not a number Smile
 
Doulos







PostPosted: Fri Dec 30, 2005 8:45 pm Reply with quote

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







PostPosted: Fri Dec 30, 2005 9:44 pm Reply with quote

You're running me in circles. Please post your code from // Set our remaining template vars on down.
 
Doulos







PostPosted: Sat Dec 31, 2005 1:52 pm Reply with quote

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

PostPosted: Fri Jan 06, 2006 2:52 pm Reply with quote

Any idea why Goal Met! would not display on one line? Check out mine on my home page
[ Only registered users can see links on this board! Get registered or login! ]

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&acute;s Goal:
</td>
<td align="left">
$DM_GOAL
</td>
</tr>
<tr>
<td width="100" align="left">Due Date:</td>
<td align="left">&nbsp;$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>
 
View user's profile Send private message Visit poster's website ICQ Number
Raven







PostPosted: Fri Jan 06, 2006 3:17 pm Reply with quote

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 Wink
 
Donovan







PostPosted: Fri Jan 06, 2006 3:32 pm Reply with quote

I use the same resolution.


hmmm...
 
Raven







PostPosted: Fri Jan 06, 2006 3:37 pm Reply with quote

Widen your browser. I use FF.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Nuke Treasury

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©