HomeE-mail

Ka of Isis - Graphic design and handcrafted web sites

First snow 2012

14 October, 2012 | Filed under “The Archives

Click on the image to stop – and clear – the snow.

Coincidence? The heavens actually opened on this – in Norway traditionally called – first day of winter, to remind us of the cold moons in store for us. With no camera at hand and nothing else to document the event, the fragile white layer soon melted away to moisten the leaves of autumn and reveal a few forgotten apples beneath the garden tree.

The low temperatures lingered, however, and I went begging for a picture to have at least something to remind me to don the wool garments. Soon the cap. Aleady the mittens.

Image used with kind permission of Amy Nelson. You can visit her at Amy flying a kite.

  Leave a comment

My new love is a mysterium

20 June, 2012 | Filed under “The Archives

She arrived in bits and pieces over several months and her name is … Scarlet. She has never been known to flush, however, and sports no less than 5K stills and a native 13.5 stops of dynamic range. I can’t wait to play with her!

  Leave a comment

ExpressionEngine and Control Panel sessions

26 April, 2011 | Filed under “ExpressionEngine

Note: This work centers on ExpressionEngine 1.6.9 Core.

When you are logged in as an administrator in ExpressionEngine’s Control Panel and leave it inactive for more than one hour, you are automatically logged out and need to re-key your Username and Password to re-enter. Great for security but an irritation overall.

It is not immediately obvious how, or if at all, you can change the 60 minutes’ session. In Joomla, for instance, you can swap the 15 minutes Session Lifetime default under Site > Global Configuration > System. Searching the ExpressionEngine (EE) forum may surface the following dialogue between user and EE support:

Question: Is there a way I can set the timeout interval on the Control Panel?

Answer: The easiest thing to do is to set yourself up for just plain Cookies instead of Cookies and Sessions.

To do that, go:

Admin > System Preferences > Security and Session Preferences

and change Control Panel Session Type from Cookies and session ID to Cookies only. Leave User Session Type at the default Cookies only.

Depending on your system, this may or may not have an impact on security. If you work on localhost and/or are in full control of the computer/browser, Cookies only will be fine. If you share the computer, think twice.

Quoting EllisLab, there are three validation types in dealings with EE sessions:

1. User cookies and session ID

This is the most secure way to run a site. Three cookies are set:

All three cookies expire when you close your browser or when you have been inactive longer than two hours (one hour in the control panel). Using this setting does not allow ‘stay logged-in’ capability, as each session has a finite lifespan.

2. Cookies only – no session ID

With this validation type, a session is not generated, therefore users can remain permanently logged in. This setting is obviously less secure because it does not provide a safety net if you share your computer or access your site from a public computer. It relies solely on the password/unique_id cookies.

3. Session ID only

Most compatible as it does not rely on cookies at all. Instead, a URL query string ID is used. No stay-logged in capability. The session will expire after one hour of inactivity, so in terms of security, it is preferable to number 2.

Note: The control panel and public pages can each have their own session preference. End quote.

Of course, the word easiest in the answer above, triggered my imagination and I went on a quest for the Control Panel default session length. I found it in:

system > core > core.session.php

in line no. 64:

var $cpan_session_len = 3600; // Admin sessions expire in one hour

As noted on other occasions, you may have renamed your EE system folder. If this is the case, only you know where to look.

Change the 3600 (and that is milliseconds) to whatever suits your working habits. Save the file. If you have the Control Panel open, log out and then in again for the change to take effect.

All things considered, if you do not log out of the Control Panel when you leave the computer, a default one hour session still leaves ample time for prying eyes and itchy fingers to enter and wreak havoc.

I log out now.

  Leave a comment

ExpressionEngine Word Limiter and Norwegian typography

5 April, 2011 | Filed under “ExpressionEngine

Note: The following has been tested with Word Limiter version 1.0 in ExpressionEngine 1.6.9 Core.

The EllisLab Word Limiter plugin for ExpressionEngine will, by default, add an ellipsis (…) at the end of whatevet number of words specified for a given text field, like so:

This field of text has been limited to ten words…

Typographic rules for the Norwegian language call for an empty space between a word and an ellipsis (in Norwegian, ellipse, or in everyday speech, prikk–prikk–prikk), like so:

words …

How do we achieve this with the American plugin? As it turns out, we do not achieve it with the plugin at all. Instead, we have to dig into a system file and make some adjustments there. Navigate to:

/system/core/core.functions.php

Note: Security-wise you may have renamed the default system folder when you originally installed ExpressionEngine. Hence, the system folder may have a different name.

1. Duplicate core.functions.php and archive the original file elsewhere.

2. Return to the duplicate and make sure that the file’s name is equal to the original’s.

3. Open the duplicate in a “web safe” word processor and search for the line:

return trim($str).'…';

It sits below the Word limiter comment; in ExpressionEngine 1.6.9 Core it is line 820.

The … part is the Unicode character encoding for an ellipsis. It is fairly safe to use as most type designers include it with their font glyphs.

4. The quick and dirty fix for Norwegian web sites would be to type a space between the singe quote and the ampersand, like so:

return trim($str).' …';

However, this way you may end up with a line break between the last word and the ellipsis, leaving the ellipsis orphaned on the last line of text.

A better approach is to make sure that the last word drops down together with the ellipsis, like so:

words …

The code should read:

return trim($str).' …';

where   is a non-breaking space (aka  )

5. Save the file.

6. Check that the new file works as expected.

  Leave a comment

What does it mean to be a web developer in 2011?

17 February, 2011 | Filed under “The Archives

Alex Walker, Editor of SitePoint Design View, echoed my thoughts exactly in the 80th issue of his newsletter. Asking the question “What does it mean to be a web developer in 2011?” he dives in and answers himself:

“A decade ago, it meant you did almost everything, from quick-fire pencil sketches, through to Photoshop mockups, to working front-end code. If you had a dedicated back-end guy, you were considered a crack dev team.

In 2011, web development is a very different beast, and few of us try to cover it all. We’ve become UI designers, JavaScript gurus, SEO wizards, usability experts, information architects, copywriters, editors, database guns, and project managers. You might say none of us are web developers, but we all are.”

It is always a relief to find like-minded souls. We can gang up, halt all progress and oppose change, but, shit, Alex is a positive guy, ending his editorial with an:

“Exciting times ahead.”

I let Silverlight pass me by only to have it come back and haunt me on a recent project. I do not know Ruby on Rails from the Trans-Siberian Railway. It took jQuery to carry me back to JavaScript, only to find MooTools, Prototype, and script.aculo.us laughing at me from the corners of the DOM.

Being the lone wolf was one reason for freelancing in the first place. The freedom to work from home, the quiet hours of the night when ActionScript flows naturally. But it is impossible to stay on top of it all and a challenge to focus on the necessary, practical and useful stuff. Join a team? Sure. Any day, should they want a jack of all trades and master of none.

This may sound lamenting, and it is, of course. But, listen, I am excused. I handle the bodhrán and sing in this group of enthusiasts playing traditional Celtic-Irish-Scottish-English-Canadian folk music and we carry a Buffy Sainte-Marie song on our repertoire, Old man’s lament. The story told in the song is a far cry from web design and web development but it has inspired me to come up with this new word, “develament”. Not bad, eh?

Got to go. Another weekend lost to Joomla!. Exciting times ahead.

  Leave a comment

Get rid of the Joomla! generator meta tag

14 February, 2011 | Filed under “Joomla!

Joomla! is open source and free for all, and we use it because of this or because somebody has handed over to us a site built on the foundations of this content management system. Its programmers are proud of their achievements and rightly so. They even leave small traces behind to remind us of the fact that this or that site was created with Joomla!. This is why you see the following piece of code in the head section of many web pages:

<meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />

Out of respect for the open source community one should maybe leave the trace untouched. Morally. Ethically. I do not know. But my fingers itch when I see that meta tag and I want to remove it. Sod off, itch!

Open the following document in the Joomla! directive:

/libraries/joomla/document/html/renderer/head.php

Search for “generator” (without the quotes) to find the following line:

$strHtml .= $tab.'<meta name="generator" content="'.$document->getGenerator().'" />'.$lnEnd;

Comment out that line to read:

// $strHtml .= $tab.'<meta name="generator" content="'.$document->getGenerator().'" />'.$lnEnd;

Save the file.

Voilà! The generator meta tag is gone from the HTML source code.

Now, prepare for the hordes of programmers riding you down.

  Leave a comment

Installation of Joomla! on localhost in Mac OS X

14 February, 2011 | Filed under “Joomla!

Note: This tutorial has been tested for Joomla! 1.5.22 Stable in Mac OS X 1.5.5 (Leopard) running Apache HTTP Server Version 2.2.6 on a Macintosh G5.

Installation of Joomla! is not necessarily straightforward. I have run into more issues and error messages in my struggles than I care to dwell on here. But when I finally settled on a way to conduct the symphony, I decided to write it down for later reference. Please note that the following is what works for me on localhost in Mac OS X. If you want details on how to turn your client side Macintosh into a personal webserver, refer to the articles published under Apache on the Macintosh in the Laboratory ramblings of Ka of Isis. As of this writing, Joomla! 1.6 had just hit the streets but I still opted for the final stable version of 1.5.x as I did not want to end up a post-beta tester for the Joomla! community.

  1. On your local server, prepare Apache and its host files for a new site and create a new folder to act as root for your Joomla! site. Name it accordingly. For the purpose of this demonstration I called mine Joomla 1 and will continue to use that name below.
  2. Download the full Joomla! 1.5.22 stable ZIP package from www.joomla.org

    Mac OS X should automatically unzip the package, revealing a hefty 15+ MB archive of hundreds, nay, thousands of files and folders. Shudder. Shudder.

  3. Copy (or move) the contents of the package (not the folder itself) to Joomla 1.
  4. With your preferred FTP client, check that proper read/write permissions are established for Joomla 1. Its octal should be 755. If not, change the mode (aka CHMOD) from its default octal 700 to 755.

    CHMOD

    Fig. 1. CHMOD for local root folder. Left: Default. Right: For Joomla!. If you use the Transmit FTP app, remember to click <Apply> before you close the info window.

  5. Shut down MySQL.
  6. Shut down Apache.
  7. Restart Apache.
  8. Restart MySQL.
  9. Enter http://localhost/ (or simply: localhost) in your browser’s address field to check that Apache is running.
  10. Log in to MySQL to check that it is running, too.
  11. Log out of MySQL.
  12. In your browser, set cookies to be accepted always. This seems to be a prerequisite for a Joomla!-installation. You may, in fact, receive an error message stating: You will not be able to install the application with this feature disabled. If you are wary of any implications this can have, you may get away with a temporary solution where you allow all cookies for the period of installation and then go back to your preferred setting post installation. I have not tried this myself, however.

    In Safari, choose Safari > Preferences… > Security > “Accept cookies: Always”

  13. The complete error message sited above reads as follows:

    Cookies do not appear to be enabled on your browser client. You will not be able to install the application with this feature disabled. Alternatively, there could also be a problem with the server’s session.save_path. If this is the case, please consult your hosting provider if you don't know how to check or fix this yourself.

    As installation details for Apache and PHP may differ from machine to machine (and, remember, you are working on a local site, not a site set up by a webhotel host), it is impossible to give exact advise on how to deal with session.save_path settings. You may, of course, go ahead with the Joomla!-installation and hope for the best – and I have added support for error scenarios further down should you do so. I do, however, recommend an analysis of, and a possible modification to, the php.ini file which can be found here in Mac OS X 10.5.5:

    /private/etc/php.ini

    Open php.ini and search for “session.save_path” (without the quotes). Most probably it will be commented out as follows:

    ;session.save_path = "/tmp"

    Read all the comments related to this, and if you find no objections to them (such as other Apache installations using custom paths), uncomment the line to read:

    session.save_path = "/tmp"

    Or better still, something like:

    session.save_path = "/tmp/zz_bjorn_777"

    This way I, at least, will understand what is going on if I come back to the file a few weeks, months or years(?) from now. Visually, the new folder will (alphabetically) drop to the bottom of the folder view in list mode, I will know that ‘bjorn’ has tampered with the original php.ini file and that the folder was given CHMOD 777. A side effect, as mentioned in a Session save path article on Joomla!’s documentation site, is that only the new folder is made writable.

    Note: Do not forget to create that folder and CHMOD it! The article decribes how to do this via Terminal, but I find it more convenient to use my FTP client.

    Important: What is far from clear in all this, is whether the session save path is at all necessary when the installation process is complete. In fact, every Joomla!-installation creates its own tmp (temporary) folder in root, a path which can be modified in the configuration file. I have, in Mac OS X 10.5.8 on a Macintosh Intel model, experienced problems with log in to MySQL via phpMyAdmin when the session save path was set to /tmp. My recommendation (fragile as it may seem) is to open the path for only as long as the installation is carried out, and then comment out the line post installation. I have more than one Joomla! site in operation even with the session save path deactivated.

    Even more important: This article focuses on installations on local machines. Do not use 777 on a live server. Nicholas K. Dionysopoulos covers the details in his article 777: The number of the beast. The title says it all and I nearly forgot to mention it. Blimey!

  14. Save the file.
  15. Point your browser to the Joomla!-installation by entering the virtual host short name (in my case: joomla1) in the address field.

    The language step of a 7-step installation guide should open and the browser address should read http://joomla1/installation/index.php or similar.

  16. Select language. I opt for en-GB - English (United Kingdom).
  17. Choose <Next>.

    At this point, the installer may complain that configuration.php is not writable. No wonder, the installer has not even created one! Ignore the message and carry on by hitting <Next> one more time.

  18. Accept the license and choose <Next>.
  19. Enter connection parameters for your MySQL database. The only thing new for the basic settings is your choice of database name.

    Do observe that there is an accordion choice for advanced settings. I chose to delete existing tables (even though there are no Joomla! tables in the database yet) and entered a table prefix of jos1_ (security wise, I might have chosen something less obvious for a live server).

    Tip: If localhost does not cut it for host name, try 127.0.0.1

  20. Choose <Next>.
  21. If you get the following error: Cookies do not appear to be enabled on your browser client…, you may have skipped the early step where cookie allowance should have been set. Hit <Previous>, set cookies to be accepted always, and start over.

    If you still receive the error message, try even one more time for the hell of it (believe me, it has worked for me). If you still-still hit the wall, you may have to tinker with PHP-settings as outlined above.

  22. Step 5, the FTP configuration, I have never used. If you were able to get this far even with error messages, this option may be useful for your system. Otherwise, continue with <Next>.
  23. Main configuration asks for a site name, an e-mail address and an administrator password. Your choice.

    Note: Joomla! offers a default username, admin. This is used, together with the password entered above, to log in to the Joomla! control panel. Both username and password can be changed later.

    Important: If you wish to perform a clean installation, do not click on the <Install Sample Data> button. If, however, you want to install sample data (as recommended for beginners), do click on the button.

  24. Choose <Next>.
  25. You may have gotten away with the following error message earlier, but it may rear its ugly head once more if you made no change to php.ini:

    Cookies do not appear to be enabled on your browser client. You will not be able to install the application with this feature disabled. Alternatively, there could also be a problem with the server's session.save_path. If this is the case, please consult your hosting provider if you don't know how to check or fix this yourself.

    Please modify php.ini as described above, save the file, return to the Joomla! installation script, hit <Previous> and start all over (yes, you will have to start all over).

    Note: It should not be necessary to restart Apache.

  26. When you reach the final stage of the installer, “Step 7: Finish”, you will be hard pressed to miss the message urging you to completely remove the installation directory. So, open the Joomla 1 folder and trash the folder named installation.
  27. Important: If you ran an installation that was not able to create a configuration file up front, read this note presented in Step 7 and follow its instructions:

    “Your configuration file or directory is not writable or there was a problem creating the configuration file. You will have to upload the following code by hand. Click in the text area to highlight all of the code and then paste into a new text file. Name this file configuration.php and upload it to your site root folder.”

    Tip: Take the time to read the configuration document. Many of the variables are self-explanatory and even if you will be able to change them later in the control panel, why not tweak a few of them now? For instance, if you run a non-English site and need to shut it down for maintenance, why not serve your users a message like “This site is down for maintenance. Please check back again soon.” in the proper language? Or the value for the $MetaDesc variable? Spend a few seconds on that one. Then, if you forget to give a new page a search optimized meta description, you can ask Google et al. to use a generic description more in line with your site’s content. And, for what it’s worth, it is not a dead giveaway that you use the Joomla! CMS. At the very least, remove the “joomla, Joomla” between the single quotes in the $MetaKeys variable. Google does not rely on keywords, anyway.

  28. Open your FTP program and CHMOD configuration.php 755 for good measure.
  29. Back on the Step 7 page, choose <Admin> in the upper right hand corner to log in to the Joomla! control panel.

    If you are unable to log in, something went wrong and you may have to start all over.

  30. Open a new tab or window in your broswer. Point the browser to your site by entering your alternative to http://joomla1/ or simply: joomla1

    Depending on whether you opted to install sample content, you will be presented with either a bare bones installation with the Joomla! logo and a skelton menu, or a more elaborate layout with miscellaneous content. If you get neither, something went wrong and you may have to start all over.

    Been there, done that.

    Reminder: Comment out the line with the Session save path-setting in php.ini.

  Leave a comment

How to avoid unzipping in Mac OS X

12 February, 2011 | Filed under “Joomla!

Whenever you click on a link and download a ZIP package from a website, Mac OS X will normally decompress the package and throw the original ZIP file away. This is a nice feature and a time saver. Normally. There are, however, situations when this is not desirable. Why, you may ask. Let me give you an example.

Installation of extensions to the Joomla! content management system (CMS) is preferably performed directly on the ZIP package from within the control panel of the CMS, usually located externally on a webserver. This because uploading of each individual file from a local hard drive to the server is both time consuming and liable to suffer from corruption of files and what not. By uploading the files encapsulated in a protecting ZIP format, the transfer is faster, and only one file is involved. The CMS takes care of unzipping, no questions asked.

But, you may parry, one can simply recompress the package from the file meny in Mac OS X and upload the new ZIP file. And I would agree were it not for the world at large and Mac OS X at small. Citing the article Creating a basic Joomla! template:

“…the Finder’s ‘compress’ menu item produces a usable ZIP format package, but with one catch. It stores the files in AppleDouble format, adding extra files with names beginning with ‘._’. Thus it adds a file named ‘._templateDetails.xml’, which Joomla 1.5.x can sometimes misinterpret. The symptom is an error message, XML Parsing Error at 1:1. Error 4: Empty document.”

The article continues with a description of how to recompress via the Terminal to avoid the problem. As stated repeatedly here on my own site, the Terminal gives me the creeps, sending me off to all corners of the world in quest of different solutions. In this case, the problem is easy to avoid in the first place, and I will waste no time in dealing the card.

Details below are given for Safari, the best browser out there:

  1. Do not left-click on the linked ZIP file
  2. Instead, right-click on the link and choose Copy Link (see figure 1)
  3. Choose Window > Downloads to open the Downloads window
  4. Choose Edit > Paste (aka Cmnd-V)
  5. Wait while the file is downloaded (see figure 2)
  6. Open the browser's download folder, and there, unzipped, is the file of interest

Copy link in Mac OS X

Fig. 1. Right-click to copy link address.

The Download window in Safari

Fig. 2. The unzipped file in the Downloads window.

  Leave a comment

Mantra

Ka of Isis

The tumbling barrel for Bjørn Sortland – web and graphic designer – wherein he can play at hand­crafting web sites, experiment at will and ramble on. When you trust him with an assign­ment, work is delivered on time. And – given a problem is techni­cally sane – he will not give up until a solution is found.

So there.

Curriculum vitaeCurriculum vitae
  • CV (NO; 121 KB PDF)
ContactContact

Today

Tonight

Northern hemisphere

Moon phase

Tomorrow

Rasta, Norway

Weather forecast unavailable

Weather symbols explained