Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
[v1.1][Guide]Contentseite erstellen.
#1
Contentseiten sind die Seiten, die Inhalt im Zentrum der Webseite anbieten, wie Chaträume, ACP und co.

In der index.php suche

PHP-Code:
switch(ZE_INC){ 

füge darunter ein

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

Speichern. Anschliessend erstellen wir im Ordner /inc/ eine neue Datei namens mynewcontent.inc.php mit folgendem Grundgerüstinhalt:

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 );

?>

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


PHP-Code:
<div id="mynewcontent" class="tabcon" data-reloadable="true"><!--ID muss dem Dateinamen entsprechen! -->
 
 <div id="mynewcontent_holder">
 
   Mein Seiteninhalt
  
</div>
 
 <script>
 
 <!--Eventuelles JavaScript gehört hier her-->
 
 </script>
</div> 


Speichern. Nun müssen wir nur noch festlegen, wo und wie diese Seite zu öffnen/laden sein soll.
Öffne - immernoch im TPL ordner - die navigation.zyr und suche ein kleines Plätzchen für



PHP-Code:
 <li id="nav_mynewcontent" onclick="loadContent('mynewcontent', 'My New Content', '');"><div><class="ui-icon fa fa-newspaper-o fa-fw"></i>My New Content</div></li


Speichern. Nach dem Reload ist die Seite nun aufrufbar.
Beachte: "fa-newspaper-o" 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:
loadContent('mynewcontent''My New Content''&uid='+uid+'&sid='+sid); 



Die Box soll von anfang an geladen sein?

Öffne frontpage.tpl und füge vor oder nach



PHP-Code:
       <li><div class="tabiconwrapper"><span class="flr tabrefresher fa fa-refresh" role="presentation"></span><span><a href="#news">Community-News</a></span><span class="flr tabcloser fa fa-times" role="presentation"></span></div></li


ein:



PHP-Code:
       <li><div class="tabiconwrapper"><span class="flr tabrefresher fa fa-refresh" role="presentation"></span><span><a href="#mynewcontent">My New Content</a></span><span class="flr tabcloser fa fa-times" role="presentation"></span></div></li


Und vor oder nach



PHP-Code:
     <div id="news">
 
       {include="news"}
 
     </div


noch:



PHP-Code:
     <div id="mynewcontent">
 
       {include="mynewcontent"}
 
     </div

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/mynewcontent.inc.php'

Speichern.

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


Nachrichten in diesem Thema
[v1.1][Guide]Contentseite erstellen. - Zion - 30.08.2017, 23:02

Gehe zu:


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