]> git.decadent.org.uk Git - memories.git/commitdiff
Merge commit 'Memories as 1.3'
authorBen Hutchings <ben@decadent.org.uk>
Tue, 4 Nov 2008 04:25:24 +0000 (04:25 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 4 Nov 2008 04:25:24 +0000 (04:25 +0000)
22 files changed:
Makefile.PL [new file with mode: 0644]
Memories.pm [deleted file]
Memories/Config.pm
Memories/Photo.pm
Memories/SystemTag.pm
Memories/Tag.pm
Memories/User.pm
README
Tagtools.pm [new file with mode: 0644]
tag_dates [deleted file]
templates/frontpage
templates/header
templates/header.orig [new file with mode: 0644]
templates/login [new file with mode: 0644]
templates/macros
templates/photo/similar [new file with mode: 0644]
templates/photo/upload
templates/photo/view
templates/robots.txt [new file with mode: 0644]
templates/static/memories.png
templates/static/sitemap.gz [new file with mode: 0644]
templates/test [new file with mode: 0644]

diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644 (file)
index 0000000..5737856
--- /dev/null
@@ -0,0 +1,21 @@
+use ExtUtils::MakeMaker;
+WriteMakefile(
+    'NAME'      => 'Memories',
+    'VERSION_FROM'  => 'Memories.pm', # finds $VERSION
+    'PREREQ_PM'     => {
+        Maypole => 1.1,
+        HTML::TagCloud => 0,
+        URI::Escape => 0,
+        Calendar::Simple => 0,
+        XML::RSS => 0,
+        Time::Piece => 0,
+        Class::DBI::Plugin::Pager => 0,
+        Class::DBI::Plugin::AbstractCount => 0,
+        Cache::MemoryCache => 0,
+        Image::Info => 0,
+        Image::ExifTool => 0,
+        File::Path => 0,
+        Image::Imlib2 => 0,
+        Text::Balanced => 0,
+    }
+);
diff --git a/Memories.pm b/Memories.pm
deleted file mode 100644 (file)
index eaf5fe3..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-package Memories;
-use strict;
-our $VERSION = "1.2";
-use Maypole::Application qw(Upload Authentication::UserSessionCookie);
-use HTML::TagCloud;
-use URI;
-use Memories::Config;
-use Memories::DBI;
-use Memories::Photo;
-use Memories::Comment;
-use Memories::Tag;
-use Memories::SystemTag;
-use Memories::User;
-use Memories::Album;
-use URI::Escape;
-use Calendar::Simple;
-use XML::RSS;
-
-Memories->config->auth->{ user_field } = "name";
-Memories->config->model("Maypole::Model::CDBI::Plain");
-Memories->setup([qw/ Memories::Photo Memories::User Memories::Tag
-Memories::Album Memories::SystemTag/]);
-
-sub message {
-    my ($self, $message) = @_;
-    push @{$self->{template_args}{messages}}, $message;
-}
-
-sub do_rss {
-    my $r = shift;
-    $r->model_class->process($r);
-    my $rss = XML::RSS->new(version => "2.0");
-    $rss->channel(
-        title => ($r->config->{application_name}. " : ".ucfirst($r->action)." ".ucfirst($r->table)." ".($r->objects||[])->[0]) ,
-        link  => $r->config->{uri_base}."/".$r->path
-    );
-    my $maybe_photos = $r->{objects}||[];
-    my $photos = 
-        (@$maybe_photos && $maybe_photos->[0]->isa("Memories::Photo")) 
-            ? $maybe_photos :
-            ($r->{template_args}->{photos} || []);
-    for my $item (@$photos) { 
-        my $link = $r->config->{uri_base}."photo/view/".$item->id;
-        $rss->add_item( title => $item->title, link => $link,
-            description => 
-    "<a href=\"$link\">
-    <img src=\"". $item->thumb_url."\" alt=\"".$item->title."\"></a>",
-            dc => { subject => join " ", $item->tags },
-            pubDate => $item->uploaded->strftime("%a, %d %b %Y %H:%M:%S %z")
-        )
-    }
-    $r->output($rss->as_string);
-    $r->content_type("application/rss+xml");
-    return
-}
-
-sub additional_data { 
-    my $r = shift;
-    if ($r->params->{view_cal}) { 
-    $r->{template_args}{view_cal} = eval {
-            Time::Piece->strptime($r->{params}{view_cal}, "%Y-%m-%d") }; 
-    }
-    $r->{template_args}{now} = Time::Piece->new;
-    return $r->do_rss if ($r->params->{format} =~ /rss/)        
-}
-
-use Maypole::Constants;
-sub authenticate {
-   my ($self, $r) = @_;
-   return DECLINED if $self->path =~/static|store/; # XXX
-   $r->get_user;
-   return OK; 
-}
-
-
-use Cache::SharedMemoryCache;
-my %cache_options = ( 'namespace' => 'MemoriesStuff',
-                   'default_expires_in' => 600 );
-my $cache =
-   new Cache::SharedMemoryCache( \%cache_options ) or
-     croak( "Couldn't instantiate SharedMemoryCache" );
-
-sub zap_cache { $cache->Clear }
-use Storable qw(freeze); use MIME::Base64;
-sub do_cached {
-    my ($self, $codeblock,$arg) = @_;
-    my $key = 0+$codeblock; if ($arg) { $key .=":".encode_base64(freeze(\$arg));  }
-    my $c = $cache->get(0+$codeblock); return @$c if $c;
-    my @stuff = $codeblock->($arg);
-    $cache->set(0+$codeblock, [ @stuff ]);
-    return @stuff;
-}
-
-sub _recent_uploads { Memories::Photo->search_recent() }
-
-sub recent_uploads { shift->do_cached(\&_recent_uploads) }
-sub tagcloud { shift->do_cached(\&_tagcloud) }
-
-sub _tagcloud {
-    my $cloud = HTML::TagCloud->new();
-    my $base = Memories->config->uri_base."tag/view/";
-    for my $tagging (Memories::Tagging->search_summary) {
-        my $name = $tagging->tag->name;
-        $cloud->add($name,
-            $base.uri_escape($name),
-            $tagging->{count}
-        )
-    }
-    $cloud
-}
-
-sub calendar {
-    # shift->do_cached(\&_calendar, shift ) }
-#sub _calendar {
-    my $self = shift;
-    my $arg = shift;
-    my ($y, $m) = split /-/, ($arg || Time::Piece->new->ymd);
-    my @m = Calendar::Simple::calendar($m, $y);
-    my @month;
-    foreach my $week (@m) {
-        my @weekdays;
-        foreach my $day (@$week) {
-                my $d = { day => $day };
-                if ($day) {
-                    my $tag = "date:$y-$m-".sprintf("%02d", $day);
-                    my ($x) = Memories::SystemTag->search(name => $tag);
-                    if ($x) { $d->{tag} = "/system_tag/view/$tag" }
-                }
-                push(@weekdays, $d);
-        }
-        push(@month, \@weekdays);
-    }
-    return \@month;
-}
-
-# THIS IS A HACK
-
-use Time::Seconds;
-sub Time::Piece::next_month {
-    my $tp = shift;
-    my $month = $tp + ONE_MONTH;
-    return if $month > Time::Piece->new;
-    return $month
-}
-sub Time::Piece::prev_month {
-    my $tp = shift;
-    my $month = $tp - ONE_MONTH;
-    return $month
-}
-
-
-sub tag_select {
-    my ($r, $tags) = @_;
-    my %counter;
-    my @photos = Memories::Photo->sth_to_objects(Memories::Tag->multi_search(@$tags));
-    for (map {$_->tags} @photos) { 
-        $counter{$_->name}++; 
-    } 
-    delete $counter{$_->name} for @$tags;
-    my @super;
-
-    my $cloud = HTML::TagCloud->new();
-    my $base = $r->config->uri_base.$r->path."/";
-    my $tags;
-    for my $name (sort {$a cmp $b} keys %counter) {
-        if ($counter{$name} == @photos) {
-            push @super, $name;
-        } else {
-            $cloud->add($name, $base.uri_escape($name), $counter{$name});
-            $tags++;
-        }
-    }
-    my %res;
-    if (@super) { $res{super} = \@super }
-    if ($tags) { $res{cloud} = $cloud }
-    \%res;
-}
-1;
index f874eff4d64462fbd9f104f6cd34d7d51085011a..9796ab0971da169b73683c9ce3304cb3d9eb0f8b 100644 (file)
@@ -38,6 +38,9 @@ Memories->config->{auth}{session_args} = {
         LockDirectory => "/var/lib/memories/sessionlock",
     };
 
+# This is where your Image::Seek library will be stored.
+Memories->config->{image_seek} = "/var/lib/memories/imageseek.db";
+
 # DISPLAY PARAMETERS
 #
 # It's OK to leave these as they are.
index 69979892688ca19e77c7b71130c3042508ec391e..4e2a59dea02f719315ab98fee116b84bb80ff2cc 100644 (file)
@@ -3,6 +3,7 @@ use strict;
 use Carp qw(cluck confess);
 use base qw(Memories::DBI Maypole::Model::CDBI::Plain);
 use Time::Piece;
+use Image::Seek;
 use constant PAGER_SYNTAX => "LimitXY";
 __PACKAGE__->columns(Essential => qw(id title uploader uploaded x y));
 __PACKAGE__->untaint_columns(printable => [qw/title/]);
@@ -48,6 +49,7 @@ sub do_upload :Exported {
 
     $photo->make_thumb;
     $photo->add_tags($r->{params}{tags});
+    $photo->add_to_imageseek_library;
     Memories->zap_cache();
 
     # Add system tags here
@@ -64,6 +66,24 @@ sub do_upload :Exported {
     ); 
 }
 
+sub view :Exported {
+    my ($self, $r) = @_;
+    if ($r->{session}{last_search}) {
+        my $photo = $r->{objects}[0];
+        # This is slightly inefficient
+        my @search = split/,/, $r->{session}{last_search};
+        my $found = -1;
+        for my $i (0..$#search) {
+            next unless $photo->id == $search[$i];
+            $found = $i;
+        }
+        return unless $found > -1;
+        $r->{template_args}{next} = $self->retrieve($search[$found+1]) 
+            if $found+1 <= $#search;
+        $r->{template_args}{prev} = $self->retrieve($search[$found-1])
+            if $found-1 >= 0;
+    }
+}
 sub upload :Exported {}
 
 use Class::DBI::Plugin::Pager;
@@ -80,6 +100,7 @@ sub recent :Exported {
     );
     $r->objects([$pager->retrieve_all ]);
     $r->{template_args}{pager} = $pager;
+    $r->last_search;
 }
 
 sub add_comment :Exported {
@@ -100,6 +121,35 @@ use Image::Info qw(dim image_info);
 use Image::ExifTool;
 my $cache = new Cache::MemoryCache( { 'namespace' => 'MemoriesInfo' });
 
+sub add_to_imageseek_library {
+    my $self = shift;
+    Image::Seek::cleardb();
+    my $img = Image::Imlib2->load($self->path("file"));
+
+    Image::Seek::add_image($img, $self->id);
+    # Merge this new one into the main database; there is a bit of a
+    # race condition here. XXX
+    Image::Seek::loaddb(Memories->config->{image_seek});
+    Image::Seek::savedb(Memories->config->{image_seek});
+}
+
+sub recommended_tags {
+    my $self = shift;
+    my %tags = map { $_->name => $_ }
+               map { $_->tags } 
+               $self->find_similar(3);
+    values %tags;
+}
+
+sub find_similar {
+    my ($self, $count) = @_;
+    Image::Seek::cleardb();
+    Image::Seek::loaddb(Memories->config->{image_seek});
+    my @res = map {$_->[0] } Image::Seek::query_id($self->id, $count);
+    shift @res; # $self
+    map { $self->retrieve($_) } @res;
+}
+
 sub unrotate {
     my $self = shift;
     my $orient = $self->exif_info->{EXIF}->{Orientation};
index d4f84390665a66ff51adfc2b40c1a7a945723e64..cdb8e14169bb9d360f57977a3f92ccb86a994f50 100644 (file)
@@ -30,6 +30,7 @@ sub view :Exported {
     $r->{template_args}{tags} = [$tag]; # For selector
     $r->{template_args}{photos} =
         [$pager->search_sorted_by_system_tag($tag->id)];
+    $r->last_search;
 }
 
 package Memories::SystemTagging;
index e1afdd2f544715c613c9e7a44742c04084055ed0..1140185a307e45e07b328e919a463c9d4120c802 100644 (file)
@@ -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");
 
index 2fa82ca3cb5179e15a847a47ada02e33d4f8e1c4..b0020a53fd4dd211cbc063ab40c4717836c3c6b4 100644 (file)
@@ -30,6 +30,7 @@ sub view :Exported {
     $user->id,{order_by => "uploaded desc"}) ];
     $r->{template_args}{pager} = $pager;
     $r->{template_args}{albums} = [$user->albums(privacy => 0)];
+    $r->last_search;
 }
 
 # Album support!
@@ -64,4 +65,13 @@ sub edit_albums :Exported {
     
 }
 
+sub api_taglist :Exported {
+    my ($self, $r) = @_;
+    my $user = $r->objects->[0];
+    $r->{output} .= $_->{tag}.":".$_->{count}."\n"
+        for Memories::Tagging->search_user_summary($user->id);
+    $r->{output}.= "\n";
+    $r->{content_type} = "text/plain";
+}
+
 1;
diff --git a/README b/README
index b58ec3e608dc9a6b96c346446bb032bbeed2b3fe..5b1fc004dbe95a6c70c508a494b96324b7187832 100644 (file)
--- a/README
+++ b/README
@@ -24,7 +24,7 @@ application, but you're on your own.
 You will also need a MySQL database. Again, in theory other databases
 can be used, but in practice, you're on your own again.
 
-Configure Maypole/Config.pm to your site, and follow the instructions in
+Configure /etc/memories/Config.pm to your site, and follow the instructions in
 there - it will require you to set other things up as well.
 
 Test that everything works:
diff --git a/Tagtools.pm b/Tagtools.pm
new file mode 100644 (file)
index 0000000..0fc2529
--- /dev/null
@@ -0,0 +1,76 @@
+package Tagtools;
+use HTML::TagCloud;
+use Carp;
+use Cache::FileCache;
+use Storable qw(freeze); use MIME::Base64;
+use Calendar::Simple;
+sub import {
+    my $whence = caller;
+    my ($class) = @_;
+    my %cache_options = ( 'namespace' => $whence.'TagTools',
+                       'default_expires_in' => 600 );
+    my $cache =
+       new Cache::FileCache( \%cache_options ) or
+         croak( "Couldn't instantiate FileCache" );
+    *{$whence."::zap_cache"} = sub { $cache->Clear };
+    *{$whence."::do_cached"} = sub {
+        my ($self, $codeblock,$arg) = @_;
+        my $key = 0+$codeblock; if ($arg) { $key .=":".encode_base64(freeze(\$arg));  }
+        my $c = $cache->get(0+$codeblock); return @$c if $c;
+        my @stuff = $codeblock->($arg);
+        $cache->set(0+$codeblock, [ @stuff ]);
+        return @stuff;
+    };
+    *{$whence."::_tagcloud"} = sub {
+        my $cloud = HTML::TagCloud->new();
+        my $base = $whence->config->uri_base."tag/view/";
+        for my $tagging (($whence."::Tagging")->search_summary) {
+            my $name = $tagging->tag->name;
+            $cloud->add($name, $base.uri_escape($name), $tagging->{count})
+        }
+        $cloud
+    };
+    *{$whence."::_calendar"} = sub {
+        my $self = shift;
+        my $arg = shift;
+        my ($y, $m) = split /-/, ($arg || Time::Piece->new->ymd);
+        my @m = Calendar::Simple::calendar($m, $y);
+        my @month;
+        foreach my $week (@m) {
+            my @weekdays;
+            foreach my $day (@$week) {
+                    my $d = { day => $day };
+                    if ($day) {
+                        my $tag = "date:$y-$m-".sprintf("%02d", $day);
+                        my ($x) = ($whence."::SystemTag")->search(name => $tag);
+                        if ($x) { $d->{tag} = "/system_tag/view/$tag" }
+                    }
+                    push(@weekdays, $d);
+            }
+            push(@month, \@weekdays);
+        }
+        return \@month;
+    };
+    for my $thing (qw(tagcloud calendar)) {
+        *{$whence."::$thing"} = sub { shift->do_cached($thing, @_) }
+    }
+
+}
+
+
+# THIS IS A HACK
+
+use Time::Seconds;
+sub Time::Piece::next_month {
+    my $tp = shift;
+    my $month = $tp + ONE_MONTH;
+    return if $month > Time::Piece->new;
+    return $month
+}
+sub Time::Piece::prev_month {
+    my $tp = shift;
+    my $month = $tp - ONE_MONTH;
+    return $month
+}
+
+1;
diff --git a/tag_dates b/tag_dates
deleted file mode 100644 (file)
index e44af81..0000000
--- a/tag_dates
+++ /dev/null
@@ -1,10 +0,0 @@
-use Memories;
-my $it = Memories::Photo->retrieve_all;
-
-my $thing = $it->first;
-do {
-    print $thing->title, "   $tag\n";
-    my $tag = "date:".$thing->shot->ymd;
-    $thing->add_to_system_tags({tag => Memories::SystemTag->find_or_create({name
-    =>$tag}) });
-} while $thing = $it->next;
index 2b36f1e533460956d6a7fcf1655d9e385d5512d8..9bd95766eba306d8e062f70253708713830a4f29 100644 (file)
@@ -2,8 +2,7 @@
 <h1> Welcome to Memories </h1>
 
 <p>
- Memories is a site where you can upload and share your photos of
- college life with your friends.
+ Memories is a site where you can upload and share your photos.
 </p>
 <p>
  To view other people's photos, look at the <a
index 2ac00f446bd1961a1d6c6a70f8a95eb649e5af88..3241c67e4cf62c5aa0368cc721f170a218c78f2e 100644 (file)
@@ -1,6 +1,7 @@
 <html>
 <head>
-    <title> Memories - ANCC Photo Sharing </title>
+    <title> Memories - Photo Sharing [% IF photo %] - [% photo.title; END%]</title>
+    <meta name="robots" content="nofollow">
     <link title="Maypole" href="[%base%]/static/memories.css" type="text/css" rel="stylesheet"/>
     [% IF photos %]
 <link rel="alternate" type="application/rdf+xml" title="RSS"
diff --git a/templates/header.orig b/templates/header.orig
new file mode 100644 (file)
index 0000000..2ac00f4
--- /dev/null
@@ -0,0 +1,27 @@
+<html>
+<head>
+    <title> Memories - ANCC Photo Sharing </title>
+    <link title="Maypole" href="[%base%]/static/memories.css" type="text/css" rel="stylesheet"/>
+    [% IF photos %]
+<link rel="alternate" type="application/rdf+xml" title="RSS"
+href="[%base%]/[%path%]?format=rss" />
+[% END %]
+[% IF request.params.active == "tagedit" %]
+    <script type="text/javascript" src="[%base%]/tag/list_js"></script>
+    <script type="text/javascript" src="[%base%]/static/upload.js"></script>
+</head>
+<body onload="init()">
+[% ELSE %]
+</head>
+<body>
+[% END %]
+[% INCLUDE nav %]
+<table width="100%">
+    <tr>
+    <td valign="top">
+    [% IF messages %]
+    <div class="messages">
+    <ul> [% FOR m = messages %] <li> [%m%] </li> [% END %]
+    </ul></div>
+    [% END %]
+   <div id="main">
diff --git a/templates/login b/templates/login
new file mode 100644 (file)
index 0000000..b875129
--- /dev/null
@@ -0,0 +1,34 @@
+    [% INCLUDE header %]
+
+    <div id="login">
+    [% IF request.user %]
+        Welcome, [% request.user.name %]
+    [% ELSE %]
+
+    [% IF login_error %]
+        <div class="error"> [% login_error %] </div>
+    [% END %]
+    <form method="post" action="[% base %]/user/register">
+    <fieldset>
+    <legend>Login or register as a new user</legend>
+        <table> <tr>
+            <td class="loginfield">
+            Username:
+            </td>
+            <td>
+           <input name="name" type="text" />
+        </td>
+        </tr>
+        <tr> <td class="loginfield">
+           Password:
+        </td><td>
+                   <input name="password" type="password" />
+            </td></tr></table>
+        <input type="submit" name="login" value="Login"/>
+        <input type="submit" name="login" value="Register"/>
+    </fieldset>
+    </form>
+    [% END %]
+    </div>
+
+    [% INCLUDE footer %]
index f97cdd3acca801ff49ca90c4b03a8df99f30c251..05824ef88ce77ba83437d3613c0422b23bd796f5 100644 (file)
@@ -1,15 +1,20 @@
-[% MACRO thumb(photo, album) BLOCK %]
-<table class="thumb">
-    <tr><td>
+[% MACRO minithumb(photo) BLOCK %]
         <a href="[%base%]/photo/view/[%photo.id%]">
         <img src="[% photo.thumb_url |uri%]" alt="[%photo.title|html%]"/>
         </a>
+[% END; MACRO thumb(photo, album) BLOCK %]
+<table class="thumb">
+    <tr><td>
+        [% minithumb(photo) %]
         </td> </tr>
     <tr><td> 
         <a href="[%base%]/photo/view/[%photo.id%]">
         <b>[% photo.title |html%] </b>
         </a>
         
+        <br>
+        <small>[% FOR tag = photo.tags %] <a
+        href="[%base%]/tag/view/[%tag%]">[%tag %]</a> [% END %]</small>
         </td></tr>
     <tr><td> Uploaded by 
         <a href="[%base%]/user/view/[%photo.uploader.id%]">
diff --git a/templates/photo/similar b/templates/photo/similar
new file mode 100644 (file)
index 0000000..2743353
--- /dev/null
@@ -0,0 +1,9 @@
+<p align="center">
+[% PROCESS macros; FOR sim = photo.find_similar(4); minithumb(sim); END %]
+</p>
+
+<p>
+Suggested tags: [% FOR tag = photo.recommended_tags; %]
+<a href="[%base%]/tag/view/[%tag.name|uri%]">[%tag.name%] </a>
+[% END %]
+</p>
index d17d3cb322fc348029e99c576367a249a120384b..ad88ff84974eb0c8c6c483aaadfc8ef39a086bb1 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <head>
-    <title> Memories - ANCC Photo Sharing </title>
+    <title> Memories - Photo Sharing </title>
     <link title="Maypole" href="[%base%]/static/memories.css" type="text/css" rel="stylesheet"/>
     <script type="text/javascript" src="[%base%]/tag/list_js"></script>
     <script type="text/javascript" src="[%base%]/static/upload.js"></script>
index 74f352ac46f8b8228a562ae291f4ab676274ee4a..b8a06bf6e72a19c8ed271a5eff59abcff40022fd 100644 (file)
@@ -4,7 +4,13 @@
 <table width="100%">
     <tr valign="top">
     <td width="70%">
+    [% IF prev %]
+        <small><a href="[%base%]/photo/view/[%prev.id%]">&lt;&lt; [% prev %]</a></small>
+    [% END %]
 <h1>[% photo.title %]</h1>
+    [% IF next %]
+        <small><a href="[%base%]/photo/view/[%next.id%]"> [% next %] &gt;&gt;</a></small>
+    [% END %]
 [% IF request.user == photo.uploader %]
     <p><a href="[%base%]/photo/delete/[%photo.id%]">Delete this
     photo</a></p>
@@ -57,6 +63,8 @@ photo.uploader %] </a>
         [% IF photo.is_bigger(sizes.$i);  %]
             [% IF i == size %]
                 [% sizes.$i %]
+            [% ELSIF sizes.$i == "full" %]
+                <a href="[%photo.path("url")%]">full</a>
             [% ELSE %]
                 <a href="[%url%]?scale=[% i %]&active=[%tab%]">[% sizes.$i %]</a>
             [% END %]
@@ -81,11 +89,13 @@ photo.uploader %] </a>
     [%do_tab("comment", "Comments") %]
     [%do_tab("exif", "Photo info") %]
     [%do_tab("tagedit", "Edit tags") %]
+    [%do_tab("similar", "Similar photos") %]
 </ul>
 <div id="content">
 [%
 IF request.params.active == "tagedit"; INCLUDE tagedit; 
 ELSIF request.params.active == "exif"; INCLUDE exif;
+ELSIF request.params.active == "similar"; INCLUDE similar;
 ELSE;                                  INCLUDE comment; END;
 %]
 </div>
diff --git a/templates/robots.txt b/templates/robots.txt
new file mode 100644 (file)
index 0000000..7e053ec
--- /dev/null
@@ -0,0 +1,5 @@
+User-agent: NaverBot
+Disallow: /
+
+User-agent: *
+Disallow: /tag/view/
index 97847d13394489c69b08eff1073f9c604d4c9136..c9207c01a623e8d1087c61b8454ba05ac3ab2455 100644 (file)
Binary files a/templates/static/memories.png and b/templates/static/memories.png differ
diff --git a/templates/static/sitemap.gz b/templates/static/sitemap.gz
new file mode 100644 (file)
index 0000000..1f3d4d3
Binary files /dev/null and b/templates/static/sitemap.gz differ
diff --git a/templates/test b/templates/test
new file mode 100644 (file)
index 0000000..b5f5031
--- /dev/null
@@ -0,0 +1,2 @@
+[% INCLUDE header %]
+[% INCLUDE footer %]