X-Git-Url: https://git.decadent.org.uk/gitweb/?p=memories.git;a=blobdiff_plain;f=Memories%2FTag.pm;fp=Memories%2FTag.pm;h=1140185a307e45e07b328e919a463c9d4120c802;hp=e1afdd2f544715c613c9e7a44742c04084055ed0;hb=5acf53e85633363aa8a207e9e08448f27a4544f9;hpb=293d891079d7545676d0a880b3b8c4f0ebacfd2c diff --git a/Memories/Tag.pm b/Memories/Tag.pm index e1afdd2..1140185 100644 --- a/Memories/Tag.pm +++ b/Memories/Tag.pm @@ -38,6 +38,7 @@ sub view :Exported { $r->{template_args}{photos} = [$pager->search_sorted_by_tag($tag->id)]; } + $r->last_search(); } sub multi_search { @@ -90,6 +91,14 @@ FROM tagging GROUP BY tag ORDER BY count DESC /); +__PACKAGE__->set_sql(user_summary => qq/ +SELECT tagging.id id, tag, count(*) AS count +FROM tagging, photo +WHERE tagging.photo = photo.id AND photo.uploader = ? +GROUP BY tag +ORDER BY count DESC +/); + Memories::Tagging->has_a("photo" => "Memories::Photo"); Memories::Tagging->has_a("tag" => "Memories::Tag");