Shine ISP Code
Status: Alpha
Brought to you by:
shinesoftware
| File | Date | Author | Commit |
|---|---|---|---|
| .cache | 2009-11-24 | shinesoftware | [r7] |
| application | 2009-11-24 | shinesoftware | [r7] |
| libraries | 2009-11-24 | shinesoftware | [r2] |
| public | 2009-11-24 | shinesoftware | [r7] |
| .buildpath | 2009-11-24 | shinesoftware | [r7] |
| .project | 2009-11-24 | shinesoftware | [r7] |
| readme.txt | 2009-11-24 | shinesoftware | [r2] |
| shineisp.bat | 2009-11-24 | shinesoftware | [r2] |
| shineisp_temp.sql | 2009-11-24 | shinesoftware | [r6] |
REQUIREMENT
===========
Apache 5.1
MySql
PHP 5
Modules: GD, MySQL, MOD_REWRITE
Create a new Virtual HOST
=========================
Add these lines in the /etc/apache2/sites-enabled/default file
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.mydomain.com
DocumentRoot /var/www/myproject/public
<Directory /var/www/myproject/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Add in the hosts file the following row:
127.0.0.1 www.mydomain.com
Database
========
Create your db using your mysql tool or the shell command: createdb myproject;
Import the dump file included in this distribution using this shell command:
mysql -p -uroot -h localhost myproject < database.sql
Create a new module
===================
1. Create a folder inside /application/modules/ with the name of the module without spaces, symbols and all the letters in lowercase
2. Create a php file inside this folder with the same name of the folder
3. Copy and paste this code inside the php file previously created:
/**
* Manage the ....... in the user control panel as module of the project.
*
* PHP versions 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to info@shinesoftware.com so we can mail you a copy immediately.
*
* @name ......
* @package Shine Framework
* @author Shine Software <info@shinesoftware.com>
* @copyright 1997-2009 Shine Software Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version 1.0
* @link http://www.shinesoftware.com
*/
class myplugin {
protected $id;
protected $params;
protected $skin;
protected $website_id;
protected $maintpl;
protected $modulename = "myplugin";
/**
* Main Constructor of the class
* @return null
*/
public function __construct($maintpl="", $id="", $params="", $skin="", $website_id="") {
// Set the main variables
$this->id = $id;
$this->params = $params;
$this->skin = $skin;
$this->website_id = $website_id;
$this->maintpl = $maintpl;
}
/**
* First method called
* @param $fn name of the function that must be called
* @return html
*/
public function doExecute() {
$libs = singleton::getInstance ( 'Library' );
/* TODO:
* 1. You have to create a folder inside the modules name with the same module name.
* 2. You have to create a folder inside your new module folder called "templates".
* 3. You have to create a php file inside your module folder with the same module name.
* 4. You have to create a htpl file inside your custom module templates folder with the same module name.
* 5. Open your template and write {$test} string
*/
$tpl = $libs->retrieveTemplate ( APPLICATION_PATH . '/modules/" . $this->modulename . "/templates/' );
$tpl->assign ( 'test', 'test my first template');
return $tpl->fetch ( $this->modulename . '.htpl' );
}
}
4. Create a "templates" folder inside your module folder
5. Create a .htpl file inside the "templates" folder previously created
6. Create a .css file inside the /public/skins/default/css folder with the same module name
7. Enable your module inserting the {$myplugin} placeholder inside the index.htpl (the file is located at /public/skins/default/)
8. Enable your module registering it inside the XML Config file at /public/skins/default/config.xml
<myplugin page="flatpage.htpl">
<modules>
<module>
<name>myplugin</name>
</module>
</modules>
</myplugin>
9. Go at http://yourproject/YourModuleName