[% IF user AND user.profile_photo %] [% IF user.profile_photo.upload %] [% USE Math %] [% upload = user.profile_photo.upload; upload_id = upload.upload_id; dir1 = upload_id / 3200 / 3200; dir1 = Math.int(dir1); dir2 = upload_id / 3200; dir2 = Math.int(dir2); %] [% ELSIF user.profile_photo.type == 'URL' %] [% END %] [% END %]