Guten Tag,
suche eine funktionierende viewtherad.php für das Diskussionsforum.
Ist da schon eine Public? Könnte diese mal jemand uppen.
Thx
Guten Tag,
suche eine funktionierende viewtherad.php für das Diskussionsforum.
Ist da schon eine Public? Könnte diese mal jemand uppen.
Thx
Code selber so schwer ist das nicht.
Ich bin mir recht sicher und denke, dass die public ist.
Deshalb dachte ich mir ich frag erstmal hier nach.
Na gut, ich werde sie morgenw ohl selber coden, falls sie bis dahin keiner gepostet hat.
Werde diesen ganzen Habbo Forum scheiß neu programmieren, wird etwas anderst sein aber funktionieren^^
JNike Der retter in Not :oo
<?php
$allow_guests = true;
require_once('./data_classes/server-data.php_data_classes-core.php.php');
require_once('./data_classes/server-data.php_data_classes-session.php.php');
$threadid = FilterText($_GET['thread']);
if(!empty($threadid) && is_numeric($threadid)){
$check = mysql_query("SELECT * FROM cms_forum_threads WHERE id = '".$threadid."' LIMIT 1") or die(mysql_error());
$exists = mysql_num_rows($check);
if($exists > 0){
$thread = mysql_fetch_assoc($check);
$valid_thread = true;
mysql_query("UPDATE cms_forum_threads SET views = views + 1 WHERE id = '".$threadid."' LIMIT 1") or die(mysql_error());
} else {
echo "Forum id nicht mehr Online";
// header("Location: me.php");
exit;
}
} else {
echo "Thrand nicht gefunden oder Gelöscht";
//header("Location: me.php");
exit;
}
$pagename = "Diskussions-Forum- " . $thread['title'];
$pageid = "forum";
$body_id = "viewmode";
$page = FilterText (isset($_GET['page'])) ? (int)$_GET['page'] : 0;
$posts = mysql_evaluate("SELECT COUNT(*) FROM cms_forum_posts WHERE threadid = '".$threadid."'");
$pages = ceil(($posts + 0) / 10);
if($page > $pages || $page < 1){
$page = 1;
}
$group = mysql_query("SELECT forumid FROM cms_forum_posts WHERE threadid='".$_GET['thread']."'");
$info = mysql_fetch_assoc($group);
if(isset($info['forumid']) && is_numeric($info['forumid'])){
$check = mysql_query("SELECT * FROM group_details WHERE id = '".$info['forumid']."' LIMIT 1");
$exists = mysql_num_rows($check);
if($exists > 0){
$groupid = $info['forumid'];
$error = false;
$groupdata = mysql_fetch_assoc($check);
$pagename = $groupdata['name'];
$ownerid = $groupdata['ownerid'];
$members = mysql_evaluate("SELECT COUNT(*) FROM group_members WHERE id_group = '".$groupid."' AND is_pending = '0'");
$check = mysql_query("SELECT * FROM group_members WHERE id_user = '".$my_id."' AND id_group = '".$groupid."' AND is_pending = '0' LIMIT 1");
$is_member = mysql_num_rows($check);
if($is_member > 0 && $logged_in){
$is_member = true;
$my_membership = mysql_fetch_assoc($check);
$member_rank = $my_membership['rank'];
} else {
$is_member = false;
}
} else {
$error = true;
}
} else {
$error = true;
}
//if($posts < 1){
// echo "<b>Internal Error</b><br />No posts found for this thread. Please double-check / repair your cms_forum_posts database table.";
// exit;
//}
$key = 0;
if(!empty($_GET["sp"]) && $_GET['sp'] == "JumpToLast"){
header("Location: viewthread.php?thread=".$threadid."&page=".$pages."#page-bottom");
exit;
}
switch($thread['type']){
case 1: $topic_open = true; break;
case 2: $topic_open = false; break;
case 3: $topic_open = true; break;
case 4: $topic_open = false; break;
}
if(!isset($topic_open)){
exit;
}
require_once('./templates/community_subheader.php');
require_once('./templates/community_header.php');
?>
<div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="mypage-wrapper" class="cbb blue">
<div class="box-tabs-container box-tabs-left clearfix">
<div class="myhabbo-view-tools">
</div>
<h2 class="page-owner">
<?php
$sql = mysql_query("SELECT forumid FROM cms_forum_posts WHERE threadid='".$_GET['thread']."'");
$row = mysql_fetch_assoc($sql);
if($row['forumid'] != 0) {
echo HoloText($groupdata['name']); ?> <?php
if($groupdata['type'] == "2"){ ?><img src='./web-gallery/images/status_closed_big.gif' alt='Closed Group' title='Gruppe Chiuso'><?php } ?>
<?php if($groupdata['type'] == "1"){ ?><img src='./web-gallery/images/status_exclusive_big.gif' alt='Moderated Group' title='Gruppe Moderatori'><?php } ?></h2>
<?php }else{ ?>
<?php } ?>
</h2>
<ul class="box-tabs">
<li><a href="<?php echo $path; ?>/groups/<?php echo $groupid; ?>">Startseite</a><span class="tab-spacer"></span></li>
<li class="selected"><a href="groupsdata_forum.php?web-discussions-id=<?php echo $groupid; ?>">Diskussions Forum </a><span class="tab-spacer"></span></li>
</ul>
</div>
<div id="mypage-content">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="content-1col">
<tr>
<td valign="top" style="width: 750px;" class="habboPage-col rightmost">
<div id="discussionbox">
<div id="group-postlist-container">
<div class="postlist-header clearfix">
<?php
$sql = mysql_query("SELECT * FROM group_details WHERE id='".$row['forumid']."' LIMIT 1");
if (mysql_errno()) die ("MySQL-Error: " . mysql_error());
$row = mysql_fetch_assoc($sql);
$asdf = "";
$zxcv = "";
if($row['topics'] == 0) {
$asdf = "<a href=\"#\" id=\"create-post-message\" class=\"create-post-link verify-email\">Antwort</a>";
$zxcv = "<a href=\"#\" class=\"quote-post-link verify-email\" id=\"quote-post-".$row['id']."-message\">Zitat</a>";
}elseif($row['topics'] == 1) {
$check = mysql_query("SELECT * FROM group_members WHERE id_user='".$my_id."' AND id_group='".$_GET['id']."' AND is_pending <> '1' LIMIT 1");
if(mysql_num_rows($check) > 0) {
$asdf = "<a href=\"#\" id=\"create-post-message\" class=\"create-post-link verify-email\">Antwort</a>";
$zxcv = "<a href=\"#\" class=\"quote-post-link verify-email\" id=\"quote-post-".$row['id']."-message\">Zitat</a>";
}
}elseif($row['topics'] == 2) {
$check = mysql_query("SELECT * FROM group_members WHERE id_user='".$my_id."' AND id_group='".$_GET['id']."' AND rank='2' AND is_pending <> '1' LIMIT 1");
if(mysql_num_rows($check) > 0) {
$asdf = "<a href=\"#\" id=\"create-post-message\" class=\"create-post-link verify-email\">Antwort</a>";
$zxcv = "<a href=\"#\" class=\"quote-post-link verify-email\" id=\"quote-post-".$row['id']."-message\">Zitat</a>";
}
}
?>
<?php if($topic_open && $logged_in){ ?><?php echo $asdf ?><?php } elseif($logged_in) { ?><span class="topic-closed"><img src="./web-gallery/images/groups/status_closed.gif" title="Closed Thread"> Thema geschlossen</span><?php } ?>
<input type="hidden" id="email-verfication-ok" value="1"/>
<?php
$hid = mysql_query("SELECT * FROM group_members WHERE id_user='".$my_id."' AND id_group='".GetUserGroup($my_id)."' AND rank='2' LIMIT 1");
if (mysql_errno()) die ("MySQL-Error: " . mysql_error());
if(mysql_num_rows($hid) > 0) { ?><a href="#" id="edit-topic-settings" class="edit-topic-settings-link">der Moderator »</a>
<input type="hidden" id="settings_dialog_header" value="Moderation Tools"/>
<?php
}elseif($user_rank > 5){ ?><a href="#" id="edit-topic-settings" class="edit-topic-settings-link">der Moderator »</a>
<input type="hidden" id="settings_dialog_header" value="Moderation Tools"/><?php } ?>
<div class="page-num-list">
<input type="hidden" id="current-page" value="<?php echo $page; ?>"/>
Zeige Seite:
<?php
for ($i = 1; $i <= $pages; $i++){
if($page == $i){
echo $i . "\n";
} else {
echo "<a href=\"viewthread.php?thread=".$threadid."&page=" . $i . "\" class=\"topiclist-page-link\">" . $i . "</a>\n";
}
}
?>
</div>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="group-postlist-list" id="group-postlist-list">
<?php
// Post view handler & echoer
$query_min = ($page * 10) - 10;
if($query_min < 0){ // Page 1
$query_min = 0;
}
$get_em = mysql_query("SELECT * FROM cms_forum_posts WHERE threadid = '".$threadid."' ORDER BY id ASC LIMIT ".$query_min.", 10") or die(mysql_error());
$dynamic_id = 0;
while($row = mysql_fetch_assoc($get_em)){
$dynamic_id++;
if(IsEven($dynamic_id)){
$oddeven = "odd";
} else {
$oddeven = "even";
}
$userquery = mysql_query("SELECT * FROM users WHERE username = '".$row['author']."' LIMIT 1");
$userdata = mysql_fetch_assoc($userquery);
$userid = $userdata['id'];
echo "<tr class=\"post-list-index-".$oddeven."\">
<a id='post-".$row['id']."'>
<td class=\"post-list-row-container\">
<a href=\"home/".$userdata['username']."\" class=\"post-list-creator-link post-list-creator-info\">".$userdata['username']."</a><br /> \n";
if(IsUserOnline($userid)){ echo "<img alt=\"Online\" src=\"./web-gallery/images/myhabbo/habbo_online_anim.gif\" />"; } else { echo "<img alt=\"Offline\" src=\"./web-gallery/images/myhabbo/habbo_offline.gif\" />"; }
echo "<div class=\"post-list-posts post-list-creator-info\">Nachrichten: ".$userdata['postcount']."</div>
<div class=\"clearfix\">
<div class=\"post-list-creator-avatar\"><img src=\"http://www.bubbo.co.uk/figure.php?figure=".$userdata['look']."&size=b&direction=2&head_direction=2&gesture=sml\" alt=\"".$userdata['username']."\" /></div><div class=\"post-list-group-badge\">";
if(GetUserGroup($userid) !== false){
echo "<a href=\"groups/".GetUserGroup($userid)."\"><img src='./habbo-imaging/badge-fill/".GetUserGroupBadge($userid).".gif' /></a>";
}
echo "</div>
<div class=\"post-list-avatar-badge\">";
if(GetUserBadge($userid) !== false){
echo "<img src=\"".$cimagesurl.$badgesurl.GetUserBadge($userid).".gif\" />";
}
echo "</div>
</div>
<div class=\"post-list-motto post-list-creator-info\">".trim(HoloText($userdata['motto']))."</div>
</td>
<td class=\"post-list-message\" valign=\"top\" colspan=\"2\">";
if($topic_open == true && $logged_in){
echo " ".$zxcv;
}
if($user_rank > 5 || $my_id == $userdata['id'] && $logged_in){
echo "<a href=\"#\" class=\"edit-post-link verify-email\" id=\"edit-post-".$row['id']."-message\">Einstellung</a>";
}
echo "<span class=\"post-list-message-header\">";
if($dynamic_id !== 1 || $page > 1){
echo "RE: ";
}
echo HoloText($thread['title'])."</span><br />
<span class=\"post-list-message-time\">".$row['date']."</span>
<div class=\"post-list-report-element\">";
if($user_rank > 5 || $my_id == $userdata['id'] && $logged_in){
echo "<a href=\"#\" id=\"delete-post-".$row['id']."\" class=\"delete-button delete-post\"></a>";
}
echo " </div>";
if(!empty($row['edit_date']) && !empty($row['edit_author'])){
echo "\n<br /><br /><font size='1'><strong>Ultima Einstellung ".$row['edit_date']." by ".$row['edit_author']."</strong></font>";
}
echo " <div class=\"post-list-content-element\">";
echo bbcode_format(trim(nl2br(HoloText($row['message']))))."
<input type=\"hidden\" id=\"".$row['id']."-message\" value=\"".HoloText($row['message'])."\" />
</div>
<div>
</div>
</td>
</tr>";
}
?>
<tr id="new-post-entry-message" style="display:none;">
<td class="new-post-entry-label"><div class="new-post-entry-label" id="new-post-entry-label">Text:</div></td>
<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" style="margin: 5px; width: 98%;">
<tr>
<td>
<input type="hidden" id="edit-type"/>
<input type="hidden" id="post-id"/>
<a href="#" class="preview-post-link" id="post-form-preview">Vorschau »</a>
<input type="hidden" id="spam-message" value="Spam-alarm!"/>
<textarea id="post-message" class="new-post-entry-message" rows="5" name="message" ></textarea>
<script type="text/javascript">
bbcodeToolbar = new Control.TextArea.ToolBar.BBCode("post-message");
bbcodeToolbar.toolbar.toolbar.id = "bbcode_toolbar";
var colors = { "red" : ["#d80000", "Red"],
"orange" : ["#fe6301", "Orange"],
"yellow" : ["#ffce00", "Yellow"],
"green" : ["#6cc800", "Green"],
"cyan" : ["#00c6c4", "Cyan"],
"blue" : ["#0070d7", "Blue"],
"gray" : ["#828282", "Grey"],
"black" : ["#000000", "Black"]
};
bbcodeToolbar.addColorSelect("Color", colors, false);
</script>
<br /><br />
<a id="post-form-cancel" class="new-button red-button cancel-icon" href="#"><b><span></span>Abrechen</b><i></i></a>
<a id="post-form-save" class="new-button green-button save-icon" href="#"><b><span></span>Speichern</b><i></i></a>
</td>
</tr>
</table>
</td>
</tr></table>
<div id="new-post-preview" style="display:none;">
</div>
<div class="postlist-footer clearfix">
<?php if($topic_open && $logged_in){ ?><?php echo $asdf ?></a><?php } elseif($logged_in){ ?><span class="topic-closed"><img src="./web-gallery/images/groups/status_closed.gif" title="Closed Thread"> Thema geschlossen</span><?php } else { echo "</a>Devi effettuare l'accesso per visualizzare/postare I post del forum."; } ?>
</a><div class="page-num-list">
Zeige Seite:
<?php
for ($i = 1; $i <= $pages; $i++){
if($page == $i){
echo $i . "\n";
} else {
echo "<a href=\"viewthread.php?thread=".$threadid."&page=" . $i . "\" class=\"topiclist-page-link\">" . $i . "</a>\n";
}
}
?>
</div>
</div>
</div>
<a id='page-bottom'>
</div>
</td>
<td style="width: 4px;"></td>
<td valign="top" style="width: 164px;">
<div class="habblet ">
</div>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
Event.observe(window, "load", observeAnim);
document.observe("dom:loaded", initDraggableDialogs);
</script>
</div>
</div>
</div>
<div class="cbb topdialog" id="postentry-delete-dialog">
<h2 class="title dialog-handle">Post< Löschen?/h2>
<a class="topdialog-exit" href="#" id="postentry-delete-dialog-exit">X</a>
<div class="topdialog-body" id="postentry-delete-dialog-body">
<form method="post" id="postentry-delete-form">
<input type="hidden" name="entryId" id="postentry-delete-id" value="" />
<p>Sicher wollen sie löschen? können nicht wiederhergestellt werden.</p>
<p class="clearfix">
<a href="#" id="postentry-delete-cancel" class="new-button"><b>Abrechen</b><i></i></a>
<a href="#" id="postentry-delete" class="new-button"><b>Löschen</b><i></i></a>
</p>
</form>
</div>
</div>
<script type="text/javascript">
HabboView.run();
</script>
</body>
</html>
Alles anzeigen
Bitte schön..
Funktioniert bei mir leider nicht.
Geht die bei den anderen die diese ausprobiert haben? Oder liegt der fehler am Script?
Kann Leider net testen, da ich bei meinem Hotel erstmal die nötigen table einfügen muss ;S
Sage später ob es funzt.
Vllt. sind meine Tabellen auch falsch.
Kann mal jemand die Tabellen für die Datenbank hochladen, die dafür nötig sind.
Ansonsten bau ich sie selber nach, wäre aber nett wenn Sie jemand hochlädt somit erspar ich mir arbeit.
Einige Lücken drin
Grab nicht alte Threads auf. Der ist sowieso nicht mehhr aktuell. Vote4Clos
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!