Jump to content


Photo

Writing a PHP Plugin System


  • Please log in to reply
15 replies to this topic

#1 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 13 June 2006 - 05:46 AM

I'm working on a writing content management system which I initially wrote for myself but am now extending. There's a demo at [a href=\"http://books.zatechcorp.com\" target=\"_blank\"]http://books.zatechcorp.com[/a].

I have the theme system down pat but I'm trying to write a plugin system that allows others to write plugins that extends the functionality of the CMS. I've searched all over the internet but I can't find anything related to developing a plugin system for one's own custom software.

Can anyone give me specifics of what I'd need and what to keep in mind while developing it?
Given enough eyeballs all bugs are shallow. My Website

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 05:51 AM

[!--quoteo(post=383108:date=Jun 13 2006, 05:46 AM:name=azuka)--][div class=\'quotetop\']QUOTE(azuka @ Jun 13 2006, 05:46 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I'm working on a writing content management system which I initially wrote for myself but am now extending. There's a demo at [a href=\"http://books.zatechcorp.com\" target=\"_blank\"]http://books.zatechcorp.com[/a].

I have the theme system down pat but I'm trying to write a plugin system that allows others to write plugins that extends the functionality of the CMS. I've searched all over the internet but I can't find anything related to developing a plugin system for one's own custom software.

Can anyone give me specifics of what I'd need and what to keep in mind while developing it?
[/quote]

Do you mean you want to offer users to add there own code to the existing code and shere there findings to others.

I think afther a time this will happen automatickly.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 13 June 2006 - 06:05 AM

I don't really mean that. Have you noticed the plugins for Wordpress, components for Joomla and such?

I don't want to write badly arhitected code that'll be difficult to extend in any direction, which is why I'm seeking help.
Given enough eyeballs all bugs are shallow. My Website

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 06:38 AM

[!--quoteo(post=383113:date=Jun 13 2006, 06:05 AM:name=azuka)--][div class=\'quotetop\']QUOTE(azuka @ Jun 13 2006, 06:05 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I don't really mean that. Have you noticed the plugins for Wordpress, components for Joomla and such?

I don't want to write badly arhitected code that'll be difficult to extend in any direction, which is why I'm seeking help.
[/quote]

Why dont you code a lot of add on's and sell them as extra added mods.

[!--quoteo(post=383119:date=Jun 13 2006, 06:30 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 13 2006, 06:30 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Why dont you code a lot of add on's and sell them as extra added mods.
[/quote]


You wont users to add Theme's to your existing project is that correct like word press.

sorry know i understand.

I thort a Theme was just css and images designd in the way the user wants them.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 13 June 2006 - 08:12 AM

Well, we seem to be misunderstanding each other. I've already written the theme / template system and it works perfectly.

I'm saying I want to implement a feature that allows others to write and install plugins for the system.
Given enough eyeballs all bugs are shallow. My Website

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 08:17 AM

[!--quoteo(post=383150:date=Jun 13 2006, 08:12 AM:name=azuka)--][div class=\'quotetop\']QUOTE(azuka @ Jun 13 2006, 08:12 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Well, we seem to be misunderstanding each other. I've already written the theme / template system and it works perfectly.

I'm saying I want to implement a feature that allows others to write and install plugins for the system.
[/quote]

what in php like a built in text editor

and sorry forthe confussion you project is 10/10 is it gpl
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 13 June 2006 - 08:42 AM

[!--quoteo(post=383151:date=Jun 13 2006, 04:17 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 13 2006, 04:17 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]

what in php like a built in text editor

and sorry forthe confussion you project is 10/10 is it gpl [/quote]

Well, it's quite personal, although I don't mind releasing the code. I'm an amateur writer and I needed something for online purposes.

Some people have met me online indicating interest in it so I'm trying to work on it and ensure that if other developers work on it with me, we won't need to do a complete rewrite.

Given enough eyeballs all bugs are shallow. My Website

#8 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 13 June 2006 - 10:48 AM

[!--quoteo(post=383156:date=Jun 13 2006, 09:42 AM:name=azuka)--][div class=\'quotetop\']QUOTE(azuka @ Jun 13 2006, 09:42 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Well, it's quite personal, although I don't mind releasing the code. I'm an amateur writer and I needed something for online purposes.

Some people have met me online indicating interest in it so I'm trying to work on it and ensure that if other developers work on it with me, we won't need to do a complete rewrite.
[/quote]
You can't be too stressed about the code being changed, it doesn't meant that anything is lost, but a good system for plug in's is quite messy I suppose. The entire code must accomodate for these plugins (depending on what level of plugins you want.
z..z..z..z..z..z..z..z..

#9 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 11:14 AM

[!--quoteo(post=383196:date=Jun 13 2006, 10:48 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 13 2006, 10:48 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You can't be too stressed about the code being changed, it doesn't meant that anything is lost, but a good system for plug in's is quite messy I suppose. The entire code must accomodate for these plugins (depending on what level of plugins you want.
[/quote]

This is the advice i give you as my self a amatur programmer .

when we make scripts i no that they fell close to our self lol, And it herts to have others tinker about with them and alter the code it is so upsetting as were all attached to our own code.

But i personally found a way around that felling buy giving the code away for free, and let users alter my beloved code and comment and help to inprove the project at hand.

When user submit code that is a good mod, I dont release it as a free mod i let users pay for upgrades and now my confedence as a programmer comes back, knowing that ok the task is free to all on hotscripts.com but for a small fee for a nice mod they pay nice!.

At the same time i ask my communty of downloading friends what mods they would like and then i set my self a task to get those mods built some i give for free and the others that are ask so meny times i charge.

So in essence a good inforstructure of a free gpl script can give a huge income if planned carefully.

My rules ok lol.

1. The free script comes with the basic and addon's i charge for.

2. Users can donate there time with there own added code.

3. If donated code is so good use it as a paying mod.

4. If the donated code is a 5/5 code link it as a donnated mod.

5. In the forum of the code make mods that are wanted.

6. Sell wanted mods or donate the mod as a 5/5 code.

7. Sit back administrate the site properly and watch my paypal account grow lol.


Hope this help good luck

Always remember if it to good to be true it probly is.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#10 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 13 June 2006 - 11:32 AM

redarrow has made quite an important point.

another option is to make a php file which can be included into any other php page which includes all the portal code (login, permissions, etc.) then give the mod makers the option to add link any new page they make (which includes your include.php page) this way integrating their code into your portal system. What do you think?
z..z..z..z..z..z..z..z..

#11 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 13 June 2006 - 04:24 PM

Well, there's a file called 'functions.php' which includes 'normal' function files and another called 'admin-functions.php' which includes admin-specific files so I get your point.

I have to admit I've been very busy and haven't touched my code for two weeks now. I'll work on it.

Perhaps my biggest problem is that I'd never written a CMS before [I started programming last year] so I get scared that I'm leaving security holes open and such, even though I keep current with security practices.

Does having a plugin system leave the system open to vulnerabilities? On the other hand, I want others to be able to extend my work without having a need to rewrite major portions of code to suit themselves, then having problems upgrading.
Given enough eyeballs all bugs are shallow. My Website

#12 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 13 June 2006 - 08:23 PM

as I said before, if you create a "master file" which deals with the basics: (design, user control and db use) in a method that has a wide compatability there should be no problem. what I would normally advise is to create the page down to what you could call the first cell of the second line (for instance the left sidebar on this website) and then to add you just add any code after that. you may want to create a file of "pre-html commands" for posting information that requires redirecting or setting cookies, etc. where people can add that kind of function.

If this is the first time you have written such a thing, and you having been programming for a year, you wanna get some beta testers on the site before going too far with it. It'll stream line the process.

Good luck in any case.
z..z..z..z..z..z..z..z..

#13 phpfreak101

phpfreak101
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 14 June 2006 - 04:54 AM

[!--quoteo(post=383453:date=Jun 13 2006, 04:23 PM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 13 2006, 04:23 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
as I said before, if you create a "master file" which deals with the basics: (design, user control and db use) in a method that has a wide compatability there should be no problem. what I would normally advise is to create the page down to what you could call the first cell of the second line (for instance the left sidebar on this website) and then to add you just add any code after that. you may want to create a file of "pre-html commands" for posting information that requires redirecting or setting cookies, etc. where people can add that kind of function.

If this is the first time you have written such a thing, and you having been programming for a year, you wanna get some beta testers on the site before going too far with it. It'll stream line the process.

Good luck in any case.
[/quote]


You can also check out phpNuke [a href=\"http://phpnuke.org/modules.php?name=Downloads&d_op=viewdownload&cid=1\" target=\"_blank\"]http://phpnuke.org/modules.php?name=Downlo...wdownload&cid=1[/a] This is a spectacularly coded CMS and its open source so you can backwards engineer it. I'm currently working on backwards engineering it and making a website to explain how it works.

#14 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 14 June 2006 - 11:29 AM

Like I said, everything is abstracted so the CMS doesn't care where the data is coming from - MySQL, MSSQL, or using PEAR itself.

This isn't a traditional 'CMS' that fits generic purposes. It's geared specially towards writers.

phpfreak101, isn't PHPNuke rather complex? I thought there'd be perhaps some CMS or some tutorial that shows how to create a plugin system whose APi you can expose?

Studying the entire PHPNuke CMS sounds like overload to me. Of course, I could be wrong...
Given enough eyeballs all bugs are shallow. My Website

#15 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 14 June 2006 - 11:34 AM

Plugin systems can be a fairly complex topic and really, it depends how your suystem has been built.

If your using php5 take a look at the reflection API, might give you some ideas. I really dont think however that your going to find a tutorial on the subject.

#16 azuka

azuka
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts
  • LocationNigeria

Posted 17 June 2006 - 04:16 AM

Thanks everyone for the help. I was really hoping I'd be able to find some information on it.  :-\ .

Well, I'll check out the reflection API. PHPFreaks rocks...

Given enough eyeballs all bugs are shallow. My Website




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users