User login

How to

Information on how to do something... anything.

Displaying taxonomy terms differently according to their vocabulary

This is how one would embed it in a node.tpl.php, but this should all be done in a pre-process function instead.

Where to save configuration settings for MacVim

UPDATE: I'm off the Mac for development and onto Ubuntu so now see at the link for the latest version of my .vimrc file for PHP.

MacVim configuration should be put in a file called "gvimrc" in your user directory:

~/.gvimrc

Here are some configurations used for Drupal:

set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent

Shell commands for untarring (and deleting the archive) a bunch of gzip files

In the process of adding modules Agaric finds useful to Drupal development to a special git repository I did a bit of bash command line scripting that was fun for me:

After a bunch of wget's like:
wget http://ftp.drupal.org/files/projects/schema-6.x-1.3.tar.gz

I ran:

for a in `ls -1 *.tar.gz`; do tar -zxvf $a; done
for a in `ls -1 *.tar.gz`; do rm $a; done

Adding tracking code via template.php

Adding custom tracking Javascript confused me on doing it the Drupal way.

When the goal was adding:

  <script type="text/javascript" language="javascript">llactid=14159</script>
<script type="text/javascript" language="javascript" src="http://trackalyze.example.com/trackalyze.js"></script>

Manually add a new repository to the Agaric test server

If done manually, basic code is this:

On the test server:

cd /srv/git/
mkdir projectname.git
cd projectname.git
git init --bare

Back in your project on your local computer:

git remote add origin git.example.com:/srv/git/projectname.git
git push origin master

Giving more people the power to approve subscriptions or memberships to a group

Client request, regarding a an e-mail for subscription requests to 'Example Mentors' from 'newusername' which she received through the site:

Load new content via AJAX and change the URL

Agaric wanted to know how to have a photo album where pictures would load when selected, without re-loading the rest of the page. The goal is to have the chosen picture load (with JQuery effects and any other coolness without a full page refresh) but to also have the URL in the address bar updates so people have a unique link back to the image.

Facebook does this, and the next time I was catching up on my friends' new album additions at 4 a.m. on a Sunday morning, I had to view source and see what was going on.

What looks like the key javascript code is copied below.

Open a .pls file in Songbird (play a playlist)

So as of version 1.0.0, Songbird does not respond to external requests to open playlists, nor by dragging and dropping it, nor any easy method.

Go to File » Import a Playlist... to take care of this basic task.

This is also the way to play live music streams in many cases– download the .pls file and import it through the file menu.

Resolution

Always show N number of items when showing items in sets of N

<?php
/**
 * Pad an array with its own elements to make it divisible by the given number.
 *
 * Take items from the beginning of the array and add to the end to ensure the
 * array is a multiple of that number.  Useful for display with innerfade.
 *
 * Utility function that does not have any other home yet, but desperately
 * wants to escape from object-land here...
 */
function change_agent_au_pad(&$array, $num, $force = FALSE) {
  $count = count($array);

Syndicate content