Tuesday, April 28, 2009

How to display quiz from 'ARI Quiz' joomla component in content

I have recently needed a component able to organize quizzes for my Joomla project. After long investigation of all components that I managed to find, I chose ARI Quiz. This component suited my needs completely, except for one thing: I needed an option of adding quiz to the article. That's why I created a simple plugin for this purpose and I'd like to share it with Joomla community. I hope it can be useful for somebody else. You can download the plugin here.

PS: I have tested it with ARI Quiz 2.4.0+.

[Updated 05.22.09] I have good news. ARI Soft team created demo page for my plugin, you can see it here.

[Updated 31.05.09] 'ARI Quiz in content' v. 1.1.0 is available. Now it works as jQuery plugin, handles calculator events and contains some bugs fixes.

[Updated 07.07.09] Plugin v. 1.2.0 is available. Feature for loading jQuery library through Google JS API was added.

[Updated 08.02.10] 'ARI Quiz in content' v. 1.3.0. New parameter 'Remove quiz title' was added.

Overriding PHP settings in Joomla 1.5

Sometimes I need to override default PHP settings in my Joomla projects. For example, it can help when you are trying to install big Joomla component through 'Upload Package File' option, but 'max_execution_limit' PHP option has small value and component hasn't time to install. Or you need to increase 'memory_limit' option for some purposes. Yes, you can change this settings in PHP config file or change it through .htaccess file, but what are you doing when you haven't access to server? For helping in this case I have created simple plugin which helps to override PHP settings. You can download this plugin here.

PS: If you use 'PHP Settings' plugin, please post a rating and a review at the Joomla! Extensions Directory.

Sunday, April 26, 2009

How to remove inclusion of MooTools javascript library in Joomla 1.5

Somethimes in projects where Joomla 1.5 is used you may need to remove inclusion of MooTools JavaScript library. It may need when your Joomla uses another JavaScript library, for example jQuery or you don't need to use functionality which provides MooTools. While looking for solution for this, I often found the following code which may be used in template code:


$headerstuff = $this->getHeadData();
$headerstuff['scripts'] = array();

This code can break some plugins or module functionality because it removes all javascript inclusions which were done through Joomla API. If module or plugin includes required javascript file(s) through Joomla API and you are using code above, this code removes this inclusion and correct behaviour of plugin or module will be broken. I can offer more correct code for this purpose:


$headerstuff = $this->getHeadData();
$scripts = $headerstuff['scripts'];
$jsForRemove = array('mootools.js', 'caption.js');
foreach ($scripts as $key => $value)
foreach ($jsForRemove as $js)
if (strpos($key, $js) !== false) unset($scripts[$key]);

$headerstuff['scripts'] = $scripts;

Include this code before inclusion in your template and it should work fine.

Or you can use 'Inclusions Remover' Joomla plugin which helps to remove unnecessary inclusions of scripts and CSS files which were included through Joomla API. You can download it here.

PS: If you use 'Inclusions Remover' plugin, please post a rating and a review at the Joomla! Extensions Directory.