Hallo Toflar,
Hallo xchs,
vielen Dank für eure schnellen Antworten.
@Toflar: Also im Template ging alles wunderbar (is ja klar, is ja im Grunde ein PHP) aber im Modul "eigenes HTML" geht es nicht. Da löscht es mir die PHP-Tags einfach raus, obwohl ich das unter "System" => "Einstellungen" => "Erlaubte HTML-Tags" hinzugefügt habe.
@xchs: Leider nützt mir eine CSS-Browserweiche nicht viel, da ich Flash-Inhalte durch MooTools-Inhalte ersetzen möchte. Oder geht das damit auch? Ich bin ja absoluter Anfänger eigentlich.
Ich wäre folgenden Weg gegangen:
Im Grunde will ich eine If-Abfrage in das Modul schreiben, etwa so:
PHP-Code:
<?php
if ($anzeige == "win"){echo '<!-- indexer::stop -->
<div id="flash_accordion">
<span id="swf_2075_19">Bitte aktivieren Sie in Ihrem Browser Javascript und/oder installieren den Flash Player.</span>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
new Swiff("tl_files/sanamedia/Flash Accordion/deploy-to-web/Main.swf", {
id: "swf_2075_19",
width: 960,
height: 374,
params : {
allowfullscreen: "false",
wMode: "transparent",
flashvars: ""
}
}).replaces($("swf_2075_19"));
//-->
</script>
</div>
<!-- indexer::continue -->';}
if ($anzeige == "iphone"){echo '<!-- indexer::stop -->
<div id="carousell">
<div id="left_tabmenu">
<ul id="tabmenu">
<li class="menulink" id="menu_tab1"><span>Konzept</span></li>
<li class="menulink" id="menu_tab2"><span>Technik</span></li>
<li class="menulink" id="menu_tab3"><span>Inhalt</span></li>
<li class="menulink" id="menu_tab4"><span>Design</span></li>
<li class="menulink" id="menu_tab5"><span>Partnerschaft</span></li>
</ul>
</div>
<!-- here comes the pane-stuff, just create the two div's which will hold the panes and insert sub-divs with class="pane", the id is only needed if you wanna make it the first element which is displayed!-->
<div id="tabcontent">
<div id="paneContainer">
<div class="pane" id="tab1" style="display:block;">
<a href="konzept.html"><img src="tl_files/sanamedia/images/carousel/content/konzept_c.jpg" alt="sanamedia - Konzept" /> </a>
</div>
<div class="pane" id="tab2">
<a href="technik.html"><img src="tl_files/sanamedia/images/carousel/content/technik_c.jpg" alt="sanamedia - Technik" /></a>
</div>
<div class="pane" id="tab3">
<a href="inhalt.html"><img src="tl_files/sanamedia/images/carousel/content/inhalt_c.jpg" alt="sanamedia - Inhalt" /></a>
</div>
<div class="pane" id="tab4">
<a href="design.html"><img src="tl_files/sanamedia/images/carousel/content/design_c.jpg" alt="sanamedia - Design" /> </a>
</div>
<div class="pane" id="tab5">
<a href="partnerschaft.html"><img src="tl_files/sanamedia/images/carousel/content/partnerschaft_c.jpg" alt="sanamedia - Partnerschaft" /></a>
</div>
</div>
</div>
</div>
<!-- indexer::continue -->';}
?>
Im Template habe ich die Variable "$anzeige" wie folgt deklariert:
PHP-Code:
<!-- PHP-Browser-Selektor BA - Anfang -->
<?php
/*
PHP CSS Browser Selector v0.0.1
Bastian Allgeier (http://bastian-allgeier.de)
http://bastian-allgeier.de/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Credits: This is a php port from Rafael Lima's original Javascript CSS Browser Selector: http://rafael.adm.br/css_browser_selector
*/
function css_browser_selector($ua=null) {
$ua = ($ua) ? strtolower($ua) : strtolower($_SERVER['HTTP_USER_AGENT']);
$g = 'gecko';
$w = 'webkit';
$s = 'safari';
$b = array();
// browser
if(!preg_match('/opera|webtv/i', $ua) && preg_match('/msie\s(\d)/', $ua, $array)) {
$b[] = 'ie ie' . $array[1];
} else if(strstr($ua, 'firefox/2')) {
$b[] = $g . ' ff2';
} else if(strstr($ua, 'firefox/3.5')) {
$b[] = $g . ' ff3 ff3_5';
} else if(strstr($ua, 'firefox/3')) {
$b[] = $g . ' ff3';
} else if(strstr($ua, 'gecko/')) {
$b[] = $g;
} else if(preg_match('/opera(\s|\/)(\d+)/', $ua, $array)) {
$b[] = 'opera opera' . $array[2];
} else if(strstr($ua, 'konqueror')) {
$b[] = 'konqueror';
} else if(strstr($ua, 'chrome')) {
$b[] = $w . ' ' . $s . ' chrome';
} else if(strstr($ua, 'iron')) {
$b[] = $w . ' ' . $s . ' iron';
} else if(strstr($ua, 'applewebkit/')) {
$b[] = (preg_match('/version\/(\d+)/i', $ua, $array)) ? $w . ' ' . $s . ' ' . $s . $array[1] : $w . ' ' . $s;
} else if(strstr($ua, 'mozilla/')) {
$b[] = $g;
}
// platform
if(strstr($ua, 'j2me')) {
$b[] = 'mobile';
} else if(strstr($ua, 'iphone')) {
$b[] = 'iphone';
} else if(strstr($ua, 'ipod')) {
$b[] = 'ipod';
} else if(strstr($ua, 'mac')) {
$b[] = 'mac';
} else if(strstr($ua, 'darwin')) {
$b[] = 'mac';
} else if(strstr($ua, 'webtv')) {
$b[] = 'webtv';
} else if(strstr($ua, 'win')) {
$b[] = 'win';
} else if(strstr($ua, 'freebsd')) {
$b[] = 'freebsd';
} else if(strstr($ua, 'x11') || strstr($ua, 'linux')) {
$b[] = 'linux';
}
return join(' ', $b);
}
?>
<!-- PHP-Browser-Selektor BA - Ende -->
<?php
$anzeige = css_browser_selector();
?>
Würde das in Contao gehn?
Oder muss ich da irgend eine Extension installieren?
Oder gibt es andere Wege für sowas die ich nicht kenne?
Liebe Grüße,
pyretta
Lesezeichen