|
|
|
May 24th, 2009
Here’s how to check, repair and optimise all your mysql tables in all databases on a server…
Am really loving the mysqlcheck command… it allows you to:
- check all mysql tables
- repair all mysql tables
- optimise all mysql tables
in one command…! Mysql rocks..!
mysqlcheck - u root - p - -auto-repair - -check - -optimize - -all-databases
That’s it..
Some tips:
- it’s probably best to kill all incoming processes to speed this up
- even better just to stop the web server (httpd) run this command and restart (add a friendly message for users to see while the site is down)
(Remember if you are using a tool like phpmyadmin (http://www.phpmyadmin.com) you can always log in, browse to the table, select operations and choose “repair”, “check”, “analyse” or “optimise table”)
Posted in Web development, Open Source, Tips, command line, Server administration, LAMP, mysql, Unix, database administration | Comments Off
April 9th, 2009
15 Essential Checks Before Launching Your Website via Smashing Magazine
Good checklist of things to do before releasing your site to the public. For example: cross browser compatibility, META data, validate XHTML & CSS.
Also available is an indepth PDF: website_launch_checklist_v1.pdf
10 Ways to Automatically & Manually Backup MYSQL Databases via Noupe
This article gives 10 ways that you can quickly backup your databases. Well written and easy to follow.
Twitter, So Easy, You Have To Do It via Mashable
“Every now and then there’s talk about folks who don’t want to tweet. It looks as though there is some kind of Twitter-tyranny going on, where everyone who’s not into Twitter (Twitter reviews) is some kind of social outcast, ostracized and shunned by the rest of the world.”
Twitterfall
Very innovative use of the Twitter REST API, Search API and the new OAuth. Twitterfall displays tweets as a casdading list and allows you to filter by popular trends or #hashtag. Just sit back and watch them scroll in. Great to watch while eating lunch.
Posted in Web development, Web design, Accessibility, Useful Links, Tips, Web 2.0, seo, Illustrator, Quality Assurance, Web standards, CSS, HTML, JavaScript, xhtml, Errors, Blogs, Design, research & strategy, Information Architecture, Usability | Comments Off
March 13th, 2009
The essentials of CSS and HTML as web standards opened new doors for web designers but also forced them to adapt their thinking. A case in point is fonts.
In web terms there are few fonts which are recognised by all browser/operating system combinations. Split into font families these are:
Serif: Times, Times New Roman, Georgia, New Century Schoolbook.
Sans-Serif: Arial, Helvetica, Verdana, Trebuchet.
Monospace: Courier, Courier New.
Cursive: Comic Sans, Zapf Chancery, Coronet.
Fantasy: Impact, Western, Papyrus.
Controlling fonts online is not easy since each browser has got a different default font; the best way to declare fonts is in cascading style sheets (css).
It is always good not to declare just one font type
body {font-family: Times;},
In case the browser doesn’t have a default font as the chosen font.
Instead use multiple font decoration:
body {font-family: Times, Times New Roman, Georgia, New Century Schoolbook;}
In this way you ensure that if the first font is not available the browser will choose a latter one and your design will look as you intended.
We can force css to use a font that is not in the list of fonts for the web. But other browsers might not support the same font and the result would be a different work flow from our design. To be safe always use the fonts for web.
Keep in mind:
- font with the same decoration should relate to the same font family;
- size and spacing could have a different visual effect even if the fonts are from the same font family.
Source: Lynda.com
Posted in Web development, typography | Comments Off
March 13th, 2009
There are 2 general categories for measuring font sizes in cascading style sheets (css) - fixed units and relative measurements.
Fixed units are used for print:
points (12pt)
in (.25in)
cm (30cm)
Relative measurements are used for the web:
em (1em)
ex (1.2ex)
percentage (100%)
pixels (16px)
1em: is relative to the nearest parent font size, and is the most secure because it is supported in Internet Explorer (I.E.).
Ex: is equal to the “x” size of particular font, but the size of the font can change dramatically when changing the font family.
Percentage: is the percentage of the size of the text compared to the default value (100%).
Px: pixels are based on the current resolution of the view, but with I.E. 7 this can create some problems, because the browser doesn’t allow for screen resizing by pixel based font size, so users are not able to change the font size.
The most secure font measurements to use for a web page are therefore: em and percentage.
Source: http://www.lynda.com interactive training.
Posted in Web development, Web design, typography | Comments Off
March 6th, 2009
The favicon is the little icon that usually appears next to the navigation tool bar of your browser.

First of all, you need to create a favcion.
In Photoshop open the icon or logo that you want to use as favicon.
Reduce the size of the icon to 16 pixels by 16 pixels, and save it in PNG 24.
After you save the icon in your image folder, change the name of the file to favico.ico (instead of png).
Then open the website that you are working on, login as admin, go to
ADMINISTER > Themes > Configure



At the bottom of the page you will see a box “Short cut icon settings”.
Browse the file called favicon.ico and upland the file.

Tick off the “default shortcut icon” and save configuration.
Posted in Web development, Drupal, Drupal customisation, Drupal development, Drupal styling, Drupal configuration | Comments Off
February 8th, 2009
jQuery is a lightweight JavaScript library which allows you to create dynamic client-side effects with simple code. The code is very stripped back from typical JavaScript – the code for selecting elements and their descendents is more similar to CSS than DOM syntax. The logic behind the code is also similar to CSS. Like how CSS separates design from the HTML structure, jQuery separates the behavior. jQuery can be activated simply by linking to it as you would any other external JavaScript file.
To reference a jQuery function, you must supply a namespace. This can be written as ‘jQuery’, but is conventionally written as ‘$’. For example;
jQuery.trim(string);
// is the same as
$.trim(string);
Whole elements can be selected, including those with particular classes or IDs. The class and ID selectors are ‘.’ and ‘#’ respectively, the same as in CSS.
// select all paragraphs
$(“p”);
// select all paragraphs with the ‘main’ class
$(“p.main”);
// set the value of the element with the ID of ‘unique'
$(“#unique”).val(“testing”);
Adding and removing classes to tags can be done easily with the addClass() and removeClass() functions.
$(“a”).addClass(“primary-link”);
$(“a”).removeClass(“primary-link”);
You can test if an element has a class by using the hasClass() function.
if ( $(“p”).hasClass(“important”) )
…
Functions are also chainable to help with more complicated selection and tasks.
// add an “impressive” class to all paragraphs within the “parent” div
$(“div#parent”).add(“p”).addClass(“impressive”);
As you can see from these code examples, jQuery allows you to do a lot with very little code. It’s this simplification and separation from the main HTML structure that makes it so useful for web developers. Use of jQuery has risen dramatically since its launch in 2006, with big names like the BBC, MSNBC and Digg now using it prominently. This popularity should see it stick around for a while, and is a useful addition to any developer’s toolkit.
Posted in Web development, JavaScript, jquery | Comments Off
February 8th, 2009
A customized Drupal module won’t be very useful if the admin user can’t configure it to their needs. This usually consists of several form fields where variables and inputs can be set. Within the module these fields are created within a function, however unlike other common module functions this one is not a hook and does not need a specific function name (although the names are usually along the lines of testmodule_admin or testmodule_settings). The following is an example of the structure these functions can take.
function testmodule_admin_settings() {
$form[‘testmodule_nodeno’] = array(
‘#type’ => ‘textfield’,
‘#title’ => t(‘Number of nodes to include’),
‘#default_value’ => variable_get(‘testmodule_nodeno’, 5),
‘#size’ => 2,
‘#maxlength’ => 2,
‘#description’ => t(‘The number of nodes to display.’),
‘#required’ => true,
);
return system_settings_form($form);
}
No HTML has to be coded to create the form, as this is all done by Drupal. The systems_settings_form function is used to add default buttons and set a form prefix. Note that variable_get is used to set the default value.
However, these settings mean nothing if they don’t interact with how the main module displays its contents. In most cases this involves grabbing information from the database – this information needs to conform to our configuration settings. In this example, we want to limit the number of nodes retrieved to 5.
$nodesmax = variable_get(‘testmodule_nodeno’, 5);
$sql = ‘SELECT nid, title FROM {node}’;
$result = db_query_range($sql, 0, $nodesmax);
To add this page to the sites menu system we must make use of hook_menu. Here we can set the page path, title and permissions.
function testmodule_menu() {
$items = array();
$items[‘admin/settings/testmodule’] = array (
‘title’ => ‘Test module settings’,
‘description’ => ‘Set a node limit to your test module.’,
‘page callback’ => ‘drupal_get_form’,
‘page arguments’ => array(‘testmodule_admin_settings’),
‘access arguments’ => array(‘access administration pages’),
‘type’ => MENU_NORMAL_ITEM,
);
return $item;
}
If you have already installed and enabled your module, it may be worth disabling and enabling it again for the new settings page to work properly.
Resource: http://drupal.org/node/206761
Posted in Web development, Drupal, Drupal modules, Drupal customisation, Drupal development, Drupal configuration | Comments Off
February 8th, 2009
Modules are the building blocks for Drupal sites. They’re an easy way to add functionality to your site, and there’s a wide variety to choose from. All modules must include a modulename.info file, which explains descriptive information about the module.
There are 3 required details needed in this file – the module name, a description, and the version of Drupal the module is built for. This should be written as below:
name = Test module name
description = A simple module to test my coding skills.
core = 6.x
Note: in the module name, only the first letter should be capitalised. For the description, apostrophes should be avoided, instead use HTML entities.
There also optional strings that can be included in the .info file. If your module relies on any other modules to work, then these should be included in this file. In the following example, our new module relies on the blog and profile modules.
dependencies[] = blog
dependencies[] = profile
Another optional string is called ‘package’. On the main module list page the blocks are grouped by type for legibility. The idea is to place your module alongside similar modules to make it easy to find. For example, if you module involved video, then you could place with other video modules by using the following code:
package = “Video”
Posted in Web development, Drupal, Drupal modules, Drupal development, Drupal configuration | Comments Off
December 28th, 2008
The British Council’s educational social network site - English Online (http://www.englishonline.hk/en and http://m.englishonline.hk/en (mobile version)) has now almost 90,000 registered users! (88,460 registered usesr at the current time of writing on 28th December 2008).
Well done to Andy Newton and the English Online team at the British Council… at this rate of growth the site will have over 100,000 users in early 2009!
English Online was built using Drupal by Brightlemon. To find out how to use Drupal and social networking concepts to power your projects - contact Brightlemon today…
Latest Members
There are 88,460 users on British Council - English Online.

Posted in Brightlemon news, Web development, social networking, Web 2.0, Drupal, Drupal Themes, Drupal modules, Drupal customisation, Drupal development, case study | Comments Off
November 28th, 2008
Below are some examples of websites that use Drupal’s successful framework.
Music organisations such as MTV UK, Warner Brothers Records and Sony BMG.

Individual record artists websites - Bob Dylan, Grateful Dead, Ozzzy Osbourne, Avril Lavigne

Non Governmental Organisations - amnesty International and End Poverty 2015

Sites which benefit from advance Drupal functionality - Spread Firefox & Yahoo research


Posted in Web development, e-commerce, Drupal, Drupal Themes, Drupal views, Drupal regions, Drupal development, Drupal video, Drupal training | Comments Off
|
|
|