public
Description: The ultra-lightweight ultra-flexible blogging engine with a fetish for birds and misspellings.
Homepage: http://chyrp.net/
Clone URL: git://github.com/vito/chyrp.git
Click here to lend your support to: chyrp and make a donation at www.pledgie.com !
You can now filter users via group:Member, and the groups on Manage > Groups 
link to a search of its users. [#166 state:resolved]
vito (author)
Thu Jul 17 10:54:57 -0700 2008
commit  de431f1a99cf570d0137df565e82e122bd58d835
tree    a916662e1711ba9eaa3dda759e88965ee9538423
parent  1380295d6e4a14394fbfe9869bfd1574dd012469
...
34
35
36
37
 
38
39
40
...
34
35
36
 
37
38
39
40
0
@@ -34,7 +34,7 @@
0
       $admin->context["site"]        = Config::current();
0
       $admin->context["visitor"]     = $visitor;
0
       $admin->context["logged_in"]   = logged_in();
0
-      $admin->context["route"]       = array("action" => $action);
0
+      $admin->context["route"]       = Route::current();
0
       $admin->context["hide_admin"]  = isset($_SESSION["hide_admin"]);
0
       $admin->context["now"]         = time();
0
       $admin->context["version"]     = CHYRP_VERSION;
...
31
32
33
34
 
35
36
 
37
38
39
...
31
32
33
 
34
35
 
36
37
38
39
0
@@ -31,9 +31,9 @@
0
           {% if group.id == site.guest_group %}
0
           ${ "“%s” is the group for guests." | translate | format(group.name) }
0
           {% elseif group.id == site.default_group %}
0
-          ${ "“%s” is the default group and has %s member." | translate_plural("“%s” is the default group and has %s members.", group.size) | format(group.name, group.size) }
0
+          ${ "&#8220;%s&#8221; is the default group and has %s <a href=\"%s\">member</a>." | translate_plural("&#8220;%s&#8221; is the default group and has %s <a href=\"%s\">members</a>.", group.size) | format(group.name, group.size, route.url("/admin/?action=manage_users&query=group%3A"~group.name)) }
0
           {% else %}
0
-          ${ "&#8220;%s&#8221; has %s member." | translate_plural("&#8220;%s&#8221; has %s members.", group.size) | format(group.name, group.size) }
0
+          ${ "&#8220;%s&#8221; has %s <a href=\"%s\">member</a>." | translate_plural("&#8220;%s&#8221; has %s <a href=\"%s\">members</a>.", group.size) | format(group.name, group.size, route.url("/admin/?action=manage_users&query=group%3A"~group.name)) }
0
           {% endif %}
0
         </h1>
0
       </div>
...
540
541
542
 
 
 
 
 
543
544
545
546
547
548
 
 
 
 
549
550
551
...
710
711
712
 
 
 
 
 
713
714
715
...
801
802
803
 
 
 
 
 
804
805
806
...
913
914
915
 
 
 
 
 
916
917
918
...
540
541
542
543
544
545
546
547
548
549
550
551
 
 
552
553
554
555
556
557
558
...
717
718
719
720
721
722
723
724
725
726
727
...
813
814
815
816
817
818
819
820
821
822
823
...
930
931
932
933
934
935
936
937
938
939
940
0
@@ -540,12 +540,19 @@
0
           $match = explode(":", $match);
0
           $test = $match[0];
0
           $equals = $match[1];
0
+          if ($test == "group") {
0
+            $group = new Group(null, array("where" => "name = :name", "params" => array(":name" => $equals)));
0
+            $test = "group_id";
0
+            $equals = ($group->no_results) ? 0 : $group->id ;
0
+          }
0
           $where[] = $test." = :".$test;
0
           $params[":".$test] = $equals;
0
         }
0
 
0
-        $where[] = "(login LIKE :query OR full_name LIKE :query OR email LIKE :query OR website LIKE :query)";
0
-        $params[":query"] = "%".$_GET['query']."%";
0
+        if (!empty($search)) {
0
+          $where[] = "(login LIKE :query OR full_name LIKE :query OR email LIKE :query OR website LIKE :query)";
0
+          $params[":query"] = "%".$_GET['query']."%";
0
+        }
0
       }
0
 
0
       $this->context["users"] = new Paginator(User::find(array("placeholders" => true, "where" => $where, "params" => $params)), 25);
0
@@ -710,6 +717,11 @@
0
             $where[] = $test." = :".$test;
0
             $params[":".$test] = $equals;
0
           }
0
+
0
+          if (!empty($search)) {
0
+            $where[] = "xml LIKE :query";
0
+            $params[":query"] = "%".$search."%";
0
+          }
0
         } else
0
           list($where, $params) = array(false, array());
0
 
0
@@ -801,6 +813,11 @@
0
             $where[] = $test." = :".$test;
0
             $params[":".$test] = $equals;
0
           }
0
+
0
+          if (!empty($search)) {
0
+            $where[] = "(title LIKE :query OR body LIKE :query)";
0
+            $params[":query"] = "%".$search."%";
0
+          }
0
         } else
0
           list($where, $params) = array(null, array());
0
 
0
@@ -913,6 +930,11 @@
0
             $where[] = $test." = :".$test;
0
             $params[":".$test] = $equals;
0
           }
0
+
0
+          if (!empty($search)) {
0
+            $where[] = "(login LIKE :query OR full_name LIKE :query OR email LIKE :query OR website LIKE :query)";
0
+            $params[":query"] = "%".$_GET['query']."%";
0
+          }
0
         } else
0
           list($where, $params) = array(null, array());
0
 

Comments