Click tag to search
joomla
-
Adding Time to Logged-In Users
The Joomla 3.x Control Panel shows a list of users who were active at the site, at the front end or the back end.
The data is displayed by a module called Logged-in Users. In previous versions of Joomla the time of the last activity was also displayed for each user, which was useful. In version 3.x only the date is included. If you want to add the time back to the listing, it can be done easily in a template override. Here are brief instructions how to do that in Joomla 3.4.3, using the Isis administration template.
Copy the file administrator/modules/mod_logged/tmpl/default.php to administrator/templates/isis/html/mod_logged and edit line 44 there:<span class="icon-calendar"></span> <?php echo JHtml::_('date', $user->time, JText::_('DATE_FORMAT_LC4')); ?>Replace with this version:<span class="icon-calendar"></span> <?php echo JHtml::_('date', $user->time, 'Y-m-d H:i'); ?>If you do not want to hard code the date & time format into the layout, you can define your own format as a language constant in the Language Manager - Overrides.
Subsequent Joomla updates will not overwrite the override code but you need to maintain it, should something change in the core code.
-
Gmail as SMTP server for Joomla
The alpha version of Joomla 3.2.0 is now available. As usual, it is easy to install and it has new features.
There was something I had wanted to test for some time: Gmail as the SMTP server. The Joomla documentation has instructions how to configure the mail settings but when I first tried it, the connection failed. I decided to configure the good old Telnet into my Windows machine so that I could test the SMTP connection manually. The TCP port 465 of the Gmail server responded, therefore the problem was somewhere else.
It occurred to me that I had started to use Google's 2-step authentication because I accessed Gmail from my Nokia Lumia phone. After the 2-step authentication was turned off, the problem disappeared and my WAMP server was able to send emails.
The 2-step authentication is an important security measure. When it was turned back on, I had to add a new password in the Gmail account settings and use that password as the application specific password in Joomla. The interesting thing was to realise that even though Google's instructions mention that the validity of the password does not depend on the blank spaces between the groups of four characters in the password, it actually did. After the spaces were removed, the SMTP connection worked.
The instructions at https://docs.joomla.org have now been updated, based on these test results.
-
How to debug SMTP mail in Joomla 3.6.5
If you have issues with SMTP emails, you can get Joomla to record all the detailed messages exchanged with your SMTP server. Inspecting the low level transaction log often allows you to see what is going on between the two servers and resolve any connectivity issues with your IT or hosting provider. This custom method is quite simple to set up if you have FTP or SSH access to the Joomla folder in your web server.
This SMTP debug option involves a temporary modification to a file in the JMail class, an extension of the PHPMailer library. Warning: core modifications are not recommended and you should revert the file back to the original version as soon as possible.
First make a backup copy of the file your are going to modify, libraries/joomla/mail/mail.php. Then edit this file, mail.php, and add the following lines to the beginning of the function useSMTP(), after line 634:
// 20170221 SMTP log
$this->SMTPDebug = 4; // maximum level data output
// $this->Debugoutput = 'error_log'; // use the PHP error log, as configured in php.ini
$this->Debugoutput = function($message, $level) { $file = 'mail_log.txt'; $config = JFactory::getConfig(); $logfile = $config['log_path'] . '/' . $file;
$log = fopen($logfile, 'a'); fwrite ($log, $message); fclose($log);};
// 20170221 endAfter you click the button Send Test Mail in the Global Configuration or any other mail function, you can download the file 'mail_log.txt' from the Joomla log folder, usually administrator/logs.
Remember to restore the original version of the file mail.php before the log file grows too much.
And here is the way you can log the mail debug entries by using the standard debug option. Configure the plugin 'System - Debug' with the following key settings:
- Allowed Groups: Super Users
- Log Priorities: All
- Log Categories: mail
- Log Almost Everything
Turn on the debug option in Global Configuration and you can find all the details of the SMTP connection requests and responses with error codes from the file administrator/logs/everything.php.
-
Joomla
Joomla is a popular free Open Source content management system (CMS). It has thousands of free and paid extensions in the Joomla Extension Directory and an active support forum. Joomla is available in 64 languages, including Esperanto, as highlighted in the Joomla Community Magazine.
-
Joomla 3.1.5
A couple of weeks ago I updated the site to Joomla 2.5.14 and the Kunena forum extension was upgraded to 3.0.1 at the same time. Now it was the right time to go even more responsive with the JA Elastica template. The latest versions were downloaded from Joomlart and the update to version 2.5.3 worked all right, still under Joomla 2.5. This step made sure that the template was compatible with Joomla 3. However, after I pushed the button and upgraded to 3.1.5, the following message was displayed both at the back end and the front end:
Fatal error: Class 'JParameter' not found in /home/myaccount/public_html/mysite/plugins/system/bigshotgoogleanalytics/bigshotgoogleanalytics.php on line 24
All the plugin information resides in the extension table in the database. The system plugin bigshotgoogleanalytics had to be disabled by changing the column `enabled` from 1 to 0 and the site is again online. The Google Analytics tracking code was then added manually before the <head> tag in the file page/default.php in the ja_elastica template.
The error highlights the importance of checking all the extensions for compatibility during version upgrades.