Extra header and footer

Name: extrahf
Type: plugin
Version: 2009-07-05
Author: dervan


Requirements.

System: Seditio 121.

Note: plugin does not work under Cotonti, use revision for Cotonti.


Preface.

Extra custom header and footer depending on: page alias or category,
list category, forums section id or category, plug code.


Features.

1.
Templates for page.php.

The standard templates which are present in system.
For body, in searching priority:
- page.(add.|edit.|)`category`.tpl
- page.(add.|edit.|)tpl
For header, in searching priority:
- header.pages.tpl
- header.tpl
For footer, in searching priority:
- footer.pages.tpl
- footer.tpl

Plugin will search in skin directory for dedicated templates.
For header, in searching priority:
- header.pages.(`alias`|pg`page id`|(add.|edit.|)`category`).tpl
- header.pages.(add|edit).tpl (generic template)
For footer, in searching priority:
- footer.pages.(`alias`|pg`page id`|(add.|edit.|)`category`).tpl
- footer.pages.(add|edit).tpl (generic template)
Examples:
header.pages.runtime_error.tpl
header.pages.pg4.tpl
header.pages.edit.news.tpl
header.pages.news.tpl
footer.pages.add.tpl

If dedicated templates not found, then plugin will search
for standard templates.

Search order is configurable for header and footer. Search options:
- alias or page_id or category - alias, then page id, then category,
  then generic, then standard templates;
- category or alias or page_id - category, then alias, then page id,
  then generic, then standard templates;
- alias or page_id - alias, then page id, then standard templates;
- category - category, then generic, then standard templates;
- default - standard templates only.

2.
Templates for list.php.

The standard templates which are present in system.
For body, in searching priority:
- list.(group.|)`category`.tpl
- list.(group.|)tpl
For header, in searching priority:
- header.pages.tpl
- header.tpl
For footer, in searching priority:
- footer.pages.tpl
- footer.tpl

Plugin will search in skin directory for dedicated templates.
For header, in searching priority:
- header.list.(group.|)`category`.tpl
- header.list.(group.|)tpl (generic template)
For footer, in searching priority:
- footer.list.(group.|)`category`.tpl
- footer.list.(group.|)tpl (generic template)
Examples:
header.list.group.heap.tpl
header.list.group.tpl
footer.list.tpl

If dedicated templates not found, then plugin will search
for standard templates.

Search order is configurable for header and footer. Search options:
- category - category, then generic, then standard templates;
- default - standard templates only.

3.
Templates for forums.php.

The standard templates which are present in system.
For body, in searching priority:
- forums.sections.tpl
- forums.(editpost|newtopic|posts|topics).`category`.`section id`.tpl
- forums.(editpost|newtopic|posts|topics).`category`.tpl
- forums.(editpost|newtopic|posts|topics).tpl
- forums.tpl (lowest priority template for editpost, newtopic, posts, topics)
For header, in searching priority:
- header.forums.tpl
- header.tpl
For footer, in searching priority:
- footer.forums.tpl
- footer.tpl

Plugin will search in skin directory for dedicated templates.
For header, in searching priority:
- header.forums.sections.tpl
- header.forums.(editpost|newtopic|posts|topics).(fs`section id`|`category`).tpl
- header.forums.(fs`section id`|`category`).tpl
- header.forums.(editpost|newtopic|posts|topics).tpl (generic template)
For footer, in searching priority:
- footer.forums.sections.tpl
- footer.forums.(editpost|newtopic|posts|topics).(fs`section id`|`category`).tpl
- footer.forums.(fs`section id`|`category`).tpl
- footer.forums.(editpost|newtopic|posts|topics).tpl (generic template)
Examples:
header.forums.sections.tpl
header.forums.posts.fs2.tpl
header.forums.fs2.tpl
header.forums.newtopic.tpl
footer.forums.topics.pub.tpl
footer.forums.pub.tpl

If dedicated templates not found, then plugin will search
for standard templates.

Search order is configurable for header and footer. Search options:
- section_id or category - section id, then category, then generic,
  then standard templates;
- category or section_id - category, then section id, then generic,
  then standard templates;
- section_id - section id, then generic, then standard templates;
- category - category, then generic, then standard templates;
- default - standard templates only.

4.
Templates for plug.php.

The standard templates which are present in system.
For body, in searching priority:
- plugin.standalone.`code`.tpl
- `code`.tpl
- plugin.tpl
For header, in searching priority:
- header.plugins.tpl
- header.tpl
For footer, in searching priority:
- footer.plugins.tpl
- footer.tpl

Plugin will search in skin directory for dedicated templates.
For header:
- header.plugins.`code`.tpl
For footer:
- footer.plugins.`code`.tpl
Examples:
header.plugins.search.tpl
footer.plugins.search.tpl

If dedicated templates not found, then plugin will search
for standard templates.

Search order is configurable for header and footer. Search options:
- code - code (i.e. name of plug), then standard templates;
- default - standard templates only.


Important details.

Only these characters in `alias` and `category` are allowed for file names:
english alphabet, digits, '-', '_'.

Plugin will convert not allowed characters.

For `alias` field:
- deleting not allowed characters (by system);
- lowercase for resulting string (by this plugin).
Example:
alias 'News-My_family' will correspond to file with name
'header.pages.news-my_family.tpl'.

For `category` field:
- replacing spaces and dots with '_';
- deleting other not allowed characters;
- lowercase for resulting string.
Example:
category with code 'News. My family!' will correspond to file with name
'header.pages.news__my_family.tpl'.

Warning!
Converted values must satisfy the following conditions to avoid mistakes search:
- for page and list: should not be the same with converted values of `category`
  and converted values of `alias` and values of pg`page id`, and these converted
  values should be not equal to 'add', 'edit', 'group';
- for forums: should not be the same with converted values of `category` and
  values of fs`section id`, and these converted values of `category` should
  be not equal to 'editpost', 'newtopic', 'posts', 'topics'.


Installation.

1.
Set value in system/functions.php:
$cfg['enablecustomhf'] = true;
2.
Copy 'extrahf' directory with plugin files to 'plugins' directory.
3.
Log into Administration panel and install plugin.


Package.

extrahf/extrahf.setup.php
extrahf/extrahf.header.main.php
extrahf/extrahf.header.tags.php
extrahf/extrahf.footer.main.php
extrahf/extrahf.footer.tags.php
extrahf/inc/extrahf.functions.pages.php
extrahf/inc/extrahf.functions.list.php
extrahf/inc/extrahf.functions.forums.php
extrahf/inc/extrahf.functions.plugins.php

extrahf/doc/.htaccess
extrahf/doc/extrahf.en.readme.txt
extrahf/doc/extrahf.ru.readme.txt
