Sobota, Červen 27, 2026

PrettyURLs

Aby fungovaly PrettyURLs u příspěvků, musí se upravit .htaccess

1) In Setting > FlatPress Protect > enable editing .htaccess
2) In Plugin > setting PrettyURLs > Save .htaccess

AddType application/x-httpd-php .php .htm .html
Options -Indexes
<IfModule mod_rewrite.c>
    RewriteEngine On
    # Zde upravte cestu k adresáři (např. RewriteBase / nebo RewriteBase /flatpress/)
    RewriteBase /
    
    RewriteRule ^.htaccess$ - [F]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

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