Latest Projects

Latest posts

Wed, 02/08/2012 - 00:51 486 Comments

In a custom module, I needed to get the latest node that each user published. It is fairly easy to goup by users, but it needs a little something to actually accomplish the sorting.

The following query worked for me, we need to do the sorting in a nested select:


pager_query("SELECT * FROM (SELECT * FROM node order by created DESC) as node WHERE nid IN ($placeholders)...
Read more
Mon, 10/31/2011 - 19:19 997 Comments

One of my latests tasks was to allow a link that would take a user id and a node id as an argument, and automatically create a new order that would have some fields pre populated and ready for further editing. Scope is to use the user id as the client that does the order and to automatically select the product depending on the taxonomy term of the provided node.

In my case I offer a...

Read more
Tue, 10/25/2011 - 22:27 906 Comments

In some cases it is seems impossible to get rid of the duplicate entries that views return in the output.
Not an elegant way, but this small module would do the trick...

So let's create a module the usual way, and put the following code in the .module file.
This one is called remove_duplicates.

 
<?php
function remove_duplicates_views_pre_render(...
Read more
Sun, 08/28/2011 - 10:24 1,639 Comments

There are so many reasons to use Content Profile instead of the user's core profile. For once, profiles are created as separate nodes and therefore the full flexibility of CCK and VIews come in the game. This way it is possible to build some really sophisticated profiles, which is usually what is needed for any website.

I had to look around for an easy solution on how to load the user's...

Read more