fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-10-03 07:21 am

[dw-free] convert directory frontend to TT

[commit: http://hg.dwscoalition.org/dw-free/rev/a424756dc0f7]

http://bugs.dwscoalition.org/show_bug.cgi?id=3961

Replace references to /directory with /directorysearch

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Logic/ProfilePage.pm
  • cgi-bin/bml/scheme/global.look
  • cgi-bin/ljfeed.pl
  • htdocs/multisearch.bml
  • htdocs/robots.txt
--------------------------------------------------------------------------------
diff -r e3f09b49dde7 -r a424756dc0f7 cgi-bin/DW/Logic/ProfilePage.pm
--- a/cgi-bin/DW/Logic/ProfilePage.pm	Mon Oct 03 15:17:20 2011 +0800
+++ b/cgi-bin/DW/Logic/ProfilePage.pm	Mon Oct 03 15:21:38 2011 +0800
@@ -437,14 +437,15 @@
         my $ecountry = LJ::eurl( $country );
         my $estate = "";
         my $secimg = $self->security_image( $u->opt_showlocation );
+        my $dirurl = "$LJ::SITEROOT/directorysearch?opt_sort=ut&s_loc=1";
 
         if ( $country ) {
             my %countries = ();
             LJ::load_codes( { country => \%countries } );
 
             $country_ret = LJ::is_enabled( 'directory' ) ?
-                { url => "$LJ::SITEROOT/directory?opt_sort=ut&s_loc=1&loc_cn=$ecountry", text => $countries{ $country } } :
-                $countries{ $country };
+                { url => "$dirurl&loc_cn=$ecountry",
+                  text => $countries{ $country } } : $countries{ $country };
             if ( !$state && !$city ) {
                 $country_ret->{secimg} = $secimg;
             }
@@ -459,8 +460,8 @@
             $state = $states{$state} if $states_type && $states{$state};
             $estate = LJ::eurl( $state );
             $state_ret = $country && LJ::is_enabled( 'directory' ) ?
-                { url => "$LJ::SITEROOT/directory?opt_sort=ut&s_loc=1&loc_cn=$ecountry&loc_st=$estate", text => LJ::ehtml( $state ) } :
-                LJ::ehtml( $state );
+                { url => "$dirurl&loc_cn=$ecountry&loc_st=$estate",
+                  text => LJ::ehtml( $state ) } : LJ::ehtml( $state );
             if ( !$city ) {
                 $state_ret->{secimg} = $secimg;
             }
@@ -469,8 +470,8 @@
         if ( $city ) {
             $city = LJ::ehtml( $city );
             $city_ret = $country && LJ::is_enabled( 'directory' ) ?
-                { url => "$LJ::SITEROOT/directory?opt_sort=ut&s_loc=1&loc_cn=$ecountry&loc_st=$estate&loc_ci=$ecity", text => $city } :
-                $city;
+                { url => "$dirurl&loc_cn=$ecountry&loc_st=$estate&loc_ci=$ecity",
+                  text => $city } : $city;
             $city_ret->{secimg} = $secimg;
         }
 
diff -r e3f09b49dde7 -r a424756dc0f7 cgi-bin/bml/scheme/global.look
--- a/cgi-bin/bml/scheme/global.look	Mon Oct 03 15:17:20 2011 +0800
+++ b/cgi-bin/bml/scheme/global.look	Mon Oct 03 15:21:38 2011 +0800
@@ -62,8 +62,6 @@
            'children' => [
                          { 'name' => 'Random!',
                 'uri' => '/random', },
-                         { 'name' => 'By Region',
-                'uri' => '/directory', },
                          { 'name' => 'By Interest',
                 'uri' => '/interests', },
                               { 'name' => 'Search',
diff -r e3f09b49dde7 -r a424756dc0f7 cgi-bin/ljfeed.pl
--- a/cgi-bin/ljfeed.pl	Mon Oct 03 15:17:20 2011 +0800
+++ b/cgi-bin/ljfeed.pl	Mon Oct 03 15:21:38 2011 +0800
@@ -647,11 +647,11 @@
     # user location
     if ($u->{'country'}) {
         my $ecountry = LJ::eurl($u->{'country'});
-        $ret .= "    <ya:country dc:title=\"$ecountry\" rdf:resource=\"$LJ::SITEROOT/directory.bml?opt_sort=ut&amp;s_loc=1&amp;loc_cn=$ecountry\"/>\n" if $u->can_show_location($remote);
+        $ret .= "    <ya:country dc:title=\"$ecountry\" rdf:resource=\"$LJ::SITEROOT/directorysearch?opt_sort=ut&amp;s_loc=1&amp;loc_cn=$ecountry\"/>\n" if $u->can_show_location($remote);
         if ($u->{'city'}) {
             my $estate = '';  # FIXME: add state.  Yandex didn't need it.
             my $ecity = LJ::eurl($u->{'city'});
-            $ret .= "    <ya:city dc:title=\"$ecity\" rdf:resource=\"$LJ::SITEROOT/directory.bml?opt_sort=ut&amp;s_loc=1&amp;loc_cn=$ecountry&amp;loc_st=$estate&amp;loc_ci=$ecity\"/>\n" if $u->can_show_location($remote);
+            $ret .= "    <ya:city dc:title=\"$ecity\" rdf:resource=\"$LJ::SITEROOT/directorysearch?opt_sort=ut&amp;s_loc=1&amp;loc_cn=$ecountry&amp;loc_st=$estate&amp;loc_ci=$ecity\"/>\n" if $u->can_show_location($remote);
        }
     }
 
diff -r e3f09b49dde7 -r a424756dc0f7 htdocs/multisearch.bml
--- a/htdocs/multisearch.bml	Mon Oct 03 15:17:20 2011 +0800
+++ b/htdocs/multisearch.bml	Mon Oct 03 15:21:38 2011 +0800
@@ -243,7 +243,7 @@
             }
         }
         ($city, $state, $country) = map { LJ::eurl($_); } ($city, $state, $country);
-        return BML::redirect("$LJ::SITEROOT/directory?s_loc=1&loc_cn=$country&loc_st=$state&loc_ci=$city&opt_sort=ut&opt_format=pics&opt_pagesize=50");
+        return BML::redirect("$LJ::SITEROOT/directorysearch?s_loc=1&loc_cn=$country&loc_st=$state&loc_ci=$city&opt_sort=ut&opt_format=pics&opt_pagesize=50");
     }
 
     if ($type eq "faq") {
diff -r e3f09b49dde7 -r a424756dc0f7 htdocs/robots.txt
--- a/htdocs/robots.txt	Mon Oct 03 15:17:20 2011 +0800
+++ b/htdocs/robots.txt	Mon Oct 03 15:21:38 2011 +0800
@@ -1,6 +1,5 @@
 User-Agent: *
-Disallow: /directory.bml
-Disallow: /directory
+Disallow: /directorysearch
 Disallow: /latest
 Disallow: /search
 
--------------------------------------------------------------------------------