TUTORIAL - Displaying Icons ONLY to AUTHORS of the page

This tutorial shows how to check who is viewing the page, and if it is the author

Created by: fire, Last modification: 13 Mar 2005 (13:54 UTC)

I wanted an: "Edit your profile picture" on users homepages to be displayed ONLY if it was the actual USER viewing his/her webpage -

I accomplished this with the following code in the TPL.
{if $fHomepage == $gTikiUser->mInfo.user_id}
you are the owner!! So put img tags

Spiderr.... how can I accomplish this in the PHP code instead of the tpl?