linux black desktop

It’s a bug which affects only one user and not the whole graphical desktop, but only the “desktop” in a narrow sense.

A workaround can be to rename the .config folder (to something like .config.old) so that you can get anew your whole graphical desktop and then maybe you could copy (prudently) one by one your config files (from .config.old to the new .config folder).

matrix clients

desktop clients

Unfortunately all the matrix desktop clients we have tested are quite poor from a graphical point of view: very different from whatsapp or telegram ones, and in particular their interface lacks of intuitivity.

Furthermore, the only capable to make a (video or audio) call is Element, while the others work only as messaging app.

mobile clients

There is Element, but I found Schildichat, with a more friendly interface, very similar to WA or Telegram.

svg rounded corner and shadow

shadow (like css shadow-box)

At least with Firefox you can use a filter, like the following:

.shadow{filter: drop-shadow(8px 6px 6px gray);}

rounded corner

The simplest way to round the corners of a box is to

  • use rect element with rx and ry attributes (such as rx="20" ry="20")
  • and define the style of rect with stroke-linejoin:round; and something like stroke:[your color]; stroke-width:[the width you like];

You can see the following example

box rounded

rename identical files (with different names) in different devices

You can use a zsh script (let we call “rename-identical-files.bash”) with a code like the following

#! /bin/zsh -
zmodload zsh/stat || exit
typeset -A size_to_name
model_folder=${1?}

CDPATH= cd -P -- "$model_folder" || exit
for f in *(ND.); do
  stat -LA size +size -- $f &&
    size_to_name[$size]=$f &&
    print -r "# File of size $size should be named ${(q)f}"
done

cd $OLDPWD || exit
for f in *(ND.); do
  stat -LA size +size -- $f &&
    (($+size_to_name[$size])) &&
    [[ $f != $size_to_name[$size] ]] &&
    print -r mv -i -- ${(qq)f} ${(qq)size_to_name[$size]}
done
#usage:  that-script /model-folder-path

then you can go to the folder where you want rename the files and do this terminal command:

~/rename-identical-files.bash /path/to/model/folder

in this way, before executing the command, you can see what could happen afterwards. If it’s all ok, do the command:

~/rename-identical-files.bash /path/to/model/folder | sh

php list and link folder’s files

an old way

There is an old way, the following:

<?php
     $path = "./";
     $narray=array();
     $dir_handle = @opendir($path) or die("Unable to open $path");
     echo "";
     $i=0;
     while($file = readdir($dir_handle))
     {
     if($file != '.' && $file != '..' && $file != 'index.php' && $file != 'normal.inc')
     {
     //echo "<a href='$path/$file'>$file</a><br/>";
     $narray[$i]=$file;
     $i++;
     }
     }
     sort($narray);

	   echo "<ul>";	            
     for($i=0; $i<sizeof($narray); $i++)
	   {
	    $filename = str_replace(".html", "", $narray[$i]) & str_replace(".php", "", $narray[$i]);
	   echo "<li><a href='$path$narray[$i]'>$filename</a></li>";
	   }
	   
	   echo "</ul>";
	   //closing the directory
	   closedir($dir_handle);
?>

a new way: glob

<?php
	   echo "<ul>";	  
$phpfiles = glob("*?[!index]?.php");
foreach ($phpfiles as $phpfile){
     echo '<li><a href="'.$phpfile.'">'.pathinfo($phpfile, PATHINFO_FILENAME).'</a></li>'; 
}	   
	   echo "</ul>";
?>

as you can see, the code is much simpler.

  • With this code: glob(“*?[!index]?.php”) we have set to list all php files except index.php.
  • with this other: ‘.pathinfo($phpfile, PATHINFO_FILENAME).’ we have set to show only filenames without extension

of course we could set a subfolder as well, with a code like the following:

$phpfiles = glob("[subfolder-name]/*?[!index]?.php");

php/msql keywords as hashtags

php separate all items in a mysql field

You can use the explode syntax, as in the following exapmple:

$keywords = $row['keywords'];
foreach (explode(',', $keywords) as $key) {
    echo "<span><a href="\hashtag.php?tag=$key\">{$key}</a></span>";
}

In the example we have a mysql field (keywords) with many items comma separated (such as : “truth, soul, body, mind” and so on).

And we obtain to have as many links from each item toward a specific target, as they are (that is: 3 links if you have 3 items, 7 links fi you have 7 ones).

In this way you can get a system of hashtags for your database keywords.

other steps

You need of two files, let we call them hashtag.php and hashtag-index.php.

The content of hashtag.php could be something like:

<?php  
 //hashtag.php  
 if(isset($_GET["tag"]))  
 {  
      $tag = preg_replace('/(?<!\S)#([0-9a-zA-Z]+)/', '', $_GET["tag"]);

//to beautify and stylize, but not necessary BEGIN
      $title=$tag;
      include "$root/intell/header-intell.inc";      
//to beautify and stylize, but not necessary END      

      $connect = mysqli_connect("localhost", "[mysql user]", "[mysql password]", "[mysql database]");  
      
      mysqli_set_charset($connect, 'utf8mb4');  // procedural style
      
      $query = "SELECT * FROM [your table] WHERE [your fileds with tags] LIKE '%".$tag."%';  
      $result = mysqli_query($connect, $query);  
      if(mysqli_num_rows($result) > 0)  
      {  
           while($row = mysqli_fetch_array($result))  
           {  
                echo "<h2>$row[title]</h2>
                <blockquote><p>$row[text]</p></blockquote>
                <p><i>$row[author]</i><br />";
                $keywords = $row['keywords'];
                foreach (explode(',', $keywords) as $key) {
                echo "<span><a href=\"hashtag.php?tag=$key\">{$key}</a></span>";
                }
                echo "</p>";
           }  
      }  
      else  
      {  
           echo '<p>No Data Found</p>';  
      }  
 }  
 ?>  

the conte of hashtag-index.php should be something like:

<?php
// (1) DATABASE CONFIG
// ! CHANGE THESE TO YOUR OWN !
define('DB_HOST', 'localhost');
define('DB_NAME', '[your database');
define('DB_CHARSET', 'utf8');
define('DB_USER', '[your mysql user]');
define('DB_PASSWORD', '[your mysql password]');

// (2) CONNECT TO DATABASE
try {
  $pdo = new PDO(
    "mysql:host=" . DB_HOST . ";charset=" . DB_CHARSET . ";dbname=" . DB_NAME,
    DB_USER, DB_PASSWORD, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES => false ]
  );
} catch (Exception $ex) {
  die($ex->getMessage());
}

// (3) SEARCH
$stmt = $pdo->prepare("SELECT * FROM `[mysql table name]` WHERE `keywords` LIKE ?");
$stmt->execute(["%" . $_POST['search'] . "%", "%" . $_POST['search'] . "%", "%" . $_POST['search'] . "%"]);
$results = $stmt->fetchAll();
if (isset($_POST['ajax'])) { echo json_encode($results); }
?>

afterwards obviously you could adjust the css according to your needs.

Of course you can have as many other php files as you want, where you usually store you database content, in which you can add the kewwords as hashtags, with a code like the following:

echo "</p><p class=\"keywords\">";
$keywords = $row['keywords'];
foreach (explode(',', $keywords) as $key) {
    echo "<span><a href=\"hashtag.php?tag=$key\">{$key}</a></span>";
}
echo "</p>";}

LibreBase problems with native mysql connector

1. mysql connector not working

From LO 6.4 native mysql connector didn’t work any more. But a possible solution is to comment the line skip-networking in my.conf.

I mean now the line is #skip-networking, before it was skip-networking.

2. subforms not working

In new releases, to avoid this issue, you have to cut a small portion of code in content.xml, as in the following instructions:

have a look at the content.xml in the *.odb-file (could be opened by a zip-program)

Not working code:
<db:driver-settings db:system-driver-settings=”” db:base-dn=”” db:parameter-name-substitution=”false”/>

Working code
<db:driver-settings db:system-driver-settings=”” db:base-dn=””/> »

It works!

3. tables or queries not working

You should check the table/query structure and avoid fields (which should have a length) with no length.