| 1 |
<?php |
<?php |
| 2 |
// $Id: $ |
// $Id: recipe.module,v 1.82 2008/04/20 19:05:12 brdwor Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 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 |
} |
} |