PDA

View Full Version : New plugin system !!!


Chuck S
August 15th, 2012, 10:30 AM
Okay now that I have your attention!!! The mad dash to support vb 4.2 navigation is behind I am trying to close up the ReviewPost beta and figured I would play around with adding a new plugin system that we could work into our system like vb has. That way people can add in code without having hack files with each version.

My intention here is to get some ideas from our customer base about hook locations. I have the basic ones in mind like on the top middle and bottom of the sidebar or top or bottom of index page or some on the photo page.

Keep in mind if I get this all sorted there are only like 6 viewable scripts in our application ( index,showproduct,showcat,showmembers,members and uploadproduct.php scripts ). The gallery apps filenames are slightly different and there is one more the personal albums script.

For any given script there are only so many locations so please be very specific.

Chuck S
August 15th, 2012, 01:09 PM
Main Index - My Product Gallery (http://www.omegatron.net/reviews/index.php)

Just a little test with straight html code but a beginning little box top of sidebar. Before I do anything else I need to write up the admin interface to add the plugin. That will take a little work.

It will be similar to how vbulletin does things although not as expansive as they have several hundred hooks.

Straight PHP code is executed and anything you want to print via html will be added like so. Once I get things worked out and we support a new plugin system I will post a tutorial.

The hook code will accept straight php code without opening or closing tags to define or grab anything you are trying to define like vb and then you will render the html output like so.

$pphook['location'] .= 'SOME HTML HERE';

Then in our templates at the proper locations I will place the hook outputs like so

$pphook[location]

As with any plugin system you can mess things up if you do bad php or html code so there will be a master switch and ability to define it off in the config directly if you mess up like vb. There will also be the ability to turn any individual plugin off.

As I am designing things any input and ideas is appreciated. ;)

Chuck S
August 15th, 2012, 10:12 PM
Main Index - My Product Gallery (http://www.omegatron.net/reviews/index.php)

Getting close here there are like 32 different hook locations I have come up with. I have done all the admin side work and main php file work just need to edit all the templates with the hook locations.

Here is a list of template hooks I have so far.

footer_top
footer_bottom
global
header_top
header_bottom
index_top
index_bottom
profile_side_top
profile_side_middle
profile_side_bottom
profile_main_top
profile_main_bottom
showcat_top
showcat_bottom
showmember_top
showmember_bottom
showproduct_details_top
showproduct_details_bottom
showproduct_top
showproduct_bottom
showproduct_above_image
showproduct_below_image
showproduct_above_thumbs
showproduct_below_thumbs
sidebar_top
sidebar_middle
sidebar_bottom
uploadproduct_top
uploadproduct_middle
uploadproduct_bottom
who_online_top
who_online_bottom

iguanairs
August 16th, 2012, 04:32 PM
You should make it so we can add hook locations like we can in vbulletin. This way, if a hook doesn't already exist, we can toss one in. (Then perhaps have it added in a later version.)

Chuck S
August 16th, 2012, 04:43 PM
Just like vb you can do that anytime you wish but if its not in our default templates it will not exist in our core product. Thats always been the case with vb and will be the case here as well.

I am going to make up as many feasible locations as I think are necessary and more would be added as time goes on.

The plugins themselves though are in the format I noted.

You enter any php code html whatever your trying to do and any html print out is defined in your plugin as

$pphook['location'] = 'html here';

In the templates like vb the hook location are like so

$pphook[location]

I will post up a tutorial once I finalize what I am doing here

iguanairs
August 16th, 2012, 06:58 PM
That will work fine then. I know I will be playing with it.

Chuck S
August 16th, 2012, 07:28 PM
No problem you will like it.

Zachariah
September 5th, 2012, 12:00 PM
Nice Chuck,
It will help in adding mods and custom code.

B=0

Chuck S
September 5th, 2012, 12:08 PM
Yep someone had asked about adding a banner ad thing so I just took the next step. ;) Nice to see you around and all is well.

Alfa1
September 5th, 2012, 08:20 PM
Are you planning to add an xml importer, similar to vbulletin?

Chuck S
September 5th, 2012, 08:24 PM
There are no current plans as of yet. Possibly in the future but for the moment I am taking a breather as I have been on 9 months of straight development.

Chuck S
September 6th, 2012, 10:10 AM
When it does come time to add in the ability to import an xml file it does not look like it would be too hard. ;)

PHP Code - import xml file from web server (/public_html/ctrackxml) into mysql database - Stack Overflow (http://stackoverflow.com/questions/8938362/php-code-import-xml-file-from-web-server-public-html-ctrackxml-into-mysql-d)

Chuck S
October 2nd, 2012, 09:27 AM
I am working on adding ability to upload xml plugins. ;)