Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by
I don't think it would be too difficult to implement a basic system, where you call functions at certain points in the code like between the question and answer output. Joomla has a good system, split into 3 types:

- Plugins: small functions that format content. For example someone could write a Markdown/BBcode parser, and the function would get called for each question/answer.

- Modules: content 'blocks' that display content from various sources. For example someone could write a module to display the most popular tags, or simply put in ad code.

- Components: separate pages with additional functionality. Q2A probably doesn't need this, but an example would be a list of questions ordered by votes.

The main advantages of this type of system are:
1. Keep the code base light and fast by default, with just the key features.
2. Upgrades are much easier because fewer people will be hacking the core files.

Only problem I can think of right now is that it partially 'opens up the code base' with more and more users wishing to contribute. What do you think?

1 Answer

+4 votes
I think it's a great idea, and the approach of having narrow specific extension types is the right one. The theme object already implemented is already a step in this direction, allowing content blocks to be easily added.

But in terms of timing I think Q2A probably needs a couple more major releases to add more functionality to the core before opening up in this way. Sorry if that's a little frustrating!
No worries, I understand. Now that you mention it, I suppose it is possible to implement the "plugin" and "module" types just through the theming engine, by simply writing my own functions to get content, or handle stuff like the question text.
Yeah I looked at and played with with your Script.. As i wanted to integrate with Joomla 1.5x which i looked at the document and got working after messing with it..

As Joomla 1.5x you can add the basic Framework which i went that way so i have access to the all the other Classes in Joomla..

Would be great as if there was a MVC pattern for keep things organized.. As the qa-inlcude folder is getting quite big in the sense of a list of files.. so it makes it hard to track down the files if we want to add something because your the programmer and you know the flow.. but other have to figure it out..

Be Nice to have some MVC with the functions with CLASSES so we can extended the CLASSES instead of all the require_once to add the extra functions..

i know you mentioned its early.. but the earlier the better because you get the framework done and then just have to make the needed CLASSES for adding things

new Controller if needed
MODEL with

i will download and checkout the new version and see what changed :) as i have to compare to the files that i changed when i added the joomla integration..

I will do a search now or make a new question with the basic flow of the required files that get loaded..

if not i guess just run in the Zend Studio and Debug.

cool script..


Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.