PDA

View Full Version : [Release] DarkCorE CMS



darksoke
01-24-2016, 10:25 PM
DarKcorE cms is a website designed for trinitycore I have created this website mostly for learning PHP , during the development process I found many tricks and useful things and i think it look really decent so far .

First things first , this is not a rip off Azer-CMS or FusinCMS or WarcryCMS , everything is made from scratch by me and lately by contributors on github. Those who followed the development process know better all the stages this website been trough.

I've been working on this CMS for a while , I think i have redesigned it over 10 times and it finally got into this new shape :)


Contributors: Darksoke (https://github.com/darksoke), DemonReborn (https://github.com/demonreborn), ProjectcoreDevs (https://github.com/ProjectcoreDevs)

Ok DarKcorE CMS have the following working features so far:
*-Working News Feed with user comment options * added the posibility to delete comment directly from comment list (GM only) *Old Pending for deletion
*-Working Changelog module *Old Pending for deletion
-Working improoved register module
-Working Login/Logout module
-Working user panel with different tools
*-Working advanced vote panel (Advance?What's that? well you'll be able to see how much time until you can vote again and it will automatically increase the points on weekends) *Merged with user panel
-Working Items,Characters,Guilds armory and a W.I.P Quests armory
-Realm statistics total account/characters/quests/items & Characters online module
-Rules and Regulations page
-Guides Page
-Builtin forum module (alpha)

Note To Developers - You can join this project and do some pull requests if you feel like helping the emulation community also as I said this website started as a PHP learning atempt so you might expect the following:


First of all the code is very very bad when I started this project I only knew what echo does in PHP but this was 1 year ago so there are some repetitive functions or bad formated ones
The CMS is not complete it only have the coded website and is missing the administration panel
I kind of stoped the project in a style transition so the following pages were not updated yet
Rules Page
Registration Page
Guides Page
Forum module is in very very early stages and is not working





http://mmltools.com/demos/darkcore/description/1.png
http://mmltools.com/demos/darkcore/description/2.png
http://mmltools.com/demos/darkcore/description/3.png
http://mmltools.com/demos/darkcore/description/4.png


GitHub Repository: https://github.com/darksoke/DarkCore-CMS

!!Very Important Note!! Do not use it in this shape on a public server just please it have very big security issues. Also it might not work on latest trinitycore servers since this was a personal project i've created the server over my customized core

Installation instructions

Move everything to to your HTDOCS now open up "For Install" folder
Run those 2 SQL files one is to update your account database and 1 is the base of the WEB DATABASE *Note the website is adapted for 12 Game Master ranks
Now move to core folder open "Config.php" and put there your database informations


CHANGELOG

-Updated Armory style and search bar
-Created Store Page *ProjectCoreDevs - not uploaded yet
-Created Login Page *ProjectCoreDevs
-Updated headers , cleared more useless code
-Fixed the style on the following pages Guides/Rules/Registration
-Cleared a bunch of useless code
-Fixed many functions mostly on registration and armory part



If you feel like helping us with the development process and see more updates faster you can help us by donating , all money will be spent on development process (paying all contributors and aquire-ing ressources) , also if you are HTML/CSS/JAVA/PHP/MySQL developer you can join us , so far we are only 3 contributors but we have already updated this website very much from it's initial form

**If you donated from this forum , please leave us a comment or write it in your donation comment because for every donation received from here we are going to send a part of the money to NomSoft to help them reaching their goal.

https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CMPYTHLHBQHCE)

Tommy
01-24-2016, 11:40 PM
Thanks for sharing! Looks decent via graphics. Though, I have to be honest about most things.


You should add ".idea" to gitignore as that shouldn't be on the repo.
Why do you have two index files? Even though one is html and the other is php, you should only have one imo.
Most of the columns you add to the account table are quite pointless. For example, "staff_id", "CustomRank". You can gather the needed data from account_access or rbac table to obtain who is staff and who is a player, rather than adding an entirely new column "staff_id" and "CustomRank". Not sure what "rank", "isactive" are used for. Any who, database could use some organizing.
File organizing doesn't seem too bad but it could be better.
The code is very ugly, especially the indentation, excessive use of div classes/other related code (which there are better ways in handling that in css in general) and the lack of a page system.
You don't escape most of your variables (string) when inserting into your database. This is a security issue.


Code like this:



if (!isset($_POST['Username']) ||
!isset($_POST['Password']) ||
!isset($_POST['RepeatPassword']) ||
!isset($_POST['Email']) ||
!isset($_POST['RepeatEmail']) ||
!isset($_POST['Country']) ||
!isset($_POST['Age']) ||
!isset($_POST['foundus']) ||
!isset($_POST['robot1']) ||
!isset($_POST['robot2'])){


Is just plain bad. You honestly should create variables instead of calling $_POST multiple times which can be redundant to do. On that note:



if (check_user_exist($_POST['Username']) > 0)
$_error = $_error . 'A';
if (strlen($_POST['Username']) < 3)
$_error = $_error . 'B';
if (strlen($_POST['Password']) < 8)
$_error = $_error . 'C';
if (check_email_exist($_POST['Email']) > 0)
$_error = $_error . 'D';
if (strlen($_POST['Email']) < 10)
$_error = $_error . 'E';
if (strlen($_POST['Country']) < 2)
$_error = $_error . 'F';
if (strlen($_POST['Age']) < 2)
$_error = $_error . 'G';
if (strlen($_POST['foundus']) < 5)
$_error = $_error . 'H';
if (strlen($_POST['robot1']) < 1)
$_error = $_error . 'I';
if (strlen($_POST['robot2']) < 1)
$_error = $_error . 'J';
if ($_POST['Password'] != $_POST['RepeatPassword'])
$_error = $_error . 'K';
if ($_POST['Email'] != $_POST['RepeatEmail'])
$_error = $_error . 'L';
if ($_POST['robot1'] != $_POST['robot1-root'])
$_error = $_error . 'M';
if (strtoupper($_POST['robot2']) != $_POST['robot2-root'])
$_error = $_error . 'N';


Why not create a global array that holds your register error message(s)? Or just simply check and if an error occurs return the error message string? For example:



$error = array(
'a' => '<div id="notify">This username already exist</div>',
'b' => '<div id="notify">Username must contain at least 3 characters</div>',
);

// Example:
echo $error["a"];
echo $error["b"];

// Output:
// This username already exist
// Username must contain at least 3 characters

// ... OR
if (check_user_exist($_POST['Username']) > 0)
return "This username already exists..";


There's probably more but I'll stop here. Regardless, thanks for the share and keep up the work.

Recycle
01-25-2016, 12:30 AM
It looks good, like, really good.

I'll boot it up and see what kind of feedback I can give - Will edit this post with my thoughts.

darksoke
01-25-2016, 12:28 PM
Thanks for sharing! Looks decent via graphics. Though, I have to be honest about most things.


You should add ".idea" to gitignore as that shouldn't be on the repo.
Why do you have two index files? Even though one is html and the other is php, you should only have one imo.
Most of the columns you add to the account table are quite pointless. For example, "staff_id", "CustomRank". You can gather the needed data from account_access or rbac table to obtain who is staff and who is a player, rather than adding an entirely new column "staff_id" and "CustomRank". Not sure what "rank", "isactive" are used for. Any who, database could use some organizing.
File organizing doesn't seem too bad but it could be better.
The code is very ugly, especially the indentation, excessive use of div classes/other related code (which there are better ways in handling that in css in general) and the lack of a page system.
You don't escape most of your variables (string) when inserting into your database. This is a security issue.


Code like this:



if (!isset($_POST['Username']) ||
!isset($_POST['Password']) ||
!isset($_POST['RepeatPassword']) ||
!isset($_POST['Email']) ||
!isset($_POST['RepeatEmail']) ||
!isset($_POST['Country']) ||
!isset($_POST['Age']) ||
!isset($_POST['foundus']) ||
!isset($_POST['robot1']) ||
!isset($_POST['robot2'])){


Is just plain bad. You honestly should create variables instead of calling $_POST multiple times which can be redundant to do. On that note:



if (check_user_exist($_POST['Username']) > 0)
$_error = $_error . 'A';
if (strlen($_POST['Username']) < 3)
$_error = $_error . 'B';
if (strlen($_POST['Password']) < 8)
$_error = $_error . 'C';
if (check_email_exist($_POST['Email']) > 0)
$_error = $_error . 'D';
if (strlen($_POST['Email']) < 10)
$_error = $_error . 'E';
if (strlen($_POST['Country']) < 2)
$_error = $_error . 'F';
if (strlen($_POST['Age']) < 2)
$_error = $_error . 'G';
if (strlen($_POST['foundus']) < 5)
$_error = $_error . 'H';
if (strlen($_POST['robot1']) < 1)
$_error = $_error . 'I';
if (strlen($_POST['robot2']) < 1)
$_error = $_error . 'J';
if ($_POST['Password'] != $_POST['RepeatPassword'])
$_error = $_error . 'K';
if ($_POST['Email'] != $_POST['RepeatEmail'])
$_error = $_error . 'L';
if ($_POST['robot1'] != $_POST['robot1-root'])
$_error = $_error . 'M';
if (strtoupper($_POST['robot2']) != $_POST['robot2-root'])
$_error = $_error . 'N';


Why not create a global array that holds your register error message(s)? Or just simply check and if an error occurs return the error message string? For example:



$error = array(
'a' => '<div id="notify">This username already exist</div>',
'b' => '<div id="notify">Username must contain at least 3 characters</div>',
);

// Example:
echo $error["a"];
echo $error["b"];

// Output:
// This username already exist
// Username must contain at least 3 characters

// ... OR
if (check_user_exist($_POST['Username']) > 0)
return "This username already exists..";


There's probably more but I'll stop here. Regardless, thanks for the share and keep up the work.

thx man :D I will update soon :D bunc of code was added when i started learning php and i did not managed to update it yet :D thx for your feedback

DemonReborn
01-25-2016, 08:17 PM
Hey everyone,

Thanks a lot for this fantastic feedback. Dark and I are both striving to make this CMS as user friendly as possible. Hopefully we'll be able to report back soon with some great updates :)

Hyperion
01-25-2016, 09:18 PM
https://github.com/darksoke/DarkCore-CMS/blob/master/js/global-functions.js

lol #fuck, that's awesome ;D

Looking nice, could use some cleanup/security but definitely looks better than others

darksoke
01-26-2016, 03:50 AM
https://github.com/darksoke/DarkCore-CMS/blob/master/js/global-functions.js

lol #fuck, that's awesome ;D

Looking nice, could use some cleanup/security but definitely looks better than others

Woah lol :)) i totaly forgot about that :)) it was my first atempt on making a show/hide button ragequit after :))after all i managed to make it with pure js+css

Shoxxo
07-30-2016, 07:04 PM
Nice but very dirty coding style :(

http://image.prntscr.com/image/eb064cdab6904c2a9ec92a067d4e82bb.png

darksoke
09-05-2016, 08:48 PM
Nice but very dirty coding style :(

http://image.prntscr.com/image/eb064cdab6904c2a9ec92a067d4e82bb.png

yeah I know been learning php alone but i found out how to use arrays and global vars and cleaned the code on my newest websites

Clastor
10-15-2016, 05:27 AM
Any fix please?

https://puu.sh/rJum7/bfa4f235b2.png

darksoke
10-27-2016, 12:40 PM
there will be no more progress on this project at least not from me, got a lot irl issues i have to deal with and i just don't have enough time to work on this project and update it , i'm sorry but the source code will remain on github if snyone is interested in updating it or at least use the style to built a brand new cms over it.