Programming


22
Jul 11

Code: Custom Node Add/Edit Title

You can achieve this by adding this to template.php in your theme folder.

function phptemplate_node_form($form) {
  switch($form['type']['#value']) {
    case 'my_node_type':
      $title = empty($form['nid']['#value']) ? 'Add a new custom node' : 'Edit a new custom node';
      drupal_set_title($title);
      break;
  }
  /** note: returning drupal_render_form() will bump your save / preview buttons up to the top **/
  return theme_node_form($form);
}

20
Jun 11

You are doing it wrong…

If you are putting this at the top of every file…

// i will keep yelling this
// DON'T FORGET TO START THE SESSION !!!
session_start();

You may just be doing php wrong… and I hate you


20
Mar 11

Setting up PHP 5.x on webfaction

PHP 5.2

1. Create a “Custom app listening on port” call it phpstack, note the port number you are assigned.
2. SSH into the server into the new application directory (~/webapps/phpstack/)
3. run: wget http://wiki.webfaction.com/attachment/wiki/MiscellaneousFiles/build_php_worker.sh?format=raw
4. Check that the file is executable by running: chmod +x build_php_worker.sh
5. Run the script ./build_php_worker.sh . PORT_NUMBER
6. Wait for it to finish building and read the instructions at the end.
(This can take 1 to 2 hours to complete.)

PHP 5.3

1. Create a “Custom app listening on port” call it phpstack, note the port number you are assigned.
2. SSH into the server into the new application directory (~/webapps/phpstack/)
3. run: wget -O build_php_worker531.sh ‘http://nero.webfactional.com/build_php_worker531.sh’
4. Check that the file is executable by running: chmod +x build_php_worker531.sh
5. Run the script: ./build_php_worker531.sh . PORT_NUMBER
6. Wait for it to finish building and read the instructions at the end.
(This can take 1 to 2 hours to complete.)


6
Mar 11

Instead of just Killing off IE6…

Why not kill off IE7 while we are at it?

So, IE6 is on the death march. It’s support ended July 13th 2010. Unfortunately it persists because of Windows XP, as it’s support lasts until 2014.

http://www.theie6countdown.com/

I figured I should help out, but I want to help kill of IE7 as well, so I found an IE6 notice script here: https://code.google.com/p/ie6-upgrade-notification-bar/. I have made quite a few changes to it, and here is the result:

http://seanja.com/demos/ie7-notice/.

The source is available on github https://github.com/SeanJA/ie7-notice.