is_movie()){ $width = $item->width; $height = $item->height; }else{ $width = $item->resize_width; $height = $item->resize_height; } $description_mode = module::get_var("three_nids", "description"); $description = ""; $tags = tag::item_tags($item); if(count($tags) && $description_mode == "tags"){ $description = " || " . implode(", ", $tags); } else if ($description_mode == "item" && $item->description != ""){ $description = " || " . str_replace("\"",""",$item->description); } else if (($description_mode == "parent" || $description_mode == "item") && $item->parent()->description != ""){ $description = " || " . str_replace("\"", """, $item->parent()->description); } $title_mode = module::get_var("three_nids", "title"); if ($title_mode == "parent"){ $title = html::clean($item->parent()->title); } else { $title = html::clean($item->title); } $rel = ""; if ($group_img == true) { $rel = " rel=\"fancygroup\" "; } if ($item->is_photo() || $item->is_movie()){ $fancymodule = ""; if (module::is_active("exif")) { $fancymodule .= "exif::" . url::site("exif/show/{$item->id}") . ";;"; } if (module::is_active("comment")) { $fancymodule .= "comment::" . url::site("three_nids/show_comments/{$item->id}") . ";;comment_count::" . three_nids::comment_count($item) . ";;"; } if ($item->is_photo()){ $link .= "id}") ."/?w=" . $width . "xewx&h=" . $height . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . $title . $description ."\" name=\"" . $fancymodule . " \">"; } else { $link .= "id}") . "/?w=" . strval(20 + $width) . "xewx&h=" . strval(50 + $height) . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . $item->parent()->title . $description . "\" name=\"" . $fancymodule . " \">"; } } else if ($item->is_album() && $view_type != "header") { $link .= "url() . "\">"; } else { // NOTE: we don't want to open an here because $view_type is "header", but lower down // we're going to close one, so that's going to generate a mismatch. For now, just open a // link anyway. // @todo: figure out what we really should be doing here. $link .= "url() . "\">"; } if ($view_type != "header") { $link .= $item->thumb_img(array("class" => "g-thumbnail")) . ""; if ($item->is_album() && $view_type == "album") { $link .= "url() . "?show=" . $item->id . "\"><$parent_title_class>" . html::clean($item->title) . ""; } else if (!($item->is_album()) && $view_type == "dynamic") { $link .= "parent()->url() . "?show=" . $item->id . "\" class=\"g-parent-album\"><$parent_title_class>" . html::clean($item->parent()->title) . ""; } if (($item->is_photo() || $item->is_movie()) && $display_comment && module::is_active("comment")) { $link .= ""; } } else { $link .= ""; } return $link; } static function comment_count($item) { access::required("view", $item); return ORM::factory("comment") ->where("item_id", "=", $item->id) ->where("state", "=", "published") ->order_by("created", "DESC") ->count_all(); } } ?>