Tutorials


21September

Open Joomla modal with Javascript

To open a modal box in Joomla using Javascript, first make sure the modal behavior is loaded:

JHTML::_('behavior.modal');

Then, open an external resource with an iframe handler:

SqueezeBox.setContent( 'iframe', 'http://google.com' );

Posted in Tutorials, Joomla, Development

01September

Reconfigure Plesk after vhost.conf changes

I always forget the command to reconfigure Plesk after adding a vhost.conf file.

The command to reconfigure Plesk for one site is:

/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com

or the command I use reconfigures all sites:

/usr/local/psa/admin/bin/websrvmng -a

Posted in Tutorials

31August

Pop-up calendar in Joomla

The Joomla frameworks offers an easy solution to insert a date field with a pop-up calender select box, to easily select a date. The pop-up is Mootools operated.

Posted in Tutorials, Joomla

25August

Virtuemart Paypal Currency Problem

Virtuemart has a multiple currency feature where users can select from a pre-defined set of currencies for checkout.

This is very useful, but has a major bug when checking out with Paypal. The final order logged in Virtuemart is correct, and has the correct currency. However, when the user is redirected to Paypal, the transaction will be done in the default currency of the Virtuemart shop.

This problem has existed since 2009, and in 2011 I would have expected it to be resolved already.

I would class this as a major problem as it results in incorrect transactions.

Posted in Tutorials, Development

31July

Changing NetBeans Source Directory

You can rename projects in Netbeans however, if you keep the NetBeans metadata files separate from your source files, you can not change the source directory from the Netbeans interface.

Luckily the NetBeans project files are simple text files, so we can easily change it there. Close NetBeans (so that you don’t accidentally overwrite the new project file). Find the project directory and open the directory called nbproject. Then open the file project.properties.

Change this:

src.dir=<old path>


To:

src.dir=<new path>

Posted in Tutorials

27July

Execute Joomla content plugins on string

In Joomla 1.7 (and I assume Joomla 1.6) you can very easily execute content plugins on a string.

$text = JHTML::_('content.prepare', $text );

This is much simpler than the previous method in Joomla 1.5:

$Item = JTable::getInstance('content');
$dispatcher = JDispatcher::getInstance();
$params = new JParameter('');
JPluginHelper::importPlugin('content');
$Item->parameters = new JParameter('');
$Item->id = "";
$Item->state = "";
$Item->catid = "";
$Item->sectionid "";
$Item->title "";
$Item->text = "Your text with {content plugin code}";

// Apply content plugins to custom text
$results = $dispatcher->trigger('onPrepareContent', array (&$Item, &$params, 0));

Posted in Tutorials, Joomla

12July

Display All Starred Messages in Thunderbird

I have many email accounts setup in Thunderbird, and I star message which I want to give more attention to later. Unfortunately, thunderbird does have an option to view all "starred" messages.

Posted in Tutorials

25June

Passing Joomla session variables to Flash

Flash does not load browser cookies when sending HTTP requests (except in Internet Explorer where persistent cookies are loaded). Any requests from Flash will be processed as a new user agent.

This raised a problem for me when trying to perform an AJAX request from a Flash object which required session data from Joomla. The session data of the user performing the request was not passed.

Obviously, I'm not the first to experience this issue and it is widely discussed elsewhere, but not so much when it comes to Joomla.

Posted in Tutorials, Joomla

11May

Setup WAMP to support HTTPS

When developing software locally (on Windows), like many others, I use WAMP SERVER.

WampServer is a Windows web development environment. It allows you to create web applications with Apache, PHP and the MySQL database. It also comes with PHPMyAdmin to easily manage your databases.

Wamp ServerIt is not uncommon that when developing and testing locally, I want to view pages over HTTPS. HTTPS refers to the use of ordinary HTTP over an encrypted Secure Sockets Layer (SSL) or Transport Layer Security (TLS) connection. For me, this is normally useful when testing shopping carts, etc.

It is certainly possible to setup WAMP to support this. Originally, I used the extremely detailed JLBN guide here. That guide offers much detail in every step, and if you have time to follow all 53 steps, I urge you to do so. However, not only is this article spread over multiple pages (making it difficult to quickly skip around the guide), it also has too many adverts (which break the flow of the pages) therefore, I put together a slightly more concise guide, along with a few solutions for problems I encountered along the way.

Posted in Tutorials

About Dave Horsfall

Dave Horsfall is a British software developer and founder of the hwdMediaShare project. More...

Recent Comments

  • Ppl like you get all the brains. I just get to say thanks for he awnesr.

    Rosa, 06. September, 2011 |

  • Ppl like you get all the brains. I just get to say thanks for he awnesr.

    Rosa, 06. September, 2011 |

  • No, the file should be called "project.properties", and it should be located in the same directory as the file called "project.xml". I'm...

    Dave Horsfall, 29. August, 2011 |

  • There is no file called "project.properties". There is a file "project.xml" is this the one? It is not "simple text" though...

    OppfinnarJocke, 29. August, 2011 |