Kaydoo

A Day in the Life of a Developer

Archive for the ‘Web Development’ Category

PNG Display issue in IE

Well I was just designing the new look and feel of a project I have started and it required the use of some gradients images. Now the problem was simple I had a background colour and I needed to fade this to white in my footer (Please see image below). So I created the gradients in PS and saved it as a png.

IE FF Gradient Example

Upon loading it in FF all was good, but loading it in IE showes the gradient image was not only darker than that in FF but it didn’t blend with the underlying base color.

I strached my head for quite a while and in the end learnt the following.

IE .png palette has a bug in which it cann’t display the gAMA chunk of the image. This causes them to be rendered incorrectly.

Now there are two possible fixes for this.

  1. Don’t use a png, use a gif
  2. Use this tool to remove the gAMA chunk from the image, http://psydk.org/PngOptimizer.php

It has been pointed out to me that there is an issue with BackendPro 0.6 on some web servers. The issue is with some new files in the site module. The problems comes because of the CamelCase used in the filenames of the site libraries.

If you get the follow error when visiting a BackendPro page:

Unable to load the requested class: bep_site

I am working on a new release which I will try to get out shortly, but for the mean time please do the following:

  1. Change all filenames in modules/site/libraries to
    Bep_assetfile.php
    Bep_assets.php
    Bep_browser.php
    Bep_site.php
  2. In the file modules/site/libraries/Bep_assets.php change the following lines:

    Change include_once(‘Bep_AssetFile.php’);
    To include_once(‘Bep_assetfile.php’);

    Change $this->CI->load->library(‘Bep_Browser’);
    To $this->CI->load->library(‘bep_browser’);

I want to thank Christian Schneider for pointing this out and for the fix.

BackendPro 0.6

BackendPro 0.6 has been released at last. Not too many little updates in it but the major thing is the new Asset library. Replacing the old Page library, it now has improved and more intelligent caching, along with the ability to have asset dependencies.

A full list of the changes can be found in the user guide here. Please download it and give it a try, any issues can you either send me an email or post about it on the CodeIgniter forums (posting a comment here will also get my attention).

BackendPro 0.5.1

A new release of BackendPro has been released due to a major bug being fixed. Please head over to the project page and get the changes asap.

BackendPro 0.5

After a long cold winter BackendPro 0.5 is here. This release is mainly about bug fixes and a few new little features. So if you havn’t tried BackendPro yet, give it a whirl. If you are currently using it, upgrade if possible to get the new features and bug fixes. A list of the things changed and added is below:

Additions

  • Added a section into the user guide to talk about the file system and matchbox, See Enhancement #10
  • JS Code Output – The Page class now has the feature to store JS code and then output it into a view (very much like the PHP to JS variable converter), See Enhancement #84
  • i18n Support – The status class language strings are now contained within a language file, See Enhancement #75
  • CI Profiler Intergration – The CI profiler is now intergrated into the admin control panel. When turned on in the system settings rather than some of the output being hidden it is now clearly visible, See Enhancement #41
  • Login Selection – It is now possible to select how a user can login, either with their email, username or either.

Modifications

  • The page->icon() method now accepts a title paramter for the displayed image.
  • Moved some of the dashboard files into their own module to tidy the file system up a bit. Also have created a new class to store to Statistics Widget creation code it.
  • Improved the is_user() method so if $config['sess_use_database'] is FALSE then extra user checks are performed. For this to work the value returned by validateLogin() has changed, See Enhancement #80
  • Removed PHP short tags from files, See Task #42
  • Added some extra language strings for the dropdown options inside application/controllers/admin/settings.php, See Enhancement #73
  • Updated the Page Module so it uses the functions in the CodeIgniter HTML helper, See Enhancement #36
  • Changed the MY_Controller so the charset header and metatag value is taken from the CI config file, See Enhancement #74
  • Altered the default dashboard statistics panel so it now also shows the current CodeIgniter version.
  • Changed the way the install process is done. Now you can specify your CI folder structure, See Enhancement #53

Bug Fixes

  • The dashboard widget system now restores moved widgets, See Bug #64
  • The BackendPro tree menu in the admin panel now saves its open/closes status rather than it being lost between different pages, See Bugs #15 and #145
  • Redirection upon login is now fixed, See Bug #100
  • Spelling errors throughout the code, See Bugs #71, #76, #77
  • Corrected the user guide section on the Page class. Originally it listed output_trail() as a method this is now output_breadcrumb, See Bug #69
  • Modified the path to the user guide from inside the BackendPro control panel (footer), See Bug #68

BackendPro 0.4

Well I’m going to say sorry for taking so long. The last several months have been tough to find time to work on BeP, but its done.

Now this release was more about trying to improve the current BeP system rather than add new things. There are a few bug fixes which were needed and also some Optimisation. Now BeP won’t load unless you use its controllers. Which means Ajax controllers are now possible (without haven’t to load the whole BeP system). This should decrease the loading required.

A quick overview of changes are below:

Additions

  • Added a new readonly style for the forms. Now if a form input is readonly add the class readonly to it to display a greyed out look. See Enhancement #44
  • Added the new Image controller which allows images to be loaded dynamically.
  • Added a new Popup Container which allows a popup window to be created with all the advantages of the BackendPro system, but without the navigation/footer/header.
  • A new and improved install script. It now performs system checks (e.g log folder writable) and gives detailed information on the process.
  • New documentation in the user guide about the process of upgrading versions of BackendPro

Modifications

  • Removed the BackendPro class and instead incoperated the library loading code into the Site_Controller class.
  • Moved the welcome controller and view to its own module so its easy for the user to delete.
  • Fixed some spelling errors both in the user guide and in the code.
  • Removed the webmaster name/email preferences since these seemed old fashioned and also were not used by the base system.

Bug Fixes

  • Fixed a bug where you couldn’t change a permission allow status, i.e. from Allow to Deny, See Bug #54
  • Fixed a bug where a “deprecated” warning is thrown when using pass by reference in php 5 in resource.php view, See Bug #55
  • Fixed a bug where you couldn’t have ACL actions with a space in the name, this caused problems when trying to assign them to a permission, See Bug #57
  • Fixed a bug where when modifying a permission, instead of saving it, it created a new permission, See Bug #20
  • Fixed a bug where status messages would get repeated if an ajax controller method was called, See Bug #4
  • Fixed a bug where if no user profile fields are created but the user profiles are turned on, it would error saying “Must you set method” when trying to save a edited user account, See Bug #51
  • Fixed a bug with unserialize() Spamming logs with errors, See Bug #37

So head over to the BackendPro development site and get a copy. Hopefuly now with the Upgrade instructions it will be easy to move your current system accross OR click HERE to download the zip file.

BackendPro 0.3.1 Released

Well I must first apologise to everyone for taking so long to get this next release out, but the last 2 months have been so busy with University finals, but they are all behind me now so as promised a new release. The majority of this release is a few new features which I was planning to incorporate in BeP for a long time. Examples of these are a dashboard for the control panel, conditional CSS files (for IE), features to use CSSTidy to optimise CSS code and many more.

Additions

  • Added a dashboard to the control panel front page.
  • Added cancel buttons to forms.
  • Added new CSS styles to create buttons.Added icon() to Page library.
  • Added a generate password feature to the member administration area
  • Added CSS caching using CSS Tidy in the Page library.
  • Added output_variables() to Page library.
  • Added conditional CSS files in the Page library.
  • Added meta tag creation into the Page library.

Modifications

  • Added a value option to <button> elements so the form can submit.
  • Updated some of the documentation so its simpler to navigate around.
  • Updated getUsers() in User_model.php to also fetch user profile columns.
  • Changed the version control system from including a date to release candidate, purely to be shorter.
  • Updated Nested_sets_model.php to remove the public attribute from the constructor

So head over to the BackendPro Development home and download it. Please as usual if you find any problems raise a ticket or post on the forum thread. As always if you want the latest updates keep an eye on the SVN repository.

BackendPro 0.2 Alpha

The first public release is now available. Please see Projects > BackendPro for more details.

Download Now

Top 5 Web Development Tools

Being a part time web developer its important I find to use the right tools to get a job done. Now normally every morning I get about 10 blog posts on my RSS feed saying “50 most needed tools for developers”. Half of them do the same as the other half and the other half have no point in life. So, I feel to be a good web developer you don’t need a lot to get the job done, they always say quality over quantity.

Firebug (Firefox)
This is probably my most important extension for firefox. With the built in javascript debugging and tools to see http requests it actually makes ajax and css quite fun. Its the sole reason I use firefox over other browsers. Along with many other features including page loading time statistics, it greatly helps you see what’s taking that extra 0.2s to load on your page.

FireBug Preview

HTML Validator (Firefox)
Now I don’t know how many of you actually check that your web pages are both HTML and CSS valid but this is getting an increasing issue. (I cannot claim all of my sites are valid since I am currently in the process of making them valid with this new tool). This tool sits in your status bar and tells you of any errors in the HTML code. You can also specify that it will only be enabled on websites of your choosing (e.g ones you are developing)

HTML Validator Preview

SVN
Its happens too many times, change a file and something breaks but you forget what you changed and then take several hours trying to get it working again. SVN is a version control system which means you will always have every change you made to your code. It can be unusual to use at first but after a while its a real godsend. If your just a small developer and don’t have an SVN server then try Tortoise. Its not just an SVN interface but also can create local repository’s on your computer.

IE Developer Toolbar
This does nearly everything Firebug does, but for IE. It even does a bit more. Another must since not all CSS designs work in both IE and FF.

Multiple IE’s
This is a great tool for windows which allows you to install multiple versions of IE on your computer at once. No more having multiple computers running IE6 & IE7. Also it means you don’t need to use BrowserShot websites to test every page. Another must have.

A Text Editor
There is no link here since this is a very personal choice. But find a good text editor you like and get on with and stick to it. I have tried a few (all for windows) and can say for small time developers HTML Kit Tools is rather good but for bigger developers PhpED is perfect.

So there you go. That’s what I use. Its not a lot but it gets the job done. I don’t belive in hundrends of programs to do everything for me, and what I do use I only want to help me if I ask for it.

Multiple Check Checkbox

As I am nearing the end of my initial development phase of BackendPro there’s some useful bits of code I came up with to handle annoying but simple tasks. Over the next week or so I will be releasing a lot more small applications and libraries but felt this may help a few people. Its a small script to check and un-check multiple html check boxes. Its prime use is to save the user time from having to check/un-check many check boxes. It uses jQuery and is only 1/2 lines long.

$("input[name='all']").change(function(){
var parent = $(this);
$("input[name='"+parent.val()+"[]']",parent.parents('form:first')).each(function(){$(this).attr('checked',parent.is(':checked'));});
});

All you need to use it is the following HTML code.

<form>
<input type="checkbox" name="all" value="myitems">
<input type="checkbox" name="myitems[]" value="1">
<input type="checkbox" name="myitems[]" value="2">
<input type="checkbox" name="myitems[]" value="3">
</form>

So when the user clicks on the check box with name all, all check boxes with the name specified in the value attribute of this ‘all‘ check box will be toggled. I hope someone finds it helpful.