当前位置: 首页>>代码示例>>PHP>>正文


PHP Recipe::updatePicture方法代码示例

本文整理汇总了PHP中Recipe::updatePicture方法的典型用法代码示例。如果您正苦于以下问题:PHP Recipe::updatePicture方法的具体用法?PHP Recipe::updatePicture怎么用?PHP Recipe::updatePicture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Recipe的用法示例。


在下文中一共展示了Recipe::updatePicture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Recipe

        $ingArray[] = $ingObj;
        //Add the object to the list
    }
    $i++;
}
/*
	Handle adding and editing of recipes
*/
$recipeObj = new Recipe($recipe_id, $recipe_name, $recipe_ethnic, $recipe_base, $recipe_course, $recipe_prep_time, $recipe_difficulty, $recipe_directions, $recipe_comments, $recipe_serving_size, $recipe_source, $recipe_source_desc, $SMObj->getUserID(), $recipe_private, $_FILES['recipe_picture'], $recipe_picture_type, $recipe_picture_oid);
// Add or update the recipe
$recipeObj->addUpdate();
// Handle the picture
if ($remove_picture == "yes") {
    $recipeObj->deletePicture();
} else {
    $recipeObj->updatePicture($resize_picture);
}
if ($recipe_id) {
    // Clear out the old ingredients, this could be done by an update if desired.
    $sql = "DELETE FROM {$db_table_ingredientmaps} WHERE map_recipe=" . $DB_LINK->addq($recipe_id, get_magic_quotes_gpc());
    $result = $DB_LINK->Execute($sql);
    // Also clear out the related_recipes
    $sql = "DELETE FROM {$db_table_related_recipes} WHERE related_parent=" . $DB_LINK->addq($recipe_id, get_magic_quotes_gpc());
    $result = $DB_LINK->Execute($sql);
}
$recipe_id = $recipeObj->getID();
/*
	Add the ingredients into the database. The order field is needed because mysql does not consistently put them in or retrieve them
		in a specific order.
*/
foreach ($ingArray as $ing) {
开发者ID:pjflameboy,项目名称:phprecipebook,代码行数:31,代码来源:update.php


注:本文中的Recipe::updatePicture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。