m (Bot: Automated text replacement (-< +<)) |
m (Bot: Automated text replacement (-> +>)) |
||
Line 1: | Line 1: | ||
Before reading on, you should know some definitions used in this documentation: | Before reading on, you should know some definitions used in this documentation: | ||
* ''element'' aka ''tag'': an instruction used to tell the package manager what to do. ie <install | * ''element'' aka ''tag'': an instruction used to tell the package manager what to do. ie <install></install> | ||
* ''attribute'' aka ''property'': an additional value used to describe an element | * ''attribute'' aka ''property'': an additional value used to describe an element | ||
* ''inline'': code or text that is written in this file instead of coming from an outside source | * ''inline'': code or text that is written in this file instead of coming from an outside source | ||
Line 16: | Line 16: | ||
''All elements, unless otherwise stated, are not optional and contain no attributes.'' | ''All elements, unless otherwise stated, are not optional and contain no attributes.'' | ||
* '''<package-info | * '''<package-info></package-info>''' | ||
* Must encompass all other elements in the file. | * Must encompass all other elements in the file. | ||
* '''Attributes''': | * '''Attributes''': | ||
* ''xmlns'': defaults to ''[http://www.simplemachines.org/xml/package-info http://www.simplemachines.org/xml/package-info]''; optional | * ''xmlns'': defaults to ''[http://www.simplemachines.org/xml/package-info http://www.simplemachines.org/xml/package-info]''; optional | ||
* '''<id | * '''<id></id>''' | ||
* Contains the id of the package. Should be in the format of [username]:[package name]. For instance ''sleepy:LeetMod'' When submitting a mod to the mod site, the username should be your username from [http://www.simplemachines.org www.simplemachines.org] | * Contains the id of the package. Should be in the format of [username]:[package name]. For instance ''sleepy:LeetMod'' When submitting a mod to the mod site, the username should be your username from [http://www.simplemachines.org www.simplemachines.org] | ||
* '''<name | * '''<name></name>''' | ||
* Contains the name of the package. | * Contains the name of the package. | ||
* '''<type | * '''<type></type>''' | ||
* The type of package - "avatar", "language", or "modification". | * The type of package - "avatar", "language", or "modification". | ||
* '''<version | * '''<version></version>''' | ||
* The package's current version. | * The package's current version. | ||
* '''<install | * '''<install></install>, <upgrade></upgrade>, and <uninstall></uninstall>''' | ||
* Actions taken on installation. The elements and their attributes are the same for the install, upgrade, and uninstall elements. | * Actions taken on installation. The elements and their attributes are the same for the install, upgrade, and uninstall elements. | ||
Line 41: | Line 41: | ||
* '''Elements''': | * '''Elements''': | ||
* '''<readme | * '''<readme></readme> or <readme /> (for use with type="file" only)''' | ||
* Filename of the readme file | * Filename of the readme file | ||
Line 50: | Line 50: | ||
* parsebbc: whether or not to parse bbcode in the readme; optional; defaults to false | * parsebbc: whether or not to parse bbcode in the readme; optional; defaults to false | ||
* type: "inline" or "file"; defaults to "file"; optional | * type: "inline" or "file"; defaults to "file"; optional | ||
* '''<code | * '''<code></code> or <code /> (for use with type="file" only)''' | ||
* Filename of a php file to be executed. | * Filename of a php file to be executed. | ||
* Deprecated use in SMF 2.0, please use <database | * Deprecated use in SMF 2.0, please use <database> in SMF 2.0 or higher | ||
* '''Optional''': Yes | * '''Optional''': Yes | ||
* '''Attributes''': | * '''Attributes''': | ||
* type: "inline" or "file"; defaults to "file"; optional</ul></ul> | * type: "inline" or "file"; defaults to "file"; optional</ul></ul> | ||
* '''<database | * '''<database></database> or <database /> (for use with type="file" only)''' | ||
* Filename of a database code to be executed. | * Filename of a database code to be executed. | ||
Line 66: | Line 66: | ||
* type: "inline" or "file"; defaults to "file"; optional | * type: "inline" or "file"; defaults to "file"; optional | ||
* '''<modification | * '''<modification></modification> or <modification /> (for use with type="file" only)''' | ||
* Instructions to take for a modification. | * Instructions to take for a modification. | ||
Line 72: | Line 72: | ||
* '''Attributes''': | * '''Attributes''': | ||
* type: if "inline", you may use the <file | * type: if "inline", you may use the <file>, <operation>, <search>, and <add> elements listed in the modification.xml documentation."inline" or "file"; defaults to "file"; optional | ||
* reverse: reverse the instructions; "true" or "false"; defaults to "false"; optional | * reverse: reverse the instructions; "true" or "false"; defaults to "false"; optional | ||
* format: this documentation only covers xml formatted modifications and it is recommended that you use this format; "xml" or "boardmod"; defaults to "xml"; optional | * format: this documentation only covers xml formatted modifications and it is recommended that you use this format; "xml" or "boardmod"; defaults to "xml"; optional | ||
* '''<create-dir / | * '''<create-dir />''' | ||
* Create a new directory. | * Create a new directory. | ||
Line 83: | Line 83: | ||
* name: the name of the directory | * name: the name of the directory | ||
* destination: the path of the directory where you want to create this new directory | * destination: the path of the directory where you want to create this new directory | ||
* '''<create-file / | * '''<create-file />''' | ||
* Create a blank file. | * Create a blank file. | ||
Line 91: | Line 91: | ||
* name: the name of the file | * name: the name of the file | ||
* destination: the path of the directory where you want to create this new file | * destination: the path of the directory where you want to create this new file | ||
* '''<require-dir / | * '''<require-dir />''' | ||
* Require a directory and all files in it from inside the package. | * Require a directory and all files in it from inside the package. | ||
Line 100: | Line 100: | ||
* name: the name of the directory | * name: the name of the directory | ||
* destination: the path of where you want to put this directory> | * destination: the path of where you want to put this directory> | ||
* '''<require-file / | * '''<require-file />''' | ||
* Require a file from inside the package. | * Require a file from inside the package. | ||
Line 109: | Line 109: | ||
* name: the name of the file | * name: the name of the file | ||
* destination: the path of where you want to put this file | * destination: the path of where you want to put this file | ||
* '''<move-dir / | * '''<move-dir />''' | ||
* Move an entire directory. May also be used to rename a directory by moving it to it's parent directory with a different name. | * Move an entire directory. May also be used to rename a directory by moving it to it's parent directory with a different name. | ||
Line 118: | Line 118: | ||
* name: the name of the directory | * name: the name of the directory | ||
* destination: the path to where you want to put the directory | * destination: the path to where you want to put the directory | ||
* '''<move-file / | * '''<move-file />''' | ||
* Move a file. May also be used to rename a file by moving it to it's parent directory with a different name. | * Move a file. May also be used to rename a file by moving it to it's parent directory with a different name. | ||
Line 127: | Line 127: | ||
* name: the name of the file | * name: the name of the file | ||
* destination: the path to where you want to put the file | * destination: the path to where you want to put the file | ||
* '''<remove-dir / | * '''<remove-dir />''' | ||
* Remove a directory and all files in it. | * Remove a directory and all files in it. | ||
Line 134: | Line 134: | ||
* name: the name and path of the directory to be removed | * name: the name and path of the directory to be removed | ||
* '''<remove-file / | * '''<remove-file />''' | ||
* Remove a file. | * Remove a file. | ||
Line 141: | Line 141: | ||
* name: the name and path of the file to be removed | * name: the name and path of the file to be removed | ||
* '''<redirect | * '''<redirect></redirect> or <redirect />''' | ||
* Redirect after install/upgrade/uninstall. | * Redirect after install/upgrade/uninstall. |
Revision as of 11:57, 1 July 2013
Before reading on, you should know some definitions used in this documentation:
- element aka tag: an instruction used to tell the package manager what to do. ie <install></install>
- attribute aka property: an additional value used to describe an element
- inline: code or text that is written in this file instead of coming from an outside source
- file: the name or location of a file to be used instead of "inline"
- location aka path: the location on the computer of a directory and/or file
There are also variables that may be used in place of a path.
- $sourcedir: The directory where the source files are contained (ie Post.php, Admin.php, etc)
- $boarddir: The directory where index.php is found. Usually one level beneath the source files are contained.
- $avatardir: The directory where the avatars may be found
- $themedir: The directory where the directories of the themes are located
- $imagesdir: The directory of the images for each theme
- $languagedir: The location of the directories of language files
- $smileysdir: The location of the smiley directory
package-info.xml All elements, unless otherwise stated, are not optional and contain no attributes.
- <package-info></package-info>
- Must encompass all other elements in the file.
- Attributes:
- xmlns: defaults to http://www.simplemachines.org/xml/package-info; optional
- <id></id>
- Contains the id of the package. Should be in the format of [username]:[package name]. For instance sleepy:LeetMod When submitting a mod to the mod site, the username should be your username from www.simplemachines.org
- <name></name>
- Contains the name of the package.
- <type></type>
- The type of package - "avatar", "language", or "modification".
- <version></version>
- The package's current version.
- <install></install>, <upgrade></upgrade>, and <uninstall></uninstall>
- Actions taken on installation. The elements and their attributes are the same for the install, upgrade, and uninstall elements.
- Attributes:
- for: What versions to install/upgrade/uninstall for. Comma delimited string with ranges such as "1.0-1.5,2.0"; optional
- from: Upgrade Only; What mod versions they are upgrading from. Comma delimited string with ranges such as "1.0-1.5,2.0"; optional
- Elements:
- <readme></readme> or <readme /> (for use with type="file" only)
- Filename of the readme file
- Optional: Yes
- Attributes:
- lang: which language this readme applies to; optional
- parsebbc: whether or not to parse bbcode in the readme; optional; defaults to false
- type: "inline" or "file"; defaults to "file"; optional
or
(for use with type="file" only)
- Filename of a php file to be executed.
- Deprecated use in SMF 2.0, please use <database> in SMF 2.0 or higher
- Optional: Yes
- Attributes:
- type: "inline" or "file"; defaults to "file"; optional
<database></database> or <database /> (for use with type="file" only)
- Filename of a database code to be executed.
- Only exists in SMF 2.0 or higher
- Optional: Yes
- Attributes:
- type: "inline" or "file"; defaults to "file"; optional
- <modification></modification> or <modification /> (for use with type="file" only)
- Instructions to take for a modification.
- Optional: Yes
- Attributes:
- type: if "inline", you may use the <file>, <operation>, <search>, and <add> elements listed in the modification.xml documentation."inline" or "file"; defaults to "file"; optional
- reverse: reverse the instructions; "true" or "false"; defaults to "false"; optional
- format: this documentation only covers xml formatted modifications and it is recommended that you use this format; "xml" or "boardmod"; defaults to "xml"; optional
- <create-dir />
- Create a new directory.
- Optional: Yes
- Attributes:
- name: the name of the directory
- destination: the path of the directory where you want to create this new directory
- <create-file />
- Create a blank file.
- Optional: Yes
- Attributes:
- name: the name of the file
- destination: the path of the directory where you want to create this new file
- <require-dir />
- Require a directory and all files in it from inside the package.
- Optional: Yes
- Attributes:
- from: the path to the directory
- name: the name of the directory
- destination: the path of where you want to put this directory>
- <require-file />
- Require a file from inside the package.
- Optional: Yes
- Attributes:
- from: the path to the file
- name: the name of the file
- destination: the path of where you want to put this file
- <move-dir />
- Move an entire directory. May also be used to rename a directory by moving it to it's parent directory with a different name.
- Optional: Yes
- Attributes:
- from: the path of the directory you want to move
- name: the name of the directory
- destination: the path to where you want to put the directory
- <move-file />
- Move a file. May also be used to rename a file by moving it to it's parent directory with a different name.
- Optional: Yes
- Attributes:
- from: the path of the file you want to move
- name: the name of the file
- destination: the path to where you want to put the file
- <remove-dir />
- Remove a directory and all files in it.
- Optional: Yes
- Attributes:
- name: the name and path of the directory to be removed
- <remove-file />
- Remove a file.
- Optional: Yes
- Attributes:
- name: the name and path of the file to be removed
- <redirect></redirect> or <redirect />
- Redirect after install/upgrade/uninstall.
- Optional: Yes
- Attributes:
- url: the url to redirect to; Required. "$boardurl", "$scripturl", and "$session_id" are accepted.
- type: inline or file. Whether to use a file or inline text for redirect text.
- timeout: Time until the redirect occurs. Default: 5 seconds