|
@@ -24,14 +24,27 @@ if (!defined('SMF'))
|
|
*/
|
|
*/
|
|
function ShowHelp()
|
|
function ShowHelp()
|
|
{
|
|
{
|
|
- global $scripturl, $context, $txt;
|
|
|
|
-
|
|
|
|
loadTemplate('Help');
|
|
loadTemplate('Help');
|
|
loadLanguage('Manual');
|
|
loadLanguage('Manual');
|
|
|
|
|
|
|
|
+ $subActions = array(
|
|
|
|
+ 'index' => 'HelpIndex',
|
|
|
|
+ 'rules' => 'HelpRules',
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $sa = isset($_GET['sa'], $subActions[$_GET['sa']]) ? $_GET['sa'] : 'index';
|
|
|
|
+ $subActions[$sa]();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function HelpIndex()
|
|
|
|
+{
|
|
|
|
+ global $scripturl, $context, $txt;
|
|
|
|
+
|
|
// We need to know where our wiki is.
|
|
// We need to know where our wiki is.
|
|
$context['wiki_url'] = 'http://wiki.simplemachines.org/smf';
|
|
$context['wiki_url'] = 'http://wiki.simplemachines.org/smf';
|
|
|
|
|
|
|
|
+ $context['canonical_url'] = $scripturl . '?action=help';
|
|
|
|
+
|
|
// Sections were are going to link...
|
|
// Sections were are going to link...
|
|
$context['manual_sections'] = array(
|
|
$context['manual_sections'] = array(
|
|
'registering' => 'Registering',
|
|
'registering' => 'Registering',
|
|
@@ -57,6 +70,41 @@ function ShowHelp()
|
|
$context['sub_template'] = 'manual';
|
|
$context['sub_template'] = 'manual';
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function HelpRules()
|
|
|
|
+{
|
|
|
|
+ global $context, $txt, $boarddir, $user_info, $scripturl;
|
|
|
|
+
|
|
|
|
+ // Build the link tree.
|
|
|
|
+ $context['linktree'][] = array(
|
|
|
|
+ 'url' => $scripturl . '?action=help',
|
|
|
|
+ 'name' => $txt['help'],
|
|
|
|
+ );
|
|
|
|
+ $context['linktree'][] = array(
|
|
|
|
+ 'url' => $scripturl . '?action=help;sa=rules',
|
|
|
|
+ 'name' => $txt['terms_and_rules'],
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ // Have we got a localized one?
|
|
|
|
+ if (file_exists($boarddir . '/agreement.' . $user_info['language'] . '.txt'))
|
|
|
|
+ $context['agreement'] = parse_bbc(file_get_contents($boarddir . '/agreement.' . $user_info['language'] . '.txt'), true, 'agreement_' . $user_info['language']);
|
|
|
|
+ elseif (file_exists($boarddir . '/agreement.txt'))
|
|
|
|
+ $context['agreement'] = parse_bbc(file_get_contents($boarddir . '/agreement.txt'), true, 'agreement');
|
|
|
|
+ else
|
|
|
|
+ $context['agreement'] = '';
|
|
|
|
+
|
|
|
|
+ // Nothing to show, so let's get out of here
|
|
|
|
+ if (empty($context['agreement']))
|
|
|
|
+ {
|
|
|
|
+ // No file found or a blank file! Just leave...
|
|
|
|
+ redirectexit();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $context['canonical_url'] = $scripturl . '?action=help;sa=rules';
|
|
|
|
+
|
|
|
|
+ $context['page_title'] = $txt['terms_and_rules'];
|
|
|
|
+ $context['sub_template'] = 'terms';
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Show some of the more detailed help to give the admin an idea...
|
|
* Show some of the more detailed help to give the admin an idea...
|
|
* It shows a popup for administrative or user help.
|
|
* It shows a popup for administrative or user help.
|