How to create a MySQL dump of database for export

1 Open the command prompt.

2 Go to  this path, by changing the directory to where MySQL is located

e.g. C:\Program Files\MySQL\MySQL Server 4.1\bin

3 Then give this command to export your database (no space after -p)

mysqldump -u[username] -p   yourdatabase > [filepath]wantedsqlfile.sql

4 You will be asked for password and enter this.

5 Your sql dump will be created at the path specified or you will be shown error message.

 

MySQL

Posted in Web Development

Form validation using jQuery Form Validator

jQuery Form Validator is a feature rich jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it’s designed to require as little bandwidth as possible. This is achieved by grouping together validation functions in “modules”, making it possible for the programmer to load only those functions that’s needed to validate a particular form.

You just need to put links to the validation library and call the library using jQuery.

Then add an attribute such as this to the input fields:

<input name=”email” data-validation=”email”>

The  validation will then be given a validation message, beside or below the input field, like this:

You have not given a correct e-mail address
Then add the following script to the footer, to connect to the libraries:
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.1.38/jquery.form-validator.min.js"></script>
<script> $.validate(); </script> 

Download the code and get further information here: 

http://formvalidator.net/

jQuery

Posted in Web Development

Never resize a thumbnail Image again

Do you spend a lot of design time catering for the ability of your website to deal with both portrait and landscape thumbnail images?

As you’ll know, if you try to re-size them a set height and width, then they will distort. If you just set one dimesion, in other words just set the height or the width, then the output may upset the layout of your website page.

Then this is a huge advance and time-saver.  A jQuery gallery that will resize your images.

It’s straightforward to use.

This will show you how to use the library:

http://www.garralab.com/nailthumb.php

It’s bound to be a timesaver, judging by the amount of time I spend altering designs to copy with landscape and portrait images.

 

Posted in Web Development

How to make video cross-browser compatible in HTML5

Using HTML5 has made it easier to have video that works cross-browser using the  <video> html tag.

First Step: Create the Video Files

The first thing to do is to make sure your files are in the right format for HTML5 video playing. Right now, there’s no standard format so you’ll have to have multiple versions of the same file in order to serve the right format to the client browser. This is indeed the biggest problem with HTML5 videos right now.

You’ll need the 3 following formats: The first is .mp4 (or .m4v) which is used on Apple products such as iPads, Safari, etc. The second format needed is .ogv, an open-source format used by Firefox. And the last one is.webm.

Converting your file into those formats is easier if you use this  tool called Video Converter. You have nothing to install on your computer, simply upload your video, choose the desired output format, and you’re video is converted and downloaded to your computer.

 

Second Step: Coding the player

Next we need to add the code for displaying a HTML5 video on a web page. Not that in order to have the video properly displayed on iPad, you must start with the .mp4 video in the src list.

Don’t forget to  add a download link for older browsers which don’t recognize the <video> tag.

<video width="800" height="374">
	<source src="my_video.mp4" type="video/mp4" />
	<source src="my_video.ogv" type="video/ogg" />
	<source src="my_video.webm" type="video/webm" />
	Video tag not supported. Download the video <a href="video.webm"&gthere</a&gt.
</video>

Important Note
A very important thing to remember is to make sure your server is serving video files with the correct MIME type in the Content-Type header. To make sure it will, open your site .htaccess file (don’t forget to do a backup before any modification) and add the lines below:

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

Also, various attributes can be used with the <video> element, for example to autoplay the video, loop it, or automatically display some controls. For the full reference, please see the w3 site.

 

Creating a fallback for older browsers

Now, you have a super cool HTML5 video player. You still haven’t accounted for some older browsers don’t support any HTML video at all. For those browsers, the only solution is to use a Flash fallback. If you want to support older browsers then consider  using this solution.

 

Posted in Web Development

Securing a .Net website

There’s a harsh reality web application developers need to face up to; we don’t do security very well. A report from WhiteHat Security last year reported “83% of websites have had a high, critical or urgent issue”. That is, quite simply, a staggeringly high number and it’s only once you start to delve into to depths of web security that you begin to understand just how easy it is to inadvertently produce vulnerable code.

A large part of the problem is education. Oftentimes developers are simply either not aware of common security risks at all or they’re familiar with some of the terms but don’t understand the execution and consequently how to secure against them.

Read these comprehensive reports here:

Open Web Application Security Project

http://www.troyhunt.com/2010/05/owasp-top-10-for-net-developers-part-1.html

XSS attacks

http://www.troyhunt.com/2010/05/owasp-top-10-for-net-developers-part-2.html

 

New website: http://www.dreamtime-theatre.com/

Posted in Web Development

Customize the WordPress admin menu based on user roles

 

If you have multiple users for WordPress administration,  some can end up with permissions that you really wish they didn’t have. There are plenty of plugins that will let you customize user permissions but it’s not that hard to do ourselves by removing certain links from the admin menu for those specific user roles.

Basic example

Add the following to functions.php (or create your own plugin) to remove the “Tools” menu from any user with a role lower than Author.

Note that this method doesn’t actually remove user permissions but just the admin menu links that would get them there.

add_action( 'admin_init''my_remove_menu_pages' );
function my_remove_menu_pages() {
  // If the user does not have access to publish posts
  if(!current_user_can('publish_posts')) {
    // Remove the "Tools" menu
    remove_menu_page('tools.php');
  }
}

 

You can choose a variety of user levels rather than publish_posts for example edit_usersdelete_pages, etc. View a complete list of WordPress roles and capabilities.

The function remove_menu_page() removes a menu item based off of the menu slug you pass it. To figure out that the menu slug was named tools.php I used used Chrome’s developer tools and right clicked on the Tools menu and selected Inspect element. This showed me that the tools menu was linked as<a href="tools.php" tabindex="1">Tools</a>.

To save you the hassle of figuring out each menu slug I listed them below.

Removing sub-menu items

add_action( 'admin_init''my_remove_menu_pages' );
function my_remove_menu_pages() {
// If the user does not have access to add new users
if(!current_user_can('add_users')) {
// Remove the "Link Categories" menu under "Links"
remove_submenu_page( 'link-manager.php''edit-tags.php?taxonomy=link_category' );
}
}

 

The function remove_submenu_page() is similar but takes two arguments, the parent menu’s slug and the sub-menu’s slug. Once again you can find the slugs by inspecting each menu link or view the complete list below.

Mixed example

add_action( 'admin_init''my_remove_menu_pages' );
function my_remove_menu_pages() {
  if(!current_user_can('add_users')) {
    remove_menu_page('options-general.php'); // Settings
    remove_menu_page('tools.php'); // Tools
    remove_menu_page('upload.php'); // Media
    remove_submenu_page( 'edit.php''edit-tags.php?taxonomy=category'); // Post categories
    remove_submenu_page( 'edit.php''edit-tags.php?taxonomy=post_tag'); // Post tags
  }
}

WordPress admin menu slugs

Dashboard remove_menu_page(‘index.php’);
Dashboard remove_submenu_page( ‘index.php’, ‘index.php’ );
Updates remove_submenu_page( ‘index.php’, ‘update-core.php’ );

Posts remove_menu_page(‘edit.php’);
Posts remove_submenu_page( ‘edit.php’, ‘edit.php’ );
Add New remove_submenu_page( ‘edit.php’, ‘post-new.php’ );
Categories remove_submenu_page( ‘edit.php’, ‘edit-tags.php?taxonomy=category’ );
Post Tags remove_submenu_page( ‘edit.php’, ‘edit-tags.php?taxonomy=post_tag’ );
Media remove_menu_page(‘upload.php’);
Library remove_submenu_page( ‘upload.php’, ‘upload.php’ );
Add New remove_submenu_page( ‘upload.php’, ‘media-new.php’ );
Links remove_menu_page(‘link-manager.php’);
Links remove_submenu_page( ‘link-manager.php’, ‘link-manager.php’ );
Add New remove_submenu_page( ‘link-manager.php’, ‘link-add.php’ );
Link Categories remove_submenu_page( ‘link-manager.php’, ‘edit-tags.php?taxonomy=link_category’ );
Pages remove_menu_page(‘edit.php?post_type=page’);
Pages remove_submenu_page( ‘edit.php?post_type=page’, ‘edit.php?post_type=page’ );
Add New remove_submenu_page( ‘edit.php?post_type=page’, ‘post-new.php?post_type=page’ );
Comments remove_menu_page(‘edit-comments.php’);

Appearance remove_menu_page(‘themes.php’);
Themes remove_submenu_page( ‘themes.php’, ‘themes.php’ );
Widgets remove_submenu_page( ‘themes.php’, ‘widgets.php’ );
Menus remove_submenu_page( ‘themes.php’, ‘nav-menus.php’ );
Editor remove_submenu_page( ‘themes.php’, ‘theme-editor.php’ );
Plugins remove_menu_page(‘plugins.php’);
Plugins remove_submenu_page( ‘plugins.php’, ‘plugins.php’ );
Add New remove_submenu_page( ‘plugins.php’, ‘plugin-install.php’ );
Editor remove_submenu_page( ‘plugins.php’, ‘plugin-editor.php’ );
Users remove_menu_page(‘users.php’);
Users remove_submenu_page( ‘users.php’, ‘users.php’ );
Add New remove_submenu_page( ‘users.php’, ‘user-new.php’ );
Your Profile remove_submenu_page( ‘users.php’, ‘profile.php’ );
Tools remove_menu_page(‘tools.php’);
Tools remove_submenu_page( ‘tools.php’, ‘tools.php’ );
Import remove_submenu_page( ‘tools.php’, ‘import.php’ );
Export remove_submenu_page( ‘tools.php’, ‘export.php’ );
Settings remove_menu_page(‘options-general.php’);
General remove_submenu_page( ‘options-general.php’, ‘options-general.php’ );
Writing remove_submenu_page( ‘options-general.php’, ‘options-writing.php’ );
Reading remove_submenu_page( ‘options-general.php’, ‘options-reading.php’ );
Discussion remove_submenu_page( ‘options-general.php’, ‘options-discussion.php’ );
Media remove_submenu_page( ‘options-general.php’, ‘options-media.php’ );
Privacy remove_submenu_page( ‘options-general.php’, ‘options-privacy.php’ );
Permalinks remove_submenu_page( ‘options-general.php’, ‘options-permalink.php’ );
Posted in Wordpress

Simple Guide to Social Media Cheat Sheet

Should you use social media for your small business. This guide gives a good appraisal as to whether  the various options are really relevant to your business:

http://blog.ineedhits.com/search-news/the-small-business-social-media-cheat-sheet-infograph-132010964.html

 

Belfast Web Design Northern Ireland

Tagged with:
Posted in Web Development, Wordpress

Landing page best practices to convert browsers into customers..

Landing pages are critical for any promotion specific marketing – but in particular for paid marketing where a measured ROI is essential to your success .

The purpose of a landing page is to provide a hyper-focused experience that is designed to accomplish the singular conversion goal of your marketing campaign.

The reason why you want to direct your paid traffic to a landing page vs. your homepage is that your homepage is often designed to be a generic entry point to your brand and business. It may contain references to many products or services – rendering the ability for a potential customer to find your intended conversion path more difficult.

Read more:

http://visualwebsiteoptimizer.com/split-testing-blog/landing-page-best-practices/

Posted in Web Development

Bing:18 things you need to know about SEO

Here’s  a list that Bing has released which should be taken into account when optimizing your websites. It gives an insight into what factors are important for ranking well in Bing searches:

http://www.bing.com/community/site_blogs/b/webmaster/archive/2011/08/19/18-things-you-need-to-know-about-seo.aspx

Posted in Web Development

Useful WordPress items

This is a list of my own references for use in WordPress sites:

How to remove/hide items in admin menu:

http://camwebdesign.com/techniques/simplify-the-wordpress-admin-sidebar-navigation/

30 best website plugins

http://blog.ineedhits.com/tips-advice/the-best-30-wordpress-website-plugins-for-2011-30149564.html?source=NL11-05-31BNLblog1h

Customise posts in order or  a Custom Field

http://kovshenin.com/archives/customize-posts-order-in-wordpress-via-custom-fields/

How to set up Home Page so can be edited as a Page

http://bloggingexperiment.com/archives/wordpress-page-as-home-page.php

Posted in Wordpress

Contact Us

Whether your requirements are small or large, please get in touch and I will be more than happy to provide you with a quote.
Phone: +44 77 42585924