Mysqli: Unknow server host

PHP can fail to connect to a MySQL database when a custom port number is specified.
In the old-style you would write like this:
$link = mysql_connect("dbhost.info:6603", "dbuser", "dbpaswd",);

Now with mysqli the same approach does not work.
$mysqli = new mysqli("dbhost.info:6603", "dbuser", "dbpaswd", "databasename");
If you try to connect this way using mysqli, it will fail with an error Unknow server host ‘dbhost.info:6603’:

Continue reading Mysqli: Unknow server host

Place intro image before article title in Joomla! 3

By default it is not possible to swap article title and intro image nor rearrange other article properties.

The solution for this problem is called a template override. The idea is to make copies of certain Joomla! core files, modify them (rearrange code blocks) and save them in specific places.

Standard layout -- Article title, then intro image
Standard layout — Article title, then intro image
Layout with template override -- intro image, then article title
Layout with template override — intro image, then article title

Continue reading Place intro image before article title in Joomla! 3

Working with asciidoc on Fedora

Install Asciidoc and DocBook
yum install asciidoc
yum install docbook-dtds
yum install publican
yum install dblatex
yum install libxml2-devel
yum install libxslt docbook5-style-xsl docbook-utils

To generate PDF files LaTeX is required. See here how to install LaTeX and XeLaTeX on Fedora.

Generate html file from asciidoc file
asciidoc myfile.txt
Use ‘-n’ to have numbered sections
asciidoc -n myfile.txt

Generate PDF file
Although it is possible to directly create PDF files using a2x utility, I prefer to convert my file to docbook format and then to PDF.
asciidoc -n --doctype=article --backend=docbook45 myfile.txt
or
asciidoc --doctype=book --backend=docbook45 myfile.txt
Then
dblatex gramata.xml
or
dblatex --backend=xetex gramata.xml