<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,8 +2,10 @@
 class Newz_Controller extends Controller {
 	public function index()
 	{
-		if(!empty($this-&gt;params['keyword'])) {
-			$results = $this-&gt;View-&gt;results = $this-&gt;Newz-&gt;search($this-&gt;params['keyword']);
+		if(!empty($this-&gt;params['Newz'])) {
+			
+			$options = $this-&gt;params['Newz'];
+			$results = $this-&gt;View-&gt;results = $this-&gt;Newz-&gt;find($options);
 			$slimmed = array();
 			foreach($results as $r) {
 				$slimmed[] = array(</diff>
      <filename>controllers/newz_controller.php</filename>
    </modified>
    <modified>
      <diff>@@ -7,11 +7,13 @@ define('VIEW_DIR', ROOT_DIR . DS . 'views');
 define('CONTROLLER_DIR', ROOT_DIR . DS . 'controllers');
 define('MODEL_DIR', ROOT_DIR . DS . 'models');
 define('CONFIG_DIR', ROOT_DIR . DS . 'config');
+define('VENDOR_DIR', ROOT_DIR . DS . 'vendors');
 
 require CONFIG_DIR . DS . 'hella.config.php';
 require INCLUDE_DIR . DS . 'inflector.class.php';
 require INCLUDE_DIR . DS . 'model.php';
 require INCLUDE_DIR . DS . 'view.php';
 require INCLUDE_DIR . DS . 'controller.php';
+require VENDOR_DIR . DS . 'haml' . DS . 'HamlParser.class.php';
 
-require 'FirePHPCore/fb.php';
+require 'FirePHPCore/fb.php';
\ No newline at end of file</diff>
      <filename>include/setup.php</filename>
    </modified>
    <modified>
      <diff>@@ -9,11 +9,13 @@ function initSearch () {
 
 function search() {
 	$(&quot;#results&quot;).prepend('&lt;li id=&quot;loader&quot;&gt;&lt;img src=&quot;images/ajax-loader.gif&quot;/&gt;&lt;/li&gt;');
+	var data = $(&quot;#newz_search_form&quot;).serialize();
 	$.ajax({
-		url: '?c=newz&amp;a=index&amp;keyword='+ $(&quot;#keyword&quot;).val(),
+		url: '?c=newz&amp;a=index',//'&amp;q='+ $(&quot;#q&quot;).val(),
 		success: handleSearch,
-		dataType: 'json'
-		
+		dataType: 'json',
+		data: data,
+		method: 'POST'
 	});
 	
 	return false;</diff>
      <filename>js/application.js</filename>
    </modified>
    <modified>
      <diff>@@ -7,10 +7,23 @@ require ROOT_DIR . DS . 'vendors' . DS . 'xmlrpc.php';
 */		
 class Newz
 {
-	public function search($keyword) {
+	public function find($params=array()) {
 		require ROOT_DIR . DS . 'vendors' . DS . 'rss_php.php';
-		$uri = 'http://v3.newzbin.com/search/query/?area=-1&amp;fpn=p&amp;searchaction=Go&amp;areadone=-1&amp;feed=rss&amp;q=' 
-			. urlencode($keyword);
+		$uri = 'http://v3.newzbin.com/search/query/?fpn=p&amp;searchaction=Go&amp;feed=rss';
+		
+		$params['area'] = (!isset($params['area'])) ? '-1' : $params['area'];
+		$params['areadone'] = $params['area'];
+		$params['category'] = str_ireplace('c.', '', $params['area']);
+		
+		foreach($params as $key=&gt;$val) {
+			if(!empty($val))
+				$uri_params[] = &quot;{$key}=&quot;. urlencode($val);
+		}
+		
+		if(!empty($uri_params)) {
+			$uri .= &quot;&amp;&quot; . implode('&amp;', $uri_params);
+		}
+#die($uri);
 		try {
 			$rss_php = new rss_php;
 			$rss_php-&gt;load($uri);</diff>
      <filename>models/newz.php</filename>
    </modified>
    <modified>
      <diff>@@ -14,12 +14,33 @@
 					&lt;li&gt;&lt;a href=&quot;#monitor&quot;&gt;monitor&lt;/a&gt;&lt;/li&gt;
 				&lt;/ul&gt;
 			&lt;/div&gt;
+			
 			&lt;div id=&quot;contents&quot;&gt;
 				&lt;div id=&quot;search&quot; class=&quot;pane&quot;&gt;
 					&lt;form id=&quot;newz_search_form&quot;&gt;
 						&lt;div class=&quot;form_element&quot;&gt;
-							&lt;label for=&quot;keyword&quot;&gt;Keyword&lt;/label&gt;
-							&lt;input type=&quot;text&quot; name=&quot;keyword&quot; id=&quot;keyword&quot;/&gt;
+							&lt;label for=&quot;q&quot;&gt;Keyword&lt;/label&gt;
+							&lt;input type=&quot;text&quot; name=&quot;Newz[q]&quot; id=&quot;q&quot;/&gt;
+						&lt;/div&gt;
+						
+						&lt;div class=&quot;form_element&quot;&gt;
+							&lt;label for=&quot;Newz-area&quot;&gt;Category&lt;/label&gt;
+							&lt;select name=&quot;Newz[area]&quot; id=&quot;Newz-area&quot;&gt;
+								&lt;option label=&quot;Unknown&quot; value=&quot;c.0&quot;&gt;Unknown&lt;/option&gt;
+								&lt;option label=&quot;Anime&quot; value=&quot;c.11&quot;&gt;Anime&lt;/option&gt;
+								&lt;option label=&quot;Apps&quot; value=&quot;c.1&quot;&gt;Apps&lt;/option&gt;
+								&lt;option label=&quot;Books&quot; value=&quot;c.13&quot;&gt;Books&lt;/option&gt;
+								&lt;option label=&quot;Consoles&quot; value=&quot;c.2&quot;&gt;Consoles&lt;/option&gt;
+								&lt;option label=&quot;Discussions&quot; value=&quot;c.15&quot;&gt;Discussions&lt;/option&gt;
+								&lt;option label=&quot;Emulation&quot; value=&quot;c.10&quot;&gt;Emulation&lt;/option&gt;
+								&lt;option label=&quot;Games&quot; value=&quot;c.4&quot;&gt;Games&lt;/option&gt;
+								&lt;option label=&quot;Misc&quot; value=&quot;c.5&quot;&gt;Misc&lt;/option&gt;
+								&lt;option label=&quot;Movies&quot; value=&quot;c.6&quot;&gt;Movies&lt;/option&gt;
+								&lt;option label=&quot;Music&quot; value=&quot;c.7&quot;&gt;Music&lt;/option&gt;
+								&lt;option label=&quot;PDA&quot; value=&quot;c.12&quot;&gt;PDA&lt;/option&gt;
+								&lt;option label=&quot;Resources&quot; value=&quot;c.14&quot;&gt;Resources&lt;/option&gt;
+								&lt;option label=&quot;TV&quot; value=&quot;c.8&quot;&gt;TV&lt;/option&gt;
+							&lt;/select&gt;
 						&lt;/div&gt;
 						&lt;div class=&quot;submit&quot;&gt;
 							&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;search&quot;/&gt;
@@ -34,6 +55,7 @@
 						monitor here
 					&lt;/fieldset&gt;
 				&lt;/div&gt;
+				
 			&lt;/div&gt;
 			&lt;div id=&quot;footer&quot;&gt;&lt;/div&gt;
 		&lt;/div&gt;</diff>
      <filename>views/newz/index.phtml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>40a08b5b703039b180deb6a435b0bdd988bef741</id>
    </parent>
  </parents>
  <author>
    <name>Buck Robinson</name>
    <email>buck2769@gmail.com</email>
  </author>
  <url>http://github.com/buck2769/hellaphone/commit/0c639e9c3048fe0afdbf2c11d6a870b77129fdff</url>
  <id>0c639e9c3048fe0afdbf2c11d6a870b77129fdff</id>
  <committed-date>2008-12-23T18:21:49-08:00</committed-date>
  <authored-date>2008-12-23T18:21:49-08:00</authored-date>
  <message>added basic category search filtering, made model methods more generic</message>
  <tree>75ea6acf040ccaf663e916fd487b687ce1dd5054</tree>
  <committer>
    <name>Buck Robinson</name>
    <email>buck2769@gmail.com</email>
  </committer>
</commit>
