Author Topic: Develop new plugin with db - best practice?  (Read 5023 times)

ttrepper

  • Newbie
  • *
  • Posts: 12
    • View Profile
Develop new plugin with db - best practice?
« on: December 07, 2009, 06:25:08 am »
Hi all,

I want to develop a new plugin with DB-Storage, in detail the plugin should store quotes and display one of them in a random way as a 'quote-of-the-day' in the dashboard (I mean the overview-page).

I think I need to:
  • create the plugin-structure
  • create the database-layout
  • modify the dashboard, or?

The database-structure is simple, because its one table, but how is it created during installation? Is there an upgrade-mechanism, if I will release a plugin-upgrade in future, which I should now keep in mind?

How about modifying the dashbord? Is this the right way or do I have to implement or extend some hooks? Does anybody has a working mini-example *WITH* DB_Access?

Thanks a lot and best regards,

Thomas
« Last Edit: December 07, 2009, 06:27:26 am by ttrepper »

allenlook

  • Volunteer Moderator
  • Sr. Member
  • ****
  • Posts: 312
    • MSN Messenger - sii_lookal@hotmail.com
    • View Profile
    • SI Group, Inc.
Re: Develop new plugin with db - best practice?
« Reply #1 on: February 08, 2010, 10:07:34 am »
I like your idea, and the ability to post messages to users would also be awesome.
I am a volunteer moderator.  Any statements, opinions or observations I contribute are solely mine and are not necessarily shared by the makers of Feng Office.

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Develop new plugin with db - best practice?
« Reply #2 on: February 09, 2010, 04:34:40 pm »
I know this is a big cheat but I just placed an iframe in the dashboard linking to an internal .html file. I use this to post any content I want to display on the main page across all workspaces (mostly links and notices), and I designed the file to look like OG widgets  :)

If you figure out a better way, do post !

allenlook

  • Volunteer Moderator
  • Sr. Member
  • ****
  • Posts: 312
    • MSN Messenger - sii_lookal@hotmail.com
    • View Profile
    • SI Group, Inc.
Re: Develop new plugin with db - best practice?
« Reply #3 on: February 09, 2010, 06:24:21 pm »
I'm assuming you posted your iframe into application\views\dashboard\index.php?

Care to share where?
I am a volunteer moderator.  Any statements, opinions or observations I contribute are solely mine and are not necessarily shared by the makers of Feng Office.

fernandog

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Develop new plugin with db - best practice?
« Reply #4 on: February 24, 2010, 05:46:28 pm »
Hi,

Yes there exactly.
I created a new folder in application\views\dashboard called "iframe"
Inside that folder I posted the html files
I added  the code bellow to the index.php file, right before the last <script> tag

<IFRAME src="http://localhost/opengoo/application/views/dashboard/iframe/index.html" width="100%" height="500" scrolling="auto" frameborder="0"></IFRAME>


allenlook

  • Volunteer Moderator
  • Sr. Member
  • ****
  • Posts: 312
    • MSN Messenger - sii_lookal@hotmail.com
    • View Profile
    • SI Group, Inc.
Re: Develop new plugin with db - best practice?
« Reply #5 on: February 24, 2010, 11:37:24 pm »
Good idea :)

I've integrated the SuperSimple Blog/CMS into a tab of its own and I'll post a write-up shortly.  It requires very little hacking, and allows for comments and RSS feed subscriptions.  Otherwise it's dirt-simple.
I am a volunteer moderator.  Any statements, opinions or observations I contribute are solely mine and are not necessarily shared by the makers of Feng Office.