PLUGINS
-------
playSMS plugin's files and folders installed under directory web/plugins 
and categorized into 5 different categories, they are:
- tools
- feature
- gateway
- themes
- language


Tools
-----
Here installed plugins with no specific SMS related features but used by playSMS.

Core functions that you can 'hook' from tools plugins:
- playsmsd()
- billing_post($smslog_id,$rate,$credit)
- billing_rollback($smslog_id)
- billing_finalize($smslog_id)
- billing_getdata($smslog_id)
- phonebook_groupid2code($gpid)
- phonebook_groupcode2id($uid,$gp_code)
- phonebook_number2name($p_num)
- phonebook_getdatabyid($gpid, $orderby="")
- phonebook_getdatabyuid($uid, $orderby="")
- phonebook_getsharedgroup($uid)
- phonebook_getgroupbyuid($uid, $orderby="")
- rate_setusercredit($uid, $remaining=0)
- rate_getusercredit($username)
- rate_cansend($username, $sms_to)
- rate_deduct($smslog_id)
- rate_refund($smslog_id)
- setsmsdeliverystatus($smslog_id,$uid,$p_status)
- interceptincomingsms($sms_datetime,$sms_sender,$message)
- interceptsmstoinbox($sms_datetime,$sms_sender,$target_user,$message)
- sendmail($mail_from,$mail_to,$mail_subject="",$mail_body="")
- call($_REQUEST)


Feature
-------
Here installed plugins which contains specific SMS related features and directly handle
incoming or outgoing SMSes.

Core functions that you can 'hook' from feature plugins:
- playsmsd()
- checkavailablekeyword($keyword)
- setsmsincomingaction($sms_datetime,$sms_sender,$keyword,$param='')
- call($_REQUEST)


Gateway
-------
Here installed plugins which has ability to actually send and/or receive SMS, and directly
connected to SMS gateway applications or services.

Core functions that you can 'hook' from gateway plugins:
- playsmsd()
- getsmsinbox()
- getsmsstatus($gpid=0,$uid="",$smslog_id="",$p_datetime="",$p_update="")
- sendsms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$uid='',$gpid=0,$smslog_id=0,$sms_type='text',$unicode=0)
- call($_REQUEST)


Themes
------
Here installed playSMS's themes.
Core functions that you can 'hook' from themes plugins:
- call($_REQUEST)


Language
--------
Here installed language database based on gettext for core/main files only, plugin's language
files are reside under each plugin's directory


Plugin Anatomy
---------------
Each plugin will need to have below structure:

<playsms_web_root>/plugin/<category>/<plugin_name>/config.php
                                                  /fn.php
                                                  /docs/VERSION
                                                  /docs/README
                                                  /docs/CHANGELOG
                                                  /lib
                                                  <plugin_name>.php

For example, plugin with purpose to serve connecting playsms to your own Content Provider, called 'mycp'.
Since its a gateway, the category would be 'gateway'.

The plugin structure will be:

<playsms_web_root>/plugin/gateway/mycp/config.php
                                      /fn.php
                                      /docs/VERSION
                                      /docs/README
                                      /docs/CHANGELOG
                                      /lib
                                      mycp.php


DIRECT ACCESS
-------------
Since version 0.9.5.1 playSMS will use single gate for all its routines.
For example, prior to 0.9.5.1 accessing menus referenced to menu.php, now its changed.

Access to menus, you will need to use URL index.php?app=menu
Access to webservices, you will need to use URL index.php?app=webservices
Access to callback functions, or functions in plugins, you will need to use index.php?app=call

Notes:
- access to menu.php has been replaced with index.php?app=menu
- access to input.php and output.php has been replaced with index.php?app=webservices
- access to callback.php, dlr.php and geturl.php has been replaced with 
  index.php?app=call&cat=[plugin's category]&plugin=[plugin's name]
- access to dlr.php in kannel will require additional parameter access=dlr
- access to geturl.php in kannel will require additional parameter access=geturl

For example:

Prior to 0.9.5.1:
http://localhost/playsms/menu.php?inc=user_outgoing&op=user_outgoing
Since 0.9.5.1:
http://localhost/playsms/index.php?app=menu&inc=user_outgoing&op=user_outgoing

Prior to 0.9.5.1:
http://localhost/playsms/input.php?u=admin&p=admin&ta=ds&last=100
Since 0.9.5.1:
http://localhost/playsms/index.php?app=webservices&u=admin&p=admin&ta=ds&last=100

Prior to 0.9.5.1:
http://localhost/playsms/plugin/gateway/clickatell/callback.php
Since 0.9.5.1:
http://localhost/playsms/index.php?app=call&cat=gateway&plugin=clickatell

Prior to 0.9.5.1:
http://localhost/playsms/plugin/gateway/kannel/geturl.php?t=%t&q=%q&a=%a
Since 0.9.5.1:
http://localhost/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a


--
Anton Raharja
