| 1 |
<?php |
<?php |
| 2 |
// $Id: node_type_filter.module,v 1.2.2.1.2.2 2008/01/21 00:51:29 nancyw Exp $ |
// $Id: node_type_filter.module,v 1.2.2.1.2.2.2.1 2008/01/25 19:32:14 nancyw Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Lets you filter node listing pages simply by &type=story,blog to the URL (for example) |
* Lets you filter node listing pages simply by &type=story,blog to the URL (for example) |
| 20 |
*/ |
*/ |
| 21 |
function node_type_filter_db_rewrite_sql($query, $primary_table, $primary_field, $args) { |
function node_type_filter_db_rewrite_sql($query, $primary_table, $primary_field, $args) { |
| 22 |
if ($primary_field == 'nid' && $primary_table=='n') { |
if ($primary_field == 'nid' && $primary_table=='n') { |
| 23 |
if (isset($_REQUEST['type']) && $str_types = $_REQUEST['type']) { |
if (isset($_GET['type']) && $str_types = $_GET['type']) { |
| 24 |
$types = explode(',', $str_types); |
$types = explode(',', $str_types); |
| 25 |
foreach ($types as $type) { |
foreach ($types as $type) { |
| 26 |
$ctypes[] = db_escape_string($type); |
$ctypes[] = db_escape_string($type); |