Salve
Volevo modificare tutto l'header, della me, cambiando ( Community, news ed altro ) con un contenitore ( quello presente, col box logo in green a sinistra dello screen ) dove poterci scrivere una centinaia se non più di caratteri, e anche inserire un'immagine !
Vi lascio qui il codice
In più ho un problema per quanto riguarda i DCR, entrando in hotel, nessun problema, ma poi inserendo un furno oppure cliccando su un furno nello shop il client crasha ( i furni sono visualizzati con le scatole nere )
( CMS HADDO V.3.2.)
Volevo modificare tutto l'header, della me, cambiando ( Community, news ed altro ) con un contenitore ( quello presente, col box logo in green a sinistra dello screen ) dove poterci scrivere una centinaia se non più di caratteri, e anche inserire un'immagine !
Vi lascio qui il codice
<?php
/*=====================================================================+
|| # HaddoCMS based on HoloCMS - Website and Content Management System
|+=====================================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| #
|| # Copyright © 2017 Raikas77 and Impossibol. All rights reserved.
|| #
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+=====================================================================+
|| # HaddoCMS v3.2 by Raikas77 and Impossibol
|| # HaddoCMS is made for Haddo Hotel. All rights reserved.
|+=====================================================================*/
$allow_guests = true;
include_once('core.php');
include_once('includes/session.php');
$pagename = "Pagina1";
$pageid = "6";
if(isset($_GET['comment'])){
$id = $_GET['comment'];
$get = RunQuery($pdo, "SELECT * FROM cms_news_comments WHERE article = :id ORDER BY id DESC LIMIT 10");
$get->execute(array('id' => $id));
if($get->rowCount()){
$str = '';
while($comment = $get->fetch(PDO::FETCH_ASSOC)){
$user1 = RunQuery($pdo, "SELECT * FROM users WHERE id = :id LIMIT 1");
$user1->execute(array('id' => $comment['user']));
$user = $user1->fetch(PDO::FETCH_ASSOC);
$str .= '{"username":"'.$user['username'].'","look":"'.$user['look'].'","rank":"'.$user['rank'].'","comment":"'.htmlspecialchars(SwitchWordFilter($pdo, $comment['comment'])).'","time":"'.date("d/m/Y", $comment['time']).'"},';
} ?>
{"news_comments":[<?php echo rtrim($str, ","); ?>]}
<?php
die;
}else{
$raikas1 = RunQuery($pdo, "SELECT * FROM users WHERE username = 'Raikas77' LIMIT 1");
$raikas1->execute();
$raikas = $raikas1->fetch(PDO::FETCH_ASSOC);
echo '{"news_comments":[{"comment":"Non ci sono commenti!","rank": "7", "username":"'.$raikas['username'].'", "look":"'.$raikas['look'].'", "time":"Oggi"}]}';
die;
}
}
if(isset($_GET['comment_new']) && $_GET['comment_new'] == 1){
$post = RunQuery($pdo, "INSERT INTO `cms_news_comments` (article, comment, user, time) VALUES (:id, :comment, :user, :time)");
$post->execute(array('id' => $_POST['article_id'], 'comment' => SwitchWordFilter($pdo, $_POST['comment']), 'user' => $_POST['user_from'], 'time' => time()));
if($post) {
echo json_encode(array("returnCode" => 1));
die;
} else {
echo json_encode(array("returnCode" => 0));
die;
}
}
include_once('templates/subheader.php');
include_once('templates/header.php');
?>
<?php
if(!isset($_GET['id'])){ ?>
<link rel="stylesheet" type="text/css" href="<?php echo $path; ?>templates/default/css/me.css"/>
<link href="<?php echo $path; ?>templates/default/css/perfect-scrollbar.min.css" rel="stylesheet">
<div id="content" class="container_12 bodyContent">
<div class="grid_8">
<div class="box" id="mebox" style="width:99%;margin-left:2px;padding:10px">
<div id="points">
<div id="timeline"></div>
<?php
$newss = RunQuery($pdo, "SELECT * FROM cms_news ORDER BY id DESC LIMIT 3");
$newss->execute();
while($news = $newss->fetch(PDO::FETCH_ASSOC)) { ?>
<div class="boxContent">
<div class="circle"></div>
<div class="title" onclick="location.href = '<?php echo $path; ?>news/<?php echo $news['id']; ?>'">
<?php echo $news['title']; ?>
</div>
<div class="date"><?php echo $news['time']; ?></div>
<div class="clearfix"></div>
<?php echo nl2br(htmlspecialchars(stripslashes($news['short_story']))); ?>
</div>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="grid_4" style="float:right">
<div class="box" id="mebox" style="width:99%;margin-left:2px;padding: 10px;">
<div class="topListTitle red">TITOLO</div>
<div style="margin: 10px 5px 0 5px;text-align:justify">
TESTO
</div>
</div>
</div>
</div>
<div style="clear:both"></div>
<div style="clear:both"></div>
<?php
include_once('templates/footer.php');
?>
<script src="<?php echo $path; ?>templates/default/js/perfect-scrollbar.min.js"></script>
<script>
$(function() {
$(".boxContent").each(function(index, obj) {
if(index == $(".box").size()-1) {
$(obj).css('border-bottom', 0);
}
});
$("#points").css('height', 'auto');
$(".circle").each(function(index, obj) {
var object = $(obj);
if(index % 2 == 0) {
object.addClass('odd');
} else {
object.addClass('even');
}
});
$(window).resize(function() {
$("#points").css('height', 'auto');
});
$('#points').perfectScrollbar();
});
</script>
<script type="text/javascript">
$("div.mainMenu li").click(function() {
var subId = $(this).attr("id");
$("div.mainMenu").find("li.active").removeClass("active");
$("div.mainMenu").find("li#" + subId).addClass("active");
$("div.bottomMenu").find("ul").css('display', 'none');
$("div.bottomMenu").find("ul." + subId).css('display', 'block');
});
</script>
</body>
</html>
<?php }else{ ?>
<?php
$id = FilterText($_GET['id']);
if($id == '' || newsnum($pdo, $id) == '0' || !is_numeric($id)){
echo '<script>window.location.href = "'.$path.'news";</script>';
exit;
}
$query = RunQuery($pdo, "SELECT * FROM cms_news WHERE id = :id LIMIT 1");
$query->execute(array('id' => $id));
$news = $query->fetch(PDO::FETCH_ASSOC);
?>
<link rel="stylesheet" type="text/css" href="<?php echo $path; ?>templates/default/css/news.css"/>
<div id="content" class="container_12 bodyContent">
<div class="grid_8">
<div class="box">
<h3 style="float:left;line-height:35px"><?php echo $news['title']; ?></h3>
<div style="float:right;margin-top:-5px">
<span class="article_date"><?php echo $news['time']; ?></span><br />
<span class="article_author"><?php echo $news['author']; ?></span>
</div>
<div class="clearfix"></div>
<hr />
<?php echo $news['short_story']; ?><br>
<hr />
<div id="long_article_raw">
<?php echo htmlspecialchars_decode($news['story']); ?>
<br>
</div>
</div>
</div>
<div class="grid_4" id="commentsGrid" style="float:right">
<div class="box" id="commentsBox">
<?php if($news['article_comments'] == 1){ ?>
<?php if($_SESSION['username']){ ?>
<button class="actAsInput" id="showCmntForm" style="float:right">Scrivi un commento</button>
<?php } ?>
<ul class="news_comments content">
</ul>
<div class="page_navigation"></div>
<div class="writeComment">
<form action="#" id="newCommentForm" method="POST">
<textarea class="input" name="comment" placeholder="Cosa pensi di questa news?"></textarea>
<input type="submit" style="border-radius:2px" name="sndCmnt" value="Posta" />
</form>
<button class="actAsInput" id="cancelComment">Annulla</button>
</div>
<div class="clearfix"></div>
<?php }else{ ?>
I <b>commenti</b> su questa news sono stati disabilitati!
<?php } ?>
</div>
</div>
</div>
<div style="clear:both"></div>
<?php
include_once('templates/footer.php');
?>
<script src="<?php echo $path; ?>templates/default/js/haddo.news.js?v=<?php echo rand(); ?>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
News.getComments(<?php echo $news['id']; ?>);
$("button#showCmntForm").click(function() {
$(this).hide();
$(".page_navigation").hide();
$("ul.news_comments").slideUp(function() {
$("div.writeComment").fadeIn();
});
});
$("button#cancelComment").click(function() {
$("div.writeComment").slideUp(function() {
$(".page_navigation").show();
$("button#showCmntForm").show();
$("ul.news_comments").slideDown();
});
});
$("#newCommentForm").submit(function(e) {
e.preventDefault();
News.postComment(<?php echo $id; ?>, $("#newCommentForm textarea").val(), "<?php echo $myrow['id']; ?>");
});
});
</script>
<script type="text/javascript">
$("div.mainMenu li").click(function() {
var subId = $(this).attr("id");
$("div.mainMenu").find("li.active").removeClass("active");
$("div.mainMenu").find("li#" + subId).addClass("active");
$("div.bottomMenu").find("ul").css('display', 'none');
$("div.bottomMenu").find("ul." + subId).css('display', 'block');
});
</script>
</body>
</html>
<?php } ?>
/*=====================================================================+
|| # HaddoCMS based on HoloCMS - Website and Content Management System
|+=====================================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| #
Perfavore,
Entra
oppure
Registrati
per vedere i Link!
|| # Copyright © 2017 Raikas77 and Impossibol. All rights reserved.
|| #
Perfavore,
Entra
oppure
Registrati
per vedere i Link!
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+=====================================================================+
|| # HaddoCMS v3.2 by Raikas77 and Impossibol
|| # HaddoCMS is made for Haddo Hotel. All rights reserved.
|+=====================================================================*/
$allow_guests = true;
include_once('core.php');
include_once('includes/session.php');
$pagename = "Pagina1";
$pageid = "6";
if(isset($_GET['comment'])){
$id = $_GET['comment'];
$get = RunQuery($pdo, "SELECT * FROM cms_news_comments WHERE article = :id ORDER BY id DESC LIMIT 10");
$get->execute(array('id' => $id));
if($get->rowCount()){
$str = '';
while($comment = $get->fetch(PDO::FETCH_ASSOC)){
$user1 = RunQuery($pdo, "SELECT * FROM users WHERE id = :id LIMIT 1");
$user1->execute(array('id' => $comment['user']));
$user = $user1->fetch(PDO::FETCH_ASSOC);
$str .= '{"username":"'.$user['username'].'","look":"'.$user['look'].'","rank":"'.$user['rank'].'","comment":"'.htmlspecialchars(SwitchWordFilter($pdo, $comment['comment'])).'","time":"'.date("d/m/Y", $comment['time']).'"},';
} ?>
{"news_comments":[<?php echo rtrim($str, ","); ?>]}
<?php
die;
}else{
$raikas1 = RunQuery($pdo, "SELECT * FROM users WHERE username = 'Raikas77' LIMIT 1");
$raikas1->execute();
$raikas = $raikas1->fetch(PDO::FETCH_ASSOC);
echo '{"news_comments":[{"comment":"Non ci sono commenti!","rank": "7", "username":"'.$raikas['username'].'", "look":"'.$raikas['look'].'", "time":"Oggi"}]}';
die;
}
}
if(isset($_GET['comment_new']) && $_GET['comment_new'] == 1){
$post = RunQuery($pdo, "INSERT INTO `cms_news_comments` (article, comment, user, time) VALUES (:id, :comment, :user, :time)");
$post->execute(array('id' => $_POST['article_id'], 'comment' => SwitchWordFilter($pdo, $_POST['comment']), 'user' => $_POST['user_from'], 'time' => time()));
if($post) {
echo json_encode(array("returnCode" => 1));
die;
} else {
echo json_encode(array("returnCode" => 0));
die;
}
}
include_once('templates/subheader.php');
include_once('templates/header.php');
?>
<?php
if(!isset($_GET['id'])){ ?>
<link rel="stylesheet" type="text/css" href="<?php echo $path; ?>templates/default/css/me.css"/>
<link href="<?php echo $path; ?>templates/default/css/perfect-scrollbar.min.css" rel="stylesheet">
<div id="content" class="container_12 bodyContent">
<div class="grid_8">
<div class="box" id="mebox" style="width:99%;margin-left:2px;padding:10px">
<div id="points">
<div id="timeline"></div>
<?php
$newss = RunQuery($pdo, "SELECT * FROM cms_news ORDER BY id DESC LIMIT 3");
$newss->execute();
while($news = $newss->fetch(PDO::FETCH_ASSOC)) { ?>
<div class="boxContent">
<div class="circle"></div>
<div class="title" onclick="location.href = '<?php echo $path; ?>news/<?php echo $news['id']; ?>'">
<?php echo $news['title']; ?>
</div>
<div class="date"><?php echo $news['time']; ?></div>
<div class="clearfix"></div>
<?php echo nl2br(htmlspecialchars(stripslashes($news['short_story']))); ?>
</div>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="grid_4" style="float:right">
<div class="box" id="mebox" style="width:99%;margin-left:2px;padding: 10px;">
<div class="topListTitle red">TITOLO</div>
<div style="margin: 10px 5px 0 5px;text-align:justify">
TESTO
</div>
</div>
</div>
</div>
<div style="clear:both"></div>
<div style="clear:both"></div>
<?php
include_once('templates/footer.php');
?>
<script src="<?php echo $path; ?>templates/default/js/perfect-scrollbar.min.js"></script>
<script>
$(function() {
$(".boxContent").each(function(index, obj) {
if(index == $(".box").size()-1) {
$(obj).css('border-bottom', 0);
}
});
$("#points").css('height', 'auto');
$(".circle").each(function(index, obj) {
var object = $(obj);
if(index % 2 == 0) {
object.addClass('odd');
} else {
object.addClass('even');
}
});
$(window).resize(function() {
$("#points").css('height', 'auto');
});
$('#points').perfectScrollbar();
});
</script>
<script type="text/javascript">
$("div.mainMenu li").click(function() {
var subId = $(this).attr("id");
$("div.mainMenu").find("li.active").removeClass("active");
$("div.mainMenu").find("li#" + subId).addClass("active");
$("div.bottomMenu").find("ul").css('display', 'none');
$("div.bottomMenu").find("ul." + subId).css('display', 'block');
});
</script>
</body>
</html>
<?php }else{ ?>
<?php
$id = FilterText($_GET['id']);
if($id == '' || newsnum($pdo, $id) == '0' || !is_numeric($id)){
echo '<script>window.location.href = "'.$path.'news";</script>';
exit;
}
$query = RunQuery($pdo, "SELECT * FROM cms_news WHERE id = :id LIMIT 1");
$query->execute(array('id' => $id));
$news = $query->fetch(PDO::FETCH_ASSOC);
?>
<link rel="stylesheet" type="text/css" href="<?php echo $path; ?>templates/default/css/news.css"/>
<div id="content" class="container_12 bodyContent">
<div class="grid_8">
<div class="box">
<h3 style="float:left;line-height:35px"><?php echo $news['title']; ?></h3>
<div style="float:right;margin-top:-5px">
<span class="article_date"><?php echo $news['time']; ?></span><br />
<span class="article_author"><?php echo $news['author']; ?></span>
</div>
<div class="clearfix"></div>
<hr />
<?php echo $news['short_story']; ?><br>
<hr />
<div id="long_article_raw">
<?php echo htmlspecialchars_decode($news['story']); ?>
<br>
</div>
</div>
</div>
<div class="grid_4" id="commentsGrid" style="float:right">
<div class="box" id="commentsBox">
<?php if($news['article_comments'] == 1){ ?>
<?php if($_SESSION['username']){ ?>
<button class="actAsInput" id="showCmntForm" style="float:right">Scrivi un commento</button>
<?php } ?>
<ul class="news_comments content">
</ul>
<div class="page_navigation"></div>
<div class="writeComment">
<form action="#" id="newCommentForm" method="POST">
<textarea class="input" name="comment" placeholder="Cosa pensi di questa news?"></textarea>
<input type="submit" style="border-radius:2px" name="sndCmnt" value="Posta" />
</form>
<button class="actAsInput" id="cancelComment">Annulla</button>
</div>
<div class="clearfix"></div>
<?php }else{ ?>
I <b>commenti</b> su questa news sono stati disabilitati!
<?php } ?>
</div>
</div>
</div>
<div style="clear:both"></div>
<?php
include_once('templates/footer.php');
?>
<script src="<?php echo $path; ?>templates/default/js/haddo.news.js?v=<?php echo rand(); ?>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
News.getComments(<?php echo $news['id']; ?>);
$("button#showCmntForm").click(function() {
$(this).hide();
$(".page_navigation").hide();
$("ul.news_comments").slideUp(function() {
$("div.writeComment").fadeIn();
});
});
$("button#cancelComment").click(function() {
$("div.writeComment").slideUp(function() {
$(".page_navigation").show();
$("button#showCmntForm").show();
$("ul.news_comments").slideDown();
});
});
$("#newCommentForm").submit(function(e) {
e.preventDefault();
News.postComment(<?php echo $id; ?>, $("#newCommentForm textarea").val(), "<?php echo $myrow['id']; ?>");
});
});
</script>
<script type="text/javascript">
$("div.mainMenu li").click(function() {
var subId = $(this).attr("id");
$("div.mainMenu").find("li.active").removeClass("active");
$("div.mainMenu").find("li#" + subId).addClass("active");
$("div.bottomMenu").find("ul").css('display', 'none');
$("div.bottomMenu").find("ul." + subId).css('display', 'block');
});
</script>
</body>
</html>
<?php } ?>
In più ho un problema per quanto riguarda i DCR, entrando in hotel, nessun problema, ma poi inserendo un furno oppure cliccando su un furno nello shop il client crasha ( i furni sono visualizzati con le scatole nere )
( CMS HADDO V.3.2.)
Allegati
Ultima modifica: