Donald Louch Title Logo

Bi-weekly Update (1)

September 15th, 2018 to September 26th, 2018

General Thoughts

I am quite pleased with my progress that I've made in the creation of the CMS. I've already been able to create a nearly functioning bare CMS! I have adapted code from a few of sources (appendix I), code that I have created in the past, new code that I have played around with, and have been able to create the account functions (like signup, login, logout, and access certain areas of the CMS), upload and view videos, edit video information (even re-upload thumbnails), and a video manager. I've had to do quite a bit of debugging and have been able to solve most issues! My goal in the next few weeks is to make sure the code is properly validated; I haven't done this yet as I've been focused on created the functional CMS.

Note that the header navigation on pages is currently not working.

I am pondering the idea of not including comment sections on the video page and maybe just having them on the Opus Creator pages or not having comments in general. I've been reading a lot that comments are slowly becoming a thing of the past. I further, think that by not having comments it will create a "safer" environment!

Issues

1) I was trying to get my PHP to work so I could setup my database however I was getting the error:

Parse error: syntax error, unexpected '$host' (T_VARIABLE) in /home/opusvid/public_html/opus/database/db-connect.php on line 2

At first I thought, "okay" maybe I typed something wrong?" so I dug through the file and couldn't find anything. I Googled "PHP file not working" no solutions. So I thought okay let's try a basic echo function and see if that works! But it did not. So I looked further in to my code and was like wait a minute; I have a space between the question mark and the "php" in the beginning and took out the space and it worked!

2) I was having some issues with my upload function. However, after digging into the code changing things in the code, echoing results, manually entering in SQL data via MySQL I was able to figure out two issues in which I was having!

  1. The music credit field had a different name=""" then the variable on the upload function did. Thus, it was looking for a field that wasn't real.
  2. The main issue that caused the function to not work was the fact that every field in the database needed to have a field and for some reason even though all the fields were filled out, it was still treating it as nulled content. So I changed the database to accept the INSERT even if there was nulled content.

3) On the video player pages, I'm having some issues with the seek slider/time and the alignment of them. This is most likely something from the script in which I adapted from DIGI 221 and in-turn my video player on my "portfolio site" so I'm looking into it! I would also like to make the controls hide when not hovered on the video page; which I am also looking into!

4) When I was trying to upload a video I had an apostrophe in my "description" and sadly broke the upload process. It took me quite a bit of debugging to figure out that's what was causing the issue. I'm thinking I'll need to look into do a validation to rather spit a PHP code version of an apostrophe (and possibly other characters) when those character(s) have been added to a field?

5) I was having issues with URL Rewriting. I tried my own ways, Googling solutions, post on StackOverFlow, and other searched. Nothing worked :( then I came across this article by Digital Ocean in which made instance sense and worked! Even though, I am pretty sure I used the exact information? But basically the structure is:

RewriteEngine On
RewriteRule ^login$ resources/views/back-end/login.php [NC]

From my understanding the:

with all these parameters it allows for a simple URL/URI such as "https://opusvid.com/login" instead of "https://opusvid.com/resources/views/back-end/login.php". Do note that since I have restructured the URLs there maybe some broken links at this point. However, I have gone though and corrected the ones that I can see!

6) This isn't really a coding issue. However, one thing that I do have to think about is storage. Video files are huge. So I need to think of a solution. What I am thinking is looking to see if it's possible to get a "storage" hosting account though a service like Digital Ocean and then link/restructure the upload function to store the files on that server. This will mean that hosting costs will be going up on my end. I only have I think 30GB of storage on my current host in which is being used up with my other sites and stuff.

Successes

I have enabled user "signups", "logins", and "logouts" within the CMS. I am have also coded some pages to check if a user is logged in and if they are it will display things like the dashboard; if they're not logged in then it will re-direct them to the login page.

After some struggles I have been able to create clean/pretty URLs/URIs for the CMS! Now there's simple and short URLs. I have further created a rewrite in which will change any "http" address to "https"!

I have enabled video uploads on the CMS. With this you can now upload videos, view them, edit them, delete them, and view all the videos that you have uploaded!

Changes

Appendix I

As of this point I have adapted code from:

View Bi-weekly (1) Repository View Working Website: Sitemap*

*Note a user account is needed to access the sitemap! You may use "TestUser" password "123456AbC!" if you would like to proceed without creating an account!