Just stumbled onto this nice little function, probably not big news to Drupal code-heads... but as a themer that frequently works in a staging development environment, I find that sometimes I'll need to use an absolute path for an image path or whatever.
Well, if you need to print the absolute path to a given file, use the url() function:
http://api.drupal.org/api/function/url/6
The fourth argument of the function allows you to make it return the absolute path, including the http:// and the domain part.
Usage:
As a themer, you frequently want to cut a bit of text to a certain length, be it for layout reasons, or teasers.
Luckily, instead of trying to figure out how to do it cleanly with PHP, Drupal API provides a very handy function that does what we need to do, to any text string.
truncate_utf8() api.drupal.org/api/function/truncate_utf8/5
First, cd to the directory that once held the file you want to restore. Then, run the following to get a list of all the files that were in this directory at some point, along with revision numbers:
svn log --verbose
Find the file you want to restore, note the revision number from the revision BEFORE the file was deleted. This is what you'll be restoring. Next, use the following command and format to being that file back from the dead:
i think that if all of a sudden, the economy crashed, and all we could eat were peanut butter and jelly sandwiches... it wouldn't be THAT bad.