> Создание ответа
Имя: Гость Вы зарегистрированы?
Помощь по ExBBCodes
С помощью кодов можно очень легко применять различные виды стилей к выделенному тексту.
Текст сообщения
Смайлики

smilie smilie smilie smilie smilie
smilie smilie smilie smilie smilie
smilie smilie smilie smilie smilie

все смайлики
Опции сообщения Вы хотите разрешить смайлики в этом сообщении?
   

> Обзор темы: Описание структуры файла modification.xml (новые сообщения вверху)

 
Отправлено: 6 сентября 2014 — 22:47
цитировать Post Id


NordWest

Попробую перевести описание структуры файла modification.xml

Для начала определимся с терминологией:
element или tag: в теги заключены инструкции для установщика, указывающие, что ему делать, например
attribute или property: дополнительный параметр в тегах, конкретизирующий инструкцию
inline: код или текст, который будет подлежать замене
file: имя файла, который подлежит изменению
location или path: путь к файлу или директории
ignore: используется для игнорирования ошибок
skip: пропустить данную операцию
fatal: прерывает установку модификации и выдает код ошибки

Так же следует пояснить смысл некоторых переменных
$boarddir: Корневой каталог форума. Обычно это каталог, в котором расположен index.php
$sourcedir: Путь к каталогу Sources в котором расположены основные файлы движка (например Post.php, Admin.php и другие)
$avatardir: Путь к каталогу Avatars в котором расположены аватары.
$themedir: Путь к каталогу с текущей темой оформления
$themes_dir: Путь к каталогу со всеми темами
$imagesdir: Путь к директории с рисунками, используемые в выбранной теме
$languagedir: Путь к директории с языковыми файлами
$smileysdir: Путь к директории со смайлами

modification.xml
Все теги, если явно не указано иное, не являются обязательными и не обязаны содержать атрибуты.


  • Описание:
    Основной тег, внутри которого должны быть расположены все другие теги.
  • Атрибуты:
    xmlns: по умолчанию "http://www.simplemachines.org/xml/modification"; опционально


  • Описание:
    Contains the id of the package. Should be in the format of [username]:[package name]. For instance groundup:bestmod When submitting a mod to the mod site, the username should be your username from www.simplemachines.org


  • Описание:
    The package's current version.


  • Описание:
    The file to modify. Including all of the operations to take on this file.
  • Attributes:
    name: the name of the file and path
    error: what to do when this file cannot be modified; "ignore" "fatal" or "skip"; use "ignore" to create a new file; optional; default to "fatal"
  • Elements:


  • Описание:
    An operation to be perfomed on this file
  • Attributes:
    error: what to do if this operation can not be performed; "ignore" "fatal" or "required"; use "required" if this operation must fail; defaults to "fatal"; optional
  • Elements:


or (for use with position="end" only)
  • Описание:
    The code to search for
  • Attributes:
    position: the position of where the search code should exist after changes: "before" (to put the code before your addition), "after" (to put the code after your addition), or "replace"; required
    whitespace: Whether to ignore whitespace or not: "exact" (default) or "loose"; optional; default: exact
    regexp: If the search is a regularexpression or not. "true" or "false"; optional; default: false


  • Описание:
    The code to add

(Добавление)
Пример:
PHP:


if (empty($options['view_newest_first']))
$counter++;
else
$counter--;
]]>

// Allow editing $output array
call_integration_hook('integrate_message', array(&$output));
call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
]]>


 
 Top

Powered by ExBB v1.1.180311