The following example illustrates the operation of LiBe CMS.
The source code is limited to the essentials: The HTML tags and id and class attributes can be added or adjusted depending on the requirements, or the individual areas at other locations, or with additional queries in the templates.
The source code, or portions thereof, may be used as a basis for the index.php of your template. (Folder / template / my template folder / index.php)

Legend:

HTML CODE is black

PHP CODE is blau

Kommentare is gray

 

to get an idea for the usage of the sections, take a look at the images right to it.

Source Code Beispiel: index.php

<!DOCTYPE html>

<html lang="de">

 

<?php /*----------------------------------------------------------------------------------------------------------

Head

--------------------------------------------------------------------------------------------------------------*/ ?>

 

<head>

<?php //HEAD contains meta, title, Stylesheets and Scripts... ?>

<meta charset="windows-1252" />

<title><?php echo $title;?></title>

<link rel="stylesheet" href="<?php echo $firstparturl,$templatedir;?>main.css" type="text/css" />

<?php if (!empty($meta)) echo "<meta name=\"description\" content=\"", $meta,"\" />";?>

 

<?php //for a faster loading: some scripts should mabe positioned at the end of the code, not in the header... ?>

<script type="text/javascript" src="<?php echo $firstparturl;?>plugins/jquery/jquery-1.7.2.min.js"></script>

</head>

 

 

<?php /*----------------------------------------------------------------------------------------------------------

Body

--------------------------------------------------------------------------------------------------------------*/ ?>

 

<body>

<header> Beispiel für Headlines 

<?php //Headlines tilte and description... ?>

<h1><?php echo $title;?></h1><?php //display the title of the topic ?>  

<h2><?php if (!empty($smalldescription)) echo $smalldescription; else echo $page_description;?></h2>  <?php //display the description of the topic ?>

</header> 

 

<?php /*----------------------------------------------------------------------------------------------------------

NAV Site Navigation Beispiel Navigation: hier Dropdown Menü 

--------------------------------------------------------------------------------------------------------------*/ ?>

 

<nav>

<?php //Site Navigation... ?>

<ul><?php //buildmenuul starts using <li>, so we have do define <ul>?>


<?php // define css classes, it is not necessary to add this variables if you do not need to change them:

$css_class_dropdown="dropdown";//class is applied to <li> if a submenu is available

$css_class_dropdown_depth="1";//on which level should dropdown be applied ...

$css_class_li_active="active";//class if the article is active

$css_class_li_level[0]="li0";//$css_class_li_level is an array so we can define every nested class by using its level number

$css_class_a_level[0]="a0";//$css_class_a_level is an array so we can define every nested class by using its level number

$css_class_ul_level[0]="ul0";//$css_class_ul_level is an array so we can define every nested class by using its level number

 

echo buildmenuul("2",0, "2"); //builds a nested ul li menu: <li><a href=""></a><ul><li><a href=""></a></li></ul></li>

//buildmenuul("end_level","submenu","collapse","limit")

//end_level means for nested ul till which level it should be processed

//submenu should be "0", is only used for additional menues take a look at: http://cms.libe.net/index.php/mehrere-Mens-erstellen

//collapse means collapse the menu till the defined level

//limit means only the number of list elements

 

unset($css_class_dropdown);unset($css_class_li_level);unset($css_class_a_level);unset($css_class_ul_level); //unset the classes

?>

</ul>

</nav>

 

<?php /*----------------------------------------------------------------------------------------------------------

Breadcrumb NAV Beispiel: Breadcrumb 

--------------------------------------------------------------------------------------------------------------*/ ?>

<nav>

<?php //breadcrumb...
if ($start!=1) //only if it is not the Startpage

echo "<ol><li><a href=$firstparturl>HOME</a></li>".breadcrumb("<li><a href=\"%linkurl%\">%titlemenu%</a></li>")."<li>$titel</li> </ol>"; //the function breadcrumb can include the HTML Source Code using Variables, take a look at: http://cms.libe.net/index.php/Vorlagen-anpassen#platzhalterhtmltemplate

?>

</nav>

 

<?php /*----------------------------------------------------------------------------------------------------------

Article Beispiel: Artikel: Inhalt 

--------------------------------------------------------------------------------------------------------------*/ ?>

<article>

<?php //Main article ... ?>

<?php echo $text;?>

</article>

 

<?php /*----------------------------------------------------------------------------------------------------------

Section News Startpage Beispiel News Startpage 

--------------------------------------------------------------------------------------------------------------*/ ?>

<section>

<?php //News Section on Startpage: ... 

if ($start==1) //only on the Startpage

{

$html_template="<li><a href=\"%linkurl%\"><img alt=\"%titlemenu%\" src=\"%image150%\"></a>
%datetime%
<a href=\"%linkurl%\">%titlemenu%</a>
%textpagebreak%

<a href=\"%linkurl%\">%smalldescription%</a>
</li>"; //modify this Template to fit your needs, see http://cms.libe.net/index.php/Vorlagen-anpassen#platzhalterhtmltemplate

 

$newest= newest(4,0);//prepare Variable Newest: 

//newest("number of News","Start from")

//Start from should be 0, means the newest article; 3 for example: start from the 3rd newest article

if (strlen($newest)>81) //display News only if there are News defined

{

echo "<h1 class=\"page-header\">New Topics <a href=\"$firstparturl"."rss.php\"><img src=\"". $firstparturl. "image/rss.png\" alt=\"Newsfeed\" style=\"border:0\"></a></h1>";//Headline and Link to the rss Newsfeed

echo $newest;

}

}?>

</section>

 

<?php /*----------------------------------------------------------------------------------------------------------

Section Feedbacks Beispiel: Feedbacks 

--------------------------------------------------------------------------------------------------------------*/ ?>

<section>

<?php //add user Feedbacks Module to the site

if ($addfeedback==1) //if Feedbacks Checkbox is selected in the article

{

echo "<h1>Feedback:</h1>";

include("plugins/libe/feedback.php");

}

?>

</section>

 

<?php /*----------------------------------------------------------------------------------------------------------

Menu Subtopics Beispiel Menu Subtopics 

--------------------------------------------------------------------------------------------------------------*/ ?>

<section>

<?php //if there are subtopics build a menu (links and thumbnails)
//Variables used in buildmenu function:
$css_clearfix=3;//echo 3rd add an extra html code:

$css_clearfix_tag="<div></div>";//this is the extra html code
$html_template="<a href=\"%linkurl%\"><img alt=\"%titlemenu%\" class=\"img-thumbnail scale\" src=\"%image150%\"></a>

%titlemenu% %smalldescription% %textpagebreak%

<a href=\"%linkurl%\">%titlemenu%</a>\n";//HTML Template for buildmenu take a look at Platzhalter html_template
if ($start!=1 and $search!=1 and $existing_sub) //if it is not the startpage search and if there are submenus

echo buildmenu($level+1,$level+1,$level+1);//call the buildmenu using $html_template $level+1 means submenues of the active article (having $level)

unset($html_template);unset($css_clearfix);unset($css_clearfix_tag);//unset css variables
?>

</section>

<?php /*----------------------------------------------------------------------------------------------------------

Nav Previous Next Beispiel Previous Next 

--------------------------------------------------------------------------------------------------------------*/ ?>

<?php if ($start!=1 and $level>1){//only if it is not the startpage and has a level > 1, means 2nd Subtopic and deeper

?>

<nav>

<?php //previous and next topic
echo prev_topic("<a href=\"%linkurl%#breadcrumb\" class=\"prev_topic\">%titlemenu%</a>\n");//the function prev_topc can include the HTML Source Code using Variables, take a look at: Platzhalter html_template
echo next_topic("<a href=\"%linkurl%#breadcrumb\" class=\"next_topic\">%titlemenu%</a>\n");//the function next_topic can include the HTML Source Code using Variables, take a look at: Platzhalter html_template
?>

</nav>

<?php }//end for the Selection start and level?>

 

<?php /*----------------------------------------------------------------------------------------------------------

Form Search Beispiel Search 

--------------------------------------------------------------------------------------------------------------*/ ?>

<form role="search" action="<?php echo $firstparturl;?>index.php/search/" method="get">

<input placeholder="Search on this Page" type="search" name="s" value="" />
<input type="submit" value="suche"/>
</form>

 

<?php /*----------------------------------------------------------------------------------------------------------

Footer Beispiel Footer 

--------------------------------------------------------------------------------------------------------------*/ ?>

<footer> 

<?php echo loadcontent("footer-text");//load the Content which is saved in the special topic Footer-text, such texts can be included in all parts of the website, this is just an example?>

<?php //Footer element: contains Copyright, Impressum, ... ?>

Copyright Notice,

<small><a href="http://cms.libe.net">powered by LiBe CMS</a></small>

<?php

echo $page_title;//display the page_title which is defined in Settings

echo $page_description;//display the page_description which is defined in Settings

 

if ($start==1) echo singlelink("Impressum"); //display a link to Impressum if there is a content in it

?> 

</footer>

<?php include("plugins/libe/counter.php"); //activates the Usercounter, prerequisite is to add the Folder  /counter on your Webserver and give write access to it

?>

 

</body>

</html>