Hallo,
ich habe mir oben mit Hilfe eines Freundes das Menü um einen zusätzlichen Punkt erweitert.
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.netsnoop.de%2Fbilder%2Fmenue.jpg&hash=960638c32215bac738193df11a48e278c7cb0030)
Am Anfang habe ich mir gedacht, ich mache das mit einem Artikel. Das hat auch alles funktioniert aber der Button im Menü wurde nicht aktiv wenn die Seite angezeigt wurde:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.netsnoop.de%2Fbilder%2Fstadtplan.jpg&hash=b3d0c607ebb4c310a76a302c741a49ea6c2a393a)
Dann wurde folgender Code geändert:
1. Wurde eine neue Datei mit den Namen Stadtplan.templates.php erstellt und in das Verzeichnis /Themes/DEIN_TEMPLATE/ kopiert:
<?php
function template_main()
{
echo '
<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Stadtplan</td>
</tr>
<tr>
<td class="windowbg">';
// Hier dein Code
echo 'Soo hier musst du nur noch deinen Code einfügen.<br />
<br />
Öffne die Themes/DEIN_TEMPLATE/Stadtplan.templates.php und ändere diesen Text hier...
';
echo '
</td>
</tr>
</table>
</form>';
}
?>
2. Eine Datei mit den Namen Stadtplan.php mit folgendem Inhalt erstellt und in das Verzeichniss /Sources/ kopiert:
<?php
if (!defined('SMF'))
die('Hacking attempt...');
Function Stadtplan()
{
global $txt, $scripturl, $db_prefix, $context;
LoadTemplate('Stadtplan');
$context['page_title'] = "Diesen Text kannst du in der /Sources/Stadtplan.php ändern ;0)";
$context['linktree'][] = array(
'url' => $scripturl . '?action=stadtplan',
'name' => $txt['stadtplan']
);
}
3. Dann wurde die /index.php noch wie folgt geändert:
nach:
'stats' => array('Stats.php', 'DisplayStats'),
folgendes:
'stadtplan' => array('Stadtplan.php', 'Stadtplan'),
4. Dann in /Themes/DEIN_TEMPLATE/index.template.php noch modifiziert:
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
wurde ersetzt mit:
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'stadtplan')))
und dann nach folgendem Code gesucht:
// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
und davor eingefügt:
// Show the [Stadtplan] button.
echo ($current_action == 'stadtplan' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'stadtplan' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=stadtplan">Stadtplan</a>
</td>' , $current_action == 'stadtplan' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
Nun wird der Button zwar aktiv, aber die Blöcke links und rechts fehlen.
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.netsnoop.de%2Fbilder%2Fstadtplan_.jpg&hash=94807ad8321a75ca8e049b65a3596b22925d2ea1)
Kann mir da jemand helfen?
Gruß Netsnoop
Probier mal in der Stadtplan.php folgendes hinzuzufügen:
//Load the main template
$context['sub_template'] = 'main';
Hallo Lemming,
danke für Deine Antwort, hat aber leider nicht funktioniert.Hast Du vielleicht noch ne andere Idee?
Gruß Netsnoop