Easy PHP Error Debug for Joomla – System Plugin – CBX PHP Debug

I don’t see any easy way to debug or see php error log for Joomla, If I am not wrong. While working with WordPress I just put some constant in wp-config.php file to enable debug and display , log errors.

define('WP_DEBUG', true);
define( 'WP_DEBUG_DISPLAY', true);
define( 'WP_DEBUG_LOG', true);

Then WordPress creates a debug.log file in wp-content folder. I don’t need to go to php error log file in the server to check the error. I know we can configure local domain so that the log file is generated in the joomla local site folder but that is also not native joomla solution ! I was thinking to enable something for Joomla but didn’t find. So, I created a system plugin for Joomla to make this easy. The idea for “System Plugin – CBX PHP Debug” comes here. Just install the system plugin, enable and configure as need “Enable Debug, Display Errors, Log Error in debug file”, save and you are done. This plugin will create a file debug.log inside Joomla’s logs folder as configured in the configuration.php file.

BTW, I copied the debug init function from WordPress 🙂

Download the plugin from here

Version 1.0.0 direct download here.

https://gist.github.com/manchumahara/977e85fede164cb2d26579f59896129d

Introduction to Joomla! – Event invitiation – Joomla User Group Dhaka, Bangaldesh

From Joomla User Group Dhaka we are trying to introduce Joomla! to the community. As part of this initiative, we started a series of Joomla introduction events at different universities. This first event venue is selected as Joomshaper office, we hope next events will be arranged at any university if we get venue permission.

Venue: JoomShaper
Date: 27 January, 2018
Time: 3.00 PM – 6.00 PM

Join the event and let’s talk, discuss, learn about Joomla!

A letter to our bengali community of joomla and wordpress

to whom it may concern or not concern

āύ⧋āϟāσ āĻāĻ•āĻžāĻ¨ā§āϤ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āĻŽāϤāĻžāĻŽāϤ, āĻĒāĻœā§‡āϟāĻŋāĻ­ āϏāĻŽāĻžāϞ⧋āϚāύāĻžāĻ“ āφāϛ⧇ āĻ•āĻŋāϛ⧁ āϜāĻžā§ŸāĻ—āĻžā§Ÿ, āĻ•āĻžāϰ⧋ āĻ•āĻžāϰ⧋ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āĻ­āĻžāĻŦ⧇ āϞāĻžāĻ—āϤ⧇ āĻĒāĻžāϰ⧇ āĻ•āĻŋāĻ¨ā§āϤ⧁ āϏāĻ¤ā§āϝ āϏāĻŦ āϏāĻŽā§Ÿ āĻ•āĻ āĻŋāύ āĻšāĻŦ⧇ āĻāϟāĻž āĻŽā§‡āύ⧇āχ āĻŦāĻžāϕ⧀āϟ⧁āϕ⧁ āĻĒ⧜āϤ⧇ āĻšāĻŦ⧇āĨ¤

// āĻĻ⧇āĻļ⧇āϰ āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āύ āĻŸā§‡āĻ• āχāϭ⧇āĻ¨ā§āϟ āφāĻŽāĻžāϰ āĻ…āĻ‚āĻļ āĻ—ā§āϰāĻšāύ āĻāχ āϰāĻ•āĻŽ āĻĒā§āϝāĻžāϟāĻžāĻ°ā§āύ⧇āϰ ā§Ļ ā§Ļ ā§Ļ ā§§ ā§Ļ ā§Ļ ā§§ā§Ļā§§ā§Ļā§Ļā§Ļā§§ āĻŽāĻžāύ⧇āχ āĻŦ⧁āĻāϤ āĻĒāĻžāϰāϤ⧇ ā§Š/ā§ĒāϟāĻž āχāϭ⧇āĻ¨ā§āĻŸā§‡āϰ (āϝāĻž āφāĻŽāĻžāϰ āĻ•āĻžāϛ⧇āϰ āϏāĻžāĻĨ⧇ āϏāĻŽā§āĻĒāĻ°ā§āĻ•āĻŋāϤ ) āĻ—ā§œā§‡ āĻāĻ•āϟāĻŋāϤ⧇ āϝāĻžāĻ“ā§ŸāĻž āĻĒā§œā§‡āĨ¤ āĻļ⧇āώ āĻĻ⧁āχāϟāĻŋ āχāϭ⧇āĻ¨ā§āĻŸā§‡ āĻ…āĻ‚āĻļāĻ—ā§āϰāĻšāύ āĻ›āĻŋāϞ āĻāĻ•/ āφāϜāϕ⧇ āϜ⧁āĻŽāϞāĻž ā§Š.x āĻŦāĻžāĻ‚āϞāĻž āĻ…āύ⧁āĻŦāĻžāĻĻ āĻĻ⧁āχ/ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏāĻŋ⧟āĻžāύ āĻ—ā§āϰ⧁āĻĒ āĻāϰ āϏāĻŽā§āĻ­āĻŦāϤ ā§ŦāĻˇā§āĻ  āĻŦāĻž ā§­āĻŽ āĻŽāĻŋāϟāĻžāĻĒāĨ¤ āύāĻŋāĻœā§‡āϰ āĻ•āĻŋāϛ⧁ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āĻ•āĻžāϰāĻŖ āϝ⧇āĻŽāύ, āχāϭ⧇āĻ¨ā§āĻŸā§‡āϰ āĻĻāĻŋāύ āϏāĻŽā§Ÿ āĻŦ⧇āϰ āĻ•āϰāĻž , āχāϭ⧇āĻ¨ā§āĻŸā§‡ āφāĻŽāĻžāϰ āĻ•āĻžāϜ āϝāĻĻāĻŋ āĻšā§Ÿ āĻļ⧁āϧ⧁ āĻŦāϏ⧇ āĻŦāϏ⧇ āĻļā§‹āύāĻž (āĻāĻ•ā§āώ⧇āĻ¤ā§āϰ⧇ āĻāĻ• āϟāĻžāύāĻž āĻ•āĻŋāϛ⧁āĻ•ā§āώāύ āĻŦāϏ⧇ āĻĨāĻžāĻ•āĻžāϰ āĻĒāϰ āφāĻŦāĻžāϰ āĻļāĻžāϰ⧀āϰāĻŋāĻ• āϏāĻŽāĻ¸ā§āϝāĻž āĻĻ⧇āĻ–āĻž āĻĻā§‡ā§Ÿ āϝ⧇āϟāĻž āĻ¸ā§āύāĻžā§Ÿā§āĻŦāĻŋāĻ•)

// āĻĻ⧇āĻļ⧇ āϝāĻžāϰāĻž āĻĒā§āϰāĻĄāĻžāĻ•ā§āϟ āĻŦāĻŋāĻ•ā§āϰāĻŋ āĻ•āϰ⧇ āϤāĻžāĻĻ⧇āϰ āϏāĻŦāĻžāχ āĻāύāĻ­āĻžāĻŸā§‹ āĻ—āĻŋā§Ÿā§‡ āĻŦāĻŋāĻ•ā§āϰāĻŋ āĻ•āϰ⧇ āύāĻžāĨ¤ āĻ…āύ⧇āϕ⧇āχ āύāĻŋāϜāĻĻ⧇āϰ āĻŽāĻžāĻ°ā§āϕ⧇āϟ āĻĒā§āϞ⧇āϏ āϤ⧈āϰāĻŋ āĻ•āϰ⧇ āĻŦāĻŋāĻ•ā§āϰāĻŋ āĻ•āϰ⧇āĨ¤ āĻāϰ āĻŽāĻžāύ⧇ āĻĻāĻžā§œāĻžāĻšā§āϛ⧇ āĻāύāĻ­āĻžāĻŸā§‹āϰ āĻĻ⧇āĻļ⧇āϰ āĻŦāĻ°ā§āϤāĻŽāĻžāύ āĻ…āύ⧇āĻ• āĻ…āĻĨāϰ āϝāĻ–āύ āĻŽāĻžāĻ°ā§āϕ⧇āϟāĻĒā§āϞ⧇āϏ āĻ•āĻŋ āĻāϟāĻžāχ āϜāĻžāύāϤ⧋ āύāĻž āϤāĻ–āύ āφāĻŽāϰāĻž āĻ•ā§Ÿā§‡āĻ• āϜāύ āϛ⧋āϟ āĻ¸ā§āϟāĻžāĻ°ā§āϟ āφāĻĒ āĻĻāĻžā§œ āĻ•āϰāĻŋā§Ÿā§‡ āϕ⧇āω āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āύ āϏāĻŋāĻāĻŽāĻāϏ āĻāϰ āϜāĻ¨ā§āϝ āĻāĻ•ā§āϏāĻŸā§‡āύāĻļāύ āφāĻŦāĻžāϰ āϕ⧇āω āĻĨā§€āĻŽ āĻŦāĻž āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āĻŦāĻžāύāĻŋā§Ÿā§‡ āĻŦāĻŋāĻ•ā§āϰāĻŋ āĻ•āϰāϤāĻžāĻŽāĨ¤ āϤāĻžāϰ āĻŽāĻžāύ⧇ āĻĻāĻžā§œāĻžāĻšā§āϛ⧇ āφāĻŽāĻžāĻĻ⧇āϰ āϕ⧇āω āϕ⧇āω āĻāĻ–āύ⧋ āĻŦ⧜ āĻŽāĻžāĻ°ā§āϕ⧇āϟ āĻĒā§āϞ⧇āϏ⧇āϰ āϏāĻžāĻĨ⧇ āĻĒāĻžāĻ˛ā§āϞāĻž āĻĻāĻŋā§Ÿā§‡ āύāĻŋāĻœā§‡āĻĻ⧇āϰ āĻĒā§āϰāĻĄāĻžāĻ•ā§āϟ āύāĻŋāĻœā§‡āĻĻ⧇āϰ āĻŽāĻžāĻ°ā§āϕ⧇āϟāĻĒā§āϞ⧇āϏ⧇ āĻŦāĻŋāĻ•ā§āϰāĻŋ āĻ•āϰ⧇ āϝāĻžāĻšā§āĻ›āĻŋ āĻāĻ–āύ⧋āĨ¤

//āφāĻŽāĻžāϰ āĻļ⧇āώ āĻĨ⧇āϕ⧇ āĻ…āĻ‚āĻļāĻ—āĻšāύ āĻ•āϰāĻž ⧍⧟ āχāϭ⧇āĻ¨ā§āϟ āĻ›āĻŋāϞ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏāĻŋ⧟āĻžāύ āĻāϰ ā§ŦāĻˇā§āĻ  āĻŦāĻž ā§­āĻŽ āĻŽāĻŋāϟāĻžāĻĒ, āϏ⧇āĻ–āĻžāύ⧇ āφāĻŽāĻŋ āφāϰ āϜ⧁āĻŽāĻļ⧇āĻĒāĻžāϰ āĻāϰ āĻ•āĻžāωāĻ›āĻžāϰ āĻ­āĻžāχ āĻ—āĻŋā§Ÿā§‡āĻ›āĻŋāϞāĻžāĻŽāĨ¤ āĻāĻ•āϜāύ āϏāĻžāϧāĻžāϰāĻŖ āĻ…āĻ‚āĻļāĻ—ā§āϰāĻšāύāĻ•āĻžāϰ⧀ āĻšāĻŋāϏāĻžāĻŦ⧇ āĻ—āĻŋā§Ÿā§‡āĻ›āĻŋāϞāĻžāĻŽ āĻāĻŦāĻ‚ āϝāĻĨ⧇āĻˇā§āϟ āϧ⧈āĻ°ā§āϝ āϧāϰ⧇ āĻĒā§āϰāĻžā§Ÿ āĻĒā§āϰāϤāĻŋāϟāĻŋ āĻĒā§āϰ⧇āĻœā§‡āĻ¨ā§āĻŸā§‡āĻļāύ āĻāϰ āĻ•āĻŽ āĻŦ⧇āĻļāĻŋ āĻļ⧁āύ⧇āĻ›āĻŋ āĻŽāĻžāĻ āĻ–āĻžāύ⧇ āϟ⧁āĻ• āϟāĻžāĻ• āφāĻĄā§āĻĄāĻž āĻ›āĻžā§œāĻžāĨ¤ āĻļ⧇āώ⧇āϰ āĻĻāĻŋāϕ⧇ āϝāĻ–āύ āĻ•āĻžāωāĻ›āĻžāϰ āĻ­āĻžāχāϕ⧇ āϜ⧁āĻŽāϞāĻžāϰ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āĻĄā§‡āϭ⧇āϞāĻĒāĻžāϰ āĻšāĻŋāϏāĻžāĻŦ⧇ āĻĒāϰāĻŋāϚ⧟ āĻ•āϰāĻžā§Ÿā§‡ āĻĻ⧇āĻ“ā§ŸāĻž āĻšāϞ āϤāĻ–āύ āφāĻŽāĻŋ āĻāĻ•āϏāĻŽā§Ÿ āĻŦ⧇āϰ āĻšā§Ÿā§‡ āφāϏāĻ›āĻŋāĨ¤ āφāĻŽāĻžāϰ āϏāĻžāĻŽāĻžāĻ¨ā§āϝ āϞ⧇āϗ⧇āĻ›āĻŋāϞ, āĻ•āĻžāϰāĻŖ āφāĻŽāϰāĻž āĻĻ⧁āχāϜāύāχ āϜ⧁āĻŽāϞāĻž āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰ⧇ āĻŦ⧇āĻļāĻŋ āĻĒāϰāĻŋāϚāĻŋāϤ, āωāύāĻŋ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āĻŦāĻžāύāĻžāύ, āφāĻŽāĻŋ āĻāĻ•ā§āϏāĻŸā§‡āύāĻļāύāĨ¤ āĻ•āĻžāωāĻ›āĻžāϰ āĻ­āĻžāĻ‡ā§Ÿā§‡āϰ āωāĻĒāϰ āϕ⧋āύ āϰāĻžāĻ— āύ⧇āχ, āϏ⧇ āϤāĻžāϰ āĻ•āĻžāϛ⧇āϰ āϝ⧋āĻ—ā§āϝ āϏāĻŽā§āĻŽāĻžāύ āĻĒāĻžāĻŦ⧇, āϤāĻžāϰ āĻ•āĻžāϜāϕ⧇ āφāĻŽāĻŋāĻ“ āϏāĻŽā§āĻŽāĻžāύ āĻ•āϰāĻŋāĨ¤ āĻ•āĻŋāĻ¨ā§āϤ⧁ āĻŽāύ⧇ āĻšāĻšā§āϛ⧇, āĻ•āĻŋāϛ⧁ āĻŽāĻžāύ⧁āώ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āĻāϰ āωāĻĒāϰ āĻĄā§‡āϭ⧇āϞāĻĒ āĻ•āϰ⧇ āĻĢāĻžāϟāĻŋā§Ÿā§‡ āĻĢ⧇āϞāϤ⧇āϛ⧇ āĻ•āĻŋāĻ¨ā§āϤ⧁ āϜ⧁āĻŽāϞāĻžāϰ āĻāĻ•ā§āϏāĻŸā§‡āύāĻļāύ⧇āϰ āύāĻžāĻŽ āĻļ⧁āύ⧇ āύāĻžāχ āĻ•āĻ–āύ⧋ ? āϝ⧇āĻšā§‡āϤ⧁ āφāĻŽāĻŋ āϜ⧁āĻŽāϞāĻž āĻŦāĻžāĻ‚āϞāĻžāĻĻ⧇āĻļ āĻ—ā§āϰ⧁āĻĒ⧇āϰ āĻāĻĄāĻŽāĻŋāύāĻĻ⧇āϰ āĻāĻ•āϜāύ āĻāĻŦāĻ‚ āϝāĻĻāĻŋ āϜ⧁āĻŽāϞāĻžāϰ āϕ⧋āύ āχāϭ⧇āĻ¨ā§āĻŸā§‡āϰ āϏāĻžā§āϚāĻžāϞāĻ• āĻĨāĻžāĻ•āĻŋ āφāϰ āϏ⧇āĻ–āĻžāύ⧇ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āĻāϰ āϕ⧋āύ āύ⧋āĻŸā§‡āĻŦāϞ āĻĄā§‡āϭ⧇āϞāĻĒāĻžāϰ āĻĨāĻžāϕ⧇ āϤāĻžāĻšāϞ⧇ āφāĻŽāĻŋ āϤāĻžāϕ⧇ āĻ…āĻŦāĻļā§āϝāχ āĻĄā§‡āϕ⧇ āύāĻŋāĻŦāĨ¤ āĻ•āĻžāϰ⧋ āϏāĻžāĻĨ⧇ āϝāĻĻāĻŋ āφāĻŽāĻžāϰ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āϕ⧋āύ āϏāĻŽāĻ¸ā§āϝāĻžāĻ“ āĻĨāĻžāϕ⧇ āĻ•āĻŽāĻŋāωāύāĻŋāϟāĻŋ āχāϭ⧇āĻ¨ā§āĻŸā§‡ āϏ⧇āϟāĻž āφāĻŽāĻŋ āϕ⧋āύ āĻ­āĻžāĻŦ⧇āχ āĻĒā§āϰāĻ•āĻžāĻļ āĻ•āϰāĻŦ āύāĻžāĨ¤

//āĻĄāĻŋāϜāĻŋāϟāĻžāϞ āĻ“ā§ŸāĻžāĻ°ā§āĻĄ āĻāϰ āϏāĻŋāĻāĻŽāĻāϏ āĻ•āύāĻĢāĻžāϰ⧇āĻ¨ā§āϏ⧇ āϝāĻžāĻ“ā§ŸāĻžāϰ āϏāĻŽā§Ÿ āĻŽā§āϝāĻžāύ⧇āϜ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŋ āύāĻžāχāĨ¤ āϤāĻŦ⧇ āϜāĻžāύāϤ⧇ āĻĒāĻžāϰāϞāĻžāĻŽ āϏ⧇āĻ–āĻžāύ⧇ āĻāĻŽāύ āĻ¸ā§āĻĒāĻŋāĻ•āĻžāϰāĻ“ āϏāĻŋāϞ⧇āĻ•ā§āϟ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇ āϝ⧇, āϜ⧁āĻŽāϞāĻž āĻĢāĻžāϞāϤ⧁ āĻŦāĻž āϜ⧁āĻŽāϞāĻž ā§Ē⧍ā§Ļ āĻāĻŽāύ āĻ•āĻĨāĻžāĻ“ āĻŦāϞ⧇āϛ⧇āĨ¤ āφāĻŽāĻžāϰ āĻŽāύ⧇ āĻšā§Ÿ āĻœā§‡āύ⧇ āĻ•āĻĨāĻž āĻŦāϞāĻž āωāϚāĻŋā§ŽāĨ¤ āϝ⧇ āϜ⧁āĻŽāϞāĻž āĻāĻŦāĻ‚ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āĻŦāĻž āφāϰ⧋ āĻ…āĻ¨ā§āϝ āϏāĻŋāĻāĻŽāĻāϏ āύāĻŋā§Ÿā§‡ āϜāĻžāύ⧇ āϏ⧇ āĻŦ⧁āĻāϤ⧇ āĻĒāĻžāϰāĻŦ⧇ āĻāĻ• āĻāĻ•āϟāĻž āϏāĻŋāĻāĻŽāĻāϏ āĻāϰ āĻĢāĻŋāϞ⧋āϏāĻĢāĻŋ, āϞāĻžāĻ°ā§āύāĻŋāĻ‚ āĻ•āĻžāĻ°ā§āĻ­, āĻŽāĻžāĻ°ā§āϕ⧇āϟ āĻĒā§āϞ⧇āϏ, āĻŦā§āϝāĻŦāĻšāĻžāϰ⧇āϰ āϰ⧇āĻŸā§‡āϰ āφāĻĒā§āϏ -āĻĄāĻžāωāύ, āĻŦā§āϝāĻŦāĻšāĻžāϰ⧇āϰ āĻĒā§āĻ°ā§Ÿā§‹āĻ— āĻāĻ• āĻāĻ• āϰāĻ•āĻŽāĨ¤ āĻāϟāĻž āύāĻŋāĻ°ā§āĻ­āϰ āĻ•āϰ⧇ āĻĻ⧃āĻˇā§āϟāĻŋāĻ­āĻ™ā§āĻ—āĻŋāϰ āωāĻĒāϰ āĨ¤ āĻāĻ•āϟāĻž āϛ⧋āϟ āωāĻĻāĻžāĻšāϰāύ āĻĻāĻŋāϞ⧇ āϏāĻšāϜ āĻšāĻŦ⧇ āĻŦ⧁āĻāϤ⧇, āĻāĻ•āĻŦāĻžāϰ āϜ⧁āĻŽāϞāĻžāϰ āĻāĻ•āϟāĻž āχāϭ⧇āĻ¨ā§āϟ āĻļ⧇āώ⧇ āφāĻŽāϰāĻž āϏāĻŦāĻžāχ āĻ–ā§‡ā§ŸāĻžāϞ āĻ•āϰāϞāĻžāĻŽ, āĻ•āĻžāωāĻ›āĻžāϰ āĻ­āĻžāχ āĻāϰ āϞ⧇āĻ•āϚāĻžāϰ āĻ›āĻŋāϞ āϜ⧁āĻŽāϞāĻž āĻĻāĻŋā§Ÿā§‡ āϏāĻžāχāϟ āĻŦāĻžāύāĻžāύ⧋āϰ āϜāĻ¨ā§āϝ āφāĻĒāύāĻžāϕ⧇ āϕ⧋āĻĄāĻŋāĻ‚ āϜāĻžāύāϤ⧇ āĻšāĻŦ⧇ āύāĻž āφāϰ āφāĻŽāĻžāϰ āϞ⧇āĻ•āϚāĻžāϰ āĻ›āĻŋāϞ āϕ⧋āĻĄāĻŋāĻ‚ āϜāĻžāύāϤ⧇ āĻšāĻŦ⧇āĨ¤ āϝ⧇āĻšā§‡āϤ⧁ āωāύāĻŋ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āϟ āύāĻŋā§Ÿā§‡ āĻŦāϞ⧇āϛ⧇āύ āωāύāĻžāϰ āĻĒāĻžāϰāϏāĻĒāĻŋāĻ•ā§āϟāĻŋāĻ­ āĻĨ⧇āϕ⧇, āφāĻŽāĻŋ āĻāĻ•ā§āϏāĻŸā§‡āύāĻļāύ āύāĻŋā§Ÿā§‡ āĻŦāϞ⧇āĻ›āĻŋ āφāĻŽāĻžāϰ āĻĒāĻžāϰāĻ¸ā§āĻĒāĻŋāĻ•ā§āϟāĻŋāĻ­ āĻĨ⧇āϕ⧇āĨ¤ āĻĻ⧁āχāϜāύāχ āϏāĻ āĻŋāĻ•āĨ¤ āĻāϰ āĻŽāĻžāύ⧇ āĻĻāĻžā§œāĻžāĻšā§āϛ⧇ āφāĻĒāύāĻŋ āϝāĻĻāĻŋ āϜ⧁āĻŽāϞāĻž āύāĻŋā§Ÿā§‡ āϏāĻŽāĻžāϞ⧋āϚāύāĻž āĻ•āϰ⧇āύ āϤāĻžāĻšāϞ⧇ āĻāϟāĻž āĻœā§‡āύ⧇ āĻ•āϰ⧇āύāĨ¤ āĻĄāĻŋāϜāĻŋāϟāĻžāϞ āĻ“ā§ŸāĻžāĻ°ā§āĻ˛ā§āĻĄā§‡ āϜ⧁āĻŽāϞāĻžāϰ āĻāĻ•ā§āϏāĻŸā§‡āύāĻļāύ āĻĄā§‡āϭ⧇āϞāĻĒ āύāĻŋā§Ÿā§‡ āĻāĻ•āϟāĻž āϞ⧇āĻ•āϚāĻžāϰ/āĻ¸ā§āĻĒāĻŋāĻ• āĻĨāĻžāĻ•āϤ⧇āχ āĻĒāĻžāϰāϤāĨ¤ āĻ•āĻŽāĻŋāωāύāĻŋāϟāĻŋāϤ⧇ āĻĒā§‹āĻ¸ā§āϟ āĻšāϤ⧇ āĻĒāĻžāϰāϤ āφāĻ—ā§āϰāĻšā§€ āĻ¸ā§āĻĒā§€āĻ•āĻžāϰ āĻāĻŦāĻ‚ āϟāĻĒāĻŋāĻ• āϞāĻŋāĻ¸ā§āϟ āύāĻŋā§Ÿā§‡āĨ¤ āĻšā§ŸāϤ⧋ āĻŦ⧇āϏāĻŋāϏ āĻāϟāĻž āĻŽā§āϝāĻžāύ⧇āϜ āĻ•āϰ⧇, āϏ⧇āϟāĻž āϤāĻžāĻĻ⧇āϰ āĻŦā§āϝāĻžāĻĒāĻžāϰāĨ¤ āφāĻŽāĻŋ āφāĻŽāĻžāϰ āĻāĻ•āĻžāĻ¨ā§āϤ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āĻŽāϤāĻžāĻŽāϤ āĻĻāĻŋāĻšā§āĻ›āĻŋāĨ¤

// āĻāĻ•āχ āĻŦāĻŋāώ⧟ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āĻ…āύ⧇āĻ• āϗ⧁āϞ⧋ āĻ—ā§āϰ⧁āĻĒ āĻĨāĻžāĻ•āϤ⧇ āĻĒāĻžāϰ⧇, āϜāĻžāĻ¤ā§€ā§Ÿ āχāϭ⧇āĻ¨ā§āĻŸā§‡ āϏāĻŦāĻžāχāϕ⧇ āĻāĻ•ā§āϟāĻŋāĻ­ āĻ—ā§āϰ⧁āĻĒāϗ⧁āϞ⧋āϕ⧇ āϏāĻŽāĻ¨ā§āĻŦ⧟ āĻ•āϰāĻž āωāϚāĻŋā§Ž, āĻŦā§āϝāĻ•ā§āϤāĻŋ āϕ⧇āĻ¨ā§āĻĻā§āϰāĻŋāĻ• āϏāĻŋāĻĻā§āϧāĻžāĻ¨ā§āϤ āύāĻž āύāĻŋā§Ÿā§‡āĨ¤

//āϕ⧋āύ āĻ…āĻĒāĻžāϰ⧇āϟāĻŋāĻ‚ āϏāĻŋāĻ¸ā§āĻŸā§‡āĻŽ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻ›āĻŋ āϏ⧇āϟāĻž āφāĻŽāϰāĻž āϜāĻ¨ā§āϝ āĻāϤ āϗ⧁āϰ⧁āĻ¤ā§āĻŦāĻĒā§‚āĻ°ā§āĻŖ āύāĻž, āϏ⧇āχ āĻ…āĻĒāĻžāϰ⧇āϟāĻŋāĻ‚ āϏāĻŋāĻ¸ā§āĻŸā§‡āĻŽā§‡ āφāĻŽāĻŋ āĻ¸ā§āĻŦāĻžāĻšā§āĻ›āĻ¨ā§āĻĻ⧇ āĻ•āĻžāϜ āĻ•āϰāĻ›āĻŋ āĻĒāĻžāϰāĻ›āĻŋ āĻ•āĻŋāύāĻž āϏ⧇āϟāĻžāϕ⧇ āϗ⧁āϰ⧁āĻ¤ā§āĻŦ āĻĻā§‡ā§ŸāĨ¤

//āϜ⧁āĻŽāϞāĻž āϏāĻŽā§āĻĒāĻ°ā§āϕ⧇ āϜāĻžāύāĻžāϰ āφāϗ⧇ āĻĨ⧇āϕ⧇ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āĻāϰ āĻĒā§āϰ⧇āĻŽā§‡ āĻĒā§œā§‡āĻ›āĻŋāĨ¤ āĻĒāϰ⧇ āϚāĻžāĻ•āϰ⧀ āĻ•āϰāϤ⧇ āĻ—āĻŋā§Ÿā§‡ āϜ⧁āĻŽāϞāĻžāϤ⧇ āĻ•āĻžāϜ āĻ•āϰ⧇ āĻāϟāĻžāϤ⧇āĻ“ āĻ•āĻžāϜ āĻļ⧁āϰ⧁ āĻ•āϰāĻŋāĨ¤ āϜ⧁āĻŽāϞāĻž, āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āĻ•āĻŋāĻ‚āĻŦāĻž āĻŽā§āĻĄāϞ āĻāϗ⧁āϞ⧋āϰ āĻĒā§āϰāϤāĻŋāϟāĻŋāϤ⧇ āĻ•āĻžāϜ āĻ•āϰāĻ›āĻŋ āĻĒā§āϝāĻžāĻļāύ āĻĨ⧇āϕ⧇, āϟāĻžāĻ•āĻž āĻ†ā§Ÿ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āύāĻžāĨ¤ āϟāĻžāĻ•āĻž āĻ†ā§Ÿ āĻāĻ•āϟāĻŋ āĻĒā§āϰāĻžāĻ•āϟāĻŋāĻ•ā§āϝāĻžāϞ āϧāĻžāĻĒ āĻ•āĻžāϰāĻŖ āĻ•āĻžāϜ āĻ•āϰāϞ⧇ āϟāĻžāĻ•āĻž āφāϏāĻŦ⧇āĨ¤

// āφāĻŽāĻŋ āĻšāύ⧁ āĻŦāϞ⧇ āφāĻŽāĻžāϰ āφāĻļ⧇ āĻĒāĻžāĻļ⧇āϰ āĻŦāĻžāĻ—āĻžāύ⧇ āφāϰ āϕ⧋āύ āĻšāύ⧁āĻŽāĻžāύ āĻĨāĻžāĻ•āϤ⧇ āĻĒāĻžāϰāĻŦ⧇ āύāĻž āĻŦāĻž āφāϰ āϕ⧇āω āĻ•āĻžāϜ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇ āύāĻž āĻāĻŽāύ āĻ­āĻžāĻŦāĻžāϰ āĻ•āĻžāϰāĻŖ āύāĻžāχāĨ¤ āφāĻŽāĻŋ ‘x’ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻ› āĻŦāϞ⧇ āφāĻļ⧇ āĻĒāĻžāĻļ⧇āϰ āϏāĻŦāĻžāχ ‘x’ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻŦ⧇ āĻāĻŽāύ āĻ­āĻžāĻŦāĻžāϰ āĻ•āĻŋāϛ⧁ āύāĻžāχāĨ¤ āϏāĻšāϜ āĻ•āĻžāϜ āϏāĻŦāĻžāχ āĻ•āϰ⧇, āĻ•āĻ āĻŋāύ āĻ•āĻžāϜ āĻ•āϰāĻžāϰ āϞ⧋āϕ⧇āϰ āĻ…āĻ­āĻžāĻŦāĨ¤ ‘āĻ•’ āĻĒā§āϰāϤāĻŋāĻˇā§āĻ āĻžāύ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āύāĻŋā§Ÿā§‡ āϕ⧋āĻ°ā§āϏ āĻ•āϰāĻžāϞ⧇ ‘āĻ–’ āĻ—ā§āϰ⧁āĻĒ⧇āϰ āĻ—āĻžāĻ¤ā§āϰ āĻĻāĻžāĻš āĻšāĻŦāĻžāϰ āĻ•āĻŋāϛ⧁ āύāĻžāχāĨ¤ ‘āĻ—’ āϜ⧁āĻŽāϞāĻžāϰ āĻāĻ•āϟāĻž āĻ­āĻžāϞ⧋ āĻŸā§‡āĻŽāĻĒā§āϞ⧇āĻŸā§‡ āĻŦāĻžāύāĻžāϞ⧇ ‘āϘ’ āĻ•āĻŽā§āĻĒāĻžāύ⧀āϰ āĻāϟāĻž āύāĻŋā§Ÿā§‡ āϘāώāĻžāϘāώāĻŋāϰ āĻ•āĻŋāϛ⧁ āύāĻžāχāĨ¤ āĻĒāĻžāϰāϞ⧇ āĻ­āĻžāϞ⧋ āĻ•āĻŋāϛ⧁ āĻ•āϰ, āĻĒāĻžāϰāϞ⧇ āĻ­āĻžāϞ⧋ āĻ•āĻžāĻœā§‡āϰ āĻĒā§āϰāĻļāĻ‚āϏāĻž āĻ•āϰ, āĻ–āĻžāϰāĻžāĻĒ āĻ•āĻžāĻœā§‡āϰ āĻĒāĻœā§‡āϟāĻŋāĻ­ āϏāĻŽāĻžāϞ⧋āϚāύāĻž āĻ•āϰāĨ¤ āĻ•āĻŋāϛ⧁āĻĻāĻŋāύ āφāϗ⧇ āϰāĻžāĻ—ā§€āĻŦ āĻ­āĻžāĻ‡ā§Ÿā§‡āϰ āĻļāĻŋāĻ•ā§āώāĻ• āϏāĻžāχāĻŸā§‡āϰ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āĻāϰ āĻāĻ•āϟāĻž āϕ⧋āĻ°ā§āϏ āύāĻŋā§Ÿā§‡ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏāĻŋ⧟āĻžāύ āĻ—ā§āϰ⧁āĻĒ⧇āϰ āϏāĻžāϧāĻžāϰāĻŖ āϏāĻĻāĻ¸ā§āϝ⧇āϰ āĻĒāĻžāĻļāĻžāĻĒāĻžāĻļāĻŋ āĻāĻĄāĻŽāĻŋāύāĻĻ⧇āϰ āĻĒāĻ•ā§āώ āĻĨ⧇āϕ⧇ āĻ•ā§ā§ŽāĻļāĻŋāϤ āĻ­āĻžāϞ⧋ āύ⧇āϗ⧇āϟāĻŋāĻ­ āϏāĻŽāĻžāϞ⧋āϚāύāĻž āĻ•āϰāϤ⧇ āĻĻ⧇āϖ⧇āĻ›āĻŋāĨ¤ āĻĻā§āĻŦāĻžā§ŸāĻŋāĻ¤ā§āĻŦāĻļā§€āϞāϤāĻž āφāϰ āĻŦāĻžāϞāĻ–āĻŋāĻ˛ā§āϝāϤāĻž āĻāĻ• āύ⧟āĨ¤ āφāĻŽāĻŋ āύāĻŋāĻœā§‡āĻ“ āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏāĻŋ⧟āĻžāύ āĻ—ā§āϰ⧁āĻĒ⧇āϰ āύāĻŋ⧟āĻŽāĻŋāϤ āϏāĻĻāĻ¸ā§āϝ, āϏāĻŽā§Ÿ āĻĒ⧇āϞ⧇āχ āϏāĻžāĻšāĻžāĻ¯ā§āϝ āĻ•āϰāĻŋ āĻ…āĻ¨ā§āϝāĻĻ⧇āϰ āϝ⧇āĻŽāύāϟāĻž āϜ⧁āĻŽāϞāĻž āĻŦāĻžāĻ‚āϞāĻžāĻĻ⧇āĻļ āĻ—ā§āϰ⧁āĻĒ⧇āĨ¤ āύāϤ⧁āύāϰāĻž āωāĻĻā§āĻ­ā§ā§Ž āĻ­āĻžāĻŦ⧇ āĻĒā§āϰāĻļā§āύ āĻ•āϰāϞ⧇ āϤāĻžāĻĻ⧇āϰ āĻŽāĻžāĻĨāĻž āĻ āĻžāĻ¨ā§āĻĄāĻž āĻ•āϰ⧇ āϕ⧋āύ āϏāĻŽā§Ÿ āĻŽāϜāĻž āĻ•āϰ⧇ āĻŦāĻž āϕ⧋āύ āϏāĻŽā§Ÿ āĻŦāĻ•āĻž āĻĻāĻŋā§Ÿā§‡ āϏāĻžāĻšāĻžāĻ¯ā§āϝ āĻ•āϰāĻžāϰ āĻšā§‡āĻ¸ā§āϟāĻž āĻ•āϰāĻŋāĨ¤

//āĻ•āĻžāωāϕ⧇ āĻĢāϞ⧋ āύāĻž āĻ•āϰ⧇ āύāĻŋāĻœā§‡āϰ āĻŽāϤ āύāĻŋāĻœā§‡āϰ āĻŸā§āϰ⧇āĻ¨ā§āĻĄ āύāĻŋā§Ÿā§‡ āϚāϞāϤ⧇ āĻĒāĻ›āĻ¨ā§āĻĻ āĻ•āϰāĻŋāĨ¤ āϕ⧇āω āφāĻŽāĻžāϕ⧇ āĻĢāϞ⧋ āĻ•āϰ⧁āĻ• āύāĻž āĻ•āϰ⧁āĻ• āϤāĻž āύāĻŋā§Ÿā§‡ āφāĻŽāĻžāϰ āϕ⧋āύ āϚāĻŋāĻ¨ā§āϤāĻž āύāĻžāχāĨ¤ āφāĻŽāĻžāϰ āĻ•āĻžāωāϕ⧇ āĻĢāϞ⧋ āĻ•āϰāϤ⧇āχ āĻšāĻŦ⧇ āĻāĻŽāύ āĻ­āĻžāĻŦāĻžāϰ āĻ•āĻŋāϛ⧁ āύāĻžāχāĨ¤ āϤāĻŦ⧇ āĻ•āĻŽāĻŋāωāύāĻŋāϟāĻŋ āχāϭ⧇āĻ¨ā§āϟ āϗ⧁āϞ⧋āϤ⧇ āφāĻŽāĻŋ āϏāĻŦāĻžāχāϕ⧇ āϏāĻŽā§āĻŽāĻžāύ āĻĻ⧇āĻ“ā§ŸāĻžāϰ āĻšā§‡āĻ¸ā§āϟāĻž āĻ•āϰāĻŋ āĻāĻŦāĻ‚ āϏāĻŦāĻžāϰ āĻŽāϤāĻžāĻŽāϤ āĻ—ā§āϰāĻšāύ āĻ•āϰ⧇ āĻ•āĻžāϜ āĻ•āϰāϤ⧇ āĻĒāĻ›āĻ¨ā§āĻĻ āĻ•āϰāĻŋ, āĻĻāĻŋāύ āĻļ⧇āώ⧇ āĻ•āĻžāϜāϗ⧁āϞ⧋ āĻļ⧇āώ āĻ•āϰāϤ⧇ āĻĒāĻ›āĻ¨ā§āĻĻ āĻ•āϰāĻŋāĨ¤

// āĻšā§āϟ āϜ⧁āĻŽāϞāĻž āĻŦāĻž āĻ“ā§ŸāĻžāĻ°ā§āĻĄāĻĒā§āϰ⧇āϏ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰ⧇ āϟāĻžāĻ•āĻž āĻ•āϰāĻž āϟāĻžāχāĻĒ āϞ⧋āĻ• āφāĻŽāĻŋ āύāχ, āφāĻŽāĻŋ āφāĻŽāĻžāϰ āĻ•ā§āϝāĻžāϰāĻŋ⧟āĻžāϰ āĻāϰ āĻļ⧁āϰ⧁ āĻĨ⧇āϕ⧇ āĻāϗ⧁āϞ⧋ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ āĻ•āϰāĻŋ, āϝāϤāĻĻā§‚āϰ āϏāĻŽā§āĻ­āĻŦ āĻ•āĻŽāĻŋāωāύāĻŋāϟāĻŋāϤ⧇ āĻ•āĻ¨ā§āĻŸā§āϰāĻŋāĻŦāĻŋāωāϟ āĻ•āϰāĻžāϰ āĻšā§‡āĻ¸ā§āϟāĻž āĻ•āϰāĻŋāĨ¤ āĻĒā§āϝāĻžāĻļāύ āĻĨ⧇āϕ⧇ āĻ•āϰāĻŋāĨ¤

āύ⧋āϟāσ āĻāĻ•āĻžāĻ¨ā§āϤ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āĻŽāϤāĻžāĻŽāϤ, āĻĒāĻœā§‡āϟāĻŋāĻ­ āϏāĻŽāĻžāϞ⧋āϚāύāĻžāĻ“ āφāϛ⧇ āĻ•āĻŋāϛ⧁ āϜāĻžā§ŸāĻ—āĻžā§Ÿ, āĻ•āĻžāϰ⧋ āĻ•āĻžāϰ⧋ āĻŦā§āϝāĻ•ā§āϤāĻŋāĻ—āϤ āĻ­āĻžāĻŦ⧇ āϞāĻžāĻ—āϤ⧇ āĻĒāĻžāϰ⧇ āĻ•āĻŋāĻ¨ā§āϤ⧁ āϏāĻ¤ā§āϝ āϏāĻŦ āϏāĻŽā§Ÿ āĻ•āĻ āĻŋāύ āĻšāĻŦ⧇ āĻāĻŦāĻ‚ āφāĻĒāύāĻŋ āĻšā§ŸāϤ⧋ āĻŽāύ⧇ āĻ•āϰāϤ⧇ āĻĒāĻžāϰ⧇āύ , āφāĻŽāĻžāϰ āĻāχ āϞ⧇āĻ–āĻžāϕ⧇ āφāĻĒāύāĻŋ āĻĒāĻžāĻ¤ā§āϤāĻž āĻĻ⧇āύ āύāĻž āĻ•āĻŋāĻ¨ā§āϤ⧁ āϏāĻŽā§Ÿ āύāĻŋā§Ÿā§‡ āϧ⧈āĻ°ā§āĻ¯ā§āϝ āϧāϰ⧇ āĻĒ⧜āĻžāϰ āϜāĻ¨ā§āϝ āϧāĻ¨ā§āϝāĻŦāĻžāĻĻ

āĻĒā§‹āĻ¸ā§āϟāϟāĻŋāϰ āϏāĻžāĻĨ⧇ āϏāĻŽā§āĻĒāĻ°ā§āĻ•āĻŋāϤ āĻāĻŦāĻ‚ āϏāĻŽā§āĻĒāĻ°ā§āĻ•āĻŋāϤ āύ⧟ āĻāĻŽāύ āĻ•ā§Ÿā§‡āĻ•āϜāύāϕ⧇ āĻŸā§āϝāĻžāĻ— āĻ•āϰāϞāĻžāĻŽāĨ¤ āϕ⧇āω āϚāĻžāχāϞ⧇ āύāĻŋāĻœā§‡āϕ⧇ āφāύ āĻŸā§āϝāĻžāĻ— āĻ•āϰ⧇ āύāĻŋāϤ⧇ āĻĒāĻžāϰ⧇āύāĨ¤

Adding custom fields to ‘any’ joomla component’s any view

I was finding is there any way to add custom fields to joomla core component (please don’t start discussing about other 3rd party has those options built in as I know them and I wanted this with core joomla, btw, I didn’t check the tables for j3.2 yet)

Found this in joomla docs http://docs.joomla.org/Adding_custom_fields_to_the_article_component

where they showed an example how to use the #__user_profiles table where custom or extra user fields are stored.

This seems funny to me what will happen when someone add custom field for user id suppose 321 and same way article id 321 ? !

Current structure of the #__user_profiles table is https://gist.github.com/manchumahara/7427002

I think we need something like
https://gist.github.com/manchumahara/7426784


CREATE TABLE IF NOT EXISTS `#__cbcustompostmeta` (
  `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `post_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `component` varchar(255) DEFAULT NULL,
  `meta_key` varchar(255) DEFAULT NULL,
  `meta_value` longtext,
  PRIMARY KEY (`meta_id`),
  KEY `post_id` (`post_id`),
  KEY `meta_key` (`meta_key`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

This table sql is little modified from wordpress meta table. I added the extra col ‘component’.

The good use of this table structure is post_id can be used to store any component’s any single view (article , category, event, contact etc) id (means article id, event id, or category id)

for ‘component’ col value should be inserted following this convension “com_content.article” , we need to use the view name with component as for same component we may need to add custom fields for different view like for event component event and venue both are treated as single article .

What do you think ?

Jomsocial auth Controller callback fix to allow other application

I was working with a new extension for jomsocial for auto update any jomsocial status update to linkedin. Please note that jomsocial has a packaged apps for twitter for such purpose and that’s why I was trying to go with same thing for linkedin and tried to use the jomsocial library etc. After authentication callback it was trying to access a method of jomsocial default twitter plugin. That means a hardcode class and it’s method.

Let me share the controller class
[code language=”php”]
class CommunityOauthController extends CommunityBaseController
{
public function callback()
{
$mainframe =& JFactory::getApplication();
$my = CFactory::getUser();
$denied = JRequest::getVar( ‘denied’ , ” );
$app = JRequest::getVar( ‘app’ , ” );
$url = CRoute::_(‘index.php?option=com_community&view=profile&userid=’ . $my->id , false );

if( empty($app) )
{
echo JText::_(‘COM_COMMUNITY_INVALID_APPLICATION’);
return;
}

if( $my->id == 0 )
{
echo JText::_(‘COM_COMMUNITY_INVALID_ACCESS’);
return;
}

if( !empty( $denied ) )
{
$mainframe->redirect( $url , JText::_( ‘COM_COMMUNITY_OAUTH_APPLICATION_ACCESS_DENIED_WARNING’ ) );
}

$oauth =& JTable::getInstance( ‘Oauth’ , ‘CTable’ );
if( $oauth->load( $my->id , $app ) )
{
$consumer = plgCommunityTwitter::getConsumer();
$oauth->userid = $my->id;
$oauth->app = $app;
$getData = JRequest::get(‘get’);

try
{
$oauth->accesstoken = serialize( $consumer->getAccessToken( $getData , unserialize( $oauth->requesttoken ) ) );
}
catch( Exception $error )
{
$mainframe->redirect( $url , $error->getMessage() );
}

if( !empty($oauth->accesstoken) )
{
$oauth->store();
}
$msg = JText::_( ‘COM_COMMUNITY_OAUTH_AUTHENTICATION_SUCCESS’ );
$mainframe->redirect( $url , $msg );
}
}
[/code]

Check line number 31
$consumer = plgCommunityTwitter::getConsumer();

Suppose if we take the getConsumer() method is a standard practice to get the configuration for the authentication method for jomsocial application for social network then we can make the plgCommunityTwitter class name here dynamic depending on the variable found from
$app = JRequest::getVar( ‘app’ , ” );

for twitter we get $app = ‘twitter’ and as I was developing another apps plugin and it’s application name is “cblinkedin” it will get $app = ‘cblinkedin’

So just modifying the line 31 will give other extension developer use this controller and this will be more practical and my suggestion here is modifying the code like

[code language=”php”]
//$consumer = plgCommunityTwitter::getConsumer();
//$consumer = plgCommunityCBLinkedin::getConsumer();
$appclassname = strtolower(‘plgCommunity’.$app);
$consumer = call_user_func( array($appclassname,’getConsumer’) );
[/code]

What do you think ?

BTW, we are close to develop an jomsocial extension that will allow users to update their jomsocial status update to linkedin as the core twitter apps does. Let me show my screenshot of current work.

I am testing here

Update: 12.08.2012
I have a new update for the above issue and that can be solved using adding an extra method in the plugin.

Solution is using onSystemStart method and check if the app is your plugin app and task is call back.
[code language=”php”]
function onSystemStart(){
$mainframe =& JFactory::getApplication();
$my = CFactory::getUser();
$denied = JRequest::getVar( ‘denied’ , ” );
$app = JRequest::getVar( ‘app’ , ” );
$task = JRequest::getVar( ‘task’ , ” );
$url = CRoute::_(‘index.php?option=com_community&view=profile&userid=’ . $my->id , false );
if($app == ‘cblinkedin’ && $task == ‘callback’){
if( $my->id == 0 )
{
echo JText::_(‘COM_COMMUNITY_INVALID_ACCESS’);
return;
}

if( !empty( $denied ) )
{
$mainframe->redirect( $url , JText::_( ‘COM_COMMUNITY_OAUTH_APPLICATION_ACCESS_DENIED_WARNING’ ) );
}

$oauth =& JTable::getInstance( ‘Oauth’ , ‘CTable’ );
if( $oauth->load( $my->id , $app ) )
{

$consumer = plgCommunityCBLinkedin::getConsumer();
$oauth->userid = $my->id;
$oauth->app = $app;
$getData = JRequest::get(‘get’);

try
{
$oauth->accesstoken = serialize( $consumer->getAccessToken( $getData , unserialize( $oauth->requesttoken ) ) );
}
catch( Exception $error )
{
$mainframe->redirect( $url , $error->getMessage() );
}

if( !empty($oauth->accesstoken) )
{
$oauth->store();
}
$msg = JText::_( ‘COM_COMMUNITY_OAUTH_AUTHENTICATION_SUCCESS’ );
$mainframe->redirect( $url , $msg );
}
}

}
[/code]

But still I think if jomsocial gives 3rd party plugins execution for it’s built in Controller.

Quick tips to work with joomla caching in different joomla versions

Here just some quick tips about how to use joomla caching in joomla extensions , here for module and component.

For joomla 1.5 module caching:

[code language=”php”]

//$params, $module are global parameter here , can be used in default.php or have to pass in helper method.
$enable_cache = $params->get(‘cache’,0);
$cachetime = $params->get(‘cache_time’,0);
//for 1.5
if($enable_cache == 1) {
$conf =& JFactory::getConfig();
$cache = &JFactory::getCache($module->module);
$cache->setLifeTime( $params->get( ‘cache_time’, $conf->getValue( ‘config.cachetime’ ) * 60 ) );
$cache->setCaching(true);
$cache->setCacheValidation(true);
$output = $cache->get( array(‘modClassname’, ‘getMethod’), array($params, $module));
} else {
$output = modClassname::getMethod($params,$module);
}

[/code]

For joomla 1.6 we do the same thing in following way

[code language=”php”]
$cacheparams = new stdClass;
$cacheparams->cachemode = ‘safeuri’;
$cacheparams->class = ‘modClassname’;
$cacheparams->method = ‘getMethod’;
$cacheparams->methodparams = array($params,$module);
$cacheparams->modeparams = array(‘id’=>’int’,’Itemid’=>’int’);
$output = JModuleHelper::moduleCache ($module, $params, $cacheparams);
[/code]

For joomla 1.5 and 1.6 compatibility we can code like this which will work for both joomla version

[code language=”php”]
$enable_cache = $params->get(‘cache’,0);
$cachetime = $params->get(‘cache_time’,0);
if(version_compare(JVERSION,’1.6.0′,’ge’)) {
$cacheparams = new stdClass;
$cacheparams->cachemode = ‘safeuri’;
$cacheparams->class = ‘modClassname’;
$cacheparams->method = ‘getMethod’;
$cacheparams->methodparams = array($params,$module);
$cacheparams->modeparams = array(‘id’=>’int’,’Itemid’=>’int’);
$output = JModuleHelper::moduleCache ($module, $params, $cacheparams);
}
else{
//for 1.5
if($enable_cache == 1) {
$conf =& JFactory::getConfig();
$cache = &JFactory::getCache($module->module);
$cache->setLifeTime( $params->get( ‘cache_time’, $conf->getValue( ‘config.cachetime’ ) * 60 ) );
$cache->setCaching(true);
$cache->setCacheValidation(true);
$output = $cache->get( array(‘modClassname’, ‘getMethod’), array($params, $module));
} else {
$output = modClassname::getMethod($params,$module);
}
}
[/code]

Note: here I assumed the modClassname is the class name of the helper and modMethod is the method used to handle the caching part. In next post I will write something about the component caching and in 3rd one post about how to caching when we are not doing any function call or how about handle caching in plugin. Let me have time for the next post.

Detect User type in joomla 1.6 or later

In Joomla1.5.x we can detect user type easily or check if a user is admin type.
[code language=”php”]
$isadmin = false;
$user =&JFactory::getUser();
if($user->usertype == "Super Administrator" || $user->usertype == "Administrator"){
$isadmin = true;
}
[/code]

But from joomla 1.6 as the user group architecture is changed the above way will not work.
From j1.6 we can do this in this way, here actually I was trying to detect if the user is super user or not like admin user in j1.5

[code language=”php”]
$isadmin = false;
$user =&JFactory::getUser();
$db = JFactory::getDbo();
//var_dump($user->getAuthorisedGroups());
$userid = intval($user->get( ‘id’ ));
if($userid > 0){
$query = $db->getQuery(true);
$query->select(‘g.title AS group_name’)
->from(‘#__usergroups AS g’)
->leftJoin(‘#__user_usergroup_map AS map ON map.group_id = g.id’)
->where(‘map.user_id = ‘.(int) $userid);
$db->setQuery($query);
$ugp = $db->loadObject();
$usertype = $ugp->group_name;
if(is_string($usertype)) $usertype = array($usertype);
if(in_array(‘Super Users’, $usertype)){
$isadmin = true;
}
//var_dump($usertype);
}
[/code]

thanks

My trouble story about ‘onContentPrepare’ hook for joomla

1. I was developing a content plugin for joomla, currently I was working with joomla1.6 or earlier.
2. My target was skip some specific or used defined category for the plugin execution as this is very useful feature.
3. It works in article details page but doesn’t work in other view of com_content component. Why
4. Here is the function that get’s hooked in content plugin for onContentPrepare
Continue reading