Author Archive for ryan

Page 3 of 15

Neumodo’s Photoshoot

Edited some clips I took during the photoshoot

Drupal Tip #3 – Determining Drupal Version

http://www.mydrupal.ca/2010-06-23/what-version-drupal-your-site-using has a helpful check list to go through when you need to determine the drupal version with missing Changelog files:

1. First thing to do is to read the CHANGELOG.txt file. It’s located in the root directory of your Drupal website. All versions of Drupal from 4.5-present have this file. Check the top entry in this file. It will have the Drupal version number. Unfortunately for our purposes today, many developers delete this file on live sites because it is perceived as a security risk.
2. Second thing to do is to check the VERSION constant in modules/system.module. This was added in Drupal 5.0.
3. If you can’t find the VERSION constant in modules/system.module then your version number is most likely 4.7 or earlier. In Drupal 4.7, the site ‘offline for maintenance’ feature was added.
4. In Drupal 4.6, a site-wide contact form (modules/contact.module) and search block were added.
5. In Drupal 4.5, all GIF’s in the default themes were replaced with PNG’s. If you can’t find the modules/contact.module, then your site is most likely Drupal 4.5.
6. You can actually download the 4.x versions on Drupal.org. Then you can compare the files in more detail. This article covers the major releasees and not the minor releases. For example upgrading from 4.51-4.52, is called a minor release.

Drupal Tip #2 – Limiting long strings

Use truncate_utf8 to quickly limit strings to certain lengths, and define whether the break should occur at character level or word level. Also optionally appends ‘ …’. Point to take note is that the ‘ …’ would not add to the resultant length – drupal compensates it by limiting the original string 4 characters less. This would be obvious in the example below, as each output never exceeds the 20 character limit.

For example:

$sentence = 'a quick brown fox jumps over the lazy dog';
echo truncate_utf8($sentence, 20); //a quick brown fox ju
echo truncate_utf8($sentence, 20, TRUE); //a quick brown fox
echo truncate_utf8($sentence, 20, TRUE, TRUE); //a quick brown ...
echo truncate_utf8($sentence, 20, FALSE, TRUE); //a quick brown fo ...

// Output side-by-side:
//a quick brown fox ju
//a quick brown fox
//a quick brown ...
//a quick brown fo ...

Drupal 4.7 – 6:
truncate_utf8($string, $len, $wordsafe = FALSE, $dots = FALSE)

Drupal Api Reference: truncate_utf8

Drupal Tip #1 – Formating Time Ago

Drupal has a nice little function called format_interval that formats a time interval in a “x secs ago” fashion. Note that it accepts a time interval, not an absolute time value, thus you need to subtract the time value from time().

For example, to print your node’s created time, use:

<?php echo 'Submitted ',format_interval(time()-$node->created),' ago'; ?>

Drupal API ref for format_interval()

Image not showing on Facebook Share

Apparently, Facebook doesn’t like .png images. When I tried to defined a png in the open graph properties “og:image”, the loading icon in the share window goes on for awhile before disappearing entirely. Fix: use a .jpg instead.

As advised on facebook docs: og:image – An image URL which should represent your object within the graph. The image must be at least 50px by 50px and have a maximum aspect ratio of 3:1.

Also, consider using the handy linter utility at http://developers.facebook.com/tools/lint/ to check the meta data of your page.

The Burning Man Project

Trying to explain what Burning Man is to someone who has never been to the event is a bit like trying to explain what a particular color looks like to someone who is blind.



In 2010, 30th August, more than 50,000 people gathered at Black Rock Desert in northern Nevada, USA. They erected a city on the 400 square mile emptiness, and proceeded to survive 8 bohemian days in this makeshift community experiencing creativity, spirituality, and sexuality. Many ideas are explored including traces of the hippie movement, sustainable living, nudism, religion, socialism, anarchy and many others.
Continue reading ‘The Burning Man Project’

ZEROING by Andrey Nepomnyaschev

ZEROING from andrey nepomnyaschev on Vimeo.

Direction & animation by
Andrey Nepomnyaschev
www.anep.ru

Sound design by
Studio Takt
www.studio-takt.com

easySwap is now uSwap

The new version of easySwap (beta 2.0) is out! The NTU Student Union has volunteered to host it on their server (and provide the manpower to maintain it, so I had to change the name to uSwap as well, to be in line with their branding.

Find it at http://su.ntu.edu.sg/uswap

Unfortunately, I still did not have time to implement the other features that I had wanted to, especially the email notifications. High priority in my list is also to implement caching of the results so that it wouldn’t be so taxing on the server when the “refresh rate” is high.

Part of me also wanted to port the project over to plain html/php so that its supported on the iPhone/iPad (probably with jQTouch), but… that’s for next time.

Satoshi’s Last Words

Thanks to Makiko Itoh for translating Satoshi’s last words. It is definitely long and rambling as she claimed, but I found it an easy reading. Being an animator and also someone who tends to surround myself with work, makes me rethink.

http://www.makikoitoh.com/journal/satoshi-kons-last-words

Joomla: TinyMCE is screwing up RokStories

RokStories is an easy way to add those rotating images on your joomla installation. Making them work, however, might require some tinkering. By default, the TinyMCE content editor modifies your html for its own purposes, and this screws up RokStories as it cannot recognize the images in your article if there are foreign attributes such as mce_src in the <img alt=”" /> tag. Editing the html source (with the TinyMCS Source editor) will not solve the problem as the extra attributes are inserted once you go back to the editor and save.

A quick way to overcome this is to temporary disable TinyMCE and use a plain text editor, removing unknown attributes and making sure the url to the images are relative. Other points to take note if its still not working:

  1. Remove any height and width definitions.
  2. Shift the src attribute to the front (<img src=”…” alt=”…” /> instead of <img alt=”…” src=”…” />)
  3. Remove any instances of <div></div>
  4. Add a readmore tag to separate the text content from the image.

Tutorial from Rocket Theme: http://www.rockettheme.com/forum/index.php?f=18&t=82376&p=420867&rb_v=viewtopic