JayC
Well-Known Member
Hey Devbest!
I have finally got a release that really might help out the community. It's a BASIC forum plugin. I might add things to this and update the thread later but here is what it features:
- Like System
- Flag System
- Comment System
- Create Thread based on Rank in-game permissions
IIS Rules:
newthread.php
Scripts:
SQL for the tables:
Forum.php
Thread.php
Post.php
This project took 13 hours to code so I hope you enjoy it This is a VERY basic forum, and it will need some work
Here is a layout of how it works:
Create catagories in forum_catagories table is it designed so you can have users post directly into the catagories, or in subcatagories The layout works like the catalog, but slightly different. If the sub_catagory = -1 it will show as a primary catagory. If you need any help managing the system I can help with that, but I will not help you install it. This is just copying my code onto a layout of your revcms. It's slightly sloppy, but it is dynamic so it will always update from the database . I hope you enjoy.
-JayCustom
I have finally got a release that really might help out the community. It's a BASIC forum plugin. I might add things to this and update the thread later but here is what it features:
- Like System
- Flag System
- Comment System
- Create Thread based on Rank in-game permissions
IIS Rules:
Code:
<rule name="Forum Threads">
<match url="^thread/([0-9]+)" />
<action type="Rewrite" url="index.php?url=thread&threadid={R:1}" />
</rule>
<rule name="Forum Posts">
<match url="^post/([0-9]+)" />
<action type="Rewrite" url="index.php?url=post&postid={R:1}" />
</rule>
<rule name="Forum New Thread">
<match url="^create/([0-9]+)" />
<action type="Rewrite" url="index.php?url=newthread&thread={R:1}" />
</rule>
Code:
<?php
if(isset($_POST['postNewThread']) && $_GET['thread']){
$str = strip_tags($_POST['postTitle']);
$str2 = strip_tags($_POST['postReply']);
if(strlen($str) < 3 || strlen($str) > 80){
echo "Invalid Title";
}elseif(strlen($str2) < 15 || strlen($str2) > 5000){
echo "You must be more discriptive but keep it under 5000 characters";
}else{
mysql_query("INSERT INTO `forum_posts` (`thread`, `poster_id`, `title`, `body`, `post_date`) VALUES ('".$_GET['thread']."','".$_SESSION['user']['id']."','".$str."','".$str2."','".date("F j, Y, g:i a")."')") or die(mysql_error());
$threadCreated = mysql_fetch_assoc(mysql_query("SELECT id FROM forum_posts ORDER BY id DESC LIMIT 1"));
header('Location: http://habdoom.com/post/'.$threadCreated['id'].'');
}
}
?>
<form action="" method="post">
<input type="text" class="textCtrl" name="postTitle" placeholder="Title"><br><br>
<textarea id="mytextarea" name="postReply"></textarea><br><br>
<center><b><input type="submit" class="button primary" name="postNewThread" value="Post Thread" /></b></center>
</form>
Code:
<script src='//cdn.tinymce.com/4/tinymce.min.js'></script>
<script>
tinymce.init({
selector: '#mytextarea',
plugins : 'advlist autolink link image lists charmap print preview media textcolor colorpicker spellchecker emoticons insertdatetime',
toolbar: "advlist autolink link image lists charmap preview media forecolor backcolor bold italic spellchecker emoticons",
menubar: "tools format view insert edit insertdatetime"
});
</script>
<script>
tinymce.init({
selector: '#mytextarea2',
plugins : 'advlist autolink link image lists charmap print preview media textcolor colorpicker spellchecker emoticons insertdatetime',
toolbar: "advlist autolink link image lists charmap preview media forecolor backcolor bold italic spellchecker emoticons",
menubar: "tools format view insert edit insertdatetime"
});
</script>
<script>
tinymce.init({
selector: '#mytextarea3',
plugins : 'advlist autolink link image lists charmap print preview media textcolor colorpicker spellchecker emoticons insertdatetime',
toolbar: "advlist autolink link image lists charmap preview media forecolor backcolor bold italic spellchecker emoticons",
menubar: "tools format view insert edit insertdatetime"
});
</script>
You must be registered for see links
Forum.php
Code:
http://pastebin.com/cQ4fgGTr
Thread.php
Code:
http://pastebin.com/wYS6FiQj
Post.php
Code:
http://pastebin.com/VDePmKsi
This project took 13 hours to code so I hope you enjoy it This is a VERY basic forum, and it will need some work
Here is a layout of how it works:
Create catagories in forum_catagories table is it designed so you can have users post directly into the catagories, or in subcatagories The layout works like the catalog, but slightly different. If the sub_catagory = -1 it will show as a primary catagory. If you need any help managing the system I can help with that, but I will not help you install it. This is just copying my code onto a layout of your revcms. It's slightly sloppy, but it is dynamic so it will always update from the database . I hope you enjoy.
-JayCustom
Last edited: