Results 1 to 6 of 6

Thread: Create an Forum Commnity

  1. #1
    Moderator riderz's Avatar
    Join Date
    Mar 2009
    Location
    EMalahleni, South Africa
    Posts
    1,349
    Thanks
    108
    Thanked 391 Times in 128 Posts
    Rep Power
    6

    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>";
    
    ?>
    ________________
    Jacques
    [Only registered and activated users can see links. Click Here To Register...]
    [Only registered and activated users can see links. Click Here To Register...]
    [Only registered and activated users can see links. Click Here To Register...]
    __________________

    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
    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's Avatar
    Join Date
    Jul 2006
    Location
    Bucharest
    Posts
    411
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    0

    Default

    is ordinary html..

  5. #4
    Junior Member
    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
    Join Date
    Mar 2009
    Location
    Albania, East Europe
    Posts
    618
    Thanks
    180
    Thanked 54 Times in 27 Posts
    Rep Power
    5

    Default

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

  7. #6
    Senior Member
    Join Date
    Nov 2009
    Posts
    100
    Thanks
    137
    Thanked 7 Times in 3 Posts
    Rep Power
    4

    Default

    bro riderz can u post the reply.php pls?

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: 5
    Last Post: 09-04-12, 17:12
  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, 11:46
  4. Wapdesire Scam Lol
    By ozziemale31 in forum Scripts Forum
    Replies: 27
    Last Post: 28-11-07, 14: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19