new forum

View previous topic View next topic Go down

new forum

Post  Megaprr on Sun Jan 22, 2012 2:21 am

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.

_________________


Not just a super purr, but a MEGApurr!!!!! Very Happy
avatar
Megaprr
Moderator

Posts : 376
Join date : 2012-01-17
Age : 2016
Location : SPARTAAAAAAAAAAAAAAAAA

View user profile

Back to top Go down

Re: new forum

Post  The Silent Watcher on Sun Jan 22, 2012 12:07 pm

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.

_________________
Most problems with a computer are caused by user error. An artificial intelligence eliminates that possibility.

Characters in Doomsday Improv: [Unnamed in universe], Nimue, Sentinel, [Not introduced]
avatar
The Silent Watcher
Artificial Intelligence

Posts : 700
Join date : 2012-01-14
Location : Watching your every move.

View user profile http://rtdaltered.canadian-forum.com

Back to top Go down

Re: new forum

Post  Megaprr on Sun Jan 22, 2012 3:05 pm

oh ok. well i tried.

_________________


Not just a super purr, but a MEGApurr!!!!! Very Happy
avatar
Megaprr
Moderator

Posts : 376
Join date : 2012-01-17
Age : 2016
Location : SPARTAAAAAAAAAAAAAAAAA

View user profile

Back to top Go down

Re: new forum

Post  BAM Blind And Mad on Tue Jan 24, 2012 11:54 pm

source code for a forum looks something like this

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
avatar
BAM Blind And Mad
Head Technician

Posts : 762
Join date : 2012-01-16
Age : 22
Location : Where I am

View user profile http://www.rolltododge.net78.net

Back to top Go down

Re: new forum

Post  Megaprr on Wed Jan 25, 2012 2:11 am

ooooooooooohhhhhhhh right.......

_________________


Not just a super purr, but a MEGApurr!!!!! Very Happy
avatar
Megaprr
Moderator

Posts : 376
Join date : 2012-01-17
Age : 2016
Location : SPARTAAAAAAAAAAAAAAAAA

View user profile

Back to top Go down

Re: new forum

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum