Author Topic: How to setup parameter input for a plugin?  (Read 2684 times)

Kareed

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
How to setup parameter input for a plugin?
« on: March 14, 2016, 03:02:12 AM »
Hi,
I want to start playing with making plugins.  I have created a tab to display a external webpage but I would like to have the website configurable from the settings panel without it being hard coded into the plugin.  How would I go about doing that?  I can't find any information on adding this type of capability.

Thanks
Kareed

conrado

  • Administrator
  • Hero Member
  • *****
  • Posts: 999
  • Conrado
    • View Profile
    • Feng Office
    • Email
Re: How to setup parameter input for a plugin?
« Reply #1 on: March 15, 2016, 02:48:59 PM »
Hi Kareed,

Please do share the info here once you figure it out.

I have seen others do it so it shouldn't be too hard.

Cheers!
Get Official Support for your Feng Office. Support the development team. Sign up for a Free Trial here.

Kareed

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: How to setup parameter input for a plugin?
« Reply #2 on: March 18, 2016, 01:50:55 AM »
I figured it out and it was easy.  It just took a long time to figure that out.

All you need to do is add a new value into the config_options table.  The category name appears to be where the item will show in the settings.  I used general and it showed up under the general settings.  Create a name for the variable, I used timeclock_url.  Specify the type of interface, I used StringConfigHandler to get a textfield.  The text for the field is specified in the language lang.php file.

I was adding a timeclock tab so in the lang.php file I put the following information.
   'config option name timeclock_url'=>'Time Clock URL',
   'config option desc timeclock_url'=>'Enter in the url for the timeclock.',

I created a file mysql_initial_data.php in the folder install/sql to add the config_options entry on the installation of the plugin.  This file added the entry to the database.

Hope this helps.

conrado

  • Administrator
  • Hero Member
  • *****
  • Posts: 999
  • Conrado
    • View Profile
    • Feng Office
    • Email
Re: How to setup parameter input for a plugin?
« Reply #3 on: April 13, 2016, 04:44:35 PM »
I am sure it will help many others.

Just FYI: Feng Office has a time tab for time tracking, and a clock for tasks on the tasks tab. I don't know if you mean that when you say you added a "timeclock" tab.

Cheers!
Get Official Support for your Feng Office. Support the development team. Sign up for a Free Trial here.

primvakt

  • Freshman
  • *
  • Posts: 17
    • ICQ Messenger - 271551524
    • MSN Messenger - primvakt@yandex.ru
    • Yahoo Instant Messenger - нача
    • View Profile
    • начало
    • Email
How to setup parameter input for a pl
« Reply #4 on: March 29, 2018, 06:15:23 AM »
Ok cool i will setup my pvpgn server to write game data to db and start working on the php side then


Sent from my iPhone using Tapatalk
<a href=http://pskbigmaster.ru/>ремонт квартир</a>

primvakt

  • Freshman
  • *
  • Posts: 17
    • ICQ Messenger - 271551524
    • MSN Messenger - primvakt@yandex.ru
    • Yahoo Instant Messenger - нача
    • View Profile
    • начало
    • Email
How to setup parameter input for a pl
« Reply #5 on: March 29, 2018, 12:40:36 PM »
I think the first thing that needs to be done is to have PvPGN store the game data in the database instead of text files

Once the data is stored in a database, we can work on writing PHP to talk to the db and display game data more efficiently

So far I dont know how to do either of those things however...


Sent from my iPhone using Tapatalk
<a href=http://pskbigmaster.ru/>ремонт квартир</a>