[Release] R63B Forums [RevCMS]

JayC

Always Learning
Aug 8, 2013
5,493
1,398
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

49a0f05442fd44a5a3c4eceb4fc746b7.png

2921be3c17714981bc694df389a1665f.png

IIS Rules:
Code:
<rule name="Forum Threads">
                <match url="^thread/([0-9]+)" />
                <action type="Rewrite" url="index.php?url=thread&amp;threadid={R:1}" />
                </rule>
                <rule name="Forum Posts">
                <match url="^post/([0-9]+)" />
                <action type="Rewrite" url="index.php?url=post&amp;postid={R:1}" />
                </rule>
             
                <rule name="Forum New Thread">
                <match url="^create/([0-9]+)" />
                <action type="Rewrite" url="index.php?url=newthread&amp;thread={R:1}" />
                </rule>
newthread.php
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>
Scripts:
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>
SQL for the tables:


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:

Synt4x

Member
Jan 13, 2016
77
59
Nice release. Just had a quick browse through the source code and it looks pretty secure hopefully people build on it and help to better it.

Keep up the good work.
 

bodge

ayy lmao
Oct 31, 2011
406
54
Poor colour choices for the user box imo; couldn't you have come up with a style for the horizontal line instead of default html?_?
The "-->" though. Don't you know HTML character entities exist? Use something like
HTML:
&#8594; (→)
 

Brought

更加努力
Jan 14, 2013
595
203
This wasn't based off of any of the other code from a CMS that includes forums that has been released recently?
 

BIOS

ಠ‿ಠ
Apr 25, 2012
906
247
Not really a fan of this myself, may be useful for some who want a base to build on however.

Also just some quick advice for the future, use prepared statements if possible or escape values if not as I've seen a number of queries in this which are raw. is_numeric isn't really efficient to use in your case for thread/post ID's as it allows floats and potentially hex/oct values, instead something like ctype_digit would be more reliable to validate whole numbers.
 

Hender

King Tinkerer
Mar 3, 2016
304
122
I saw a similar release but couldn't get it working, maybe this will supplement me.

Thanks for the release Jay.
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
This wasn't based off of any of the other code from a CMS that includes forums that has been released recently?
No , Infact I didn't even look ANYTHING up I coded it from 100% scratch staying up all night (13 hours straight)


Poor colour choices for the user box imo; couldn't you have come up with a style for the horizontal line instead of default html?_?
The "-->" though. Don't you know HTML character entities exist? Use something like
HTML:
&#8594; (→)
Thanks for your input, and I didn't even think about using HTML entities, and that would be a better choice.

I saw a similar release but couldn't get it working, maybe this will supplement me.

Thanks for the release Jay.
I hope so mate!
Not really a fan of this myself, may be useful for some who want a base to build on however.

Also just some quick advice for the future, use prepared statements if possible or escape values if not as I've seen a number of queries in this which are raw. is_numeric isn't really efficient to use in your case for thread/post ID's as it allows floats and potentially hex/oct values, instead something like ctype_digit would be more reliable to validate whole numbers.
Thanks for that, and yeah it is a very basic base to build, but I didn't know if a forums plugin was already made, and I didn't bother searching for one because I have never made a forums before so I wanted to do it from scratch.
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
There is a forum plugin coded but its not for rev, its on a custom cms but none the less I like the idea of this I think its nice, good job Jay :)
 

Brought

更加努力
Jan 14, 2013
595
203
There is a forum plugin coded but its not for rev, its on a custom cms but none the less I like the idea of this I think its nice, good job Jay :)
Hebba's CMS leak comes with forums. They are a replica of the ones I had previously published on Static/Wubbo that were designed by @Damon.
 

Users who are viewing this thread

Top