OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Currency symbol

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Currency symbol

Postby ccrm » Thu May 12, 2005 4:44 am

Hi!

Is there an easy way to change the currency symbol from $ (dollar) to R (South African Rand)? Typing an "R" in front of the amount doesn't work: apart from potentially appearing confusing (is it now $400 or is it R400? - BIG difference in South Africa) it actually comes up with fees for all levels to be "free".

Perhaps there is merit in changing OCS such that in setting up a conference, the administrator should be able to choose the currency in which payments for that particular conference will be accepted?

Looking forward to a reply.

Markus Mostert
ccrm
 
Posts: 1
Joined: Thu May 12, 2005 4:26 am
Location: Rhodes University, South Africa

Currency symbol

Postby Barbara » Fri Oct 21, 2005 7:16 am

Has anyone got an answer to this one? I need to change the $ to a £.

Many thanks
Barbara
Barbara
 

Postby asmecher » Fri Oct 21, 2005 9:02 am

Hello Markus & Barbara,

Unfortunately there's no way to do this in the current version of OCS without modifying the source code. You'll have to look for places where the currency is referenced and change the $ to something else by hand.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 9083
Joined: Wed Aug 10, 2005 12:56 pm

Postby asmecher » Thu Oct 27, 2005 11:30 am

Hello Markus & Barbara,

Here is a diff that will change dollar-signs into pounds; it's easily modified for any other currency symbol (just replace £ with your currency symbol of choice).

Code: Select all
diff -u -r ocs/admin/include/step4.inc.php ocs-pounds/admin/include/step4.inc.php
--- ocs/admin/include/step4.inc.php     2004-01-10 18:40:17.000000000 -0800
+++ ocs-pounds/admin/include/step4.inc.php      2005-10-27 10:14:13.839795455 -0700
@@ -207,7 +207,7 @@
        $y=$i+1;
        echo "Level $y: <font class=\"instructions\">";
        echo sanitize_output($reg_levels[$i]);
-       echo "</font> &nbsp;&nbsp;&nbsp; Amount: <font class=\"instructions\">$";
+       echo "</font> &nbsp;&nbsp;&nbsp; Amount: <font class=\"instructions\">&pound;";
        echo sanitize_output($reg_fees[$i]);
        echo "</font><br />";
 }
@@ -236,7 +236,7 @@
        $y=$i+1;
        echo "Level $y: <font class=\"instructions\">";
        echo sanitize_output($reg_levels_late[$i]);
-       echo "</font> &nbsp;&nbsp;&nbsp; Amount: <font class=\"instructions\">$";
+       echo "</font> &nbsp;&nbsp;&nbsp; Amount: <font class=\"instructions\">&pound;";
        echo sanitize_output($reg_fees_late[$i]);
        echo "</font><br />";
 }
@@ -414,7 +414,7 @@
                }
                echo "Level $y: <input type=\"text\" name=\"reg_levels[]\" value=\"";
                echo sanitize_output($reg_levels[$i]);
-               echo "\"> &nbsp;&nbsp;&nbsp; Amount: $<input type=\"text\" name=\"reg_fees[]\" size=\"10\" value=\"";
+               echo "\"> &nbsp;&nbsp;&nbsp; Amount: &pound;<input type=\"text\" name=\"reg_fees[]\" size=\"10\" value=\"";
                echo sanitize_output($reg_fees[$i]);
                echo "\"> <input type=\"submit\" name=\"del_reg_level\" value=\"Delete Level #$y\" class=\"button\"><br />";
        }
@@ -468,7 +468,7 @@
                }
                echo "Level $y: <input type=\"text\" name=\"reg_levels_late[]\" value=\"";
                echo sanitize_output($reg_levels_late[$i]);
                echo "\"> <input type=\"submit\" name=\"del_reg_level_late\" value=\"Delete Level #$y\" class=\"button\"><br />";
        }
diff -u -r ocs/admin/registrants.php ocs-pounds/admin/registrants.php
--- ocs/admin/registrants.php   2004-01-10 18:40:17.000000000 -0800
+++ ocs-pounds/admin/registrants.php    2005-10-27 10:15:00.172866835 -0700
@@ -300,7 +300,7 @@
                        echo str_replace("\n","<br/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$items[address]);
                        // print out fee information, if conference uses fees
                        if($conference_items[reg_fees]) {
-                               echo "<br />\nRegistration Level: $items[reg_level] - \$$items[reg_fee]";
+                               echo "<br />\nRegistration Level: $items[reg_level] - &pound;$items[reg_fee]";
                                // print out link to mark user as paid
                                if($items[has_paid]!="paid") {
                                        echo " <font class=\"SmallText\">(<a href=\"".print_url("registrants.php?paid=$items[id]")."\">Mark as Paid</a>)</font>";
diff -u -r ocs/registration.php ocs-pounds/registration.php
--- ocs/registration.php        2004-01-10 18:40:17.000000000 -0800
+++ ocs-pounds/registration.php 2005-10-27 10:16:41.541581602 -0700
@@ -189,7 +189,7 @@

        <table border="1" cellpadding="2" cellspacing="0" width="300">
        <tr><td><b>Registrant</b></td><td><b>Cost</b></td></tr>
-       <tr valign="top"><td><?php echo $name."<br />".nl2br($address); ?></td><td><?php if($reg_fee > 0) { echo "\$$reg_fee"; } else { echo "Free"; } ?></td></tr>
+       <tr valign="top"><td><?php echo $name."<br />".nl2br($address); ?></td><td><?php if($reg_fee > 0) { echo "&pound;$reg_fee"; } else { echo "Free"; } ?></td></tr>
        </table>

        <p>Please submit payment with a print-out of this invoice to:</p>
@@ -314,7 +314,7 @@
                        echo "<input type=\"radio\" name=\"reg_level\" value=\"$reg_levels[$i] %% $reg_fees[$i]\"";
                        if($i == 0) { echo " checked"; }
                        echo "> $reg_levels[$i] - ";
-                       if($reg_fees[$i] > 0) { echo "\$$reg_fees[$i]"; }
+                       if($reg_fees[$i] > 0) { echo "&pound;$reg_fees[$i]"; }
                        else { echo "Free"; }
                        echo "<br />";
                }

If this patch is difficult to apply because of formatting issues on the bulletin board, contact me at pkp-support@sfu.ca and I can email you a copy.

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 9083
Joined: Wed Aug 10, 2005 12:56 pm


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 4 guests