Yearly Archives > 2013

15 Dec
2013

dreamweaver

Open and colour code tpl files in Dreamweaver

I have tested this with Dreamweaver CS6, Dreamweaver CC, Dreamweaver CC 2014 and it works fine.

NOTE: Doesn’t work in Dreamweaver CC 2017. It sadly has been completely removed by Adobe.

Files with the extension (tpl) by default aren’t recognised by Dreamweaver. Plus when they do get opened in Dreamweaver they don’t use the php code colouring even though they are just the same as a php file with a different extension.

So in order to do this you will need to edit some files on your Mac OS X or Windows, also make sure to quit Dreamweaver.
Continue reading…


24 Nov
2013

php icon grafxflow

PHP convert stdClass() object into JSON data

I was recently working on a website were the PHP function was doing a var_dump of the array and making it into a stdClass. The problem that I had was that there was also some jQuery code that needed to validate the data had been retrieved successfully. So the stdClass object needed to be converted to JSON data.

Here is how…

Continue reading…


03 Sep
2013

jquery icon grafxflow

Prevent Empty Searches in WordPress Revised

I had an issue in WordPress where blank searches were still being passed and bringing back results. So I had to find a way of stopping it from being submitted. Searching the web I found this nice little solution/snippet of code from (PAGE/URL NO LONGER EXISTS): http://callmenick.com/2013/04/24/prevent-empty-searches-in-wordpress/

Continue reading…

Posted in: <WordPress>

06 Aug
2013

wordpress icon grafxflow

Navigation item stays highlighted when tag or category selected

I recently had a problem relating to the main menu with a WordPress site which used the e-shop plugin. The main navigation menu had three buttons – ‘Contact Us’, ‘Useful Links’ and ‘Shop’. I wanted the ‘Shop’ button to stay highlighted even when the user selected a Shop Category or Shop Tag.

Here is the scenario:

I have a shop with sells several cloths items. The categories would be ‘t-shirts‘ and ‘shorts‘. The tags would be the ‘brands‘, ‘colours‘ and ‘sizes‘. When choosing the ‘Shop’ button it takes me to a landing page which shows the top 10 items. Now when choosing a Shop Category it takes me to a page listing all the items for that category. If I then choose a Shop Tag it shows a page listing all the products that use that tag. So how did I make the Shop button stay highlighted all the time?

Continue reading…

Posted in: <WordPress>

27 Jul
2013

codeigniter icon grafxflow

Pass email in CodeIgniter url with jQuery and php

Here is the problem:

I was working with CodeIgniter and created a search form which passed its search terms via jQuery to the url like http://www.url.com/search/search_terms/, then the php would search the database and bring back the results. So what was the big issue you may think? Well if somebody tried to search for an email ‘anybody@email.com‘ it would bring back the CodeIgniter error.

An Error Was Encountered
The URI you submitted has disallowed characters.

CodeIgniter An Error Was Encountered

Continue reading…

Posted in: <CodeIgniter>

smart search