[PhpRetro]GuestBook[PhpRetro]
Hello ppl. Today i did make a guestbook for phpretro. If any use phpretro anymore. Fact: This is a RE-CODE!
1. Make a file called guestbook.php
2. Put this in guestbook.php
PHP Code:
<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/
$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');
$data = new community_sql;
$lang->addLocale("community.news");
$id = $input->FilterText($_GET['id']);
$category = $input->stringToURL($input->HoloText($_GET['category'],true),true,false);
$archive = $_GET['archive'];
$pagenum = $_GET['pageNumber'];
if(!isset($_GET['pageNumber'])){ $pagenum = 1; }
if(!isset($id) || $id == ""){ $id = $db->result($db->query("SELECT MAX(id) AS count FROM ".PREFIX."news LIMIT 1")); }
$news_row = $db->fetch_assoc($db->query("SELECT * FROM ".PREFIX."news WHERE id = '".$id."' LIMIT 1"));
foreach ($news_row as &$value) {
$value = $input->HoloText($value, true);
}
$page['id'] = "news";
$page['name'] = $lang->loc['pagename.guestbook']." - ".$news_row['title'];
$page['bodyid'] = "guestbook";
$page['cat'] = "guestbook";
require_once('./templates/community_header.php');
?> <div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="column9" class="column">
<div class="habblet-container">
<div class="cbb clearfix orange ">
<h2 class="title"><?php echo SHORTNAME; ?> guestbook
</h2><center>
Welcome to the guestbook!</center> <meta http-equiv="refresh" content="30"/>
<style type="text/css">
input[type="text"], input[type="password"] {
background-color: #F1F1F1;
border: 1px solid #999999;
width: 175px;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
input[type="submit"] {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
textarea {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
width: 517px;
height: 70px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
select {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
</style>
<?php
if(isset($_POST['post_comment']) && $user->name != 'Guest'){
$posted_on = date("M j, Y g:i A");
$comment = strip_tags($input->FilterText($_POST['comment']));
if($comment == NULL){
$error_message = 'You have left a field empty.<br /><br />';
}else{
mysql_query("INSERT INTO cms_comments (userid, comment, posted_on) VALUES ('".$news_row['id']."', '".$user->id."', '".$comment."', '".$posted_on."');");
$error_message = 'Posted!!!<br /><br />';
}
}
?>
<div class="habblet-container ">
<div id="article-wrapper"><h2>Post</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if($user->name != 'Guest'){
echo $error_message; ?>
<form action="" method="post">
<textarea name="comment" maxlength="500"></textarea><br /><br />
<input type="submit" name="post_comment" value="Post" />
</form>
<?php
}else{
echo 'You must login to post a comment.';
}
?>
</div>
</div>
</div>
</div>
<?php
$getComments = mysql_query("SELECT * FROM cms_comments WHERE article = '".$news_row['id']."' ORDER by id DESC");
?>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2> <?php echo mysql_num_rows($getComments); ?> Post`s</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if(mysql_num_rows($getComments) == 0){
echo 'Sorry, but no one has post anything.';
}else{
echo '<table width="528px">';
while($Comments = mysql_fetch_array($getComments)){
$getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$Comments['userid']."'");
$userInfo = mysql_fetch_array($getUserInfo);
echo '
<tr>
<td width="90px" valign="top">
<div style="float:left"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userInfo['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m"></div>
';
if($userInfo['rank'] > 5){
echo '<div style="position: absolute; z-index:1"><img src="http://www.habborator.org/badges/badges/ADM.gif"></div>';
}
echo '
</td>
<td width="427px" valign="top">
<strong></strong><br /><br />'.$Comments['comment'].'
</td>
</tr>
<tr>
<td width="90px" valign="top">
</td>
<td width="427px" align="right">
<i>Posted by <strong><a href="#">'.$userInfo['name'].'</a></strong> on '.$Comments['posted_on'].'</i><br /><br />
</td>
</tr>';
}
echo '</table>';
}
?>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>
<script type="text/javascript">
HabboView.run();
</script>
<?php require_once('./templates/community_footer.php'); ?>
And put this in templates/community_header.php
PHP Code:
<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/
if (!defined("IN_HOLOCMS")) { header("Location: ".PATH."/"); exit; }
$version = version();
$lang->addLocale("community.header");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo SHORTNAME; ?>: <?php echo $page['name']; ?> </title>
<script type="text/javascript">
var andSoItBegins = (new Date()).getTime();
</script>
<link rel="shortcut icon" href="<?php echo PATH; ?>/web-gallery/v2/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="alternate" type="application/rss+xml" title="<?php echo SHORTNAME; ?>: <?php echo $lang->loc['rss']; ?>" href="<?php echo PATH; ?>/articles/rss.xml" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/libs2.js" type="text/javascript"></script>
<script src="<?php echo PATH; ?>/web-gallery/static/js/visual.js" type="text/javascript"></script>
<script src="<?php echo PATH; ?>/web-gallery/static/js/libs.js" type="text/javascript"></script>
<script src="<?php echo PATH; ?>/web-gallery/static/js/common.js" type="text/javascript"></script>
<script src="<?php echo PATH; ?>/web-gallery/static/js/fullcontent.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/style.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/buttons.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/boxes.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/tooltips.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/local/com.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/js/local/com.js" type="text/javascript"></script>
<script type="text/javascript">
document.habboLoggedIn = <?php if($user->id == 0){ echo "false"; }else{ echo "true"; } ?>;
var habboName = <?php if($user->id != 0){ ?>"<?php echo $user->name; ?>"<?php }else{ echo "null"; } ?>;
var ad_keywords = "";
var habboReqPath = "<?php echo PATH; ?>";
var habboStaticFilePath = "<?php echo PATH; ?>/web-gallery";
var habboImagerUrl = "<?php echo PATH; ?>/habbo-imaging/";
var habboPartner = "";
window.name = "habboMain";
if (typeof HabboClient != "undefined") { HabboClient.windowName = "client"; }
</script>
<?php
switch($page['id']){
case "welcome":
?>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/welcome.css" type="text/css" />
<?php
break;
case "me":
?>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/personal.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/habboclub.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/minimail.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/control.textarea.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/minimail.js" type="text/javascript"></script>
<?php
break;
case "profile":
?>
<script src="<?php echo PATH; ?>/web-gallery/static/js/settings.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/settings.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/friendmanagement.css" type="text/css" />
<?php
break;
case "community":
?>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/rooms.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/rooms.js" type="text/javascript"></script>
<script src="<?php echo PATH; ?>/web-gallery/static/js/moredata.js" type="text/javascript"></script>
<?php
break;
case "tryout":
?>
<script src="<?php echo PATH; ?>/web-gallery/static/js/settings.js" type="text/javascript"></script>
<?php
break;
case "collectables":
?>
<script src="<?php echo PATH; ?>/web-gallery/static/js/credits.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/collectibles.css" type="text/css" />
<?php
break;
case "home":
?>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/myhabbo.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/skins.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/dialogs.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/buttons.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/control.textarea.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/boxes.css" type="text/css" />
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/myhabbo.css" type="text/css" />
<link href="<?php echo PATH; ?>/web-gallery/styles/myhabbo/assets.css" type="text/css" rel="stylesheet" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/homeview.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/lightwindow.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/homeauth.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/group.css" type="text/css" />
<style type="text/css">
#playground, #playground-outer {
width: <?php if($user->IsHCMember($userrow[0])){ echo "922"; }else{ echo "752"; } ?>px;
height: 1360px;
}
</style>
<?php if($page['edit'] == true){ ?>
<script src="<?php echo PATH; ?>/web-gallery/static/js/homeedit.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
document.observe("dom:loaded", function() { initView(<?php echo $userrow[0]; ?>, <?php echo $userrow[0]; ?>); });
function isElementLimitReached() {
if (getElementCount() >= 200) {
showHabboHomeMessageBox("<?php echo addslashes($lang->loc['error']); ?>", "<?php echo addslashes($lang->loc['savehome.limit.error']); ?>", "<?php echo addslashes($lang->loc['close']); ?>");
return true;
}
return false;
}
<?php if($page['type'] == "home"){ ?>
function cancelEditing(expired) {
location.replace("<?php echo PATH; ?>/myhabbo/cancel/<?php echo $userrow[0]; ?>" + (expired ? "?expired=true" : ""));
}
function getSaveEditingActionName(){
return '/myhabbo/save';
}
<?php }else{ ?>
function cancelEditing(expired) {
location.replace("<?php echo PATH; ?>/groups/actions/cancelEditingSession" + (expired ? "?expired=true" : ""));
}
function getSaveEditingActionName(){
return '/groups/actions/saveEditingSession';
}
<?php } ?>
function showEditErrorDialog() {
var closeEditErrorDialog = function(e) { if (e) { Event.stop(e); } Element.remove($("myhabbo-error")); Overlay.hide(); }
var dialog = Dialog.createDialog("myhabbo-error", "", false, false, false, closeEditErrorDialog);
Dialog.setDialogBody(dialog, '<p><?php echo addslashes($lang->loc['error.dialog']); ?></p><p><a href="#" class="new-button" id="myhabbo-error-close"><b><?php echo addslashes($lang->loc['close']); ?></b><i></i></a></p><div class="clear"></div>');
Event.observe($("myhabbo-error-close"), "click", closeEditErrorDialog);
Dialog.moveDialogToCenter(dialog);
Dialog.makeDialogDraggable(dialog);
}
<?php if($page['type'] == "groups"){ ?>
document.observe("dom:loaded", function() {
Dialog.showInfoDialog("session-start-info-dialog",
"<?php echo addslashes($lang->loc['editing.session.timeout']); ?> <?php echo millisecondsToMinutes($timeout['expire']); ?> <?php echo addslashes($lang->loc['minutes']); ?>.",
"<?php echo addslashes($lang->loc['ok']); ?>", function(e) {Event.stop(e); Element.hide($("session-start-info-dialog"));Overlay.hide();Utils.setAllEmbededObjectsVisibility('hidden');});
var timeToTwoMinuteWarning= <?php echo $timeout['twominutes']; ?>;
if(timeToTwoMinuteWarning > 0){
setTimeout(function(){
Dialog.showInfoDialog("session-ends-warning-dialog",
"<?php echo addslashes($lang->loc['editing.session.timeout']); ?> 2 <?php echo addslashes($lang->loc['minutes']); ?>.",
"<?php echo addslashes($lang->loc['ok']); ?>", function(e) {Event.stop(e); Element.hide($("session-ends-warning-dialog"));Overlay.hide();Utils.setAllEmbededObjectsVisibility('hidden');});
}, timeToTwoMinuteWarning);
}
});
<?php } ?>
function showSaveOverlay() {
var invalidPos = getElementsInInvalidPositions();
if (invalidPos.length > 0) {
$A(invalidPos).each(function(el) { Element.scrollTo(el); Effect.Pulsate(el); });
showHabboHomeMessageBox("<?php echo addslashes($lang->loc['cant.do.that']); ?>", "<?php echo addslashes($lang->loc['cant.do.that.desc']); ?>", "<?php echo addslashes($lang->loc['close']); ?>");
return false;
} else {
Overlay.show(null,'<?php echo addslashes($lang->loc['saving']); ?>');
return true;
}
}
</script>
<?php }else{ ?>
<script type="text/javascript">
document.observe("dom:loaded", function() { initView(<?php if($page['type'] == "home"){ echo $userrow[0]; }else{ echo $grouprow[0]; } ?>, <?php if($user->id == "0"){ echo "null"; }else{ echo $user->id; } ?>); });
</script>
<?php } ?>
<?php
break;
}
?>
<?php if($page['discussion'] == true){ ?><link href="<?php echo PATH; ?>/web-gallery/styles/discussions.css" type="text/css" rel="stylesheet"/><?php } ?>
<meta name="description" content="<?php echo $settings->find("site_description"); ?>" />
<meta name="keywords" content="<?php echo $settings->find("site_keywords"); ?>" />
<!--[if IE 8]>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/ie8.css" type="text/css" />
<![endif]-->
<!--[if lt IE 8]>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/ie.css" type="text/css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" href="<?php echo PATH; ?>/web-gallery/v2/styles/ie6.css" type="text/css" />
<script src="<?php echo PATH; ?>/web-gallery/static/js/pngfix.js" type="text/javascript"></script>
<script type="text/javascript">
try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
</script>
<style type="text/css">
body { behavior: url(<?php echo PATH; ?>/web-gallery/js/csshover.htc); }
</style>
<![endif]-->
<meta name="build" content="PHPRetro <?php echo $version['version']." ".$version['status']; ?>" />
</head>
<body id="<?php echo $page['bodyid']; ?>" class="<?php if($user->name == "Guest"){ echo "anonymous"; } ?> ">
<div id="overlay"></div>
<div id="header-container">
<div id="header" class="clearfix">
<h1><a href="<?php echo PATH; ?>/"></a></h1>
<div id="subnavi">
<?php if($user->id != "0"){ ?>
<div id="subnavi-user">
<ul>
<li id="myfriends"><a href="#"><span><?php echo $lang->loc['my.friends']; ?></span></a><span class="r"></span></li>
<li id="mygroups"><a href="#"><span><?php echo $lang->loc['my.groups']; ?></span></a><span class="r"></span></li>
<li id="myrooms"><a href="#"><span><?php echo $lang->loc['my.rooms']; ?></span></a><span class="r"></span></li>
</ul>
</div>
<div id="subnavi-search">
<div id="subnavi-search-upper">
<ul id="subnavi-search-links">
<li><a href="<?php echo PATH; ?>/help" target="habbohelp" onclick="openOrFocusHelp(this); return false"><?php echo $lang->loc['help']; ?></a></li>
<li><a href="<?php echo PATH; ?>/account/logout" class="userlink" id="signout"><?php echo $lang->loc['sign.out']; ?></a></li>
</ul>
</div>
</div>
<div id="to-hotel">
<?php if(HotelStatus() == "online"){ ?>
<a href="<?php echo PATH; ?>/client" class="new-button green-button" target="client" onclick="HabboClient.openOrFocus(this); return false;"><b><?php echo $lang->loc['enter']; ?></b><i></i></a>
<?php }else{ ?>
<div id="hotel-closed-medium"><?php echo $lang->loc['closed']; ?></div>
<?php } ?>
</div>
<?php }else{ ?>
<div id="subnavi-user">
<div class="clearfix"> </div>
<p>
<a href="<?php echo PATH; ?>/client" id="enter-hotel-open-medium-link" target="client" onclick="HabboClient.openOrFocus(this); return false;"><?php echo $lang->loc['enter']; ?></a>
</p>
</div>
<div id="subnavi-login">
<form action="<?php echo PATH; ?>/account/submit" method="post" id="login-form">
<input type="hidden" name="page" value="<?php echo $_SERVER["REQUEST_URI"]; ?>" />
<ul>
<li>
<label for="login-username" class="login-text"><b><?php echo $lang->loc['username']; ?></b></label>
<input tabindex="1" type="text" class="login-field" name="username" id="login-username" />
<a href="#" id="login-submit-new-button" class="new-button" style="float: left; display:none"><b><?php echo $lang->loc['login']; ?></b><i></i></a>
<input type="submit" id="login-submit-button" value="<?php echo $lang->loc['login']; ?>" class="submit"/>
</li>
<li>
<label for="login-password" class="login-text"><b><?php echo $lang->loc['password']; ?></b></label>
<input tabindex="2" type="password" class="login-field" name="password" id="login-password" />
<input tabindex="3" type="checkbox" name="_login_remember_me" value="true" id="login-remember-me" />
<label for="login-remember-me" class="left"><?php echo $lang->loc['remember']; ?></label>
</li>
</ul>
</form>
<div id="subnavi-login-help" class="clearfix">
<ul>
<li class="register"><a href="<?php echo PATH; ?>/account/password/forgot" id="forgot-password"><span><?php echo $lang->loc['forgot']; ?></span></a></li>
<li><a href="<?php echo PATH; ?>/register"><span><?php echo $lang->loc['register']; ?></span></a></li>
</ul>
</div>
<div id="remember-me-notification" class="bottom-bubble" style="display:none;">
<div class="bottom-bubble-t"><div></div></div>
<div class="bottom-bubble-c">
<?php echo $lang->loc['remember.popup']; ?>
</div>
<div class="bottom-bubble-b"><div></div></div>
</div>
</div>
<?php } ?>
</div>
<?php if($user->id != 0){ ?>
<script type="text/javascript">
L10N.put("purchase.group.title", "<?php echo $lang->loc['purchase.group.title']; ?>");
document.observe("dom:loaded", function() {
$("signout").observe("click", function() {
HabboClient.close();
});
});
</script>
<?php }else{ ?>
<script type="text/javascript">
LoginFormUI.init();
RememberMeUI.init("right");
</script>
<?php } ?>
<ul id="navi">
<?php if($user->name != "Guest"){ ?>
<li<?php if($page['cat'] == "home"){ echo " class=\"selected\""; } ?>>
<?php if($page['cat'] == "home"){ echo "<strong>".$user->name." </strong>"; }else{ echo "<a href=\"".PATH."/me\">".$user->name."</a>"; } ?>
<span></span>
</li>
<?php }else{ ?>
<li id="tab-register-now"><a href="<?php echo PATH; ?>/register"><?php echo $lang->loc['register.tab']; ?></a><span></span></li>
<?php } ?>
<li<?php if($page['cat'] == "community"){ echo " class=\"selected\""; } ?>>
<?php if($page['cat'] == "community"){ echo "<strong>".$lang->loc['community']." </strong>"; }else{ echo "<a href=\"".PATH."/community\">".$lang->loc['community']."</a>"; } ?>
<span></span>
</li>
<li<?php if($page['cat'] == "credits"){ echo " class=\"selected\""; } ?>>
<?php if($page['cat'] == "credits"){ echo "<strong>".$lang->loc['coins']." </strong>"; }else{ echo "<a href=\"".PATH."/credits\">".$lang->loc['coins']."</a>"; } ?>
<span></span>
</li>
<li<?php if($page['cat'] == "guestbook"){ echo " class=\"selected\""; } ?>>
<?php if($page['cat'] == "Guestbook"){ echo "<strong>".Guestbook." </strong>"; }else{ echo "<a href=\"".PATH."/guestbook\">".Guestbook."</a>"; } ?>
<span></span>
</li>
<?php if((int) $user->user("rank") > 4){ ?>
<li id="tab-register-now"><a href="<?php echo PATH; ?>/housekeeping/"><?php echo $lang->loc['housekeeping']; ?></a><span></span></li>
<?php } ?>
</ul>
<div id="habbos-online"><div class="rounded"><span><?php echo GetOnlineCount()." ".$lang->loc['members.online']; ?></span></div></div>
</div>
</div>
<div id="content-container">
<?php
switch($page['cat']){
case "home":
?>
<?php if($user->name != "Guest"){ ?>
<div id="navi2-container" class="pngbg">
<div id="navi2" class="pngbg clearfix">
<ul>
<li class="<?php if($page['id'] == "me"){ echo "selected"; } ?>">
<?php if($page['id'] == "me"){ echo $lang->loc['home']; }else{ echo "<a href=\"".PATH."/me\">".$lang->loc['home']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "home" && ($_GET['id'] == $user->id || $_GET['name'] == $user->name)){ echo "selected"; } ?>">
<?php if($page['id'] == "home" && ($_POST['name'] == $user->name || $_GET['name'] == $user->name)){ echo $lang->loc['my.page']; }else{ echo "<a href=\"".PATH."/home/".$user->name."\">".$lang->loc['my.page']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "profile"){ echo "selected"; } ?>">
<?php if($page['id'] == "profile"){ echo $lang->loc['settings']; }else{ echo "<a href=\"".PATH."/profile\">".$lang->loc['settings']."</a>"; } ?>
</li>
<li class=" last">
<a href="<?php echo PATH; ?>/club"><?php echo $lang->loc['habbo.club']; ?></a>
</li>
</ul>
</div>
</div>
<?php } ?>
<?php
break;
case "community":
?>
<div id="navi2-container" class="pngbg">
<div id="navi2" class="pngbg clearfix">
<ul>
<li class="<?php if($page['id'] == "community"){ echo "selected"; } ?>">
<?php if($page['id'] == "community"){ echo $lang->loc['community']; }else{ echo "<a href=\"".PATH."/community\">".$lang->loc['community']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "news"){ echo "selected"; } ?>">
<?php if($page['id'] == "news"){ echo $lang->loc['news']; }else{ echo "<a href=\"".PATH."/articles\">".$lang->loc['news']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "tags"){ echo "selected"; } ?> last">
<?php if($page['id'] == "tags"){ echo $lang->loc['tags']; }else{ echo "<a href=\"".PATH."/tag\">".$lang->loc['tags']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "guestbook"){ echo "selected"; } ?> last">
<?php if($page['id'] == "guestbook"){ echo $lang->loc['guestbook']; }else{ echo "<a href=\"".PATH."/guestbook.php\">".Guestbook."</a>"; } ?>
</li>
</ul>
</div>
</div>
<?php
break;
case "credits":
?>
<div id="navi2-container" class="pngbg">
<div id="navi2" class="pngbg clearfix">
<ul>
<li class="<?php if($page['id'] == "credits"){ echo "selected"; } ?>">
<?php if($page['id'] == "credits"){ echo $lang->loc['coins']; }else{ echo "<a href=\"".PATH."/credits\">".$lang->loc['coins']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "club"){ echo "selected"; } ?>">
<?php if($page['id'] == "club"){ echo $lang->loc['habbo.club']; }else{ echo "<a href=\"".PATH."/credits/club\">".$lang->loc['habbo.club']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "collectables"){ echo "selected"; } ?>">
<?php if($page['id'] == "collectables"){ echo $lang->loc['collectables']; }else{ echo "<a href=\"".PATH."/credits/collectables\">".$lang->loc['collectables']."</a>"; } ?>
</li>
<li class="<?php if($page['id'] == "pixels"){ echo "selected"; } ?> last">
<?php if($page['id'] == "pixels"){ echo $lang->loc['pixels']; }else{ echo "<a href=\"".PATH."/credits/pixels\">".$lang->loc['pixels']."</a>"; } ?>
</li>
</ul>
</div>
</div>
<?php
break;
}
?>
And mysql
Code:
CREATE TABLE IF NOT EXISTS `cms_comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`comment` varchar(500) NOT NULL,
`posted_on` varchar(150) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=254
http://i53.tinypic.com/bjijqr.gif
-emÈrica
Credits:
RastaLulz 70-80%
Me 20-30%
Re: [PhpRetro]GuestBook[PhpRetro]
Rastalulz comment system has been renamed!
---------- Post added at 05:19 PM ---------- Previous post was at 05:18 PM ----------
Wait Nvm tells the posts plus aint used for articles fail lol
Re: [PhpRetro]GuestBook[PhpRetro]
If it is a Guest Book Why do you most login to post a comment it's called Guest Book get it Right You should not be able to login to leave a comment :) i'm just saying im not flamming this Thread... Nice Release Tho :)
Re: [PhpRetro]GuestBook[PhpRetro]
it is nice for people don't understand that stuff!
ah but you could better make it blue or what, then it is not not like anything you've renamed
Re: [PhpRetro]GuestBook[PhpRetro]
Re: [PhpRetro]GuestBook[PhpRetro]
Uhm.
That table is used by comment system for acticels(Whatever) right?
So if you make a new news, You see the comments from the questbook as comment in your news? (Or i can't read)
And...
Code:
http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$userInfo['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m
Co.uk is months ago dead? (copy past?)
[edit]
Meta tags you put it in your head and not body.
Re: [PhpRetro]GuestBook[PhpRetro]
Here is the fixed XD :thumpsup:
PHP Code:
<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/
$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');
$data = new community_sql;
$lang->addLocale("community.news");
$id = $input->FilterText($_GET['id']);
$category = $input->stringToURL($input->HoloText($_GET['category'],true),true,false);
$archive = $_GET['archive'];
$pagenum = $_GET['pageNumber'];
if(!isset($_GET['pageNumber'])){ $pagenum = 1; }
if(!isset($id) || $id == ""){ $id = $db->result($db->query("SELECT MAX(id) AS count FROM ".PREFIX."news LIMIT 1")); }
$news_row = $db->fetch_assoc($db->query("SELECT * FROM ".PREFIX."news WHERE id = '".$id."' LIMIT 1"));
foreach ($news_row as &$value) {
$value = $input->HoloText($value, true);
}
$page['id'] = "news";
$page['name'] = $lang->loc['pagename.guestbook']." - ".$news_row['title'];
$page['bodyid'] = "guestbook";
$page['cat'] = "guestbook";
require_once('./templates/community_header.php');
?> <div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="column9" class="column">
<div class="habblet-container">
<div class="cbb clearfix orange ">
<h2 class="title">Hotelname guestbook
</h2><center>
Welcome to the guestbook!</center> <meta http-equiv="refresh" content="30"/>
<style type="text/css">
input[type="text"], input[type="password"] {
background-color: #F1F1F1;
border: 1px solid #999999;
width: 175px;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
input[type="submit"] {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
textarea {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
width: 517px;
height: 70px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
select {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
</style>
<?php
if(isset($_POST['post_comment']) && $user->name != 'Guest'){
$posted_on = date("M j, Y g:i A");
$comment = strip_tags($input->FilterText($_POST['comment']));
if($comment == NULL){
$error_message = 'You have left a field empty.<br /><br />';
}else{
mysql_query("INSERT INTO cms_comments (article, userid, comment, posted_on) VALUES ('".$news_row['id']."', '".$user->id."', '".$comment."', '".$posted_on."');");
$error_message = 'Posted!!!<br /><br />';
}
}
?>
<div class="habblet-container ">
<div id="article-wrapper"><h2>Post</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if($user->name != 'Guest'){
echo $error_message; ?>
<form action="" method="post">
<textarea name="comment" maxlength="500"></textarea><br /><br />
<input type="submit" name="post_comment" value="Post" />
</form>
<?php
}else{
echo 'You must login to post a comment.';
}
?>
</div>
</div>
</div>
</div>
<?php
$getComments = mysql_query("SELECT * FROM cms_comments WHERE article = '".$news_row['id']."' ORDER by id DESC");
?>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2> <?php echo mysql_num_rows($getComments); ?> Post`s</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if(mysql_num_rows($getComments) == 0){
echo 'Sorry, but no one has post anything.';
}else{
echo '<table width="528px">';
while($Comments = mysql_fetch_array($getComments)){
$getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$Comments['userid']."'");
$userInfo = mysql_fetch_array($getUserInfo);
echo '
<tr>
<td width="90px" valign="top">
<div style="float:left"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userInfo['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m"></div>
';
if($userInfo['rank'] > 5){
echo '<div style="position: absolute; z-index:1"><img src="http://www.habborator.org/badges/badges/ADM.gif"></div>';
}
echo '
</td>
<td width="427px" valign="top">
<strong></strong><br /><br />'.$Comments['comment'].'
</td>
</tr>
<tr>
<td width="90px" valign="top">
</td>
<td width="427px" align="right">
<i>Posted by <strong><a href="#">'.$userInfo['name'].'</a></strong> on '.$Comments['posted_on'].'</i><br /><br />
</td>
</tr>';
}
echo '</table>';
}
?>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>
<script type="text/javascript">
HabboView.run();
</script>
<?php require_once('./templates/community_footer.php'); ?>
Re: [PhpRetro]GuestBook[PhpRetro]
You kinda just stole a News comments release, whichever that may be, and added the snippet to a page where you made the guestbook.
Kinda easy to do if you ask me, even I could do it, and I release shit!
Re: [PhpRetro]GuestBook[PhpRetro]
Its a great release. Tbh Mithex is kind of right. With the ".co.uk" it means you copied something as everyone knows cause of the merge it got changed to ".com".@Mithex But, it is useful for people and to you it may be easy but stuff like this is what can make some Content Management System's unique and maybe not you but some people would love this add on and would use it.
Re: [PhpRetro]GuestBook[PhpRetro]
Where does it go on your cms?
Re: [PhpRetro]GuestBook[PhpRetro]
Quote:
Originally Posted by
Mithex
You kinda just stole a News comments release, whichever that may be, and added the snippet to a page where you made the guestbook.
This deserves to be 1st post.
This post is a fact.
All you have to do is take a news comment source, edit a few words, like the SQL code, etc, edit the header to Guestbook, and release it. Give credits at least, we all know you didn't code it at all.
Besides, I have good proof you edited it.
The SQL code is the exact same. And, I found this bit:
Quote:
`article` int(11) NOT NULL,
With much love,
Sway
Re: [PhpRetro]GuestBook[PhpRetro]
lol you got owned Mithex.
Re: [PhpRetro]GuestBook[PhpRetro]
Re: [PhpRetro]GuestBook[PhpRetro]
Quote:
Originally Posted by
davidon
lol you got owned Mithex.
How? lol. Everyone is backing up what I said...
Re: [PhpRetro]GuestBook[PhpRetro]
Did forget to fix. I dont use phpretro anymore :s Btw, i fixed musql update and some more!