/[drupal]/contributions/modules/recipe/recipe.module
ViewVC logotype

Diff of /contributions/modules/recipe/recipe.module

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

revision 1.82, Sun Apr 20 19:05:12 2008 UTC revision 1.82.2.1, Sun Apr 20 20:07:15 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: $  // $Id: recipe.module,v 1.82 2008/04/20 19:05:12 brdwor Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 556  function recipe_ingredient_id_from_name( Line 556  function recipe_ingredient_id_from_name(
556      if (!$ingredient_id) {      if (!$ingredient_id) {
557        global $active_db;        global $active_db;
558        $node_link = db_result(db_query("SELECT nid FROM {node} n WHERE title = '%s'", $name));        $node_link = db_result(db_query("SELECT nid FROM {node} n WHERE title = '%s'", $name));
559          if (empty($node_link)) { $node_link=0; }
560        db_query("INSERT INTO {recipe_ingredient} (name, link) VALUES ('%s', '%s')", $name, $node_link);        db_query("INSERT INTO {recipe_ingredient} (name, link) VALUES ('%s', '%s')", $name, $node_link);
561        $ingredient_id = db_result(db_query("SELECT id FROM {recipe_ingredient} WHERE LOWER(name)='%s'", trim(strtolower($name))));        $ingredient_id = db_result(db_query("SELECT id FROM {recipe_ingredient} WHERE LOWER(name)='%s'", trim(strtolower($name))));
562      }      }

Legend:
Removed from v.1.82  
changed lines
  Added in v.1.82.2.1

  ViewVC Help
Powered by ViewVC 1.1.2