Neděle, Listopad 23, 2025

Vítejte ve FlatPressu!

Tento článek vám ukáže některé z možností FlatPressu.

Tag “more” zobrazí odkaz “Číst dál…”, po kliknutí na něj se zobrazí celý článek.

[Číst dál…]

Neděle, Leden 5, 2025

Detecting mobile device

Script detecting mobile device

<script>
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
  document.currentScript.outerHTML = `[img=images/mapka_apartmany.jpeg scale=5% float=right]`;
}else{
  document.currentScript.outerHTML = `[img=images/mapka_apartmany.jpeg scale=18% float=right]`;
}
</script>

CSS: change the background color when the browser window is less 400px

@media only screen and (max-width: 400px) {
  body {
    background-color: lightblue;
  }
}

Codepen: https://codepen.io/L … r-Ludvik/pen/RNbjeOV
More example: https://www.w3school … ref/atrule_media.php

This script also detecting mobile device:

<script>
if (window.matchMedia(”(max-width: 400px)”).matches) {
  // Viewport is less or equal to 400 pixels on mobile
document.currentScript.outerHTML = `less or equal to 400`
} else {
  // Viewport is greater than 400 pixels on desktop
document.currentScript.outerHTML = `greater than 400`
}
document.write(”
“);
document.write(document.documentElement[”clientWidth”]);
document.write(”
“);
document.write(document.body[”scrollWidth”]);
</script>

Neděle, Prosinec 22, 2024

Simple rssread widget

source rssread.php?rss=

<?php
$rss = $_GET[’rss’];
$rss = simplexml_load_file($rss);
echo ’<h1>’. $rss->channel->title . ’</h1>’;

foreach ($rss->channel->item as $item) {
   echo ’<h2><a href=”‘. $item->link .’”>’ . $item->title . ”</a></h2>”;
   echo ”<p>” . $item->pubDate . ”</p>”;
   echo ”<p>” . $item->description . ”</p>”;
} 
?>
<html><head><style>
iframe{
height: 400px;
width: 200px;
}</style></head>
<body>
<iframe src=”https://solarcz.eu/programy/php_kody/rssread.php?rss=https://www.flatpress.org/feed/rss2/” ></iframe>
<iframe id=”test” src=”https://solarcz.eu/programy/php_kody/rssread.php?rss=http://flatpress.cz/?x=feed:rss2”></iframe>
<iframe id=”test1” src=”https://solarcz.eu/programy/php_kody/rssread.php?rss=http://feeds.bbci.co.uk/news/england/rss.xml” ></iframe>

<iframe src=”https://rss.app/embed/v1/feed/xeLKa4jg6jhRnw7V”style=”border-style:none; width:610px; height:500px;”></iframe>
</body></html>






Edit RSS

edit /fp-interface/sharedtpls/rss.tpl

a) {$content|tag:the_content|truncate:256}
b) {$content|tag:the_content|strip_tags|strip|truncate:256:”…”:true|escape}
rss_tag.png

změna formátu datumu

<pubDate>{’r'|date:$date}</pubDate>
<pubDate>{’d.m.Y’|date:$date}</pubDate>

Try Widget Preview: https://rssatom.de/r … tpress.org/feed/rss2
or create rss widget https://www.rssfeedwidget.com/
https://www.flatpress.org/feed/rss2/ - has big description with picture
https://forum.flatpress.org/feed/rss2 forum rss
http://feeds.bbci.co … news/england/rss.xml - look good
http://wordpress.org/news/feed/ - look good

Neděle, Září 18, 2022

Widget na počasí

Astronomy Picture of the Day

[html]<a href=”http://apod.nasa.gov/apod/astropix.html” title=”n.a.”><img src=”http://apod.nasa.gov/apod/calendar/today.jpg” alt=”n.a.” title=”n.a.”></a>[/html]

n.a.

1) cut from picture http://portal.chmi.c … teo/kam/dukovany.jpg

<META HTTP-EQUIV=”Refresh” CONTENT=”120”>
<iframe id=”Pocasi” name=”Pocasi” allowtransparency=”true”  title=”Pocasi”  width=”220”    height=”66”    frameborder=”0”    scrolling=”no”  marginheight=”0”  marginwidth=”0”   align=”middle”  style=”transform:scale(1);background-image:url(http://portal.chmi.cz/files/portal/docs/meteo/kam/dukovany.jpg);background-position: top -30px right 0px” src=”"></iframe>

2) cut from picture https://www.yr.no/en … 283758/meteogram.svg

<iframe id=”Pocasi” name=”Pocasi” allowtransparency=”true”  title=”Pocasi”  width=”770”    height=”155”    frameborder=”0”    scrolling=”no”  marginheight=”0”  marginwidth=”0”   align=”middle”  style=”transform:scale(1);background-image:url(https://www.yr.no/en/content/2-7283758/meteogram.svg);background-position: top -105px right 0px” src=”"></iframe>

3) picture from https://www.in-pocas … p?stanice=rouchovany

<a href=”https://www.in-pocasi.cz/aktualni-pocasi/rouchovany/” title=”meteostanice Rouchovany” target=”_blank”><img src=”https://www.in-pocasi.cz/aktualni-pocasi/img/line_chart.img.php?stanice=rouchovany” style=”width:220px; height:180px; border:0px; padding:0px; margin:0px;”/></a>

4) picture from https://www.chmi.cz/ … at/mobile/msg2a6.gif

<a href=”https://www.chmi.cz/files/portal/docs/meteo/rad/inca-cz/short.html” title=”webkamera Dukovany” target=”_blank”><img src=”https://www.chmi.cz/files/portal/docs/meteo/sat/mobile/msg2a6.gif” style=”width:220px; height:160px; border:0px; padding:0px; margin:0px;”/></a>

5) widget from https://www.meteoblu … vany_czechia_3066735

<iframe src=”https://www.meteoblue.com/cs/po%C4%8Das%C3%AD/widget/three/rouchovany_czechia_3066735?geoloc=fixed&nocurrent=0&nocurrent=1&noforecast=0&days=4&tempunit=CELSIUS&windunit=KILOMETER_PER_HOUR&layout=dark”  frameborder=”0” scrolling=”NO” allowtransparency=”true” sandbox=”allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox” style=”width: 400px; height: 400px”></iframe>

6) counter from https://toplist.cz/stat/1814104/

<center><a href=”https://www.toplist.cz/” target=”_top”><img src=”https://toplist.cz/count.asp?id=814104&logo=mc&start=1000&http=encodeURIComponent(document.referrer)&t=encodeURIComponent(document.title)&l=encodeURIComponent(document.URL)’&wi=encodeURIComponent(window.screen.width)&he=encodeURIComponent(window.screen.height)&cd=encodeURIComponent(window.screen.colorDepth)” alt=”TOPlist” border=”0” align=”center”></a></center>
pocasi-widget.jpg
yrno.jpg

Dlouhodobá předpověď počasí z yr.no, dwd.de, noaa.gov https://yrno.cz/poca … ouhodobe-predpovedi/
Cut from the page, testing: http://jsfiddle.net/nh43f5mb/

<html>
<head>
<style>
#mydiv{
    margin:30px;
    position:relative;
    overflow:hidden;
    height:250px;
    width:416px;
}
#myframe{
    position:absolute;
    top:-1340px;
    left:-90px;
}
p{margin:5px 30px;}
</style>
</head>
<div id=”mydiv”>
    <iframe id=”myframe” 
        height=”2000px” 
        scrolling=”no” 
        src=”https://yrno.cz/pocasi/Vysocina/Rouchovany/graf-dlouhodobe-predpovedi/” 
        width=”1000px”>
    </iframe>
</div>