WorldOWeb http://www.worldoweb.co.uk Resources tutorials and inspiration on Linux, Web Design, WordPress, PHP, jQuery and Open Source. Tue, 10 Feb 2015 23:16:32 +0000 en-US hourly 1 100th Post in a 1000 Words-A Story of Love, Life and Griefhttp://www.worldoweb.co.uk/2015/100th-post-1000-words-story-love-life-grief http://www.worldoweb.co.uk/2015/100th-post-1000-words-story-love-life-grief#comments Tue, 10 Feb 2015 23:11:52 +0000 http://www.worldoweb.co.uk/?p=7912 By Tracy Ridge

I had plans that my 100th post would be special so I am dedicating it to the life of my fiance Shaun, of 16 years, who was suddenly taken away from me on the 1st January at the age of 35.  Here is our story of love, life and grief. Early Days We first met […]

The post 100th Post in a 1000 Words-A Story of Love, Life and Grief appeared first on WorldOWeb.

]]>
By Tracy Ridge

I had plans that my 100th post would be special so I am dedicating it to the life of my fiance Shaun, of 16 years, who was suddenly taken away from me on the 1st January at the age of 35.  Here is our story of love, life and grief.

Early Days

We first met in 1998 whilst Shaun was celebrating his 19th birthday on Friday 29th May and I was out celebrating my 18th Birthday, which was the day before. Our relationship was steady at first but the more I got to know him the more I liked. He was warm, kind, funny, generous and loving.  In 2000, after 2 years we moved into my family home together for 6 months when he was offered promotion with his job, in Aberdeen, Scotland. He felt like he had to take up the chance and when he first went he loved it and then 3 months later I followed him.

Robert Burns Poem

Very fitting poem by Robbie Burns used in Shaun’s ‘Celebration of life’ service

It was a difficult move to make, leaving our families behind but we knew that if it didn’t work out we could go back.  In October 2001 I was dealt a cruel blow being diagnosed with Hodgkin’s Lymphoma, I faced 6 months of intensive chemotherapy. Within 3 months of finishing chemo I found out that I was pregnant with our daughter Caitlin who, after a difficult pregnancy, was born in March 2003.  Being able to have children was a dream come true for both of us.

Our family was complete in April 2006 when our son Cameron was born but in September of that year we were dealt another bitter blow.  Shaun had a freak near-fatal motorcycle accident.  He spent 9 weeks in hospital averaging 2 operations a week on his shattered leg.  He spent 4 more years of agonising operations and intensive physiotherapy going from a wheelchair to crutches and eventually a walking stick. Despite the excruciating pain he never moaned or felt sorry for himself.

In 2012 he decided that he was going to start his own Handyman business.  The walking stick went, he built up his confidence and his business, which relied on very little advertising, grew stronger and stronger.  Despite the pain and his diagnosis of arthritis and curvature of the spine in January 2014, life was good, business was good.  We finally planned to get married and consider moving home in 2015, it would be our time.

We had a fantastic Christmas and we celebrated the New Year coming in with our friends as we did every year.  New Years Day celebrations got off to a good start after having our annual family dinner with our friends we settled down to watch a movie when Shaun suddenly collapsed.  Myself and a friend desperately tried to resuscitate him with the paramedics taking over when they arrived.  Within an hour they announced that they were unable to resuscitate him and he was gone.

Although I was calm, my heart was pounding with shock, I said my goodbyes and had to face the agonising task of telling our children (Aged 11 & 8), who had been taken away by friends when he collapsed, and our families back in England.

Week 1

The first week went by with many questions unanswered Why? How? Have I done something wrong? I had little sleep, little food yet I had 2 children to look after who are also grieving.  Friends came round in droves to offer condolences, support, wash the dishes, clean and encourage.  This support got me through the day, prevented me from going into hibernation.

Weeks 2 & 3

Weeks 2 & 3 were spent planning his funeral even though at this stage I hadn’t found out the cause. The questions were still unanswered, I felt like I was the one that was being blamed until the dreaded phone call came.  Shaun had died from an undiagnosed genetic heart condition called Cardiomyopathy and there is a 50% chance that your children may also have it!

It felt like I had been repeatedly punched in the face.  Grieving for Shaun and now face the prospect of my children having the same condition.  I was still angry at life at this stage.  Shaun battled the stress of all those operations and nothing ever flagged up!  Trying to think of positives; Did Shaun spare his life to save our children?

Week 4

Week 4 came, the funeral was 4 weeks to the day.  A constant flow of family and friends arrived from across the UK to attend.  I was reunited with Shaun for the first time since and all I remember is walking in/out, comforting the kids and thanking people at the end.  The flow of visitors slowly dispersed to continue with normality although I was thankful that they travelled half way up the country to say their goodbyes.  The funeral is meant to bring closure, does it?

Week 5

Spent the week  phoning banks, insurance companies, changing names, cancelling stuff I don’t need and by this time I hadn’t had an income for 5 weeks, living off savings with a funeral to pay for and 2 children to support.  I  just wanted to grieve but knew I had to this.  I sit here, alone at night whilst the kids are asleep, still expecting him to walk through the door,  I can’t accept that he’s gone quite yet.  If someone was to tell me on the morning of New Years Day that in 5 weeks Shaun would be in a plastic container, in the form of ashes, in my cupboard I would have probably laughed.

Future

I take each day as it comes,  some days are better than others. I’m in a vicious circle of feeling guilty for having a laugh, frustrated when I spend hours on the phone trying to speak to a human being and not a computer (for once), utterly heartbroken that he’s gone and won’t see his kids grow up and yet thankful for the memories we shared.  The last 16 years we had a fair share of problems but in the last 2 years we had plenty of family time and those times were precious!

 

Shaun’s choice of funeral song

 

 

The post 100th Post in a 1000 Words-A Story of Love, Life and Grief appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2015/100th-post-1000-words-story-love-life-grief/feed 0
With The Deepest Sadnesshttp://www.worldoweb.co.uk/2015/deepest-sadness http://www.worldoweb.co.uk/2015/deepest-sadness#comments Sat, 03 Jan 2015 23:10:54 +0000 http://www.worldoweb.co.uk/?p=7897 By Tracy Ridge

It is with the deepest sadness my Fiance and soulmate for the past 16 years was suddenly taken away from me on New Years Day at the tender age of 35.  Shaun was a dedicated father and hard working man with a heart of gold.  We spent the last 2 weeks together as a family, having […]

The post With The Deepest Sadness appeared first on WorldOWeb.

]]>
By Tracy Ridge

It is with the deepest sadness my Fiance and soulmate for the past 16 years was suddenly taken away from me on New Years Day at the tender age of 35.  Shaun was a dedicated father and hard working man with a heart of gold.  We spent the last 2 weeks together as a family, having fun and doing what families should do.  Time is precious!

 

Me and Shaun

RIP Shaun 01-01-2015

 

 

The post With The Deepest Sadness appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2015/deepest-sadness/feed 0
Preparing for an Upgrade – My Yosemite Experiencehttp://www.worldoweb.co.uk/2014/preparing-upgrade-yosemite-experience http://www.worldoweb.co.uk/2014/preparing-upgrade-yosemite-experience#comments Sun, 14 Dec 2014 20:52:03 +0000 http://www.worldoweb.co.uk/?p=7739 By Tracy Ridge

When a new operating system is released  you question yourself.  Do I really need an upgrade?  How easy is it?  Do I dive in or wait for the mass participation to die down?  Do I research blogs to find the good, bad and ugly, will it put me off? I guess the answer is all […]

The post Preparing for an Upgrade – My Yosemite Experience appeared first on WorldOWeb.

]]>
By Tracy Ridge

When a new operating system is released  you question yourself.  Do I really need an upgrade?  How easy is it?  Do I dive in or wait for the mass participation to die down?  Do I research blogs to find the good, bad and ugly, will it put me off? I guess the answer is all of them.  Here is my experience with my recent Yosemite upgrade on my 2-year-old Mac.

Computer Display

Image provided by SGM / Shutterstock.com

Preparing is key

I’m don’t necessarily suffer from OCD but having gone through the process of losing data many years ago.  I have always been an advocate of backing things up especially after my friend once had to pay over £600 to resurrect her personal photos after her hard drive failed. These days there are so many inexpensive and easy ways to backup your data there is no excuse for not doing it.  When I lost my data all those years ago I didn’t have any external drive or network drive (was too expensive),  services like Dropbox didn’t exist and your options were limited to backing up to CD’s, DVD’s or if you were fortunate enough to have a secondary hard drive.  Luckily the data I lost was minimal as I did frequent backups.

Key preparation is identifying what is important to you. It could be software you use daily, important files, collection of graphics or ebooks that you can’t live without.  My key items were Ampps (Web Development Server Software), Mail and being able to connect to my MyBookLive (NAS).  These important key items are always backed up manually by exporting all of my emails from Apple Mail in .mbox format and copying the entire Ampps Folder in Applications then pasting them into my personal folder on my NAS.  If I couldn’t access my Time Machine Backup after upgrade I know I have these files available to work with.  After backing up manually I did a full Time Machine backup.

Research

I kept an eye on Yosemite development since it was made public,  I opted out for testing as my Mac is my primary computer, although my PC with Linux Mint is a very close 2nd, I certainly didn’t want unnecessary risk of vital apps not working.   I was happy to read plenty of articles, both positive and negative on the new features or any reported problems.  The positives outweighed the negatives for me.  I enjoy looking at screenshots but I never judged the book by its cover.  For me it’s the stuff that it’s built on and not the aesthetics.  The real test is when it’s installed!

After my last upgrade (Mountain Lion -> Mavericks) I decided to start afresh and install Yosemite on a clean wiped hard drive.  This is more time-consuming than a normal upgrade but for me after 2 years it was much-needed.

I had looked at several tutorials on the web and came across the mashable one which I decided to follow.  I first downloaded Yosemite and installed DiskMaker X to create my bootable USB.  On reboot I wiped my drive and started the installation which ran rather smoothly and I didn’t encounter any problems.

Installation and Restoring Data/Accounts

On reboot I really liked the look of Yosemite and it’s new polished flatter design, like I said before it’s not all about the looks it how the OS performs.  The first port of call was to add all my accounts. Windows Live, Yahoo, Facebook, Twitter and LinkedIn all worked flawlessly.  Gmail on the other hand kept prompting me for an application specific password, despite creating one.

Google Account Password Screenshot

The 2nd attempt I tried to get access to my account through Safari, which prompted me to add the account.  This was great but unfortunately the apps box appeared directly over the authentication box which required an input (Code from my mobile phone) to go ahead with no option to minimise it.  I had to force quit safari.

Google Safari Bug Screenshot

The 3rd attempt was to try to add the account to Mail app which worked thankfully although I had continuous problems with the outgoing SMTP server which wouldn’t accept my created password, thankfully this was resolved in the 10.10.1 update shortly after.

My computer recognised that I had a NAS on my network so it was time to use the Migration Assistant to migrate some apps and data from my Time Machine Backup.  Migration Assistant recognised that I had a storage device but failed to display any backups.  I had to mount my Time Machine backup manually in finder to restore my apps and data.

New Features

Some of the key features that prompted me to upgrade was the closer interaction with other iOS devices (iPad/iPhone).  The handoff feature which requires being on the same network and bluetooth enabled, lets you start something, like composing an email, on one device and finish it off in Yosemite and vice versa.  Obviously you need handoff compatible apps but as things progress I am sure we will see more of these.

Spotlight which I rarely used in Mavericks has been beefed up, now in the center of the screen displaying far more information, previewing of files, interacting with Wikipedia and displaying map info.  Apple have certainly got spotlight spot on.  Will it convert people from Alfred or Quicksilver, who knows!

The best feature for Mail is now being able to send bigger attachments via iCloud automatically, similar to Dropbox and providing that you have the right amount of space available you will not have any issues with email attachments again.

Conclusion

Despite the few problems initially I am very happy with the performance I get from my Mac and after using Yosemite for a month now I am glad I waited a few weeks before taking the big step.  After reading all the problems with WiFi that people were reporting I haven’t had any such issue.

There are risks associated with any Operating System Upgrade, researching, preparing and always having the mindset to backup and have different methods of doing the same thing can be the difference between getting things done or throwing your computer out of the window.  Patience is definitely a virtue!

The post Preparing for an Upgrade – My Yosemite Experience appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/preparing-upgrade-yosemite-experience/feed 0
WOW Playground – PHP Checkboxes Revisitedhttp://www.worldoweb.co.uk/2014/wow-playground-php-checkboxes-revisited http://www.worldoweb.co.uk/2014/wow-playground-php-checkboxes-revisited#comments Sat, 29 Nov 2014 21:22:29 +0000 http://www.worldoweb.co.uk/?p=7802 By Tracy Ridge

Having checked back at some of my popular PHP and jQuery posts I decided to create WOW playground which unites all of my previous checkboxes and radio button form tutorials into one handy script.  I have updated to newer, modern technologies like HTML5, CSS3 and PDO, to handle the database.  jQuery and jQuery UI have […]

The post WOW Playground – PHP Checkboxes Revisited appeared first on WorldOWeb.

]]>
By Tracy Ridge

Having checked back at some of my popular PHP and jQuery posts I decided to create WOW playground which unites all of my previous checkboxes and radio button form tutorials into one handy script.  I have updated to newer, modern technologies like HTML5, CSS3 and PDO, to handle the database.  jQuery and jQuery UI have been updated to the latest versions with a few new features and the odd tweak here and there.

Image of Web Form

Image provided by Shutterstock

The playground features all the code from these posts in one handy page.

PHP and jQuery checkbox array with a hint of Jquery UI

Getting to grips with PHP Checkboxes

Getting to grips with PHP Radio Buttons

jQuery Disable and Enable Form Elements Using a Checkbox

Prerequisites

PHP MySQL server with PDO extension.  I’ve tested it in PHP 5.3+

Download

Version 1.0 released 29th November 2014

Download WOW Playground

Installation

Simply upload to your server or testing server.  Add your database connection details into class-databasehelpers.php.   Navigate to wow_playground/php/setup.php with your web browser and hit Setup to install the MySQL tables.  You will automatically redirected to the index page.  Please note that setup.php will be renamed automatically.

Features

The PHP code has now been cleaned up from the main page and is in the PHP folder.  fetch.php interacts with the database by fetching the information and process.php, you guessed it, processes the information from the forms and saves it to the database. jQuery and jQuery UI has been updated and as a result some deprecated functions have been removed.  For the design I have integrated CSS from the Kube Web Framework.  As for the new features I have added a button which will add a new checkbox to PHP and jQuery checkbox array demo.  I have also added a save button which will save them to the database. I have added comments throughout the code for clearer understanding.

If you encounter any problems or would like to suggest something to add then please get in touch.

The post WOW Playground – PHP Checkboxes Revisited appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/wow-playground-php-checkboxes-revisited/feed 0
The Knitting Pattern That Caused Me Grief!http://www.worldoweb.co.uk/2014/knitting-pattern-caused-grief http://www.worldoweb.co.uk/2014/knitting-pattern-caused-grief#comments Thu, 13 Nov 2014 23:31:53 +0000 http://www.worldoweb.co.uk/?p=7745 By Tracy Ridge

As bizarre as this title sounds I haven’t taken up knitting as a hobby. Recently I was called by my friend whose Windows Vista computer had shut down on her and refused to restart. Being slightly curious I paid her a visit to be greeted with a computer that had gone into hyper hibernation mode. […]

The post The Knitting Pattern That Caused Me Grief! appeared first on WorldOWeb.

]]>
By Tracy Ridge

As bizarre as this title sounds I haven’t taken up knitting as a hobby. Recently I was called by my friend whose Windows Vista computer had shut down on her and refused to restart. Being slightly curious I paid her a visit to be greeted with a computer that had gone into hyper hibernation mode. A simple long press of the power button turned it off and boy what was I greeted with when I restarted it.

Malware Detected Image

Image provided by Shutterstock

When it first loaded Windows, it appeared OK then I saw a couple of command prompt windows which started and soon went off. Having seen this before on my computer it could have been harmless but I thought I would check it out.

My first port of call was to check the Program Files folder in the main hard drive, usually C: I noticed that there were some programs that had been installed a few days before. I asked my friend if she had installed anything and she replied that she had downloaded some knitting patterns.

I checked out her downloads folder to find the culprit crazyforcrafts.exe. Unfortunately she had installed it thinking it was a knitting pattern generator of some sort.  When it was installed on her computer it disabled her firewall and security center so she didn’t know she had no firewall as there was no warnings as a result. The program ran as a system service so every time she started her computer it ran, probably installing other bad stuff along the way.

Safe Mode to the Rescue

Without any hesitation I booted it into safe mode by pressing and holding F8 on reboot. Did a full system scan with Malwarebytes which found 2000+ items of trojans, malware and potentially unwanted programs (PUP) on her system. Also ran a scan with Spybot and Microsoft Security essentials, which despite being a Microsoft App, had actually caught some of it.

Conclusion

I guess the moral of the story is never trust what you are downloading, unless it’s from an official website or a reputable company. Not everything is what it says it is!

The post The Knitting Pattern That Caused Me Grief! appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/knitting-pattern-caused-grief/feed 0
Adding Google Charts to WordPress Blog Part 2http://www.worldoweb.co.uk/2014/adding-google-charts-wordpress-blog-part-2 http://www.worldoweb.co.uk/2014/adding-google-charts-wordpress-blog-part-2#comments Fri, 10 Oct 2014 11:49:04 +0000 http://www.worldoweb.co.uk/?p=7689 By Tracy Ridge

In this mini-series of Google Visualization tutorials we will be adding a Google chart to a WordPress theme without having to install any plugins but ensuring that we use the correct WordPress functions and recommended safe way of implementing JavaScript. The data we will be pulling will be in JSON format and will be stored […]

The post Adding Google Charts to WordPress Blog Part 2 appeared first on WorldOWeb.

]]>
By Tracy Ridge

In this mini-series of Google Visualization tutorials we will be adding a Google chart to a WordPress theme without having to install any plugins but ensuring that we use the correct WordPress functions and recommended safe way of implementing JavaScript. The data we will be pulling will be in JSON format and will be stored on the same server inside the theme directory.  In this tutorial we will be adding  a stacked column chart.  Want to add a table?  Checkout part 1

Image of Stacked Column Chart

Image provided by Shutterstock

Prerequisites

Access to your WordPress theme folder.
A little knowledge of PHP and WordPress functions is useful but not required.

Download

Download

Let’s get started

In the Download above there is an example  of a correctly formatted JSON file (Purely fictional of course) which we will use to populate our data to create our chart. Upload the js and data folder to your WordPress theme folder.  If using a Child Theme upload to that folder rather than the parent.

Ajax in the head

Before we start to enable our ajax event to fire when non-admin users look at the page.  Open up header.php and check to see if ajaxurl is defined.  If not add the following  just above the wp_head() function.

<?php if (!is_admin()){?>
   		<script type="text/javascript">
    		var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
		</script>
	<?php }?>

Add the Chart container to the Blog Post/Page

Naturally you can’t have a chart without a container!  In your blog post or page add the following

<div id="chart_div" class="chart"></div>

Enqueue Our scripts

To add the JavaScript to our WordPress blog we need to officially enqueue our scripts so that they are present for the chart to load.  Open up functions.php and add the following and save (Don’t close yet).   Please note the comments at the top.

/*
*Enqueue Scripts for our chart
* 
*Optional:  
****1. Limit our table to display on a single page  - http://codex.wordpress.org/Function_Reference/is_page
****2. If you are WORKING with a child theme replace all instances of get_template_directory_uri()
****	with get_stylesheet_directory_uri()
***/

function fundraising_chart(){

	
//if (is_page('page_name')){
	wp_enqueue_script('chart', 'https://www.google.com/jsapi');
	wp_enqueue_script('chart_main', get_template_directory_uri() . ' /js/fundraising.min.js', array('jquery'));
//}
	
}

/*Add Javascript Action and our ajax actions that will be used in the fundraising chart script  */
	add_action( 'wp_enqueue_scripts', 'fundraising_chart' );

The Google Visualization library is quite heavy and unnecessary to load on each individual page or post.  Simply uncomment Lines 13 & 16 to only load the JavaScript on a specific page, replacing page_name with the Page ID, Page Title or Page Slug.  If you are displaying  your chart in a blog post replace is_page() with  is_single()   See is_page() and is_single() on the WP Codex for further details.

Build Table Action

With the JavaScript files added we now need to add the following to functions.php which is the ajax action that is called from the JavaScript file.  The build_graph function works a little differently to the build_table function in Part 1.  After we have retrieved the JSON file we decode it and add all the values together for each category ie; school and our events.  We then re-encode it to be parsed by JavaScript.  This can also be done with JavaScript if required.

add_action( 'wp_ajax_build_graph', 'build_graph' );//admin
	add_action('wp_ajax_nopriv_build_graph', 'build_graph');//frontend

function build_graph() {
	
	$url = get_template_directory_uri() .'/data/donations.json';

	$request =   wp_remote_post($url);
	// Get the body of the response
	$response = wp_remote_retrieve_body( $request );
		
		/*function get_sum will add all the amounts together and return the sum*/
		function get_sum($json){
			$keys = array();// Creates a new variable as an array
				foreach( $json as $key){//loops through the sections
  					$sum[] = $key['amount'];//finds all amount values  and adds them to an array
				}
			return array_sum($sum);//adds the all the values together
		
		}
	
		$myJson= json_decode($response, true);//decode file as an array
	
		$company = get_sum($myJson['Company']);
		$ct = get_sum($myJson['Collection Tins']);
		$ourevents = get_sum($myJson['Our Events']);
		$individual = get_sum($myJson['Individual']);
		$misc = get_sum($myJson['Miscellaneous']);
		$school = get_sum($myJson['School']);
		
/*echo json encoded array*/
echo json_encode(
	array(	'company'=>$company,
			'ct'=>$ct,
		  	'ourevents'=>$ourevents,
		  	'individual'=>$individual,
		  	'misc'=>$misc,
		  	'school'=>$school));

die();//required for ajax
	
}?>

Fundraising.js

When your page or post loads the action build_graph is fired in functions.php. If successful it will load the contents of the JSON file and add them to the row (line 37)

var $j = jQuery;

// Load the Visualization API and the chart package.
google.load("visualization", "1", {packages:["corechart"]});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);


/*Create our Chart through an Ajax request by passing the build_graph action which will be parsed with the build_gaph function in functions.php*/

function drawChart() {
	$j.ajax({
		url: ajaxurl,
		data: {
			"action": "build_graph" //run build_graph function in functions.php
		},
		dataType: "json",
		success: function (data) {
			/*data[''] represents the json data */
			var company = data.company;
			var ct = data.ct;
			var ourevents = data.ourevents;
			var individual = data.individual;
			var misc = data.misc;
			var school = data.school;

			// Create the data table.
			var data = new google.visualization.DataTable();
			data.addColumn('string', 'Name');
			data.addColumn('number', 'Our Events');
			data.addColumn('number', 'Individual');
			data.addColumn('number', 'Company');
			data.addColumn('number', 'School');
			data.addColumn('number', 'Miscellaneous');
			data.addColumn('number', 'Collection Tins');
			data.addRow([null, ourevents, individual, company, school, misc, ct]);
			// Set chart options
			var options = {
				//'width':600, //unhighlited width to allow for responsive graph - see CSS file in source
				'height': 600,
				'allowHtml': true,
				'is3D': true,
				hAxis: {
					title: 'Types of Donations'
				},
				vAxis: {
					format: 'u00A3'
				},
				'isStacked': true
			};
			var formatter = new google.visualization.NumberFormat({
				prefix: "u00A3"
			});
			formatter.format(data, 1);
			formatter.format(data, 2);
			formatter.format(data, 3);
			formatter.format(data, 4);
			formatter.format(data, 5);
			formatter.format(data, 6);

			// Instantiate and draw our chart, passing in some options.
			var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
			chart.draw(data, options);

		}
	});
}

/*The following will resize the chart in the browser*/
$j(window).resize(function () {
	drawChart();
});

Add a little CSS Spice

Open up your theme’s stylesheet and add the following to make your chart responsive.

.chart {
	width: 100%;
}

 Conclusion

If you have followed all steps correctly you should now have a fully functioning Google Chart.  If you have any problems with the code or don’t quite understand something please feel free to use the comment section below.

Example of Google Charts

 

 Further Reading

The post Adding Google Charts to WordPress Blog Part 2 appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/adding-google-charts-wordpress-blog-part-2/feed 0
Adding Google Charts to WordPress Blog Part 1http://www.worldoweb.co.uk/2014/adding-google-charts-wordpress-blog-part-1 http://www.worldoweb.co.uk/2014/adding-google-charts-wordpress-blog-part-1#comments Fri, 10 Oct 2014 11:39:32 +0000 http://www.worldoweb.co.uk/?p=7610 By Tracy Ridge

In this mini-series of Google Visualization tutorials we will be adding a Google chart to a WordPress theme without having to install any plugins but ensuring that we use the correct WordPress functions and recommended safe way of implementing JavaScript. The data we will be pulling will be in JSON format and will be stored […]

The post Adding Google Charts to WordPress Blog Part 1 appeared first on WorldOWeb.

]]>
By Tracy Ridge

In this mini-series of Google Visualization tutorials we will be adding a Google chart to a WordPress theme without having to install any plugins but ensuring that we use the correct WordPress functions and recommended safe way of implementing JavaScript. The data we will be pulling will be in JSON format and will be stored on the same server inside the theme directory.  In this tutorial we will be adding a table. Want to add a chart?  Checkout part 2

JSON - Creating a Google Chart

Image provided by Shutterstock

Prerequisites

Access to your WordPress theme folder.
A little knowledge of PHP and WordPress functions is useful but not required.

Download

Download

Let’s get started

In the Download above there is an example  of a correctly formatted JSON file (Purely fictional of course) which we will use to populate our data to create our table. Upload the js and data folder to your WordPress theme folder.  If using a Child Theme upload to that folder rather than the parent.

Ajax in the head

Before we start to enable our ajax event to fire when non-admin users look at the page.  Open up header.php and check to see if ajaxurl is defined.  If not add the following  just above the wp_head() function.

<?php if (!is_admin()){?>
   		<script type="text/javascript">
    		var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
		</script>
	<?php }?>

Add the Chart container to the Blog Post/Page

Naturally you can’t have a chart without a container!  In your blog post or page add the following

<div id="table_div" class="chart"></div>

Enqueue Our scripts

To add the JavaScript to our WordPress blog we need to officially enqueue our scripts so that they are present for the table to load.  Open up functions.php and add the following and save (Don’t close yet).   Please note the comments at the top.

/*
*Enqueue Scripts for our chart
* 
*Optional:  
****1. Limit our table to display on a single page  - http://codex.wordpress.org/Function_Reference/is_page
****2. If you are WORKING with a child theme replace all instances of get_template_directory_uri()
****	with get_stylesheet_directory_uri()
***/

function fundraising_chart(){

	
//if (is_page('page_name')){
	wp_enqueue_script('chart', 'https://www.google.com/jsapi');
	wp_enqueue_script('chart_main', get_template_directory_uri() . ' /js/fundraising.min.js', array('jquery'));
//}
	
}

/*Add Javascript Action and our ajax actions that will be used in the fundraising chart script  */
	add_action( 'wp_enqueue_scripts', 'fundraising_chart' );

The Google Visualization library is quite heavy and unnecessary to load on each individual page or post.  Simply uncomment Lines 13 & 16 to only load the JavaScript on a specific page, replacing page_name with the Page ID, Page Title or Page Slug.  If you are displaying  your chart in a blog post replace is_page() with  is_single()   See is_page() and is_single() on the WP Codex for further details.

Build Table Action

With the JavaScript files added we now need to add the following to functions.php which is the ajax action that is called from the JavaScript file.

add_action( 'wp_ajax_build_table', 'build_table' );//admin
	add_action('wp_ajax_nopriv_build_table', 'build_table');//frontend




function build_table() {
	
	//Our json file in data folder
	$url = get_template_directory_uri() .'/data/donations.json';
	
	//Retrieve json file
	$request =   wp_remote_post($url);
	
	// Get the body of the response
	$response = wp_remote_retrieve_body( $request );
	
	echo $response;
	die();
}
?>

Fundraising.js

When your page or post loads the action build_table is fired in functions.php. If successful it will load the contents of the JSON file and add them to the row (line 28)

var $j = jQuery;

// Load the Visualization API and the piechart package.

google.load("visualization", "1", {packages:["table"]});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawTable);


function drawTable() {
	$j.ajax({
		url: ajaxurl,
		data: {
			"action": "build_table" //this is the function called in functions.php
		},
		dataType: "json",
		success: function (json) {

			var data = new google.visualization.DataTable();
			data.addColumn('string', 'Name');
			data.addColumn('string', 'Type');
			data.addColumn('number', 'Amount');

			/*loop through json and add rows of content */
			for (var x in json) {
				for (var i = 0; i < json[x].length; i++) {
					data.addRow([json[x][i].name, x, json[x][i].amount, ]);
				}
			}

			var options = {
				'sortColumn': 2,
				'sortAscending': false,
				'allowHtml': true,
				'pageSize': 10,
				'page': 'enable'
			};
			var formatter = new google.visualization.NumberFormat({
				prefix: "u00A3"
			});
			formatter.format(data, 2);
			var table = new google.visualization.Table(document.getElementById('table_div'));
			table.draw(data, options);

		}
	});


}
/*The following will resize the table in the browser*/
$j(window).resize(function () {
	drawTable();
});

Add a little CSS spice

Open up your theme’s stylesheet and add the following to make your table responsive.

.chart {
	width: 100%;
}

 Conclusion

If you have followed all steps correctly you should now have a fully functioning Google Chart table.  If you have any problems with the code or don’t quite understand something please feel free to use the comment section below.

Example of Google Chart Table

 Further Reading

The post Adding Google Charts to WordPress Blog Part 1 appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/adding-google-charts-wordpress-blog-part-1/feed 2
MultCloud – Access all of Your Cloud Driveshttp://www.worldoweb.co.uk/2014/multcloud-access-cloud-drives http://www.worldoweb.co.uk/2014/multcloud-access-cloud-drives#comments Thu, 04 Sep 2014 21:39:47 +0000 http://www.worldoweb.co.uk/?p=7540 By Tracy Ridge

Multcloud is a convenient way of accessing multiple online cloud drives through the web, with no software installations neccessary, MultCloud can be convenient when travelling from office to home or have several computers in which you work from. With support for services like Dropbox, Box, Amazon S3, Google Drive, OneDrive, SugarSync, Copy, Bitcasa, CloudMe, Cubby, […]

The post MultCloud – Access all of Your Cloud Drives appeared first on WorldOWeb.

]]>
By Tracy Ridge

Multcloud is a convenient way of accessing multiple online cloud drives through the web, with no software installations neccessary, MultCloud can be convenient when travelling from office to home or have several computers in which you work from. With support for services like Dropbox, Box, Amazon S3, Google Drive, OneDrive, SugarSync, Copy, Bitcasa, CloudMe, Cubby, MyDrive, WEB.de, Yandex, HiDrive, Baidu as well as support for FTP and WebDav you can copy, move, preview, download files from one drive to another with ease.

The Cloud

Image provided by Shutterstock

What Multcloud Has To Offer

MultCloud and is 100% free with no traffic restrictions. With multiple accounts supported there is no limit on how many drives from the same provider you can add so you are able to add multiple Google Drives etc.  If you are conscious about security all connections and transfers are encrypted for SSL using 256-bit AES and Multcloud does not cache your data or files on their servers. Cloud drives are accessed using OAuth authorisation and does not save your passwords.

On Test

MultCloud has a very simple registration process. Simply go to https://www.multcloud.com/ and fill out your email, username and password, complete the verification box and click create account. After you hit create account you should receive an email to verify your account. Once verified you can sign in and start adding your accounts immediately.  Simply click Add Cloud Drives then this will bring up a list of services available.

MultCloud Add Drive

After selecting the service of your choice hit Next which will bring you to a screen where you enter your email, password etc for that service (All services differ). After entering the required data, accept the permissions and you will see your newly added drive in the file manager on the left. Follow this process for the rest of your accounts. Within 5 minutes I had signed up and added 5 accounts so this process is really quick.

The interface, similar to any other file browser is very clean and simple with a handy right-click menu. I previewed some of my images in OneDrive, which decided to work unlike transferring files, and the image loaded pretty quickly on my 5MB internet connection.

MultCloud Preview

Files can be transferred quite easily by either dragging and dropping or by right clicking on the file/folder then selecting Copy To which enables you to select your target destination/folder.

Now for the real test. I transferred a small video, just over 132MB, from Google Drive to Dropbox which took less than 2 minutes, that is considerably quicker than if I uploaded it from my computer or copied it from Google’s own software.  I attempted to transfer the video to OneDrive too but came up with an error and failed to transfer, whether this is a problem with OneDrive itself, or just relative to the day of test, it certainly wouldn’t deter me from using the service.

Rating: 9/10

Pros

  • Fast
  • Easy to use
  • Drag & Drop
  • Useful context-menu
  • Extremely accessible through any web browser and an internet connection of course
  • Good Layout

Cons

  • Transfers to OneDrive, worked occasionally but not large files

Summary

If you want a 100% free service to get access to multiple cloud drives then MultCloud will do the trick. With the added protection of 256-bit AES encryption you are free to move your files around without having to install multiple file synchronisation software. People will no doubt be saying “What’s the Catch?”

The post MultCloud – Access all of Your Cloud Drives appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/multcloud-access-cloud-drives/feed 1
Mazwai – HD Video Resources for Web Designershttp://www.worldoweb.co.uk/2014/mazwai-hd-video-resources-web-designers http://www.worldoweb.co.uk/2014/mazwai-hd-video-resources-web-designers#comments Fri, 22 Aug 2014 11:43:05 +0000 http://www.worldoweb.co.uk/?p=7526 By Tracy Ridge

Mazwai is a new stock video website which only selects the very best of free HD videos online. The purpose of Mazwai is to help every web designer, blogger, creative and artist to find great video resources for their professional and personal projects. All the video clips, footage, and mini-film are available in HD under […]

The post Mazwai – HD Video Resources for Web Designers appeared first on WorldOWeb.

]]>
By Tracy Ridge

Mazwai is a new stock video website which only selects the very best of free HD videos online. The purpose of Mazwai is to help every web designer, blogger, creative and artist to find great video resources for their professional and personal projects.


Mazwai

All the video clips, footage, and mini-film are available in HD under the public domain or the Attribution license (CC 3.0) which means that you can do everything with the video (transform, adapt, cut, share) as long as you do not forget to credit the original author in some way. There is no subscription and no download limitation.

How to use Mazwai

  • Simply click on the preview you like
  • Watch the video on the embed player
  • Simply download the video. You will receive a .zip including a .mp4 and .webm version.

If the video isn’t what you’re looking for, just simply close the player and browse the many other previews on offer. New videos added regularly to expand the choice.

The post Mazwai – HD Video Resources for Web Designers appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/mazwai-hd-video-resources-web-designers/feed 0
Top 20 WordPress Development Blogs to Followhttp://www.worldoweb.co.uk/2014/top-20-wordpress-development-blogs-follow http://www.worldoweb.co.uk/2014/top-20-wordpress-development-blogs-follow#comments Mon, 11 Aug 2014 19:44:10 +0000 http://www.worldoweb.co.uk/?p=7363 By Tracy Ridge

I haven’t posted anything about WordPress for a while so I thought I would start off with my Top 20 WordPress Development blogs. If you can’t find what you are looking for on the ever-expanding WP Codex or you simply just don’t understand it then you will find loads of hints, tips and resources in […]

The post Top 20 WordPress Development Blogs to Follow appeared first on WorldOWeb.

]]>
By Tracy Ridge

I haven’t posted anything about WordPress for a while so I thought I would start off with my Top 20 WordPress Development blogs. If you can’t find what you are looking for on the ever-expanding WP Codex or you simply just don’t understand it then you will find loads of hints, tips and resources in the following sites to cover all aspects of your WordPress life. If I have not mentioned your favourite then feel free to add it to the comments section or fire me a tweet @ridgey28.

WordPress

Image provided by 360b / Shutterstock.com

Manage WP

Manage WP has been around a few years. They have a premium WordPress plugin that manage multiple WordPress sites.  They also have a blog which have loads of resources and tutorials from developing plugins and themes to their hot picks of the month.
Manage WP Blog

WP Engineer

WP Engineer is a dedicated WordPress Blog which was created by 3 WP Super Fans. The dedicated WordPress blog is loaded with tips, tutorials and resources.
WP Engineer

WP Shout

Started in 2009 bu Fred and David,  WP Shout have lots of  WordPress tutorials and resources.
WP Shout

WP Tavern

WordPress Tavern, established in 2009, is a warm and inviting community site that is focused on all things WordPress, BuddyPress and bbPress
WP Tavern

Digging into WordPress

Digging into WordPress was created by Chris Coyier and Jeff Starr, the authors of Digging into WordPress book, who eat and breathe WordPress.
Digging Into WordPress

WP Explorer

WP Explorer is a haven of all things WordPress. Featuring Premium WordPress Themes and Plugins and a blog with news, tutorials, tips, snippets, SEO and security.
WP Explorer

WP Hacks

WP Hacks covers a variety of WordPress topics including themes, plugins, SEO and yes you guessed it hacks.
WordPress Hacks

WP Lover

WP Lover hasn’t posted anything for a while but you can still access tips and tutorials that cover a vast array of topics.
WP Lover

WP Arena

WordPress Arena is a place for WordPress Developers and Designers, providing Tips, tricks, tools and resources to build a website or blog on WordPress. They also feature a WordPress Showcase for all kind of WordPress Powered Websites.
WP Arena

WP Hub

WPHub review high quality premium plugins and themes. They also strive to create high quality and innovative WordPress tutorials.
WordPress Hub

WP Mayor

WP Mayor was founded in 2010 by Jean Galea, a WordPress developer. WP Mayor offers premium review services and has a community of content contributors posting tutorials covering many different WP topics.
WP Mayor

Pippins Plugins

Pippin covers only WordPress plugin development. His tutorials are very clear and precise and is an excellent alternative to the official codex.
Pippins Plugins

Winning WP

Winning WP covers every category you can possibly think of. It’s loaded with helpful resources from blogging, tutorials, marketing, design, security and much more.
Winning WP

WPLift

WPLift was founded in September 2010 by Oliver Dale, the founder of Kooc Media, to help people with WordPress by providing tutorials, theme roundups, plugin guides and general WordPress news.
WP Lift

WP Business Tips

WP Business Tips, sister to WP Shout, is designed to deliver quick, non-technical tutorials on the parts of WordPress you can really use for your business.
WP Business Tips

WP Beginner

WPBeginner is a WordPress resource site which was founded by Syed Balkhi in July 2009. The main goal of this site is to provide quality tips, tricks, hacks, and other resources for the WordPress community but in a helpful and clear format for beginners to understand.
WP Beginner

WPMU Dev

The WPMU DEV Blog provides news, tips, tutorials, and reviews on WordPress, BuddyPress and Multisite.
WPMU DEV

Paulund

Paul Underwood from Bristol, UK, created Paulund to collect all the resources and snippets to use in the future. He developed these into tutorials, describing how they work to help people learn. He mainly focuses on theme and plugin development but his resources are definitely worth checking out.
Paulund

Theme Lab

ThemeLab is a company that specializes in building easy to use premium WordPress themes to help you create a website as unique as you are without any code knowledge.
Theme Lab

Tom McFarlin

Tom is a WordPress developer who has published WordPress plugins. His personal blog is where he shares articles, notes, tips, and resources related to WordPress development.
Tom McFarlin

Bonus Websites – The Best of the Rest

Obviously there are more blogs out there than the above so here are the best of the rest

Other Resources worth checking out

Some of these blogs are dedicated to the world of Web Development in general but feature WordPress tutorials so they are definitely worth checking out.

The post Top 20 WordPress Development Blogs to Follow appeared first on WorldOWeb.

]]>
http://www.worldoweb.co.uk/2014/top-20-wordpress-development-blogs-follow/feed 0