I plan on, over the course of the next few posts, going into a tutorial of sorts in how I go about creating plugins for the Mybb forum system. All are informal (ie not released on the mybb website heh) so do take them with a grain of salt when it comes to official caliber. Still, I think it would be fun and helpful to take a walk through how even to begin approaching altering the functionality to better suit your forum’s needs. I have a blast doing it!
For an example, I’m going to use the monster of a plugin for a writing hobby site. It's a system that accomplished a few things
Allows managing of character groups and their assigned forums
Allows easy tracking of characters' threads
Allows admins to vet applicants for writing quality
Allows character activity to be tracked
There were a few other minor additions, but these were the major. Suppose we have character packs, each with a group of members. Each pack has a forum that is their own dedicated writing space as well as a Members-only forum only they can see. With all of the permission setting, forum creation, etc... the process of managing this site gets intense.
First question - what do we want to solve? In group managing, it's fairly simple: when a group is created, I want to be able to hit a single submit button and have everything created with minimal effort. Same in group disbanding. In addition, when promoting leaders, I want them to be forum moderators, a part of the Mod usergroup, and usergroup leaders. (In the Mybb system these are three very different things, and some are a pain to set up).
Plugins are powerful. Once you know what shortcuts you want, you can find ways to make it happen. The sky is the limit!
In this tutorial, I expect to go over the following:
Plugin File Structure
Finding the right hooks
Hook Usage
Using Templates
Though, disclaimer: this list is subject to change ;)
For the curious, the plugin I'll be exploring is here - https://github.com/megan-starr9/RPGSuite. Not a particularly polished piece, but definitely complex enough to illustrate some interesting concepts!
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
âś“ Live Streamingâś“ Interactive Chatâś“ Private Showsâś“ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Recently I applied for a position with a company that uses Django. As a result, I ended up playing with the framework some! And though I didn’t make it to the tech portion ;) I still had a ton of fun and am glad I had the excuse to give it a shake.
All in all, I like the framework quite a bit! I was a fan of python’s syntax style back when I first used it in college, but I have never used it extensively. The system of breaking and lack of brackets makes code a lot more natural to write and read imo! And, like express/node.js, I feel like Django offers a lot of functionality while not feeling completely like you are coding in a box. It’s a relatively light framework from what I can tell!
Just beautiful :’)
But perhaps my favorite aspect of Django so far is how modular it is. Every portion of your application has its own package and functionality. In this it feels a lot like Java and suits a much more reusability and OO organization than most other languages I’ve worked in (re: php). For example, all of my user login/registration code will be in the user module, and can be so easily copied to other projects <3!
I feel like I will still continue to build this project in Django and really dive in. It will probably teach me a lot about concepts I haven’t had to get into yet using looser languages. Things like modularity, cohesiveness of parts, and organization of different application aspects.
And finally, testing!!! Since Django has a whole set of tools built in for testing, I can get back into the practice of writing unit tests for my code. I’ve gotten so lazy in this and I feel like I am losing the skill!! :D. I like the look of their testing suite, it seems straightforward on first impression and a lot easier to use than anything I’ve tried so far! The fact that it is built in and readily available right off the bat definitely helps ;D.
The tl;dr version is that, even though I didn’t get to use my newfound knowledge for anything job-related yet, I am glad I looked into it! And Django seems like a clean, useful, and honestly enjoyable framework to use. I’m going to continue playing, so you might see some related things pop up from me in coming days!
Because I like to occasionally ramble out about what I am working on, and because someone expressed interest, a little writeup on how I manage all of my side projects!
I’m in no way claiming this is the best way to set up a git deployment, but it has worked super well for me and I’ve gotten pretty comfortable with it <3
The first thing to know is that I am the type to use command line as a last resort in most instances. There’s something fun about it, but the less I can mess up by mistyping a key, the better! Therefore, I use Sourcetree for pushing from my computer/local environment up to the repo.
Currently this is my only live project, so it’s the only one that shows my develop/master branch setup. Generally I try to keep develop as my active branch and push any changes to it first. After I verify I didn’t break anything, I’ll switch my active branch to master and merge develop in.
You can do all of this through the command line, but again, the less I can mess things up, generally the better!
SO that’s how it works from computer to repo! But what about repo to server?
I walked through in this post how I did the initial setup on the server. When I did that initial setup, I first created the develop branch and pushed all of my code to it. I then put the code up on the develop site and attempted the setup on the develop server first, just in case things were deleted. Luckily, it went smoothly! So I went ahead and set up a master branch and setup the production site to reference it. The details are in that post and hopefully are semi-clear :)
Once I finished that, I had the following setup
Production Site >>>> master repository branch
Development Site >>>> develop repository branch
Now whenever I make a change, I push it to develop. Then I log into the website server, cd into the project directory, and perform a “git pull” command. This updates the live development site with my changes, and I can check it out.
If it’s good, I switch my sourcetree branch to master and merge in develop. Then I push the changes to master to get everything on the same level, log into the live production server, navigate to the project, and again perform a “git pull”.
Vala, production changes are live!
It’s pretty standard, but git is a brilliant tool when it comes to taking the stress out of updates.Â
On my specific site, I also sometimes have site staff who FTP in and change files directly on the server. When this happens, I like to update the repository with those changes as well. So if I know a change has been made, I will cd into the production server directory and perform a “git add .”. This sets the changes up to be committed. I will then simply do a “git commit -m message” followed by a “git push”.
Some might argue for fetching as opposed to immediate pushing/pulling, but in less formal projects and less collaborators involved, it seems pretty safe to take the shortcut <3. That’s about it!
I’ve been exploring a lot (out of necessity) of the ins and outs of MyBB’s plugin system as well as Bootstrap. I think in the near future I may post some thoughts and guides, at least on the plugin aspects since I’ve written some rather large endeavors! Bootstrap is a little newer to me (but amazing so far wowee)
One of my goals for work was to get more comfortable speaking and writing about what I do, so I really need to start using this space :). I just need to get the idea in my head that no thought is too small.
For the moment, enjoy rambles!
I’m actually super excited to try my hand at a tutorial, I could get pretty in depth with the system and have some fun with it. This may come sooner than later, I just have to work up a good example to use!
A personal post, oh noes! I wanted to take a moment to evaluate, as I've made an important discovery this week! Front End Developer? Not in my job title future, at least not likely! Over the past few weeks I have taken over managing the code for one of my side, recreational internet hangouts. This included, of course, the half-finished design! I was excited, it was a real and driving reason to delve into a bit more html/css and design theory than my previous solo ideas. This was a live site full of users who really wanted a finished layout. What better incentive? And for a while, I had fun! I got to work off of the previous designer's PSDs and play with languages that I don't get to touch in my work, business setting. I do have basic common sense when it comes to visual design. I know that dark background + light text should be avoided. I know websites are read like newspapers and that around two navigational clicks is the goal. I know what spacing makes things clear to read and that elements that line up are more appealing visually. But it soon became clear that I just don't care enough to be a Dev in the world of appearance! When I visit a site, I don't think about things like "it would look better in this font face" or "wow that padding ratio is great" or "this design needs to be more cohesive". When I look at a work in progress, I think "how can I make this faster?", "how can I make it do more for me", "how can I make it easier to use". My priorities are completely different. I can't tell the difference between this font or that. I couldn't care less about spacing or borders or colors beyond that they look visually appealing and everything is clear/easy to read! My designs aren't awful, don't get me wrong! Or at least I like to think they aren't! But they are unimaginative. Bland. Utilitarian :). They value function over form and don't give much regard to aesthetics. And I am completely ok with this! I think my career is going to come down to not the programming language I am using or the technologies I am working on, but the types of problems I am solving with them. I want to be challenged - I don't like just filling in tiny blanks left by some other developer or adding simple functionalities to what is already there. I want to help build something new, exciting, and learn something every day in the process. This is a tall order! But I'm learning that I am happiest when I have a project at work that has me a little bit frustrated. Not when I am pressed for time! But when I am forced to really think about how I am going to manage implementing something. And this realization has me super excited :) because I'm starting to figure out what it is I want out of a job. And soon maybe I will find one that fits me!
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
âś“ Live Streamingâś“ Interactive Chatâś“ Private Showsâś“ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
This one is another simple concept, but one that I have never actually put into practice. Â Now that I decided to, I am definitely wondering why that was! Â It is so nice!
Sometimes in a web application we want to redirect the user to a new page, but also give them a message based on their previous state. Â Some sites use GET variables for this, but I chose to go the session route. Â It prevents the URLs from getting cluttered up and ensures that messages don't get displayed more often than we want them to!
To start off, I created a Message class within my library that utilizes my custom Session class. Â It's a relatively simple design, as you can see below!
The nice part about setting up this separate class is that I can now introduce multiple message types at my leisure. Â It allows for a lot more freedom, as classes generally do!
All this class is doing is accepting a message and storing it in a session variable. Â Then, when we retrieve the message, we go ahead and delete it so that it will not display more than once! Â This allows us to only hold the given message over a single page load, but no longer.
Anyway, most of the heavy lifting is done within my Controller class. Â If you recall, I have each of my pages extending a single master Controller parent. Â In this parent, I set up my Message instance like so.
I have to pull the message and store it separately as soon as possible, because I found that I was clearing the session variable before I could grab the message if I tried pulling it out later.
I then set up a function that can be called by the child controllers to set the message within the Message instance.
Finally, in our render function, we pass the message text in a variable to be displayed on the page.
Now whenever I want to forward a message to the next page, all I have to do is call setMessage on the class before redirecting! Â Super quick, super simple, but oh so useful :D
IN CASE ANYONE IS WONDERING how to set up a git repository in a folder that already holds a project... while ignoring/leaving unversioned the files you want to leave unversioned.... I FOUND A SOLUTION. FINALLY.
This was so stressful because I had a live site I was working with and I really didn’t want to take it offline. What I ended up doing was downloading the site source and pushing the files that I wanted versioned into the new repository on Bitbucket.
Then, on the Dreamhost server, I ran the following commands within the project folder
git init
git remote add origin <repositoryurl>
(These simply set up an empty repo and pointed it in the right direction)
git fetch --all
git reset --hard origin/master
(Fetch all of the changes, then force the files in the project to be overwritten (where they exist) by the files in the repository. Any files that exist in the project, but not in the repo, are left alone! Though I had also added them to my .gitignore for future safety)
git pull origin master
git push -u origin master
(Set the working branch to master so that I don’t have to specify a branch every time I want to push/pull)
This took me so long to figure out but once I did I can’t believe how smoothly it went ;v;. IT IS A GOOD DAY AND NOW TIME FOR BED
This is really the first week that I have taken a good look at how this project will be organized and structured. Â By looking at a few good articles and using my own experience, I've managed to come out with something that I'm satisfied with and moderately proud of (hurray!). Â It's long, so hiding :)
I already had some direction in the beginning. Â I'm a huge MVC fan, so figured that would come into play at some point. Â The division of data/display really makes a lot of sense to me in the scheme of things and allows for flexibility on both sides without reinventing the wheel every time I want to make a change! Â I wasn't sure how far I'd end up taking it but it turns out I slipped right back into a pretty much 100% MVC design. Â Old habits die hard :D
Anyway, my overall structure is as follows:
Controllers form the bridge between Views and Libraries
Libraries call Data Accessors
Data is held in models (Data Objects)
It's a pretty simple and standard layout! Â But as someone who has always treated pet projects with a little chaos rather than planning, it's a little revolutionary how well this fits together!
So, lesson 1 - my code makes me 10x happier when I sit down and come up with a design concept first. Â Note to self: research is your friend!
Once I got my organization figured out, I really began looking into a few things using PHP that I've never considered deeply. Â These are
Object Inheritance
Namespaces
I've used both in Java but, starting out a functional programmer, I never had reason to in PHP. Â By the time I got to OO in PHP, I was using frameworks that did everything for me. Â Yes it makes things 10x easier, but the learning experience isn't quite as clear as building your own!
Currently I have three main inheritances.
Data Objects -> DataObject interface
Data Accessors -> DataAccessor parent
Controllers -> Controller parent
The DataObject is an interface because I am mainly using that, at the moment, for type specification. Â There is no shared functionality between Data Objects right now. Â They will all have a TABLE constant, but those will all differ in value.
By contrast, DataAccessor is going to contain a lot of shared code by the time I'm done.  Since all Data Accessors will be making the same queries and returning data objects when doing so, I should be able to generalize quite a lot.  You can already see this beginning with my UserAuth library and my UserProfile library  in reference to the UserDB.
UserAuth handles the login functionality. Â That's it. Â Eventually it will also handle registration, but it will not be used to display or change existing users. Â Those functionalities will rest on UserProfile
However, both of these instances involve retrieving user information from the database, only with different criterion. Â Because they both deal in User data, I was able to use the UserDB Data Accessor for both.
You may notice that the UserDB function for getting a user is pretty simple. Â That's because all of the querying happens in the DataAccessor parent. Â The way I have it set up, any specific DataAccessor can pass in a Data Object containing some criterion and it will fill the rest of the fields if a record exists that matches. (You can see that updating works in a similar fashion).
Handy, right? Â The TABLE constant even makes it so that I don't have to specify a table every time. Â Data Objects are built around my table columns, so will always be used on the table they are defined for.
The code that actually ties everything together lies in the Controller classes. Â Controller is a parent class as well because it shares a lot of functionality with its children. Â This includes setting view variables, setting page titles, and rendering the page.
Each sub Controller can call these as necessary to set up the pages that they are responsible for. Â For example, the Login page utilizes these as well as a few helpers of it's own to handle the form data. Â Here you also see the library/view connection being made.
Despite feeling like I've made a ton of substantial progress, I know I have a ways to go! Â Because my project is simple, I didn't bother to define a complicated routing system like many frameworks tend to have. Â My controllers are my defined pages.
I also really need to look at managing Sessions. Â Currently the base Controller handles session data so that any view can access the current user, but I'm sure there are more optimized ways of doing this. Â One big thing that I want to look into is setting up a caching system so that the active user doesn't need to be retrieved from the database on every single page change.
But I'm LEARNING SO MUCH and loving every second of it! Â Before this week I wasn't even aware that namespaces were a thing in PHP. Â While I haven't used them in a huge capacity (or, likely, well) it's progress and pretty cool stuff!
I’m going to try to get more regular with these.
I started yet another new project guys! (I know, right?)
It’s a web application in PHP. I’ve decided I need to focus and get the basics of good project design down before I really do much of anything else, so this project is going to be 100% focused on learning.
For starters, I’m doing something very different in that I am going with a library-based design. Instead of custom built code that is all super inter-dependent, I am going to develop any possible functionality as separate libraries that are then referenced and used. This way I can really focus on one area of functionality as a learning experience before moving on.
Starting with an authentication library :D
I know there are tons out there, but using someone else’s code does me no favors in actually learning important programming concepts. I’ve gotten so out of practice guys it feels like. I don’t plan on releasing the library (unless I figure out something super different? which I doubt) but I do want to take the opportunity to dive into code optimization and security concerns. Two areas that I am sadly lacking in.
Here’s hoping! Optimistically I’d like to blog a bit about what I learn on here but we’ll have to find out if that actually happens ;)
Ok so this blog ended up being a bit of a non-starter
So a ramble post!
I am still planning on finishing my writing site (of course!) but lately I’ve gotten into playing with game development on the Unity framework.  And wow am I having FUN!
I’m beginning to realize that there are so many different avenues of tech that I haven’t known to explore that are freely available to me and this makes me so gosh darn happy I can’t even stand it.
Did you know that, with Unity and Blender, you can create an entire game yourself completely without cost?
INSANE
I mean, the time and effort are definitely huge factors, but these are things that I never stopped to consider.  It is so easy to play with so many different concepts when all you need is a computer and some drive to learn!  Reason number 5893725927 that I absolutely LOVE my area of study/career path choice and why I will likely continue to hop around on projects for the forseeable future.  I want to find the area of development that I am truly, sincerely passionate about and build a career around that.  Not only will I feel more fulfilled about what I am bringing to life professionally, but I will be a whole lot happier too. (Not that I’m not happy now! Totally not the case)
Anywho, this might turn into more of a conceptual ramble-blog but I’ll have fun either way :)
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
âś“ Live Streamingâś“ Interactive Chatâś“ Private Showsâś“ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
I figured a good place to start this blog would be an intro to my current pet project.  I started dreaming this baby up when I was a junior in high school, and since then it has gone through so many different forms and iterations I wonder that I should even refer to it as the same project.  Still, the core values have remained the same, so I tend to affectionately refer to it as the project that never ends!  (Because I’ll likely still be working on it when I’m retired, woo!)
Now, a year out of college, I’ve finally buckled down and really gotten a good handle on what I want this project to be.  In shorter terms, I want to create a place where authors can come together and write collaborative fiction.
Seems straightforward enough, right?
Well, in order to properly collaborate in a completely online setting, certain things need to happen. Â Plots need to be fleshed out, settings agreed on, characters created, and finally, somehow the authors need to be able to cohesively write together. Â The order gets a little taller.
I’m a big fan of lists and organization when it comes to stories.  I have notebooks full of ideas, scribbles, doodles, and lists.  Color-coded, even.  Heck, I will sometimes jot down full on character quotes and random passages if the mood takes me.  So how do you take this chaos and streamline it into a web application?  That is the question I am trying to answer currently.
I’ll talk more about the tech in future posts, but the last question is the one that I at least have an answer to… how to allow authors to write cohesively together.  In order to provide a space to do this, I have taken up learning Node.js and have rebuilt the site from scratch to completely utilize this web platform.  Can I just say how much I am LOVING this language?
I have decided to make a side blog for my programming rambles and project discoveries! Working in tech I do a LOT of exploring, especially with web technologies, and find a lot of cool things. Why not share them? :D
Also I should really get more confident about sharing my programming experiences. This might help with that ;)