+ Reply to Thread
Results 1 to 6 of 6

Thread: Create an Forum Commnity

  1. #1
    Moderator riderz is on a distinguished road riderz's Avatar
    Join Date
    Mar 2009
    Location
    south africa
    Posts
    1,259
    Thanks
    75
    Thanked 171 Times in 77 Posts
    Rep Power
    3

    Default Create an Forum Commnity

    sql
    Code:
    CREATE TABLE forumtutorial_posts (
    
      postid bigint(20) NOT NULL auto_increment,
    
      author varchar(255) NOT NULL default '',
    
      title varchar(255) NOT NULL default '',
    
      post mediumtext NOT NULL,
    
      showtime varchar(255) NOT NULL default '',
    
      realtime bigint(20) NOT NULL default '0',
    
      lastposter varchar(255) NOT NULL default '',
    
      numreplies bigint(20) NOT NULL default '0',
    
      parentid bigint(20) NOT NULL default '0',
    
      lastrepliedto bigint(20) NOT NULL default '0',
    
      PRIMARY KEY  (postid)
    
    )
    
    connect.php
    Code:
    <?php
    
    
    
    $db = mysql_connect("localhost", "username", "password") or die("Could not connect.");
    
    if(!$db) 
    
    	die("no db");
    
    if(!mysql_select_db("database_name",$db))
    
     	die("No database selected.");
    
    if(!get_magic_quotes_gpc())
    
    {
    
      $_GET = array_map('mysql_real_escape_string', $_GET); 
    
      $_POST = array_map('mysql_real_escape_string', $_POST); 
    
      $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
    
    }
    
    else
    
    {  
    
       $_GET = array_map('stripslashes', $_GET); 
    
       $_POST = array_map('stripslashes', $_POST); 
    
       $_COOKIE = array_map('stripslashes', $_COOKIE);
    
       $_GET = array_map('mysql_real_escape_string', $_GET); 
    
       $_POST = array_map('mysql_real_escape_string', $_POST); 
    
       $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
    
    }
    
    
    
    ?>
    
    style.css
    Code:
    <!---
    
    
    
    body {
    
    a:link, a:visited, a:active { text-decoration: none}
    
    font-family:Verdana, Sans-serif;
    
    color; #000000;
    
    font-size: 12px
    
    }
    
    input,textarea, select,{
    
    	color : #000000;
    
    	font: normal 12px;
    
    	border-collapse: collapse; border: 1px solid #000000;
    
    }
    
    .maintable {border: 0px ; width: 100%; padding: 0px; background-color: #FFFFFF} /*main table for forum*/
    
    .regrow {font-family: Verdana,Sans-serif; color: #000000; font-weight: bold; background-color: #FFFFFF;font-size: 12px;} /*registration row, mainly here for symetry*/
    
    .headline {font-family: Verdana,Sans-serif;font-weight: bold;color: #FFFFFF;background-color: #003366;font-size: 11px;} /*headline row, the first row that says forum name, topics, posts and such*/
    
    .forumrow {font-family: Verdana,Sans-serif; color: #000000;background-color: #F2F2F2;font-size: 12px;} /*color of the forum rows*/
    
    .mainrow a:link, a:visited,  a:active { text-decoration: none;}
    
    .mainrow {font-family: Verdana,Sans-serif; color: #000000;background-color: #F2F2F2;font-size: 12px; a:link, a:visited, a:active { text-decoration: none}} /*color of the forum rows*/
    
    .maintables{background-color: #FFFFFF; width: 95%; padding: 0px; border: 1px solid; cellspacing: no} /*main table for forum*/
    
    --->
    
    index.php
    Code:
    <?php 
    
    include "connect.php"; //mysql db connection here
    
    print "<link rel='stylesheet' href='style.css' type='text/css'>";
    
    print "<A href='post.php'>New Topic</a><br>";
    
    print "<table class='maintable'>";
    
    print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>";
    
    $getthreads="SELECT * from forumtutorial_posts where parentid='0' order by lastrepliedto DESC";
    
    $getthreads2=mysql_query($getthreads) or die("Could not get threads");
    
    while($getthreads3=mysql_fetch_array($getthreads2))
    
    {
    
      $getthreads3[title]=strip_tags($getthreads3[title]);
    
      $getthreads3[author]=strip_tags($getthreads3[author]);
    
      print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td>$getthreads3[showtime]<br>Last post by <b>$getthreads3[lastposter]</b></td></tr>";
    
    }
    
    print "</table>";
    
    
    
    ?>
    
    message.php
    Code:
    <?php 
    
    include "connect.php"; //mysql db connection here
    
    $id=$_GET['id'];
    
    print "<link rel='stylesheet' href='style.css' type='text/css'>";
    
    print "<A href='index.php'>Back to main forum</a>-<A href='post.php'>New Topic</a>-<A href='reply.php?id=$id'>Reply<br>";
    
    print "<table class='maintable'>";
    
    print "<tr class='headline'><td width=20%>Author</td><td width=80%>Post</td></tr>";
    
    $gettopic="SELECT * from forumtutorial_posts where postid='$id'";
    
    $gettopic2=mysql_query($gettopic) or die("Could not get topic");
    
    $gettopic3=mysql_fetch_array($gettopic2);
    
    print "<tr class='mainrow'><td valign='top'>$gettopic3[author]</td><td vakign='top'>Last replied to at $gettopic3[showtime]<br><hr>";
    
    $message=strip_tags($gettopic3['post']);
    
    $message=nl2br($message);
    
    print "$message<hr><br>";
    
    print "</td></tr>";
    
    $getreplies="Select * from forumtutorial_posts where parentid='$id' order by postid desc"; //getting replies
    
    $getreplies2=mysql_query($getreplies) or die("Could not get replies");
    
    while($getreplies3=mysql_fetch_array($getreplies2))
    
    {
    
       print "<tr class='mainrow'><td valign='top'>$getreplies3[author]</td><td vakign='top'>Last replied to at $getreplies3[showtime]<br><hr>";
    
       $message=strip_tags($getreplies3['post']);
    
       $message=nl2br($message);
    
       print "$message<hr><br>";
    
       print "</td></tr>";
    
    }
    
    print "</table>";
    
    
    
    ?>
    
    post.php
    Code:
    <?php
    
    include "connect.php"; //connection string
    
    print "<link rel='stylesheet' href='style.css' type='text/css'>";
    
    print "<table class='maintables'>";
    
    print "<tr class='headline'><td>Post a message</td></tr>";
    
    print "<tr class='maintables'><td>";
    
    if(isset($_POST['submit']))
    
    {
    
       $name=$_POST['name'];
    
       $yourpost=$_POST['yourpost'];
    
       $subject=$_POST['subject'];
    
       if(strlen($name)<1)
    
       {
    
          print "You did not type in a name."; //no name entered
    
       }
    
       else if(strlen($yourpost)<1)
    
       {
    
          print "You did not type in a post."; //no post entered
    
       }
    
       else if(strlen($subject)<1)
    
       {
    
          print "You did not enter a subject."; //no subject entered
    
       }
    
       else
    
       {
    
          $thedate=date("U"); //get unix timestamp
    
          $displaytime=date("F j, Y, g:i a");
    
          //we now strip HTML injections
    
          $subject=strip_tags($subject);
    
          $name=strip_tags($name);
    
          $yourpost=strip_tags($yourpost); 
    
          $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter) values('$name','$subject','$yourpost','$displaytime','$thedate','$name')";
    
          mysql_query($insertpost) or die("Could not insert post"); //insert post
    
          print "Message posted, go back to <A href='index.php'>Forum</a>.";
    
       }
    
    
    
    }
    
    else
    
    {
    
       print "<form action='post.php' method='post'>";
    
       print "Your name:<br>";
    
       print "<input type='text' name='name' size='20'><br>";
    
       print "Subject:<br>";
    
       print "<input type='text' name='subject' size='20'><br>";
    
       print "Your message:<br>";
    
       print "<textarea name='yourpost' rows='5' cols='40'></textarea><br>";
    
       print "<input type='submit' name='submit' value='submit'></form>";
    
    
    
    }
    
    print "</td></tr></table>";
    
    ?>
    
    I'm working on my six-pack...I've got 2 cans left.

    _________________
    Cheap Host Waplive Webhosting
    Jacques


    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

  2. The Following User Says Thank You to riderz For This Useful Post:

    bjayz (24-05-10)

  3. #2
    Junior Member Allyours247 is on a distinguished road
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Please is this 4 HTML/xHTML

  4. #3
    Senior Member blackhowk blackhowk's Avatar
    Join Date
    Jul 2006
    Location
    Bucharest
    Posts
    428
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Default

    is ordinary html..

  5. #4
    Junior Member Allyours247 is on a distinguished road
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    How can i use for all dis wapsite creators eg wapzan.com,wen.ru,wapka.mobi,peperonity.com,phn.me ,xtgem.com is it that i will create pages

  6. #5
    Senior Member Mysterio3 is on a distinguished road Mysterio3's Avatar
    Join Date
    Mar 2009
    Location
    Albania, East Europe
    Posts
    414
    Thanks
    49
    Thanked 6 Times in 6 Posts
    Rep Power
    2

    Default

    Can you stop? Its the 7th topic with same question.

  7. #6
    Senior Member bjayz is on a distinguished road
    Join Date
    Nov 2009
    Posts
    104
    Thanks
    28
    Thanked 1 Time in 1 Post
    Rep Power
    1

    Default

    bro riderz can u post the reply.php pls?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. latest dmpwap script
    By ozziemale31 in forum Scripts Forum
    Replies: 59
    Last Post: 09-07-10, 10:55
  2. Cant Find Wapple Sql
    By kaibaspoon in forum Coding Forum
    Replies: 7
    Last Post: 16-04-08, 04:04
  3. Script Problem!
    By mobilmega in forum Scripts Forum
    Replies: 8
    Last Post: 05-12-07, 10:46
  4. Wapdesire Scam Lol
    By ozziemale31 in forum Scripts Forum
    Replies: 27
    Last Post: 28-11-07, 13:02
  5. Sql For Lavalair (original)
    By witchblade in forum Scripts Forum
    Replies: 4
    Last Post: 27-10-07, 16:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO