use Anon user in Recipe
This commit is contained in:
parent
a36fb5dde2
commit
04d3fdb206
@ -119,6 +119,15 @@ final class RecipeModel
|
|||||||
|
|
||||||
return round($avg*2)/2;
|
return round($avg*2)/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAuthorOrAnon(){
|
||||||
|
$O_author = self::getAuthor();
|
||||||
|
if ($O_author === null) {
|
||||||
|
return UserModel::getAnonUser();
|
||||||
|
} else {
|
||||||
|
return $O_author;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getAuthor(){
|
public function getAuthor(){
|
||||||
if($this->O_AUTHOR === null){
|
if($this->O_AUTHOR === null){
|
||||||
|
@ -35,14 +35,7 @@ $O_recipe = $A_view["RECIPE"];
|
|||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php
|
<p>By <?= $O_recipe->getAuthorOrAnon()->S_USERNAME ?> </p>
|
||||||
$O_author = $O_recipe->getAuthor();
|
|
||||||
if($O_author === null) {
|
|
||||||
echo '<p>By an anonymous user</p>';
|
|
||||||
} else {
|
|
||||||
echo '<p>By '.$O_author->S_USERNAME.' </p>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section class="buttonsEditRecipe">
|
<section class="buttonsEditRecipe">
|
||||||
<a href="/recipe/edit/<?= $O_recipe->I_ID ?>">Modifier la recette</a>
|
<a href="/recipe/edit/<?= $O_recipe->I_ID ?>">Modifier la recette</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user