]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add fancy urls for search
authorEvan Prodromou <evan@prodromou.name>
Wed, 9 Jul 2008 22:31:44 +0000 (18:31 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 9 Jul 2008 22:31:44 +0000 (18:31 -0400)
darcs-hash:20080709223144-84dde-10f7f9db7dc5ba200fdeea4d6c1f277e71c54c16.gz

classes/User.php
htaccess.sample
lib/util.php

index 4a03630b5939216994fee83f6ffe3cb1a3df999e..99aac626f8c184ce41957816227800b7b36fdc8d 100644 (file)
@@ -90,7 +90,8 @@ class User extends DB_DataObject
        function allowed_nickname($nickname) {
                # XXX: should already be validated for size, content, etc.
                static $blacklist = array('rss', 'xrds', 'doc', 'main',
-                                                                 'settings', 'notice', 'user');
+                                                                 'settings', 'notice', 'user',
+                                                                 'search');
                $merged = array_merge($blacklist, common_config('nickname', 'blacklist'));
                return !in_array($nickname, $merged);
        }
index 35c0ef7e312b8fc5c38ef4a28ca2fdeb4698e1f5..48ee74bfacfdaaacbb3eec1c20834eb03fa81faf 100644 (file)
@@ -33,6 +33,9 @@ RewriteRule ^settings/profile$ index.php?action=profilesettings [L,QSA]
 RewriteRule ^settings/openid$ index.php?action=openidsettings [L,QSA]
 RewriteRule ^settings/im$ index.php?action=imsettings [L,QSA]
 
+RewriteRule ^search/people$ index.php?action=peoplesearch [L,QSA]
+RewriteRule ^search/notice$ index.php?action=noticesearch [L,QSA]
+
 RewriteRule ^notice/new$ index.php?action=newnotice [L,QSA]
 RewriteRule ^notice/(\d+)$ index.php?action=shownotice&notice=$1 [L,QSA]
 
index 1498ffb142fd43e0c73a77986dfee6d50f464588..c6b456a03522f1df6c9781df8e9565e7fffde0b8 100644 (file)
@@ -278,6 +278,7 @@ function common_nav_menu() {
                                                 _t('Home'));
        }
        common_menu_item(common_local_url('public'), _t('Public'));
+       common_menu_item(common_local_url('peoplesearch'), _t('Search'));
        common_menu_item(common_local_url('doc', array('title' => 'help')),
                                         _t('Help'));
        if ($user) {
@@ -773,6 +774,10 @@ function common_fancy_url($action, $args=NULL) {
            return common_path($path);
         case 'imsettings':
                return common_path('settings/im');
+        case 'peoplesearch':
+               return common_path('search/people' . (($args) ? '?' . implode('&', $args)) : '');
+        case 'noticesearch':
+               return common_path('search/notice' . (($args) ? '?' . implode('&', $args)) : '');
         default:
                return common_simple_url($action, $args);
        }