Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
[v1.1][Guide]Seitenbox erstellen.
#1
Zuerst in der index.php suchen:

PHP-Code:
//        Including correct inc file
switch(ZE_INC){ 

Darunter einfügen:

PHP-Code:
 case 'mynewbox':
 
   $TPL_DONT 0;
 
   $TPL 'mynewbox';
 
   require_once './inc/mynewbox.inc.php';
 
   break

Abspeichern.

Unter /inc/ die Datei mynewbox.inc.php anlegen und mit der Grunstruktur füllen:

PHP-Code:
<?php

/**
 *        This file is part of "Zephyr v01".
 *
 *        "Zephyr v01" is free softwore. Feel free to use and/or modify
 *        it under the terms of the GNU General Public License as published by
 *        the Free Software Foundation; either version 3 of the License, or
 *        (at your option) any later version.
 *
 *        "Zephyr v01" is distributed in the hope that it will be useful,
 *        but WITHOUT ANY WARRANTY; without even the implied warranty of
 *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *        GNU General Public License for more details.
 *
 *        You should have received a copy of the GNU General Public License
 *        along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *        Developed by Alexander Pakusch aka Zion, 2015
 *        <admin@zevolutions.de>
 *
 *        Developed by Johanna Fegg aka Holly, 2015
 *        <holly@zevolutions.de>
 *
 *        CREATED BY DEINNAME, JAHR
 *        <deinkontakt>
 *
 *        You are not allowed to sell this software or remove the Copyrights.
 *
 *        <http://www.zevolutions.de/>
 */

if($inc == '') {
  goto tplVars;
}

//Initiate Zephyr Parser - DO NOT CHANGE!
require_once './class/zephyr.class.php';
$tpl_path 'styles/'.ZE_USED_STYLE.'/tpl/';
zephyr::configure("base_url"NULL );
zephyr::configure("tpl_dir"$tpl_path );
zephyr::configure("cache_dir""cache/" );
zephyr::configure("path_replace"false);
$ZE_TPL = new zephyr;
//Zephyr Parser initiated, you may change below

tplVars:

//Include SessionClass. Kann entfernt werden, wenn es unnötig ist, eingeloggt zu sein
require_once './class/session.class.php';
$ZE_SESS = new session($db);


//Weitere Classes werden hier geladen

//Ggf die SessionID abfangen. Kann entfernt werden, wenn es unnötig ist, eingeloggt zu sein
if(isset($_GET["sid"])) {
  $sid htmlspecialchars($_GET["sid"]);
  } elseif(isset($_POST["sid"])) {
    $sid htmlspecialchars($_POST["sid"]);
  } else {
  $sid '';
}
//SessionID ende

//SessionID an das Template übertragen
$ZE_TPL->assign("ZE_SID"$sid );

?>

Abspeichern. Nun gehen wir in euren Style-Ordner über und erstellen unter /styles/{STYLENAME}/tpl/ die Datei mynewbox.zyr und füllen auch diese mit der Grundstruktur:

PHP-Code:
<div class="widget side" id="mynewbox" data-reloadable="true"><!-- ID muss dem Dateinamen entsprechen! -->
 
 <header class="ui-widget-header whead">
 
   <span class="fll curpoint fa fa-refresh" style="margin-left: 2px; margin-top: 2px" role="presentation"></span>
 
     Meine neue Box<!--Titel der neuen Box-->
 
   <span class="flr curpoint fa fa-times" style="margin-right: 2px; margin-top: 2px" role="presentation"></span>
 
 </header>
 
 <div class="content" style="text-align: center">
 
   Mein neuer Inhalt<!--Inhalt der neuen Box-->
 
 </div>
 
 <!--Eventuelles Javascript gehört hier her.-->
 
 <script>
 
 </script>
</div> 

Nochmals abspeichern. Nun müssen wir nur noch festlegen, wo und wie diese Box zu öffnen/laden sein soll.
Hier öffne ich immernoch im TPL ordner die navigation.zyr und suche mir ein kleines Plätzchen für

PHP-Code:
       <li id="nav_mynewbox"><div><class="ui-icon fa fa-cubes fa-fw"></i>Meine neue Box&nbsp;&nbsp;</div>
 
         <ul>
 
           <li onclick="loadBox('mynewbox', 'left', '&sid={$SID}');"><div><class="ui-icon fa fa-angle-double-left fa-fw"></i>Links</div></li>
 
           <li onclick="loadBox('mynewbox', 'right', '&sid={$SID}');"><div><class="ui-icon fa fa-angle-double-right fa-fw"></i>Rechts</div></li>
 
         </ul>
 
       </li

Abspeichern, reloaden und ich kann meine neue Box öffnen.
Beachte: "fa-cubes" kann jedes Icon sein, das du auf fontawesome.io findest.

Sie soll beim Login automatisch geöffnet werden?

Öffne /js/login.js und suche

PHP-Code:
loadBox('roomlist'side'&uid='+uid+'&sid='+sid); 

Darunter setze einfach:

PHP-Code:
loadBox('mynewbox'side'&uid='+uid+'&sid='+sid); 

Die Box soll von anfang an geladen sein?
Öffne frontpage.tpl und füge in einer der beiden "widgetholder" ein:

PHP-Code:
{include="mynewbox"

Speichern. In der index.php suche nun:

PHP-Code:
 default:
 
   $TPL_DONT 0;
 
   $TPL 'frontpage';
 
   require_once './inc/frontpage.inc.php';
 
   require_once './inc/onlinelist.inc.php';
 
   require_once './inc/loginbox.inc.php';
 
   require_once './inc/news.inc.php'

Und füge darunter ein:

PHP-Code:
require_once './inc/mynewbox.inc.php'

Speichern.

Und so haben wir eine neue Box im Chat.
Es gibt keine dummen Antworten - nur dumme Fragen.
Antworten
  


Nachrichten in diesem Thema
[v1.1][Guide]Seitenbox erstellen. - Zion - 30.08.2017, 14:45

Gehe zu:


Benutzer, die gerade dieses Thema anschauen:
1 Gast/Gäste