TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 05, 2024, 04:43:36 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 232
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 160
  • Total: 161
  • @rjen

Wie Blöcke rechts und links einblenden lassen?

Started by Netsnoop, June 15, 2007, 07:27:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Netsnoop

Hallo,


ich habe mir oben mit Hilfe eines Freundes das Menü um einen zusätzlichen Punkt erweitert.



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:




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&uuml;gen.<br />
<br />
&Ouml;ffne die Themes/DEIN_TEMPLATE/Stadtplan.templates.php und &auml;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 &auml;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 . '">&nbsp;</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 . '">&nbsp;</td>' : '';


und davor eingefügt:


   // Show the [Stadtplan] button.
echo ($current_action == 'stadtplan' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</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 . '">&nbsp;</td>' : '';




Nun wird der Button zwar aktiv, aber die Blöcke links und rechts fehlen.





Kann mir da jemand helfen?


Gruß Netsnoop

Tommy

#1
Probier mal in der Stadtplan.php folgendes hinzuzufügen:

//Load the main template
$context['sub_template']  = 'main';

Netsnoop

Hallo Lemming,

danke für Deine Antwort, hat aber leider nicht funktioniert.Hast Du vielleicht noch ne andere Idee?


Gruß Netsnoop