Archive for December, 2008

Fix No Bootable Partition in Table at start up

Tuesday, December 30th, 2008

For the last 2 days in my Christmas holiday, I have struggled to accomplish one of my ambition that is having three operating systems dwell inside my new laptop. XP, Vista, and Ubuntu that was the most ideal installation sequence if you want turn your PC into triple boot device, but that is not an option in my case. My laptop come preinstalled with Vista and the stupid product recovery discs will erase all partitions, turn it back into Vista brick. At one point, I face this blank black screen with a message “No Bootable Partition In Table” when I try to boot the laptop.

How to fix this “No Bootable Partition Table” ? If your PC produce this kind of weird message, big chance you have modified your Master Boot Record (MBR) or your PC can’t find one. You don’t need to understand what is this, but it is record on your hard drive that contains boot instruction. These are options that you can do to fix this.

Have a look if you get the right device to boot. New Computers today are capable to boot from numerous devices including CD/DVD drive and Flash Drive/USB devices apart from HDD. if your computer try to boot from flash drive / disc without any master boot record, it will throw this error message. Try to remove any USB devices and CD/DVD from your PC. Try to make sure the boot sequence point to your HDD first in BIOS setting.

If the first step does not solve any problem, you have to recover, restore, or create new MBR by using your operating system disc. This task can be daunting for some people, you may want to get IT Savvy to get this done for you.
Windows Vista installation DVD can be used to fix master boot record of your Vista installation. Other option is installing other boot manager such as GRUB which is used by Linux Ubuntu. You can google “Fix master boot record” to get into detail of this.

How to Locate, search, find file via Linux terminal (Ubuntu)

Saturday, December 13th, 2008

I have been using Linux especially Ultimate Ubuntu (really cool Ubuntu distribution) for a while and I think I will share this basic tutorial series on Linux shell commands.

One of the crucial functions that we need on every system is how to search and find. To Locate file in Linux my favourite command is “Locate” which can be run via terminal (some sort of command prompt in Linux). Open your terminal (in Ubuntu it will be Applications → Accessories → Terminal) and type in the following commands.

1
2
sudo updatedb
locate FILE_NAME_PATTERN

Updatedb creates or updates a database used by locate. If the
database already exists, its data is reused to avoid rereading directories that have not changed. Locate will find files which match your pattern and display the list (for example: locate libflashplayer.so, locate *.mp3, locate lib*, etc.).

You should not execute “updatedb” everytime you need to find file, but if you have just installed, or added new files to your system then you will need “updatedb” to includes these files on your search.

To get more information, read the manual of Locate and Updatedb by executing “man COMMAND_NAME”. For examples:

1
2
man updatedb
man locate

(use arrows to scroll and type ‘q’ to exit)

Add custom Admin configuration field setting for Zencart

Wednesday, December 3rd, 2008

Have you created your own module for Zencart? And you would like to add configuration setting for your module, so that your client can configure your module via Admin area? Here is how to do that…

What I do usually is adding new group (with your module name) under Configuration in zencart administrator, then add fields under that group to be setup. Just like if you go to Configuration > My Store, you will find many settings there. All of this fields are declared inside your database, specifically inside zen_configuration_group and zen_configuration table (NB: zen_ is used as table prefix).

So let’s insert new row to your zen_configuration_group to create new group under “Configuration” menu. The following SQL script will add “My New Module” group under “Configuration” menu and position it in the last order. Use this script as template.

1
2
3
4
5
INSERT INTO configuration_group
(configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible)
VALUES (NULL, 'My New Module', 'My New Module Description....', '1', '1');
 
UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

Secondly, to add config items under your new “Configuration > My New Module” use the following SQL

1
2
3
4
5
6
7
8
9
SET @last_id=0;
SELECT (@last_id:=configuration_group_id) AS last_id 
FROM configuration_group
WHERE configuration_group_title= 'My New Module';
 
INSERT INTO configuration 
(configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added)
VALUES 
('', 'Small Image Height', 'IMAGE_VIEWER_SMALL_IMAGE_HEIGHT','75','Description of Small Image Height Setting. Default 75.', @last_id, 1, now());

Note that to run this SQL smoothly without bothering with your zencart database table prefix, execute this script from zencart admin area Tools > Install SQL Patches.

Once you executed those SQL, you will find My New Module category under Configuration menu and Small Image Height setting inside that category. You can then access the value of this configuration from your module straight away by using configuration_key which you have set in your SQL (i.e. echo IMAGE_VIEWER_SMALL_IMAGE_HEIGHT). Please leave comment if you find any difficulties or feel grateful with this blog. Cheers.

Send HTML Newsletter Email to Admin Zencart 1.3.8

Monday, December 1st, 2008

In my last project, I designed new newsletter template and created custom newsletter administration area. When I send newsletter to admin to test the email, it does not send HTML email but plain text mail. Scratching my head, I searched Zencart documentation as well as Google for couple hours to find the answer. Now, I will share the solution here, just in case you go through the same pain as me.

First of all, you need to configure your Zencart to use HTML type email. Login to your administrator area and go to configuration > E-mail options.

  1. Make sure your “E-Mail Transport Method” is set appropriately
  2. Use MIME HTML When Sending Emails = “true”
  3. Send E-Mails = true
  4. Email Admin Format? = HTML

Now try to send a newsletter to the admin, if it still sends plain text mail, do the following. Backup and open in your text editor includes/functions/functions_email.php. In your functions_email.php try to find these codes

120
121
122
if (ADMIN_EXTRA_EMAIL_FORMAT == 'TEXT' && substr($module,-6)=='_extra') {
        $email_html='';  // just blank out the html portion if admin has selected text-only
}

Just below that add the following codes

125
126
127
128
// if no customer email record found, and admin email format is set to HTML, and sending newsletter, and admin is logged in, use HTML:
if ($customers_email_format_read->RecordCount() == 0 && ADMIN_EXTRA_EMAIL_FORMAT == 'HTML' && in_array($module, array('newsletters', 'product_notification')) && isset($_SESSION['admin_id'])) {
     $customers_email_format = 'HTML';
}

Now, you should send email in HTML format. Leave comment if it does not work for you or if this post has helped you and save your time.