TheDrunkenEpic - Drunken Ramblings of a Code Monkey
Filed under

MyTopix

 

MyTopix is still out there ...

Yeah, yeah, I know it's been a while, but I've been working on a super-secret project for the past few months. After which, I'll find the time to finish Great British Walks. Speaking of which, I should probably shoot myself in the face because it's been in development in some form or another for the past few years. Not sure what my problem is as I usually finish my contracted projects post haste. Honestly, Pete is the most patient guy in the universe... and I suck.

ANYWAYS... A lot of people have been asking about MyTopix lately and where they can download a copy. I'm assuming the memo didn't go out to everyone, so I'll just say it again. MyTopix is no longer supported by me in any shape or form. It is an open source project now and can be forked by anyone who wants to keep the project alive.

For those of you who are interested, you can ALWAYS find the LATEST build tucked away in its Google Code repository.

Seriously, it's right there. Check it out, create a fork and publish your own distro. If you people like it so much, go ahead and keep it alive and you'll definitely have my full backing.

Loading mentions Retweet
Filed under  //   Code Monkey   Development   Free Goodies   MyTopix   Rants and Raves  

Comments [0]

So long old friend ...

For those of us in the know, we all saw it coming a mile away for a while now. Today I finally decided to pull the plug on my first real webventure; Jaia Interactive. For a good few years now, this site was host to my very first open source project, MyTopix. An open source PHP-base discussion board solution. It had a great following for a while until our hosting provider went monkey shit and decided to lose all our data.

Due to personal issues, it took a good month to get the site up and running again. I didn't even have the time to get to all our users to explain what was going on with the site. This was probably the first death blow to the project. It was young at the time and was starting to pick up a serious following. We were in position to compete against some of the bigger discussion board solutions out there and this disaster couldn't have come at a worse time.

The loss of data coupled with the amount of time it took to get back on our own feet was a serious blow to the project's credibility. We ended up having to start our community from a very old backup dated a year or so before the crash. The project's momentum never picked up again to the same level that it was.

Some time later I just lost complete interest in the site and wanted to move on to other things. Since then, I've been far too busy with other projects to even look at the site. Now, the old forum is a ghost town. Only a few of the regulars pop by every now and again.

All these factors brought me to the conclusion that it was time to take the site off life support. Everything will be removed and the domain will be redirected to this site. The data from the old support boards has all been saved and converted to a new Vanilla install on this site. I want to start the community up again, but take it in a different direction.

If you are a member of the MyTopix support boards and would like to stick around, just go to the new forums (via the link at the top of the page) and go through the password recovery process. Due to the differences in the way Vanilla and MyTopix store passwords, there is no simple way to transfer them across. Resetting your password is the only viable option at this point.

For the members of the board who were a part of the 'Mod Squad', you still retain your positions in the new forum install.

As soon as I get a chance, I'll go ahead and publish the MyTopix to Vanilla converter as I'm sure I won't be the only one who wants to move on.

I have quite a few things in store for this site within the next few months and this is only the first step. I hope that you will join me in taking this site to new places.

Loading mentions Retweet
Filed under  //   General Nonsense   MyTopix  

Comments [0]

Discussion board naming conventions ...

Forums, categories, topics, threads, posts, replies, blah, blah, blah. Has anyone ever really given any thought as to whether or not we're using these terms properly? Lately, I've been doing a lot of thinking about forum software in general and this is probably one of the more nit-picky subjects of the lot. I just think we're naming our parts wrong.

First off, the definition of a 'forum', according to my good friend Webster, is:

1 a : the marketplace or public place of an ancient Roman city forming the center of judicial and public business b : a public meeting place for open discussion c : a medium (as a newspaper or online service) of open discussion or expression of ideas

Ok, so maybe Forum is a pretty good word for this type of software, but I've got an issue with the next word on the list; categories. Now it makes pretty good sense, since you're trying to categorize your topics, but how do we categorize real life discussions? Well, we usually call them TOPICS of DISCUSSION, don't we? Sports, technology, web development are all topics of discussion. We could still call them categories, but doesn't that sound boring?

Next, we have 'topics' as we see them today. Well, we can't call them topics since categories are called the same thing; kind of confusing. Why not call them discussions? If we follow the idea of the phrase 'topic of discussion', this term falls into place and makes perfect sense.

Last on my list is the boring use of the word 'posts'. You don't POST something when you're having a discussion, you comment on a discussion. So posts are really comments, which makes this whole thing sound a bit more 'human'.

Forums are used to bring people together, not robots, so it's only natural to use terms that are more 'human-oriented'. So, in closing, here's a quick rundown of what I'm trying to say:

  1. Forums are Forums
  2. Categories are Topics
  3. Topics are Discussions
  4. Posts are Comments

Again, "Bob visited a forum and commented on a discussion based on the topic of sports."

MUCH nicer. Discuss ...

P.S. - This was posted almost 2 years ago on the MyTopix support forums. Good for content here. ;)

Loading mentions Retweet
Filed under  //   Development   General Nonsense   MyTopix   Rants and Raves  

Comments [0]

There's Something About MyTopix ...

Alright, as most of you might have guessed, I've lost a bit of interest in MyTopix over the past few months. I doubt admitting this now will surprise anyone who follows this board. I found that, while still a solid application, the source code has aged to a point where I don't even want to look at it anymore.

The way I wrote the software is so vastly different than the way I currently code, I have to, literally, regress back the skill set I had almost 4 years ago. I think it's time to move on from this endeavor and explore new options. I don't think forum software is dead and I don't think MyTopix is a crappy piece of software, but I do think the market has become quite stale.

Now, recently, whenever I think of recommending a forum solution I constantly find myself considering Vanilla. It's small, fast, free and decently-written. The only thing that stops me from using it most of the time is that I would much rather work with a forum solution that utilizes the technologies I've now become accustomed to. From the research I've done, I can't find a single free, well-written, forum solution out there that uses cutting-edge web technologies. I'm not talking about AJAX and neat little Scriptaculous effects, I'm talking about the very core of the software. What's under the hood so-to-speak. There is nothing out there that really captivates my interest. Vanilla is seriously the closest thing I can come up with to an almost perfect forum solution for most people's needs.

So, I suppose the question here is, if there was a forum solution similar to MyTopix that operated similar to Vanilla and used a framework similar to Cogsworth (XML/XSL), would there be a strong interest? Or should we just stop beating this dead horse and let forum software finally die?

Concerning MyTopix itself I'm sure you're all wondering what happens next. Well, the release is currently stable, so now is as good a time as any to probably end development. Does this mean MyTopix is dead? Well, yes and no. I guess that all depends on you folks since MyTopix is, after all, an open source application.

Next up: "WTF DID WILHELM GO?!?!?"

Loading mentions Retweet
Filed under  //   Code Monkey   MyTopix   Rants and Raves  

Comments [0]

Using Markdown in MyTopix

There are a number of people out there who would much rather use the popular Markdown as a text parser as opposed to the standard bbCode tags that have become popular with most modern discussion boards. So, to satisfy this growing number of individuals, I've gone ahead and thrown together an extremely simple tutorial on how to implement this alternative text-to-html conversion tool into MyTopix.

Getting Markdown

Before you can use Markdown, you must first download the appropriate library. Since MyTopix is written in PHP, we cannot use the standard Markdown library which is written in Perl. Fortunately for us, Michel Fortin wrote a PHP-based alternative, so go get it!

Implementing Markdown

This is the easy part. Just drop the markdown.php file in MyTopix's library folder which is located directly beneath the MyTopix root directory %root%/lib/.

Before we start messing with core files, it's always a great idea to be on the safe side, I suggest creating a backup of the original file just in case you messed something up.

Next, you'll need to open the system's text parsing library and make a small change. Within the same library folder, open the file named parse.han.php in your favorite IDE. Within your IDE, scroll down to line 132. It should look like the following block of code:

$string = $this->parseBlocks ( $string );
$string = $this->parseSimple ( $string );
$string = $this->parseLinks  ( $string );

You're going to want to replace it with:

require_once SYSTEM_PATH . 'lib/markdown.php';

$string = Markdown($string);

Save and upload the library, overwriting the older version to complete this mod. There, that's it. You're done!

Say What Now?

Yep, that's all there is to it. MyTopix makes this change simple because it parses the text during read time. To save resources, a lot of forum softwares out there convert text during post time and save the translated version in the database. Since the text is already translated, it doesn't need to go through a parser during read time. The only time it gets translated back to bbCode is when a user attempts to edit or quote an existing post.

MyTopix doesn't do this, so we really only have to change a couple lines to make this whole thing work. It even works well with emoticons turned on too.

I hope you enjoyed this tutorial! Till next time ...

Loading mentions Retweet
Filed under  //   Code Monkey   MyTopix   Tutorials and Such  

Comments [0]

Building MyTopix Modules

With MyTopix becoming more and more popular in recent months I think it's about time I started pumping out some tutorials so you all can make your own modifications and features. I've always thought that people learned more through example rather than reading long and drawn out technical documentation, so let's just jump right into the system and learn what modules are, how they work and how we can create new ones.

Understanding The Basics

In order to create a new module, one must understand how MyTopix handles said modules. What's a module? Well, in this instance a module could be defined as the individual screens you view when browsing the MyTopix interface. For example, the user registration area of MyTopix is referred to as the register module. The same goes for your personal control panel, the private messaging system and so on. Each of these sections all have their very own modules.

To add a new module to MyTopix, you need to do two simple things. First, you need the actual module itself, which is a PHP file. Second, you need to tell the system that the module actually exists by registering it. But, before we get into that, let's discuss what a module really is.

What Makes a Module?

Since MyTopix is written using simple object oriented principles, all modules exist as objects. All module objects are given the name ModuleObject. Since modules are only ever executed one per user request, there are never any naming conflicts, so giving all module objects the same name is never really an issue.

Below, you will find an example of a module object in its most simplest form. I will try my best to explain how it works in Layman's terms, but I won't go into too much detail about the object oriented aspects of the code as it falls out of this article's scope.

class ModuleObject extends MasterObject
{
    var $_message;

    function ModuleObject(& $module, & $config, $cache)
    {
        $this->MasterObject($module, $config, $cache);

        $this->_message = 'Hello World!';
    }

    function execute()
    {
        return $this->_message;
    }
}
Class Naming Conventions

You can see here the class ModuleObject being declared and extending its parent class MasterObject. The class MasterObject is just that, a master object, because it contains all the core functions the system will ever need to get its modules running properly. For instance, it contains the UserHandler, which is an object responsible for authenticating user sessions and pulling their account data.MasterObject also contains the database abstraction layer that allows modules to interact with the specified database.

class ModuleObject extends MasterObject
Defining Instance Variables

Next, we have an example of an instance variable, also called an object's property. Instance variables, depending on their types, are usually used to define an object's attributes. In the example above, our particular module object has a message attribute that will only be used within said object.

var $_message;
Constructors

Moving on, we have the module object's constructor. A constructor is basically a method that is automatically called once you instantiate (or run) an object. It's purpose is to, more or less, prepare the object for use. In MyTopix, all constructors must have the same name as the objects they reside in.

function ModuleObject(& $module, & $config, $cache)

You can also see 3 parameters that are passed into the constructor. These are very important and essential if you want your modules to work properly, or at all.

The first parameter, $module, is just the system name of the requested module. For example, if you're registering a new account, the name of the module being executed is register.

The second parameter, $config, is the system configuration array. This contains the values for all the system settings which include paths to special directories, configuration options for user avatars, etc.

The third and final parameter, $cache, contains which cache groups are assigned to the requested module. Just as with every other system out there, cache can be considered a storage area that contains frequently used data. For instance, all forum settings are cached as well as skin, language and emoticon information. We place all these cache groups in a single table within the database, so we can call upon them all using a single query rather than a complex query for each table we need to pull data from. We'll discuss MyTopix's version of caching in greater detail in a future article.

You may also notice the following line right below where we declared the constructor:

$this->MasterObject($module, $config, $cache);

On this line, we are instantiating the parent class MasterObject and routing all those previously mentioned parameters to it. Once we get to this step, the system executes the MasterObject constructor, which, in turn, loads all the core library objects.

Finally, you will notice that we're giving our message instance variable a default value of 'Hello World!'. It is good practice to assign default values to ALL your declared instance variables within the module object's constructor.

$this->_message = 'Hello World!';
The Boot Method

Every module needs a boot method. As the final step in the system's initialization process, the boot method is typically the very last thing to execute. All boot methods for modules are aptly entitled execute. This is where all the magic happens for your module. It is within this method where you place all your custom code and calls to other subroutines. In our little example, the boot method simply returns a message that every code monkey should be familiar with:

function execute()
{
    return $this->_message;
}

You might want to note that all methods, excluding the constructor, should return something, anything. So, when in doubt, just add return true; to the very end of all your methods.

Adding a New Module

Now that we have a basic idea of how modules are handled within MyTopix we can begin learning about how to add them to the system. Remember, there are 2 steps that we need to take in order to implement a new module.

Implementing the Module's File

This is probably the simplest step. All it involves is dropping your new module file in the appropriate directory. For this article, let's just save our basic object in a file named test.mod.php to the modules directory, which can be found directly beneath your MyTopix root directory. If you are working with a hosted MyTopix installation, you'll need to FTP the file to the corresponding directory after saving it locally.

Registering the Module

This step may seem a bit confusing to some, so I'll try and tone it down a bit. In order for MyTopix to actually see your new module, you need to register it within the system. In order to do so, you will need to modify a source file. Don't worry, it's easier than you think.

Within your MyTopix installation, navigate to the config directory that resides directly beneath the system's root. You see a listing of files, one of which is named pub_modules.php; short for 'public modules'. Open this file and take a peak inside. You will see the following:

$modules = array();

//MODULE NAMES:        CACHE GROUPS:

$modules['active']   = array('forums');
... 
more modules 
...
$modules['calendar'] = array('emoticons', 'filter', 'titles');

As you can see, the system's module registry is a simple 2-dimensional array containing the system names of modules and corresponding cache groups.

We want the system to see our test.mod.php file, so we are going to add the following line directly after the very last entry of the list.

$modules['test'] = array();

Note that the name of our entry is exactly the same as the file name of our module, test.mod.php. This is important because if you misspell the entry, MyTopix will attempt to open a file that does not exist, thus resulting in the system going banana sandwiches. We don't want that, so be careful.

When we are done, the registry should now look like:

$modules = array();

//MODULE NAMES:        CACHE GROUPS:

$modules['active']   = array('forums');
... 
more modules 
...
$modules['calendar'] = array('emoticons', 'filter', 'titles');
$modules['test']     = array();

Save the file and place it in the appropriate directory, overwriting the old version.

The Moment of Truth

Now that we finished all these steps, we can finally call this module and see the result of all our hard work. In MyTopix, to call a module, you must use the following format:

http://www.mysite.com/forum/index.php?a=module_name
or, in this case,
http://www.mysite.com/forum/index.php?a=test

If you see 'Hello World!' printed at the top of the screen, you can consider your efforts a success!

In Closing ...

In this installment, you learned what modules are how they operate within the system. You also learned how to create your own custom modules and implement them to add new functionality to your MyTopix installation. Unfortunately, without knowing more about MyTopix's core functionality, your early modules probably won't be doing much. We plan on addressing this issue in the coming weeks.

In our next article, I will teach you how to create your very own basic RSS module and, in doing so, introduce you to some of the most widely used objects within MyTopix. Sort of a bonus for some, I suppose, considering the fact that RSS functionality is one of the most requested feature enhancements for the system.

Well, I hope you all enjoyed this article and were able to get something out of it. Thanks and stay tuned for more!

Loading mentions Retweet
Filed under  //   Code Monkey   MyTopix   Tutorials and Such  

Comments [0]