Forums / All Other Contributions/Addons / Currency Update (Automatic)

Currency Update (Automatic)

Views: 82,431

Results 181 to 200 of 298
11 Feb 2010, 7:40 PM
#181
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Currency Update (Automatic)

I am new to this and have not had any problems setting up anything else with zencart until now.

I am loosing my mind with this. I have been at it for hours just to make sure i have read all the posts and not missed something.

The error I am getting when I try to access the "currency_update_curled.php file" using my browser just to see if it works is:

**Warning: **require_once(/home/[username]/public_html/imnaughty.net/includes/cinfigure.php) [function.require-once]: failed to open stream: No suchfile or directory in /home/dirtysic/public_html/imnaughty.net/currency_update_curled.php on line 20

Fatal error:require_once() [function.require-once]: Failed opeding required '/home/dcm2hdf/public_html/imnaughty.net/includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dirtysic/public_html/imnaughty.net/currency_update_curled.php on line 20

I have tried every variation i can think of. The "currency_update_curled.php file" is in the root directory. I have setup the cron job to be:
curl imnaughty.net/currency_update.php

as mentioned in a post about curled (cpanel)

I am unsure about the [username] also, is it your zencart usename or your username to login to cpanel or your username to login to your hosting???

Sorry if this is silly but i truely have read all 18 pages and cannot figure it out.

11 Feb 2010, 8:52 PM
#182
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

If you read the part you posted it says No suchfile or directory and failed to open file.

You need to play around with the part of script which mentions location.

Depending on your webhost the method you use may differ. See previous posts here for suggestions others have used

12 Feb 2010, 12:46 AM
#183
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

Hi Whitt,

Thanks for your comment. I understand that the location is the problem but I just can not figure it out. I have tried sooo many variations and literally read every post in the now 19 pages but can not get the right location.

I think it has maybe to do with the username,
When it says [username] - what username does it mean?

12 Feb 2010, 1:14 AM
#184
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

i use curled version and

'/var/www/vhosts/mywebsite.com/httpdocs/'

12 Feb 2010, 1:29 AM
#185
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

Re: Currency Update (Automatic)


i use curled version and

'/var/www/vhosts/mywebsite.com/httpdocs/'

Thank you for being so patient and taking to to assist.
I am trying everything i can think of and will try what you have above. In your example what does the "var" represent and the "vhost"????

not sure if this helps but my domain name is in my hosting account as an addon domain although the "currency etc" file is in the root directory for that domain name which is also the root directory for the zen-cart

Also just to clarify, the cron job detail should not affect me at this point of just using my browser to test if the file work - correct?

12 Feb 2010, 2:10 AM
#186
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

correct you can use browser at this stage.

I am not sure what var or vhost mean. that was on my hosts home page FAQ support area.
I just put file in root directory and think that must be how the script sends me to the root.
Some hosts use or need a different format .

give it a try and change my website to yours

12 Feb 2010, 2:56 AM
#187
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

I got onto my hosting support and they have told me that it should read:

/home/dirtysic/public_html/imnaughty.net/

this is what i have put into the file:

DEFINE ('/home/dirtysic/public_html/imnaughty.net/')

//Get Zen Cart configuration data
require_once('/home/dirtysic/public_html/imnaughty.net/currency_update_curled.php/includes/configure.php');
('/home/dirtysic/public_html/imnaughty.net/currency_update_curled.php/includes/database_tables.php');

But it still comes up with this error:

Warning: define() expects at least 2 parameters, 1 given in /home/dirtysic/public_html/imnaughty.net/currency_update_curled.php on line 17

Warning: require_once(/home/dirtysic/public_html/imnaughty.net/currency_update_curled.php/includes/configure.php) [function.require-once]: failed to open stream: Not a directory in /home/dirtysic/public_html/imnaughty.net/currency_update_curled.php on line 20

Fatal error: require_once() [function.require]: Failed opening required '/home/dirtysic/public_html/imnaughty.net/currency_update_curled.php/includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dirtysic/public_html/imnaughty.net/currency_update_curled.php on line 20

I am loosing my mind - PLEASE HELP

12 Feb 2010, 3:37 AM
#188
whitt avatar

whitt

New Zenner

Join Date:
Aug 2008
Posts:
29
Plugin Contributions:
0

Re: Currency Update (Automatic)

what happens if you use?
'/home/dirtysic/public_html/'

remember if you are going to use browser when it works you will get a blank page.

12 Feb 2010, 4:07 AM
#189
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

still no good - tried a few more variations but still not working. I tried without imnaughty and others but i am sure it needs to have imnaughty.net as that is a subdomain/addon on my hosting account.

I am open for any other ideas? maybe I should try the other version that is not "curled"?

12 Feb 2010, 4:08 AM
#190
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

Also, I am not sure but I dont think it has anything to do with permissions as i have set it to 744 for now but can change it if anyone thinks that is it

12 Feb 2010, 10:16 AM
#191
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Currency Update (Automatic)

Installed this mod today on both of my stores (in separate sub domains) and simply duplicated the file currency_update.php as store1_currency_update.php and store2_currency_update.php.

Set up cron jobs as below, tested in cPanel and browser and it worked immediately without a glitch.

Great mod, thank you indeed. Shame the ECB does not update the xml file more often, especially when the markets are volatile.

This cron job has been suggested previously

/usr/lib/php /home/username/public_html/path/currency_update.php

My host requires

/usr/local/bin/php /home/YOUR_USER_NAME/public_html/store1_currency_update.php

and

/usr/local/bin/php /home/YOUR_USER_NAME/public_html/store2_currency_update.php

In the above command please note the space BETWEEN /usr/local/bin/php AND /home/YOUR_USER_NAME/public_html/store2_currency_update.php

if you close that gap (ie no space) the whole thing falls over.

Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

12 Feb 2010, 11:14 AM
#192
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Currency Update (Automatic)

This command should also work on a Linux server (not tested on my server though):

wget http://www.yourdomain.com/subdomain/currency_update.php
or
wget http://www.yourdomain.com/currency_update.php

depening where your file is located

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Feb 2010, 7:27 AM
#193
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

I still cant get it - i am sure i have the correct information but I must be just mixing it up? Anyone have any other suggestions?

28 Feb 2010, 10:08 AM
#194
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

I am still stuck with this.

Currently I have the file like this:

DEFINE ('/')

//Get Zen Cart configuration data
require_once('/home/dirtysic/public_html/imnaughty.net/currency_update.php/includes/configure.php');
('/home/dirtysic/public_html/imnaughty.net/currency_update.php/includes/database_tables.php');

But it still comes up with this error:

Warning: define() expects at least 2 parameters, 1 given in /home/dirtysic/public_html/imnaughty.net/currency_update.php on line 17

Warning: require_once(home/dirtysic/public_html/imnaughty.net/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/dirtysic/public_html/imnaughty.net/currency_update.php on line 20

Fatal error: require_once() [function.require]: Failed opening required 'home/dirtysic/public_html/imnaughty.net/includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dirtysic/public_html/imnaughty.net/currency_update.php on line 20

:censored:
Can anyone see what is wrong? If there is someone who knows how this works, I will pay to get this sorted as It is really taking too much of my time.

28 Feb 2010, 10:28 AM
#195
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Currency Update (Automatic)

We can't see your server paths from the outside, but my best guess would be that you should set the first line to

DEFINE('PATH_TO_STORE_ROOT','');

and set the next two back to

// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');

This is based on a reading of your warning and error messages that seem to suggest that you have placed the currency update file in your site's root folder

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

1 Mar 2010, 7:43 AM
#196
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

:clap:

Kuroi - you a legend, or possibly the zen God. It looks like that worked. I just used the original file that i downloaded intially. It looks like it worked and now just waiting for the cron job to go through.

Can I ask one more thing?
now that the file is changed back to the original do i still need to make the changes to the code at the bottom? As mentioned in other posts such as #169:

$newrates = $newrates."\n".$currency['code']." ".$rate;

if ($rate) {mysql_db_query(DB_DATABASE, "update " . TABLE_CURRENCIES . " set value = '" . $rate . "', last_updated = now() where currencies_id = '" . $currency['currencies_id']. "'", $link);}

}
}

mysql_close($link);
//end lookup

$to = "[email protected]";
$subject = "Currency Update";
$thedate = getdate();
$thedate = $thedate['hours'].":".$thedate['minutes'].".".$thedate['seconds']." ".$thedate['mday']."/".$thedate['mon']."/".$thedate['year'];
$body = "mywebsite.com\n\ncurrency_update.php script has been run on ".$thedate."\nRate: ".$newrates;
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}

OR does the standard file work?

Mal

1 Mar 2010, 9:07 AM
#197
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Currency Update (Automatic)

imnaughty:

now that the file is changed back to the original do i still need to make the changes to the code at the bottom? As mentioned in other posts such as #169:Those changes aren't part of this mod as such. They are a notification for the store owner that a change has occurred in the case where somebody triggers it manually by browsing to the file (CRON can usually be set to send an email in cases where the changes occur as planned).

However, this is only relevant when the file has been installed below the web root (in your case public_html). The mod is designed such that the file can be placed outside the web root, in which case nobody without inside access to the server would be able to execute the script anyway.

Even with it installed below the web root, I don't really see any risk. While I don't like the idea of a visitor being able to trigger a script on your site, in this case it would simply mean that they've improved the accuracy of your rates slightly before you do it yourself - so no real downside, i.e. I wouldn't bother with these additions.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

5 Mar 2010, 3:10 AM
#198
imnaughty avatar

imnaughty

New Zenner

Join Date:
Feb 2010
Location:
Brisbane Australia
Posts:
10
Plugin Contributions:
0

Re: Currency Update (Automatic)

IT WORKED!

Thank you Kuroi, all I had to do is use the default file and not make any changes to it. I put in the CRON job and it works. Thank you. Kuroi - sent you a PM

16 Apr 2010, 10:13 AM
#199
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Currency Update (Automatic)

frank18:

This command should also work on a Linux server (not tested on my server though):

wget http://yourdomain.com/currency_update.php

Just set this up on my third store albeit on a different server to the other two and with newer version of cPanel.

At first I placed the file into various locations, used this command to no avail

/usr/local/bin/php /home/MY_ACCOUNT/public_html/FOLDER/currency_update.php

then moved it to top level and used the command

wget http://mystore.com/currency_update.php

Result: :clap::clap:

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

22 Apr 2010, 5:43 PM
#200
owendev avatar

owendev

New Zenner

Join Date:
Jan 2010
Posts:
6
Plugin Contributions:
0

Re: Currency Update (Automatic)

I'm using this mod.

I installed this months ago, and had a bit of trouble getting it work but I figured it out soon after.

Randomly, a couple of days ago, I'm getting an error in the cron email:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /nfs/c04/h02/blah/blahblah/data/currency_update.php on line 51

Any ideas?

Nothing changed to the code or anything... :(