This commit is contained in:
Lorenzo Giacomelli
2016-03-17 11:17:19 +01:00
parent ff898967db
commit c5b5bae44a
3 changed files with 19 additions and 15 deletions
+18 -14
View File
@@ -25,7 +25,7 @@ try {
$media = DaoMediaHandler::getMainMediaFromModel($articolo);
$medias = DaoMediaHandler::getMedias($articolo);
$commenti = GlobalVariables::get("dao")->query("CommentiModel",
$commenti = GlobalVariables::get("dao")->query("CommentoModel",
array("notizia"=>$articolo->id,"status"=>CommentoModel::STATUS_ACCEPTED),
array("sort"=>array("about.data"=>-1))
);
@@ -81,15 +81,19 @@ try {
}
if(array_key_exists("sendCommento", $_POST) && strcmp($_POST["sendCommento"] ,"Send")==0){
$saveable = new stdClass();
$saveable->user = UserLoginManager::getLogged();
$saveable->notizia = $articolo->id;
$saveable->titolo = $_POST["titolo"];
$saveable->testo = $_POST["commento"];
$saveable->status = CommentoModel::STATUS_PENDING;
$commento = new CommentoModel($savable);
GlobalVariables::get("dao")->save($commento);
if(UserLoginManager::isLogged()){
$saveable = new stdClass();
$saveable->user = $user->id;
$saveable->notizia = $articolo->id;
$saveable->titolo = strip_tags($_POST["titolo"]);
$saveable->testo = strip_tags($_POST["commento"]);
$saveable->status = CommentoModel::STATUS_PENDING;
// var_dump($saveable);
$commento = new CommentoModel($saveable);
GlobalVariables::get("dao")->save($commento);
}
}
}catch(GUIException $ex){
@@ -133,7 +137,6 @@ GUIHandler::generateHtmlHeaders(array("additionalHeaders"=>$additionalHeaders));
<?php if($articolo->hasProperty("sondaggio") && !is_null($articolo->sondaggio)){?>
<div class="sondaggioContainer">
<div id="sondaggioGraph" style="height:300px;margin-right:280px;margin-top:10px;"></div>
<div class="votanti">Votanti: <?php $i=0; foreach ($articolo->sondaggio->votanti as $votante){ echo ($i++==0?"":", ").$votante;}?></div>
<?php if(UserLoginManager::isLogged()){
if(!in_array($user->username, $articolo->sondaggio->votanti)){?>
<div class="sondaggioOptions">
@@ -209,11 +212,12 @@ GUIHandler::generateHtmlHeaders(array("additionalHeaders"=>$additionalHeaders));
?>
<div class="oldCommentiContainer">
<?php foreach ($commenti as $oldCommento){
$utonto = GlobalVariables::get("dao")->getFirst("UserModel",array("_id"=>$oldCommento->user));
?>
<div class="commento">
<div>Username</div>
<span>Titolo</span>
<span>Testo</span>
<div><?php echo $utonto->username;?></div>
<div><?php echo $oldCommento->titolo;?></div>
<div><?php echo $oldCommento->testo;?></div>
</div>
<?php }
?>
+1 -1
View File
@@ -11,7 +11,7 @@ try{
$category = "";
if(array_key_exists("category", $_GET) && strcmp($_GET["category"], "")!=0){
var_dump(NotiziaModel::$NOTIZIE_CATEGORY[intval($_GET["category"])]["hidden"]);
// var_dump(NotiziaModel::$NOTIZIE_CATEGORY[intval($_GET["category"])]["hidden"]);
if(NotiziaModel::$NOTIZIE_CATEGORY[$_GET["category"]]["hidden"]){
GUIHandler::redirect("index.php");
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 41 KiB