Blogs

Simple access and Organic Groups integration

Posted by gordon on Wed, 09/08/2006 - 11:29pm

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)


It's been a while

Posted by gordon on Thu, 03/08/2006 - 10:28am

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.


Melbourne Meetup II

Posted by gordon on Thu, 13/07/2006 - 10:20pm

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.


Adding a Drupal page as a Tab to the CiviCRM Contacts page.

Posted by gordon on Thu, 22/06/2006 - 11:18am

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.


Imortalised forever

Posted by gordon on Tue, 13/06/2006 - 1:44pm

I have been interviewed by Jeff Roberts of Lullabot about the E-Commerce Release and other things.

If has got a lot of good information, and it was a fun chat.
 


Bryght.com featured on Call for Help

Posted by gordon on Mon, 12/06/2006 - 11:49pm

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.

Update: Added the link to the episode.


Drupal Dates in MySQL

Posted by gordon on Tue, 09/05/2006 - 10:21am

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.


Comment Spam Sucks

Posted by gordon on Fri, 05/05/2006 - 10:23am

One of the biggest problems with allows people to post comments is that all this crap spam comes along with it. Now I moderate all my comments so none of this spam goes onto my site, but removing the spam from the approval queue is very time consuming, esp when you have 12+ pages.

I know what I could install the spam module, or the bad behaviour module, but I have not gotten to it.

Now with the forms api, you can re-theme any form, so I did a small amount of coding and added to the command page a toggle all link which switches checks all the check boxes. This is just a quick hack that speeds this up a lot for me.

<?php
function phptemplate_comment_admin_overview($form) {
  $js = <<<EOL
<script type="text/javascript" language="javascript">
function toggle_checkboxes() {
  var inputs = document.getElementsByTagName('input');
  for (i = 0; input = inputs[i]; i++) {
    if (input && input.type == 'checkbox') {
      input.checked = (input.checked ? false : true);
    }
  }
  return false;
}
</script>
EOL;
  drupal_set_html_head($js);
  $form['options']['select all'] = array(
    '#value' => '<a href="#" onClick="return toggle_checkboxes()">Toggle Checkboxes</a>',
    '#weight' => 1,
  );
  // Call the real theme so if there are changes I don't need to worry about coping them over.
  return theme_comment_admin_overview($form);
}
?>

Now I have a little link which allows me to just click and check all the spams and then away they go.
 


Drupal 4.7 Released.

Posted by gordon on Mon, 01/05/2006 - 10:24pm

Drupal 4.7 Released!

This has been a heroic effort by everyone, and this is the Greatest version of Drupal yet. This release has had the most changes every for any release, and the most contributors.

So where does this leave E-Commerce. Well as I have said since I took over the maintenance that I (we) would be aiming to release E-Commerce 1 month after 4.7 was released. So now the the timer is ticking, and we should have a release by June 1.

This is quite approprate that today before 4.7 was released I posted to the E-Commerce group a request for ideas on what people would like to see in 4.8. Go and see http://groups.drupal.org/node/248 to see what has been added, and add more to it.


An interesting week on the Heydon Front.

Posted by gordon on Sat, 29/04/2006 - 9:32am

Well over the last week we have had some fun here in the Heydon house. Last Sunday Xander and Sam were playing, Running around the house, and then Sam ran into a door.

Their was blood coming from her head and we had a trip to the hospital.

Then a couple of days later, the same thing happened again. Except this time Xander hit his head, and there was just a huge egg. This is still comming down.

The best news happened last night when Xander stopped having his nightly bottles. He now has a cup of warm milk from his new special cup.

All and all it has been an interesting week.