When developing a new site, for anyone you will generally have
test and/or development version of a site. These sites are
usually exact copies the live site, and from time to time you
will copy the live database to these sites.
Usually when doing this you will go through the site and
change some of the configuration values, like the gmap api
number, and others like the path to payment gateways and credit
card gateway indentification numbers to point to test versions of
the payment gateways.
Generally doing this by hand you will miss some parameters,
and have it really cause problems later. But there is an answer
that will allow you to set these values automatically so that
depending on the site, will be rewritten correctly everytime.
In the sites directory you will have a directory for each
site, and a settings.php file in each of these directories. Just
add to your test file the following
One of the biggest problems with being a web developer is being able to make sure that all your web site is cross platform. So that it will work on all browsers.
The majority of browsers (firefox, opera, etc) are cross platform. so no matter which os you run you can run these browsers. The problems come with IE and Safari which are only available in Windows, and OS X, and generally most developers have access to a windows machine since IE is the biggest bastard of a browser to develop for, and and the other side Safari is pretty standards compliant.
So most people will take route of getting a Windows machine to sort out IE, and hope more than anything that it will just work.
Now with the release of the Intel Macs 2 things have happened. You can now dual boot, or use parallels on your Mac to test IE, or the old PowerPC macs have become dirt cheap and will run OS X 10.4
Because I just wanted to dip my feet in the Mac waters, I picked up a PowerMac G4 400 for a couple of hundred bucks, and I get to play with OS X, and see if it is for me, and I can test Safari without any issues. It is a bit slow, but to play MP3's and check the layout of pages in Safari it is just right.
At this stage my next laptop is going to be a Macbook, and I am very happy with this.
Yesterday I was having fun with the image module creating a new hook to allow people to build contrib module which will modify images when they are uploaded. see http://drupal.org/node/42835 for more details.
I needed to add in a hook to the node so that it would call my process after the validation had completed. and would always be called no matter what action was taken, Preview or submit.
I triied adding it before the #submit, but it would not call on a preview. After talking with chx, I found a cool feature, and a use for buttons besides firing scripts.
One of the biggest problems with the node_access system is
that the you can only really use 1 node access module at a time.
So if you want to use simple_access and
organic groups
together, the access is not really going to work very well. In
fact it is totally useless.
Their is the great node_arbitrator module which
will allow modules to do this, but you need to use a new hook,
that both simple access and og do not support, but both intend to
support in the future. (I know that when I get a bit of time I
will put it into simple access)
Well I have been very busy over the last month on a couple of projects, so much so that I have not been able to do anything else, or drop a note on what I have been up to.
The biggest thing at the moment in my life is that the baby is now due in less than 4 months. It is starting to kick a lot and Sarah is starting to get use to it. But the little bugger will not kick for me ;-)
We had Xanders 5th birthday a couple of weeks ago, and and we had a lot of fun. We gave him a hot wheels track, and he is just loving it. I did have to stand in line for it at the KMart toy sale, but it was worth it.
Also I have finally done it, I have purchased a Mac. I have had a play with some mac laptops lately, and I have very interest in getting 1 for myself for my next laptop. However this is at least 8-12 months away. But I read this article which told of a guy getting a Mac for $25, and putting on OS X, and it ran just find. So off to ebay I went and picked up a G4/400 with OS X on it, and now I can test all my web sites with Safari, and get a feel for the Mac before I make the big plunge and buy the laptop.
As long as I can run itunes and play my music, I will be a great little machine.
Well it is that time again, and Melbourne is having it's second Meetup.
We have taken up a kind offer from Luke Hodges @ Sustainable Living Foundation to use their premise and internet to make this a much better meetup that people will learn more and gain more from this event.
see http://groups.drupal.org/node/993 for more information and the siteup sheet so we have a good idea on how many people are going to be comming.
I hope to see a good turn out, and hopefully better than we did have last time.
Over the last month or so I have doing a project which
involved installing CiviCRM for my clients contact managements
needs. So because of this I have been crawling around CiviCRM
quite a bit.
One of my clients requirements to a membership system which is
linked to both CiviCRM and Drupals E-Commerce, and gives access
to the parts of the system, and some other items such as books,
and resources.
I developed this membership system in Drupal, and used the
CiviCRM API to update contacts. But when enquiring on contacts
the problem was getting easy access to the membership information
and history. The obvious answer was to add a tab to the contacts
page for the membership information.
The problem with this is that the membership system was
developed in Drupal, and not in CiviCRM, so adding the tab, and
making the tab look like a CiviCRM page was going to be a
challenge.
When I was watching Call for Help tonight, Leo showed off Bryght.com on the show as well as demonstrated the new twit.tv site which is being created by lullabot.
This was pretty cool, and I think we can really add the "seen on tv" tag.
This is shown on episode #377, which has not been put on the site yet. I will update in the next day or so.
Drupal stores all dates in the unix time format which is the number of seconds since the 1/1/1970. This is good because adding days, it easy, just add 86400 seconds, or you can use the strtotime().
When you are trying to access data directly from the MySQL database because it is not stored in a date field, it just appears as a number.
However there is a trick you can use in MySQL which will display this number as a date. You can use the FROM_UNIXTIME() which will convert the unix time to a MySQL date. So you can do something like
SELECT n.nid, FROM_UNIXTIME(n.created) FROM node n
This will display the created field as a date field. These times will be displayed in GMT, so you will still need to adjust it to your local time.