janecodam
Forum Replies Created
-
Forum: Hacks
In reply to: PHP – Using ProgPress Thermometer with a global custom field valueThanks again, Ian for taking the time to respond. Much appreciated!
I’d like to set the value in one place to keep it simple for my client. I tried your code, but was unable to get it going; it seemed to break the code at the number value.
I tried the number_format option, to output the comma:
$nf = (get_custom_option ('raised-so-far', 0)); echo number_format($nf);Since I already have the ‘$’ for the currency as part of the HTML. This did work, adding the desired comma. So thank you, seeing your php syntax helped me along, I’m pretty green at this.
Jane
Forum: Hacks
In reply to: PHP – Using ProgPress Thermometer with a global custom field valueThank you for your prompt reply, it is working well! I’m using the same value to populate the number above the text “Raised So Far”, directly below the thermometer. It is working well here too, but I’d love to see a comma added. Obviously a comma breaks the thermometer function, so it can’t be added in the option setting itself. Here’s the code I have now:
<?php if (function_exists('jcp_progpress_generate_meter')){ echo jcp_progpress_generate_meter("title", 40000, get_custom_option ('raised-so-far', 0), 0, "label"); }?></div> <div id="goal"><span class="thermometer_numbers">$40,000</span> <br /> Campaign Goal</div> <div id="raised"><span class="thermometer_numbers">$<?php echo get_custom_option ('raised-so-far', 0); ?>