8ennett 0 Report post Posted January 30, 2011 Before starting on this tutorial be sure to run through the first 5. Part 1: Advanced User Account System Part 2: Welcome Home Part 3: Administrative Part 4: Profiles Part 5: Messaging & Inventory ######################## Part 6: Forums ######################## Download Example6.rar So in this tutorial we are going to cover the features of our new forums. So first of all once you have uploaded the new files to your server load up the install.php and input your database details and super admin account details. Once you have succesfully run through the installation program delete install.php (or move it outside public access) you can login with your new account and visit the forums. Now the features of our new forums are as follows. Forums.php So when you click on the Forums link on the left-side menu you should see a screen similar to this (without the already created forums of course). Now if you are an admin or super admin you will also see the table row at the bottom with the options to add forums, edit forums and delete forums. Also notice I have put in a little script to change the colour of each forums table row on mouseover and the entire row is clickable instead of just the link. The css also changes the mouse cursor to the pointer when mousing over the table row. So if you want to create a couple of new forums we will be able to test out the rest of our forum system. So as you can see after clicking the 'Add Forum' link we get our form layout asking for the forum details. Now obviously the name and description are what they are. In the who can post section we can choose between admins, mods and users. This is the access rights for creating new posts in this forum. Now 99 times out of 100 the admins will be permitted full access to all forums, but I put the option in just in case. I have also written in some simple javascript which automatically fills in the other permissions for each user type. So when you click Admins can post, then it will check admins can reply and admins can view. Unchecking it will uncheck admins can reply as well since it assumes if they can't post they can't reply either. If you check the admins can reply box then this will also check admins can view but not post, because obviously you need to view the forum before you can reply to any topics. Unchecking admins can reply however will not uncheck view. Checking view will not check any of the others. This gives a tier effect so if you only want to check individual boxes then you work from the bottom up. So this javascript rule also applies to the mods and users checkboxes as well. So if everything checks out and you have set permissions then this will create the new forum. Next we move on to editing the forums. Now all this is pretty self explanatory. I decided just to have all forums displayed for editing divided by seperate background colours. None of the checkboxes work on the javascript used to creare the forums as it's assumed most of the permissions are correct anyway and help avoid mistakes. Also the forums id number is displayed next to the name and description titles to help distinguish each forum. Finally we have the delete forum option. NOTE: The mouse cursor is currently over the News forum row and you will notice the background colour is different. Mousing out again will revert it back to normal. The background colour change also applies to the forum names in the delete table. I've also written in something extra, so if you want to select a forum to delete from the database simply click it once and it will then be highlighted in blue. Clicking the forum General Chat again will deselect the forum for deletion and turn the background colour back to its original. Right so as you can see above we also have all our forum information which tells us how many topics are in each forum, the total amount of replies to all topics and when the last post/reply was made. If we click on one of our forums we will then be taken to the topics list using the $_GET values. So this will display a list of the 20 most recently active topics in the select forum. At the very top there are links for navigation back to the forum. Where it says Page 1, this will also display a next page/previous page button depending on wether there are more topics or you can go back. Also the new topic button will only appear if the current user has permission to post in this forum. All the new topic, edit topic and reply to topic pages have all got the proper permission checking on them and divert the user back to their previous page if they try to access something they don't have permission to access. So above you can see how many views the topic has had, this does not increment if it is your own post. It also shows the amount of replies and which user created the topic. It also shows all topics marked as a sticky first, however these don't count toward the 20 topics per page. It will display ALL sticky topics with no limit at the top of each page before showing the regular topics beneath it which means if you create a load of stickys the page will get very crowded. It would be best to reserve the sticky topics for forum rules and FAQ's. So if we choose to create a new topic we will get the next screen. Now using a javascript located in the sites root called bbcode.js we are able to automatically insert our bbcode in to the main topic content. So clicking the B button will create the forum code but also if you were to type something in to the message box and highlight it eg. This is bold text, then click the B button it will change the highlighted text to This is bold text. This is also the same for the others including the colour pad. The only one that isn't affected by the highlighting rule is the youtube video button. This will write over any highlighted text with the new information. Simply enter the reference id for the youtube video (http://forums.xisto.com/no_longer_exists/ you would use only the xlC9SzWsCPo part). Also, if you use the URL link on highlighted text it will only ask for the URL and will use the highlighted text as the display text for the link. The sticky checkbox will only display if you are either a mod, admin or super admin as well. So when we click on a topic our page is displayed like so, also if we did not create the topic the view count is incremented by one. We have all the usual display. Where it says Replies Page 1, this will display a Next page/Previous page button either side depending on wether or not there are more replies. The replies are displayed in lists of 10 instead of 20 like the topics. They are also displayed in ascending order from the time they were posted, so oldest to newest. The delete button on the replies only appears to mods, admins and super admins. On the main topic options the reply button is displayed to all users, the edit button is only displayed to mods, admins, super admins or the topic creator, the same with the delete button. The report button is displayed to everyone as well and inserts an alert in to the admin alerts table. So when we go to add a reply to a topic we get a similar page to the new topic one, but without the subject field. All the bbcode still works the same as well. If the user who created the topic has put you on their blocked list you will not be able to post a reply in their topics. Next we have the edit topic page as well. Again it is just the same however there is a reason for editing field as well. If you fill this in then on the topic page it will display at the bottom of your message who edited the topic and the time and date it was edited with the reason for editing just below it. If you do not fill in the reason for editing field then it will still display the time of editing and who did it but it will skip displaying the reason. So that's about it for this tutorial. I've probably missed some bits out but if you run through all the code in the files under modules/forums then you can see how each effect and feature was achieved and modify it to suit your needs. As usual, comments and questions are welcome. Share this post Link to post Share on other sites
spawN-eD 0 Report post Posted February 3, 2011 10/10 i like this Share this post Link to post Share on other sites
8ennett 0 Report post Posted February 8, 2011 Ok this is going to be the last tutorial now for this. Instead I have started up an open-source project which you can find at the temporary address http://forums.xisto.com/no_longer_exists/. The project is named Praetorian and is designed to offer a complete rpg game engine which is fully configurable through the admin panel. Also I've just finished building a module manager and add-on manager. This means you can download individual add-ons and modules and use the manager to install/uninstall them with the click of a button. This also opens up the possibility of user development for the engine. Also built in a styles manager as well so you can download different styles and completely change the look of the site easily. Here's a few screenshots of the new code. So as you can see I've completely reworked the code and the entire layout of the site is dependant upon css. Version 0.8a is going to be released soon so even though it's not a complete engine you can start getting to grips with the style and module formats. So keep an eye out on the PGE (Praetorian Game Engine) website for updates. Share this post Link to post Share on other sites
TheGuy 0 Report post Posted April 23, 2011 great work i love all of your guides they are just great! Share this post Link to post Share on other sites
8ennett 0 Report post Posted July 22, 2011 Just a quick update on the new project I have been developing. The project is now in its BETA testing stage now and aside from amending any bugs that are found during this phase and some additional work on the template system, the projects 1.0 release is close to being finished. Thanks to everyone who has been contributing their time to testing PGE, without you there would probably be a lot more overlooked bugs in the system. Share this post Link to post Share on other sites
Frazzman 0 Report post Posted August 11, 2011 Kinda skipped a few and saw some forums these look awesome! Well made! Thanks i love your work! Keep this up any more updates coming soon? Share this post Link to post Share on other sites