Firefox 10 crashes on Ubuntu

When I upgraded to Firefox 10 on Ubuntu 10.04, it kept crashing. After some research, the problem seems to be an issue with the Firefox profiles. The simple fix is to just create a new profile.

To do this, open a terminal and type ‘firefox -p’. This will start Firefox with a prompt to edit the profiles. Simply create a new profile and and set it to default.

This new profile will contain none of the Firefox history, saved passwords, etc.

I really only needed the the saved passwords. To copy these, open a terminal and type ‘cd ~/.mozilla/firefox’. There should be some folders, likely two with a name like ‘as9asd7.default’. The folder with the ‘random_characters.default’ is the original profile, and the with the ‘random_characters.new_profile_name’ is the new default Firefox profile. navigate to the  ’random_characters.new_profile_name’ folder and type ‘mv key3.db key3.db` and ‘mv signons.sqlite signons.sqlite.orig’ to back up the original new profile password data. Then type ‘cp ../random_characters.default/keys3.db keys3.db’ and ‘cp ../random_characters.default/signons.sqlite signons.sqlite’ to move the old passwords and sign ons to the new profiles.

How to Edit User Registration Emails in Joomla (with Virtuemart registration)

This post is a follow up to the previous post about how to edit the registration emails in Joomla 1.5 when using stock Joomla registration. The method mentioned there does not work with the Virtuemart registration.

Virtuemart supports extended classes. This makes this task pretty easy.

First, make sure extended classes is enabled by going to the Virtuemart configuration. It is not by default.

Create a folder called user_class in the (site base)/components/com_virtuemart/themes/(theme name, probably default)/ directory.

Next create a file in this new directory ps_shopper.php and put the following code in the new file:

<?php

if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

class ps_shopper extends vm_ps_shopper {

	function _sendMail($name, $email, $username, $pwd, $activation_link='') {

	}

}

?>

Now, I recommend copying the contents of the _sendMail funtion from (site base)/administrator/components/com_virtuemart/classes/ps_shopper.php and placing it in the new _sendMail function.

In this contents you can edit the emails. In this instance, I added the IP address to the administrator emails. I first edited the language file located at (site base)/administrator/components/com_virtuemart/languages/common/english.php. Then edited the following line, adding the remote IP address.

$message2 = sprintf ($VM_LANG->_('ASEND_MSG',false), $adminName2, $mosConfig_sitename, $name, $email, $username, $_SERVER['REMOTE_ADDR']);

Upload. Viola, simple as that.

Joomla 1.6 Component Installation: “Error building Admin Menus”

While installing a component I had built, I ran across the error: “Error building Admin Menus”. All of the forums mentioned running the following command in phpMyAdmin to remove orphaned menu entries from the database.

DELETE FROM `jos_menu` WHERE link LIKE '%com_component%';

This turned out to not be the problem this time. The real culprit was my install xml file had a duplicate admin menu name:

<menu alt="Deals">COM_DEALS_DEALS</menu>
<submenu>
<menu link="option=com_deals&amp;task=new" alt="New Deal">COM_DEALS_NEW_DEAL</menu>
<menu link="option=com_deals&amp;task=view" alt="View / Edit Deals">COM_DEALS_VIEW_EDIT_DEALS</menu>
<menu link="option=com_deals&amp;task=dealer" alt="Dealer Forms">COM_DEALS_VIEW_EDIT_DEALS</menu>
</submenu>

It should have been:

<menu alt="Deals">COM_DEALS_DEALS</menu>
<submenu>
<menu link="option=com_deals&amp;task=new" alt="New Deal">COM_DEALS_NEW_DEAL</menu>
<menu link="option=com_deals&amp;task=view" alt="View / Edit Deals">COM_DEALS_VIEW_EDIT_DEALS</menu>
<menu link="option=com_deals&amp;task=dealer" alt="Dealer Forms">COM_DEALS_DEALER_FORMS</menu>
</submenu>

How to Edit User Registration Emails in Joomla

Recently I needed to change the formatting of the emails (administrator and user) that are triggered when a user registers on a Joomla 1.5 site. This is a pretty easy task in and of itself, but becomes a little more complicated to do when Virtuemart is installed and the Virtuemart registration is being used. This article explains how to change the email when using the stock Joomla registration.

To change the user registration emails when using the Joomla registration, two files need edited: /components/com_user/controller.php and /language/en-GB/en-GB.com_user.ini. In the latter there are three pertinant lines: SEND_MSG, SEND_MSG_ACTIVATE, SEND_MSG_ADMIN.

  • SEND_MSG is the message that is send to the use when email activation is disabled.
  • SEND_MSG_ACTIVATE is the email sent out when activation of accounts is enabled.
  • SEND_MSG_ADMIN is sent out in both cases, but to the administrators of the site.

Editing these allows the static text to be changed. If dynamic variables are needed, the other file, controller.php, needs to be edited. All these messages are formed with the use of sprintf. The following snippet from the _sendMail function where the messages are created for the user. It is on about line 500.

if ( $useractivation == 1 ){
	$message = sprintf ( JText::_( 'SEND_MSG_ACTIVATE' ), $name, $sitename, $siteURL."index.php?option=com_user&task=activate&activation=".$user->get('activation'), $siteURL, $username, $password);
} else {
	$message = sprintf ( JText::_( 'SEND_MSG' ), $name, $sitename, $siteURL);
}

The administrator message is created in the below line.

$message2 = sprintf ( JText::_( 'SEND_MSG_ADMIN' ), $row->name, $sitename, $name, $email, $username);

In this case, I added the IP address of the person created the user account to the administrators’ emails. I just added a “\nIP: %s” to the appropriate language entries and a “JRequest::getVar(‘REMOTE_ADDR’,”,’SERVER’)” as an argument to the sprintf.

Surprisingly, this did not place the IP in the emails. It took a little while, but I finally realized that I was using the Virtuemart registration which has its own email setup independent from that of Joomla. It does work when using the stock Joomla registration though.