Vielen Dank. Hat geklappt.
Ich habe 5 tpl-(function) gegeben für prev-top-next. Der Grund war, Drafiken statt Texte zu nutzen, ohne in languages oder config etwas ändern zu müssen. :
- für next - function tpl_previouspage_left() oder function tpl_previouspage_top()
- für next - function tpl_nextpage_right() oder function tpl_nextpage_down()
- für top - function tpl_top()
Falls es jemand braucht:
1. die Ikonen (top,right, bottom, left) vorbereiten und unter [template]/images speichern
2.
3. in tplfuncs.php erweitern
Code: Select all
function tpl_previouspage_left()
{
global $tx, $pth;
$index = XH_findPreviousPage();
if ($index !== false) {
return a($index, '" rel="prev" alt="' . $tx['navigator']['previous'])
. tag("img src=\"{$pth['folder']['templateimages']}button-left-0.png\" onmouseout='this.src=\"{$pth['folder']['templateimages']}button-left-0.png\"' onmouseover='this.src=\"{$pth['folder']['templateimages']}button-left-1.png\"' alt=\"{$$tx['navigator']['previous']}\"") . '</a>';
}
}
function tpl_nextpage_right()
{
global $tx, $pth;
$index = XH_findNextPage();
if ($index !== false) {
return a($index, '" rel="next" alt="' . $tx['navigator']['next']) . tag("img src=\"{$pth['folder']['templateimages']}button-right-0.png\" onmouseout='this.src=\"{$pth['folder']['templateimages']}button-right-0.png\"' onmouseover='this.src=\"{$pth['folder']['templateimages']}button-right-1.png\"' alt=\"{$$tx['navigator']['next']}\"") . '</a>';
}
}
function tpl_previouspage_top()
{
global $tx, $pth;
$index = XH_findPreviousPage();
if ($index !== false) {
return a($index, '" rel="prev" alt="' . $tx['navigator']['previous'])
. tag("img src=\"{$pth['folder']['templateimages']}button-top-0.png\" onmouseout='this.src=\"{$pth['folder']['templateimages']}button-top-0.png\"' onmouseover='this.src=\"{$pth['folder']['templateimages']}button-top-1.png\"' alt=\"{$$tx['navigator']['previous']}\"") . '</a>';
}
}
function tpl_nextpage_bottom()
{
global $tx, $pth;
$index = XH_findNextPage();
if ($index !== false) {
return a($index, '" rel="next" alt="' . $tx['navigator']['next']) . tag("img src=\"{$pth['folder']['templateimages']}button-bottom-0.png\" onmouseout='this.src=\"{$pth['folder']['templateimages']}button-bottom-0.png\"' onmouseover='this.src=\"{$pth['folder']['templateimages']}button-bottom-1.png\"' alt=\"{$$tx['navigator']['previous']}\"") . '</a>';
}
}
function tpl_top()
{
global $tx, $pth;
return '<a href="./#TOP">' . tag("img src=\"{$pth['folder']['templateimages']}button-top-0.png\" onmouseout='this.src=\"{$pth['folder']['templateimages']}button-top-0.png\"' onmouseover='this.src=\"{$pth['folder']['templateimages']}button-top-1.png\"' alt=\"{$ptx['navigator']['top']}\"") . '</a>';
}
4. in stylesheet.css
Code: Select all
.top{cursor: pointer; position: fixed; left: 50%; right: 50%; bottom: 10px;}
.previous_page, .next_page{ position: fixed; top: 50%; z-index: 100; cursor: pointer;}
.previous_page{ left: 0;}
.next_page{ right: 0;}
5. in template.htm
Code: Select all
<div class="previous_page"><?php echo tpl_previouspage_left();?></div>
<div class="next_page"><?php echo tpl_nextpage_right();?></div>
<div class="top"><?php echo tpl_top();?></div>
Noch möchte ich eine ÖscrollDown Funktion schreiben. Die braucht aber javascript nutzen. Ich habe einige Anleitungen am Internet gefunden. Das funktioniert aber nicht:
Code: Select all
<?php
function tpl_scrollDown()
{
global $tx, $pth;
echo "<script type = 'text/javascript'>function scrollWin() {window.scrollBy(0, window.innerHeight-100)}</script>"; //change the value if needed
return tag("img src=\"$pth['folder']['templateimages']}button-bottom-0.png\" onmouseout='this.src=\"{$pth['folder']['templateimages']}button-bottom-0.png\"' onmouseover='this.src=\"{$pth['folder']['templateimages']}button-bottom-1.png\"' onclick=\"scrollWin()\" alt=\"SCROLL DOWN\"");
}