Category: Tutorials

A PHP Performance Case Study

Inspired by a retweet[1] I did myself, regarding people that should really NOT write articles[2] about PHP, I began to code a little PHP benchmark. I call it a PHP performance case study[3]. It was inspired by a site that the autor of this 10 points tutorial took reliant as a base for his first paragraph "single quotes - double quotes" and named it "significant gains". I was really shocked while reading that!

My script primarily covers performance aspects in different ways of constructing PHP code. My intension is to show up, that it is not ever possible to state, which PHP function may be the fastest one. It will anytime depend on the whole code design.

Best Regards
Uwe Walter

[1] My ReTweet
[2] tutsplus :: 10 PHP mistakes
[3] PHP performance case study

HowTo Ninja Shadowbox

For all our members that are not familiar on how to load items into the Shadowbox viewport, I wrote this little blog post.

The Shadowbox JavaScript on startup parses the XHTML DOM tree. It searches for „A” link tags that carry a relation attribute rel="shadowbox", initializes an array object and creates new click events on these links.

Image Example:

<a href="/path/to/image.png" rel="shadowbox">Linktext</a>

HTML DIV Example:

<div id="sbox">Shadowboxed content here</div>
<a href="#sbox" rel="shadowbox">Linktext</a>



The relation attribute can carry even more values like the width and height or gallery definitions.

Image Example:

<a href="/path/to/image-1.png" rel="shadowbox[gallery-1]">Linktext</a>
<a href="/path/to/image-2.png" rel="shadowbox[gallery-1]">Linktext</a>

HTML DIV Example:

<div id="sbox">Shadowboxed content here</div>
<a href="#sbox" rel="shadowbox;width=600;height=400">Linktext</a>



We also have a PDF documentation available for download[1]. This document was actually written for the previous versions of Ninja Shadowbox (1.x), but it describes detailed what one can do with shadowbox with several examples.



Have a Lot of Fun

Best Regards
Uwe Walter

[1]Shadowbox PDF documentation

Making MobileMe work on OSX Leopard

Before upgrading to Leopard I had no problems setting MobileMe on my Mac Book.

But then I upgrade the other day (Late I know) and MobileMe decided to die and stopped connecting.

I was constantly receiving this error:

"The server cannot be contacted on Port 993" blahblah@mac,com

After my usual round of Googleing, I found that the problem hadn't been solved (not that I could find) and everyone had been told it was Apple's mistake and we had to wait.

But something struck me as odd in the error message. -> @mac,com

I had entered me.com everywhere and not entered mac.com once but it was still getting it from somewhere. Plus I couldn't enter half of the fields, primarily the port number, when I chose to let mobile me configure itself.

So I decided to try and manually connect as another imap account instead of using the default MobileMe settings.

After 5 minutes of experimentation I fixed it!

When creating the account, uncheck the 'create automatically' box, because it puts mac,com into everything instead of me.com BUT it sets the ports to the me,com port: 993 and not the mac,com port: 587 so it will never work.

If you turn off the Automatic account creation, then you can manually enter your server info.

Set the incoming server to mail,me,com port 993 and ssl
Set the outgoing server to smtp,mac,com port 587 and ssl

You should be right as rain from there. (^_^)b

Why am I using mac.com for my outgoing? me.com still wouldn't work no matter what I port field but mac.com did. It works, and people get the right return email address so I am not complaining.

Obviously this isn't a desirable or perfect fix, but it will do for me until Apple finally fixes the auto setup.

How to Redirect Specific Users to Specific Pages

How to redirect specific users to a section or page of my site when they logged in. With this hack the administrator can add a specific Login and Logout Rediect for each user in the User Manager. If no redirect is defined for the user then the login/logout checks to see if there defined a redirect in the login module.

This hack can be used to link users to docman category's, profile pages, forums, etc.

Read more