/[drupal]/contributions/modules/regcode/regcode.admin.php
ViewVC logotype

Diff of /contributions/modules/regcode/regcode.admin.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.18, Wed Oct 14 14:48:11 2009 UTC revision 1.1.2.19, Wed Oct 14 23:44:02 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: regcode.admin.php,v 1.1.2.17 2009/10/10 20:39:30 aidan Exp $  // $Id: regcode.admin.php,v 1.1.2.18 2009/10/14 14:48:11 aidan Exp $
3    
4  require_once 'regcode.api.php';  require_once 'regcode.api.php';
5    
# Line 508  function regcode_admin_list_savefilters( Line 508  function regcode_admin_list_savefilters(
508   */   */
509  function regcode_admin_list_getwhere() {  function regcode_admin_list_getwhere() {
510    // Grab a list of current filters    // Grab a list of current filters
511    $resource = db_query('SELECT name,value FROM {variable} WHERE name LIKE "regcode_filter_%"');    $resource = db_query("SELECT name,value FROM {variable} WHERE name LIKE 'regcode_filter_%'");
512    
513    // Build array of applicable conditions    // Build array of applicable conditions
514    $conditions = array();    $conditions = array();
# Line 528  function regcode_admin_list_getwhere() { Line 528  function regcode_admin_list_getwhere() {
528    $cond = array();    $cond = array();
529    foreach ($conditions as $filter => $value) {    foreach ($conditions as $filter => $value) {
530      $value = preg_replace('/[^a-zA-Z0-9\s]+/', '', $value);      $value = preg_replace('/[^a-zA-Z0-9\s]+/', '', $value);
531      $cond[] = sprintf('%s = "%s"', $filter, $value);      $cond[] = sprintf("%s = '%s'", $filter, $value);
532    }    }
533    
534    // Return the string    // Return the string
# Line 536  function regcode_admin_list_getwhere() { Line 536  function regcode_admin_list_getwhere() {
536    if (!empty($cond)) {    if (!empty($cond)) {
537      $string .= implode($cond, ' AND ');      $string .= implode($cond, ' AND ');
538    } else {    } else {
539      $string .= '1';      $string .= 'TRUE';
540    }    }
541    
542    return $string;    return $string;

Legend:
Removed from v.1.1.2.18  
changed lines
  Added in v.1.1.2.19

  ViewVC Help
Powered by ViewVC 1.1.2