-
Notifications
You must be signed in to change notification settings - Fork 7
Developer Notes
RedDragonWebDesign edited this page Sep 5, 2020
·
27 revisions
If you are interesting in adding to or editing the BlueThrust5 code, here are some notes.
Our current minimum PHP version is PHP 7.0. Currently we are including the following 2 features, that are only supported by PHP 7.0, which is why I made the change.
- Null Coalescing Operator
??
- Function Arguments
Everyone is encouraged to run these scripts on the newest version of PHP that their server supports. The speed improvements between PHP improvements are significant. And also each version of PHP supports new and better features, which makes it easier to code.
- You can turn on Debug Mode in My Account -> Administrator Options -> Website Settings -> Debug Mode. Debug mode on will do PHP
error_reporting(E_ALL)
- Whenever you add or edit a function, please add variable types. Instead of
function setDebugMode($value)
, please dofunction setDebugMode(bool $value): void
. This helps with tooltips and with bug catching. - Try not to change the database schema. Changes to the database schema risk breaking backwards compatibility, and may require changing installer code.
- Try not to change themes. Modifying a theme requires changing all 29 of them.
- If you write an SQL query, don't forget to include
$dbprefix
. Instead of"SELECT member_id FROM members WHERE loggedin = '1' AND rank_id != '1' AND disabled != '1'"
, need to write"SELECT member_id FROM ".$dbprefix."members WHERE loggedin = '1' AND rank_id != '1' AND disabled != '1'"
- Don't use
?>
, and delete it when you find it, unless it's necessary. Prevents hard to debug whitespace errors. - Prefer
require_once()
overinclude()
andrequire()
. Prevents hard to debug double include errors.
- Lots of JQuery modal windows.
- Each database table has a class, that extends
Basic
.Basic
provides both SQL functions and form validation functions.BasicOrder
andBasicSort
may be used as an in-between class.
- JQuery
- maybe some others
The code in this project is workable. I was able to patch in the things my client wanted. But there are several areas that need modernization:
- Was designed for PHP 5. Huge number of notices and warnings when running on PHP 7.4
- Does not follow MVC (Model View Controller). MVC is the excellent practice of separating SQL, HTML, and PHP into different files.
- Many skins, but the skins are not mobile friendly.
- Database functions tend to use a
$mysqli
class. We should probably move toward PDO.
- $MAIN_ROOT - Folder that contains the website. For example,
/BlueThrust5/
- $dbprefix - SQL table prefix, if used.
- Administrators can't be seen because their rankcategory_id = 3, and that rankcategory_id doesn't exist. To make an administrator visible, make a category for them and put them in it.
- rank_id is both rank and permissions.
- color - not used. rankcategory table has the colors.
- hiderank - hides the rank on the ranks page only, members with that rank still show up in other places
- autodisable - not DSL (days since login) related. Rather, it's a different feature. It'll disable you for failure to get promoted within X autodisable days.
- app_captcha
- app_components
- app_selectvalues
- app_values
- clocks
- comments
- console
- consolecategory
- console_members
- customform
- customform_components
- customform_selectvalues
- customform_submission
- customform_values
- custompages
- diplomacy
- diplomacy_request
- diplomacy_status
- downloadcategory
- downloads
- download_extensions
- eventchat
- eventchat_messages
- eventchat_roomlist
- eventmessages
- eventmessage_comment
- eventpositions
- events
- events_members
- failban - This is a throttle for the pin # required in Add Console Option, Edit Console Option, and Edit Theme. It is not a throttle for regular login.
- forgotpass
- forum_attachments
- forum_board
- forum_category
- forum_memberaccess
- forum_moderator
- forum_post
- forum_rankaccess
- forum_topic
- forum_topicseen
- freezemedals_members
- gamesplayed
- gamesplayed_members
- gamestats
- gamestats_members
- hitcounter
- iarequest
- iarequest_messages
- imageslider
- ipban
- logs
- medals
- medals_members
- memberapps
- members
- membersonlypage
- menuitem_customblock
- menuitem_custompage
- menuitem_image
- menuitem_link
- menuitem_shoutbox
- menu_category
- menu_item
- news
- notifications
- plugins
- plugin_config
- plugin_pages
- polls
- poll_memberaccess
- poll_options
- poll_rankaccess
- poll_votes
- privatemessages
- privatemessage_folders
- privatemessage_members
- profilecategory
- profileoptions
- profileoptions_select
- profileoptions_values
- rankcategory
- ranks
- rank_privileges
- social
- social_members
- squadapps
- squadinvites
- squadnews
- squadranks
- squads
- squads_members
- tableupdates
- tournamentmatch
- tournamentplayers
- tournamentpools
- tournamentpools_teams
- tournaments
- tournamentteams
- tournament_connect
- tournament_managers
- websiteinfo