new forum
3 posters
Page 1 of 1
new forum
hey, the source code for this site is on the pad. (i think that's the source code) it's at the very bottom. go ahead and delete this post afterwards if you want.
Megaprr- Moderator
- Posts : 376
Join date : 2012-01-17
Age : 2023
Location : SPARTAAAAAAAAAAAAAAAAA
Re: new forum
That isn't the source, that's just the style information and such for the page.
Next time you come over I'll show you what a forum's source code looks like.
Next time you come over I'll show you what a forum's source code looks like.
Re: new forum
oh ok. well i tried.
Megaprr- Moderator
- Posts : 376
Join date : 2012-01-17
Age : 2023
Location : SPARTAAAAAAAAAAAAAAAAA
Re: new forum
source code for a forum looks something like this
this is rather basic though so it would be way longer and much harder to read
- Code:
<?php
ob_start();
session_start();
include "./global.php";
$action = $_GET['act'];
$actions_array = array('forum','create','topic','reply','mod','profile');
?>
<html>
<head>
<title>Roll to dodge forum index</title>
<link rel="stylesheet" type="text/css" href="./style.css">
<script language="Javascript">
function confirmLogout(){
var agree = confirm("Are you sure you wish to logout?");
if(agree){
return true ;
}else {
return false ;
}
}
</script>
</head>
<body>
<center>
<div id="userInfo">
<?php
if($_SESSION['uid']){
$sql = "SELECT * FROM `users` WHERE `id`='".$_SESSION['uid']."'";
$res = mysql_query($sql) or die(mysql_error());
$sqlAF = "UPDATE `users` SET 'name'= sicked WHERE `id`='".$_SESSION['uid']."'";
$resAF = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) == 0){
session_destroy();
echo "Please <a href=\"./login.php\">Login</a> to your account, or <a href=\"./register.php\">Register</a> a new account!\n";
}else {
$row = mysql_fetch_assoc($res);
echo "Welcome back, <a href=\"./forum.php?act=profile&id=".$row['id']."\">".$row['username']."</a>! <a href=\"./logout.php\" onClick=\"return confirmLogout()\">Logout</a>\n";
echo "<br>\n";
echo "<a href=\"./forum.php\">Forum Index</a>\n";
if($row['admin'] >= '1'){
echo " | <a href=\"./admin.php\">Administrative Section</a>\n";
}
}
}else {
echo "Please <a href=\"./login.php\">Login</a> to your account, or <a href=\"./register.php\">Register</a> a new account!\n";
}
$admin_user_level = $row['admin'];
?>
<h1 align=left>Roll To Dodge Forum</h1>
</div>
<div id="navibar">
<a href="http://rolltododge.net78.net/index.php">home</a>
</div>
<div id="forum">
<?php
if(!$action || !in_array($action,$actions_array)){
$sql1 = "SELECT * FROM `forum_cats` WHERE `admin` < ".$row['admin']."+1";
$res1 = mysql_query($sql1) or die(mysql_error());
$i=1;
while($row2 = mysql_fetch_assoc($res1)){
echo "<div id=\"fcontent\">\n";
echo " <div class=\"header\" id=\"header_".$i."\" onMouseOver=\"this.className='headerb'\" onMouseOut=\"this.className='header'\">".$row2['name']."</div>\n";
$sql2 = "SELECT * FROM `forum_sub_cats` WHERE `cid`='".$row2['id']."' AND `admin` < ".$row['admin']."+1";
$res2 = mysql_query($sql2) or die(mysql_error());
while($row3 = mysql_fetch_assoc($res2)){
echo " <div id=\"content\">\n";
echo " <a href=\"./forum.php?act=forum&id=".$row3['id']."\">".$row3['name']."</a><br>\n";
echo " " . $row3['desc'] . "\n";
echo " </div>\n";
}
echo "</div>\n";
$i++;
}
}else {
if($action == 'forum'){
include "./includes/forum.php";
}
if($action == 'create'){
if(!$_SESSION['uid']){
header("Location: login.php");
}else {
include "./includes/create.php";
}
}
if($action == 'topic'){
include "./includes/topic.php";
}
if($action == 'reply'){
if(!$_SESSION['uid']){
header("Location; login.php");
}else {
include "./includes/reply.php";
}
}
if($action == 'mod'){
if(!$_SESSION['uid']){
header("Location; login.php");
}else {
include "./includes/mod.php";
}
}
if($action == 'profile'){
if(!$_SESSION['uid']){
header("Location; login.php");
}else {
$sql = "SELECT * FROM `users` WHERE `id`='".$_SESSION['uid']."'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) == 0){
session_destroy();
echo "Please <a href=\"./login.php\">Login</a> to your account, or <a href=\"./register.php\">Register</a> a new account!\n";
}else {
$row = mysql_fetch_assoc($res);
echo "your username is, ".$row['username']."! <br>\n";
echo "your password is, ".$row['password']."! <br>\n";
echo "your email is, ".$row['email']."! <br>\n";
echo "<br>\n";
echo "<a href=\"./forum.php\">Forum Index</a>\n";
}
}
}
}
?>
</div>
</center>
</body>
</html>
<?php
ob_end_flush();
?>
this is rather basic though so it would be way longer and much harder to read
Re: new forum
ooooooooooohhhhhhhh right.......
Megaprr- Moderator
- Posts : 376
Join date : 2012-01-17
Age : 2023
Location : SPARTAAAAAAAAAAAAAAAAA
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|