Kevin Phillips http://kevinphillips.co.nz Who is Dollar Dad Thu, 06 Dec 2012 20:50:12 +0000 en-US hourly 1 http://wordpress.org/?v=3.5 Excellent Hosting Option http://kevinphillips.co.nz/news/excellent-hosting-option/ http://kevinphillips.co.nz/news/excellent-hosting-option/#comments Thu, 06 Dec 2012 20:37:19 +0000 kevin http://kevinphillips.co.nz/?p=188 Continue reading ]]> Scala Hosting

One of the best lesser know hosting companies

In my search for a web hosting company that caters for resellers like myself I have tried a number of them.

Now my reseller hosting requirements are particular in that I don’t offer hosting for websites that I have not been directly involved in. However I do need a cPanel account for each website so that the end user can manage their own site.

I also need good technical back-up and the option to have some additional server scripts loaded, for example Drupal likes to have PECL Uploadprogress Library or APC.

Most host will not move from their default install but one ticket to Scala Hosting and they had it done within two minutes.

They also have great ratings at Web Hosting Stuff, which I recommend you to look at.

Just to be clear I am not part of or employed by Scala Hosting although I do get a little bit through their affiliates program.

So please go check them out – great for Drupal, Joomla and WordPress sites.

]]>
http://kevinphillips.co.nz/news/excellent-hosting-option/feed/ 1
Ionize Error On Articles http://kevinphillips.co.nz/news/ionize-error-on-articles/ http://kevinphillips.co.nz/news/ionize-error-on-articles/#comments Thu, 22 Nov 2012 23:02:40 +0000 kevin http://kevinphillips.co.nz/?p=177 Continue reading ]]>

 

 

 

 

 

 

 

 

 

 

 

Codeigniter, Ionize version 0.9.7

When editing an article you will see the php error (image above).

line 934 application/controllers/admin/article.php

if ($context['link'] !='')

change to

if (isset($context['link'] && $context['link'] !='')

Will solve the problem.

UPDATE:

I’ve just noticed that in the github version changes have been made

if ( ! empty($context['link']) )

Which does work

 

]]>
http://kevinphillips.co.nz/news/ionize-error-on-articles/feed/ 0
Hawkes Bay Cricket http://kevinphillips.co.nz/news/hawkes-bay-cricket/ http://kevinphillips.co.nz/news/hawkes-bay-cricket/#comments Sat, 10 Nov 2012 01:15:40 +0000 kevin http://kevinphillips.co.nz/?p=175 Continue reading ]]> I have the proud honour of being a Cricket Umpire for Hawke’s Bay, New Zealand. Cricket is just one of those games that you love or hate. Being in the former group but being a little bit old too play competition cricket, not enough time to manage or coach anymore the role of Umpire is perfect.

Cricket is a game of stats and I’ve built a website for Hawke’s Bay Cricket Umpires’ and scorers’ association that displays news and features plus a content type that shows the weekly appointments, this wil also be used to show the umpires’ profiles and activities over the coming years.

Built on Drupal 7

Please click the link below to see our new site

Hawke’s Bay Umpires

 

]]>
http://kevinphillips.co.nz/news/hawkes-bay-cricket/feed/ 0
Working programmatically with custom content types http://kevinphillips.co.nz/news/working-programmatically-custom-content-types/ http://kevinphillips.co.nz/news/working-programmatically-custom-content-types/#comments Sun, 28 Oct 2012 04:51:26 +0000 kevin http://kevinphillips.co.nz/?p=102 Continue reading ]]> Learning to create custom content types programmatically in Drupal is like jumping without a parachute.  The documentation in the core API is very limited.  I’ve create a short list of websites that have generated useful helpers and tutorials. I hope they help you, please leave a comment if you have any other useful links.

Here is the link to the standard drupal core file that installs article content type

http://api.drupal.org/api/drupal/profiles!standard!standard.install/7

I would just like to add the Andy Pangus (http://www.andypangus.com) has some really interesting articles and well worth a few minutes of anyones time.

]]>
http://kevinphillips.co.nz/news/working-programmatically-custom-content-types/feed/ 0
Validate a Domain Name http://kevinphillips.co.nz/news/validate-domain-name/ http://kevinphillips.co.nz/news/validate-domain-name/#comments Sat, 06 Oct 2012 04:49:55 +0000 kevin http://kevinphillips.co.nz/?p=100 Continue reading ]]> I was looking for a decent way to validate against a domain name (not a url) but could not see one in either Drupal or Codeigniter so I quickly built this function

/**
 * function to check for valid domain names
 */
function validate_domain_name($domain) {
  // Strip out any http or www
  $search = array('http://', 'www.');
  $replace = array('','');
  $domain = str_replace($search, $replace, $domain);

  $regex = "/^([a-z0-9][a-z0-9\-]{1,63})\.[a-z\.]{2,6}$/i";

  return preg_match($regex, $domain, $matches);
}

Happy coding !!!

]]>
http://kevinphillips.co.nz/news/validate-domain-name/feed/ 0
Colorbox Error with IE8 http://kevinphillips.co.nz/news/colorbox-error-with-ie8/ http://kevinphillips.co.nz/news/colorbox-error-with-ie8/#comments Tue, 14 Aug 2012 05:48:49 +0000 kevin http://kevinphillips.co.nz/?p=97 Continue reading ]]> I came across a small bug that really got to me today.
Using the colorbox module with colorbox node in Drupal 7, which I will say are just great modules I was getting one of those useless script error in IE7 and IE8

http://www.hawkesbaytyres.co.nz

Drupal 7

Colorbox (latest dev)

Colorbox node

Views

Panels

When clicking the close button on the pop up menu I was seeing this error (using firefox and firebug to find the errors)

TypeError: c.call is not a function

This is located in the jquery.colorbox.min.js file that you download from colorbox and store in your libraries directory.

It’s minified so you will need to do a search for

c.call

It only appears once – I’ve no idea what it does !!

…function cb(b,c){a.event.trigger(b),c&&c.call(P)}function db(){ ….

delete it

… function cb(b,c){a.event.trigger(b),c}function db(){…

save

And everything is sweet again.

I’ll keep you updated if I get any problems or info on this !!

]]>
http://kevinphillips.co.nz/news/colorbox-error-with-ie8/feed/ 0
Codeigniter Auth http://kevinphillips.co.nz/news/codeigniter-auth/ http://kevinphillips.co.nz/news/codeigniter-auth/#comments Sat, 04 Aug 2012 05:46:48 +0000 kevin http://kevinphillips.co.nz/?p=95 Continue reading ]]> https://github.com/dollardad/CI-ACL

I’ve just updated this library so it now includes a full login system with role base permissions.

NO DATABASE REQUIRED
The use case for this simple login system for Codeigniter is small websites that one or two users need access to update say the blog or a couple of pages.

This Auth library does not include user registration or lost password or remember me. It’s what it says on the “Can” simple but secure auth system for small applications.

]]>
http://kevinphillips.co.nz/news/codeigniter-auth/feed/ 0
Codeigniter Simple ACL http://kevinphillips.co.nz/news/codeigniter-simple-acl/ http://kevinphillips.co.nz/news/codeigniter-simple-acl/#comments Fri, 20 Jul 2012 05:45:46 +0000 kevin http://kevinphillips.co.nz/?p=93 Continue reading ]]>

A simple Role Based Access Control List that dosen’t require a database.

Users can have multiple roles, and roles have access permissions.

I’ve based this on the Drupal ACL which I very much like.

A configuration file called acl.php which needs to be stored in applications/config folder

A library file called acl.php which needs to stored in the applications/libraries folder

Inside the config file is the config array which has two arrays

$config[ 'permission' ] = array();

and

$config[ 'roles' ] = array();

 

To setup roles simply add role names, any names you like but you must have ‘admin’ as your main website owner/administrator

ie

$config[ 'roles' ] = array( ‘user’, ‘blogger’, ‘editor’, ‘umpire’, ‘admin’ );

now set up the permission (which I tend to do on a controller basis);

$config[ 'permission' ] = array(
    'users' => array(
        'add' => array( 'admin' ),
        'edit own' => array( 'blogger', 'editor', 'admin' ),
        'edit all' => array( 'editor', 'admin' ),
        'delete own' => array( 'blogger', 'editor', 'admin' ),
        'delete all' => array( 'editor', 'admin' ),
    ),
    'umpires' => array(
        'add' => array( 'admin' ),
        'edit own' => array( 'umpire', 'admin' ),
        'edit all' => array( 'admin' ),
        'delete own' => array( 'umpire', 'admin' ),
        'delete all' => array( 'admin' ),
    ),
    'cricket' => array(
        'add' => array( 'umpire', 'admin' ),
        'edit own' => array(), // not applicable
        'edit all' => array( 'umpire', 'admin' ),
        'delete own' => array( ), // not applicable
        'delete all' => array( 'umpire', 'admin' ),
    ),
);

 

Now your login process needs to add

$this->session->set_userdata('uid' = $uid);  // !important that you use uid for session name
$roles = array('user', 'blogger');
// If you are using a database to store users I would create a field called roles and save roles as either json or serialize
Then  $roles = unserialize($user->roles);
$this->session->set_userdata('role' = $roles);  // !important that you use uid for session name
To set permissions on controllers or functions
$this->load->library('acl');
//has_permission( The Controller, The min permission)
has_permission('cricket','add');
or for editing own post
//has_permission( The Controller, The permission, The post ID );
has_permission( 'posts', 'edit own', 234 );

 

You can download from here – the files are well documented (Remove the comments when you are ready to go live)

https://github.com/dollardad/CI-ACL.git

 

]]>
http://kevinphillips.co.nz/news/codeigniter-simple-acl/feed/ 0
Simple responsive webdesign example http://kevinphillips.co.nz/news/simple-responsive-webdesign-example/ http://kevinphillips.co.nz/news/simple-responsive-webdesign-example/#comments Sat, 28 Apr 2012 05:43:38 +0000 kevin http://kevinphillips.co.nz/?p=89 Continue reading ]]>

To create different layouts on web pages according to the size of the users browser simply use different ccs files.

<link rel="stylesheet" media="screen and (max-width: 480px)" href="/iphone.css" />
<link rel="stylesheet" media="screen and (max-width: 800px)" href="/ipad.css" />
<link rel="stylesheet" media="print" href="/print.css" />
]]>
http://kevinphillips.co.nz/news/simple-responsive-webdesign-example/feed/ 0
Now I am a web hosting company http://kevinphillips.co.nz/news/now-i-am-web-hosting-company/ http://kevinphillips.co.nz/news/now-i-am-web-hosting-company/#comments Thu, 19 Apr 2012 05:42:05 +0000 kevin http://kevinphillips.co.nz/?p=87 Continue reading ]]>

Welcome to LiveHost

After resigning as a director of Devol – I needed to host a few website, although I still have access to Devol’s servers and continue to maintain them, I thought it would be unethical to continue using their resources for own my personal use.

What would happen if one of my development projects brought the their servers down !!!!

I tried quite a few hosting companies inluding Flexihost and I would say they are very good but to actually host multiple website you need to activate a reseller’s account to get enough databases and bandwidth etc.

I actually had quite a few requirements:

  • php 5.2.x and php 5.3.x on the same account that could be used on a domain by domain basis.
  • Access to the php.ini file.
  • SSH root login.
  • Dedicated IP address.
  • Client login access.
  • unlimited (or large quota) disk space.
  • unlimited (or large quota) bandwidth.
  • unlimited MySql Databases (I’m always running new projects as sub domains)
  • unlimited (or large quota) sub domains.

plus all the usual stuff you get with cPanel.

But most important was minimum latency – I’ve used some servers that were so bad we regularly got the WSOD (White Screen of Death) in Drupal.

Putting all this together it was becoming quite hard to find a hosting solution.  I spoke to a number of other developers – who all agreed that getting good hosting was hard. Plently of cheap stuff but just didn’t cut the mustard.

The first requirement (different php) ruled out 90% of hosting companies.

The problem with the hosting companies I came across was that they were all resellers for another company, so as you moved further down the food chain you got less for more money.  Almost like pyramid selling back in the old days.

Getting support was some what variable. One of the problems I came across was that many of the resellers were using the same upstream provider, Web Drive (I won’t go into that particular company at this point) having tried a number of hosting providers suddenly I found my domains’ DNS being deleted or email not working. It appears that because the resellers were using the same provider when one of them deleted my old account details it went across the board (Could be a security problem here !!). The other thing was opening a ticket normally meant waiting for the hosting company to open a ticket with their hosting provider.

This also leads to over selling – hundreds of WordPress installs all fighting for a small amount of server resources!!!!

I’m also not too sure that many of the resellers I came across actually had a lot of Server/Software experience.

Not one to be beaten I did the next best thing – I created my own hosting company with all the above requirements built in.

Welcome to LiveHost

]]>
http://kevinphillips.co.nz/news/now-i-am-web-hosting-company/feed/ 0