View Full Version : Modules Manager???


nikidala
27th January 2004, 10:27 PM
So what's the Mod Manager? See, I have some template mods I want to do, but I also want to track them. I was thinking of sticking them in the HTL just so I could have all my "changes" in one place, butI started thinking that might actually be what the MM is all about...

So spill it...

KuraFire
27th January 2004, 11:14 PM
Nope, for what you want to do you should really use the HTL. It works fine for that.

The Modules Manager is a system that allows you to insert 'plugins' in your vB templates that allow you to do virtually anything you want, without having to seriously hack up the .php file that makes that specific page.

EXAMPLE:
You have the index.php page, Forum home, and at the top of the forumlisting you want to insert a small calendar, much like the little things you see on every Portal script.
Ordinarily, you would do the following:
- edit the templates list for index.php to include all templates you need for this mini-calendar;
- go into the file somewhere before the end and paste a whole collection of code that generates a $variable which you then use in the FORUMHOME template on the location where you want it to appear.

That's a lot of file edits. WAY too much for my taste. So I figured, we can do much better than that, let's be creative and use insta-ready plugins that work from a single 'command line', allowing people to use an entire function or combination of functions without having to add more than a word or two to the .php file.

So I made the Modules Manager.
In the above example, you would not do those things, but instead you would do this:

- use the HTL to install the module "Mini Calendar Block", its keyword being 'mini_calendar'. Keywords are an integral part of Modules. It lives on consistancy of keywords. Anyway...
- You have the module installed now. To use it on FORUMHOME, you adjust the top of index.php:
(current standard vB code of that part in index.php:)
// get special data templates from the datastore
$specialtemplates = array(
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue'
);
Instead of that, to insert your Module in the page you would have this:
// get special data templates from the datastore
$specialtemplates = array(
'modules',
'module_mini_calendar',
'userstats',
'birthdaycache',
'maxloggedin',
'iconcache',
'eventcache',
'mailqueue'
);
Not a difficult file edit if you ask me :)
- Next, you open template FORUMHOME and on the location where you want your mini-calendar to appear, you put this:
<if condition="$block = get_module('mini_calendar')">$block</if>

And whaddya know. Suddenly, the entire mini calendar will appear there! And in your Style Manager, you can customize the templates for the mini calendar, but even though it uses templates, you didn't have to add those templates to the $globaltemplates array on index.php.
Even better: if you had a $vbphrase for the Calendar (for instance), you could have it in the phrases system but you wouldn't have to modify the $phrasegroups array on index.php either, for it to be available to you!

WHY NOT??
That's the power of the Modules Manager.
If you load the Modules Manager at the start of a script (by making the first $specialtemplates element be 'modules'), it will automatically cache and load:
- templates for the chosen module(s);
- phrases for the chosen module(s);
- functions that make up the chosen module(s);
- global Module Manager settings (including a list of enabled modules, so that you can globally enable/disable every single module, should -for instance- a security issue be found in a certain module).

And all YOU had to do was make one TEENY TINY file edit. THAT'S IT!


And you know what's even cooler?

If you use:

$specialtemplates = array('modules', 'module_shoutbox+c');

you could have an entire shoutbox, with all the shouts being cached in datastore and automatically loaded (without additional queries), with all its templates and phrases, loaded for you as a module, that you can use anywhere in the templates for that page.
The +c tackon at the end of the module name tells the Modules Manager that this Module has its own datastore cache. It will then proceed to add the necessary field to the Datastore Query that vB does at all times, and thus you will have templates, phrases, and your own cache, from the tiniest, simplest file edit, usable in files and templates everywhere.

If that isn't efficient for the amount of file edits hacks need, then nothing is! :)

nikidala
28th January 2004, 04:57 AM
Wow... Um, wow...

Huh, so you don't think big, do you?!? ;)

Sounds great! I am sure it will be as kick butt as your HTL! Thanks for the info on using the HTL on my template mods. Already got started! I love it... Used to have a special forum on my test forums to hold all this crud, but now it is so pretty and organized...

Sorry, don't mean to be kissing your butt all the time, just love having new toys... :D

trafix
28th January 2004, 07:55 AM
lol W00t to the HTL

KuraFire
28th January 2004, 11:24 AM
Wow... Um, wow...

Huh, so you don't think big, do you?!? ;)
Who, me? *attempts to look innocent*


*fails miserably*
shhh.. ;p

Sounds great! I am sure it will be as kick butt as your HTL! Thanks for the info on using the HTL on my template mods. Already got started! I love it... Used to have a special forum on my test forums to hold all this crud, but now it is so pretty and organized...
HTL++ ! :D
('s an insider's joke thing, we have ++ and -- karma'ing in irc...)

Yeah, the Modules Manager is going to be an extremely powerful tool.
Picture the entire Shoutbox hack, run from a Module. With the Modules Manager, you have the power to simply place the entire Shoutbox on ANY page you want, with only 1 TINY file edit and 1 TINY template edit. NO MORE COMPLICATIONS!
It's a revolutionary new approach to vB-hacking, if you ask me. No more old-skool hacking up the files! We don't live in the vB2 era anymore, we are vB3 PowerWhores!!!! :D:D:D

Sorry, don't mean to be kissing your butt all the time, just love having new toys... :D
I know the feeling. I just can't bend that way myself ;)

Daniel C
30th January 2004, 10:10 PM
sounds like a good idea kura :D

Daniel P
30th January 2004, 10:16 PM
Good idea? I can't wait for the MM and the rest of Kura's hacks.

imported_7thGenCivic.com
2nd February 2004, 06:19 PM
Definetly sounds sweet

spence
10th April 2004, 07:55 PM
Any updates on your progress?

Neocorteqz
11th April 2004, 11:34 AM
I'm just waiting for the Add Locations to WHo's Online. Which last I checked, needed the MM. But some of the other things you can do with it, interest me even more.

can't wait to see it. :)

KuraFire
11th April 2004, 09:10 PM
The MM will be released in beta stage soon; then shortly after that will come Add Who's Online Locations in its first form (completely unphrased). The final form of that one will support multiple languages and will thus be 100% phrased...