photos_getInfo($photo_id); $title = $photo['description']; if ($title==""){ $title = $photo['title']." ".date('Y-m-d H:i:s', $photo['dates']['posted']); } // printing include "header.php"; // tag control $tags = array(); if($photo['tags']['tag']) foreach($photo['tags']['tag'] as $tag) $tags[] = $tag["raw"]; $photo_template = file_get_contents('template/photo_page.tpl'); // template vars $photo_template = str_replace('__photo_title__', $photo['title'], $photo_template); $photo_template = str_replace('__photo_url__', $flickr->buildPhotoURL($photo, "medium"), $photo_template); $photo_template = str_replace('__date__', date('Y-m-d H:i:s', $photo['dates']['posted']), $photo_template); $photo_template = str_replace('__description__', nl2br($photo['description']), $photo_template); $photo_template = str_replace('__photo_flickr_url__', "http://www.flickr.com/photo_zoom.gne?id=$photo_id&size=o", $photo_template); $photo_template = str_replace('__tags__', ($tags ? ''. implode(' ', $tags) .'' : ''), $photo_template); // comments $comments_content = ''; $comment_template = file_get_contents('template/comment_loop.tpl'); // getting comments $comments = $flickr->photos_comments_getList($photo_id); $comments = isset($comments['comment']) ? $comments['comment'] : NULL; // bubble type $bubble_type = ( $theme == 'black' ? 'pimped':'normal' ); // printing comment list if($comments){ foreach ($comments as $comment){ $new_comment = $comment_template; // template vars $new_comment = str_replace('__author__', $comment['authorname'], $new_comment); $new_comment = str_replace('__date__', date('Y-m-d H:i:s', $comment['datecreate']), $new_comment); $new_comment = str_replace('__comment__', nl2br($comment['_content']), $new_comment); // adding to comment loop $comments_content .= $new_comment; } $comments_content = str_replace('__bubble_type__', $bubble_type, $comments_content); }else{ $comments_content = file_get_contents('template/no-comment.tpl'); } // comment list $photo_template = str_replace('__comment_loop__', $comments_content, $photo_template); // printing print $photo_template; include "footer.php";