code monkey not functional or elegant

31Aug/110

window.WebSocket and Firefox

In Firefox(5, not sure of >) wesockets are enabled but blocked by default. You can unblock them by setting network.websocket.override-security-block  = false. The issue is that some libraries such as socket.io do

if (window.WebSocket) return;

To test if the browser supports websockets which means they are able to use them, FF will however pass that test even with network.websocket.override-security-block = false.

Filed under: General No Comments
5Mar/112

Drupal Comment Depth

I was quite astonished when a colleague said to me that the you cannot set the maximum depth of drupals comment threading. It turns out he wasn't the only person having this issue http://drupal.org/node/323237

Turns out this could easily be done by using hook_link_alter. According to the docs http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_link_alter/6 if the the current link is a comment the third parameter($comment) will be a object of the current comment and $comment->depth contains...you guessed it, the depth of the current comment. Here you can unset the $link['comment_reply'] which stops user from clicking through to reply to a comment of the desired depth. This only stops them clicking through to create the undesired depth, you need to also stop them manually navigating the comment creation form. Which can be done by using form_alter and checking the depth of the parent comment that they are replying to.

I thought it would be good idea to create this as a separate module and have a separate comment depth foreach content type. This module removes the reply link from comments that are already of the set depth and also displays a access denied message if the user went out of their way to create a comment of incorrect depth.

After installing the module, navigate to edit screen for your desired content type(i.e. page admin/content/node-type/page) and at the bottom of comments setting group there should be a depth drop down, select a value and save.

comment_depth module

Filed under: General 2 Comments
9Jan/112

Drupal Quicktabs Taxonomy

Quicktabs are great. It allows you to create blocks that contain tabs which can contain views, blocks, nodes and quicktabs. Once you have created your tabs you just visit your blocks section and enable the block, that's it.

I was using taxonomy for categorization of nodes and then showing those categories on the front page in tabs. To add a new category(term) I had to also add a new tab to the quicktabs manually. I had no problem doing this manual work but the programmer within did, plus what about if I wanted to switch to free tagging terms.

So I set about ways to create and edit quicktabs and edit programmatically. It was actually quite simple to create tabs http://drupal.org/node/332895 I also had to use hook_taxonomy to add, edit and delete tabs when a term is added, edited or removed.

So now I have a quicktabs that expand and contract depending on the terms in a given vocabulary and put into a Quicktabs Taxonomy module.

9Feb/1042

vBullshit update

There is an increase in the amount of orders for this software and also an increase in feature requests. Sadly at the moment I am up to my eyeballs with uni work and also my final year project. Some of the feature request are absolutely fabulous and would make the software more powerful. Active development on the program will resume as soon as I hand in my final year project.

Also previously I was using my laptop to despatch the activation keys. However I am having some difficulty being connected all the time, so there might be a small delay (1 hour maximum) in getting your keys.

Feel free to comment any feedback or feature requests.

Filed under: General 42 Comments
14Oct/090

AVG Fail

I think AVG is trying to tell me something...
The latest update of AVG blocks yahoo.com on FF

avgfail
meh

Filed under: General No Comments
4Oct/090

Drupal: Combining Taxonomy with Node Reference

Scenario: You want to get the taxonomy terms associated with the node the current node references. Make sure you download the node reference url module as this will provide us a link on the referencing node types and also auto-populates the node reference field with a value from the URL.

Read the full article

Filed under: General No Comments
27Jan/092

Excellent WebOS Idea

Very briefly looked around and found others doing the same but not putting emphasis or any on API. What I was thinking is having an Online OS with an API that developers can implement and have the software on their servers. Lots of these exist but didn't see any docs for developers. It would be awesome to have OOS where developers can host the software on their servers and then publish it to a market place and then allow the users to browse that place and then install the software (Kind of like ITunes but not device specific, not control freak open to all ad free). This would be awesome if it works with windows live services and Google docs from the start. The important part of the idea is the API, so the API should be available in different languages and easy to use. If you already know a service that does this please let me know. This service http://www.jooce.com/ looks nice but as far as I can see no API.

I don't know probably too adventurous but just thought

18Jan/090

Drupal module: Don’t tease me bro – update

I had a bit free time today and updated the dtmb module. Now instead of being forced to use no teaser at all after install, you can select it from the teaser length options at admin/content/node-settings. It's under 'none'.

17Jan/090

Drupal module: Don’t tease me bro

The other day I was asked whether it was possible to disable the teaser option in drupal. To my surprise I couldn't find a way, so I hit google and found all these nasty hacks to the template. So instead I threw together this little really simple module(ah I love drupal). The module empties the teaser field before it is stored.

28Dec/083

osdate – new signup look

The osdate signup form is quite long because it contains five sections that each contain at least three questions. Having all this on one page could scare off potential users. So I think that the whole form should be divided up into different sections and then present those sections to the user one at a time  with some indication of how much the user has completed.
I've spent the best part of the day just doing that. All the changes took place in the signup.tpl. First thing I did was to re-format the validateme javascript function so that it can be called for each section and know what to validate and what not to. Then I had to give each section which was a div, a unique id. Then it was just a matter of hiding all the sections at the start and as the user progressed through the form showing the appropriate section.
The new signup look will only be visible to users if they have scripting enabled else they'll see the page as before, a big fat form. So turn off scripting to see how the page looked before.
Filed under: osdate 3 Comments