danielhpavey.uk

A sorta, kinda, web development and design blog...

Posts tagged #php:

Eventbrite API Event Series Query with Ticket Data

Wednesday 22 March 2017

Eventbrite API Event Series Query with Ticket Data I needed to get some data from the Eventbrite API. It took a bit of effort to build the request URL that I needed. The events I wanted the data fro where recurring. I also wanted to know how many tickets where available for

Tags: #web developement #eventbrite #api #php

Create Wordpress User in phpMyadmin SQL

Thursday 16 February 2017

Create Wordpress User in phpMyadmin SQL This simple sql script will create a Wordpress user. You'll need access to the database via phpMyadmin or another means.. INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_status) VALUES ('username', MD5('password'), 'Firstname Lastname', 'email address', '0'); INSERT INTO wp_usermeta (umeta_id, user_id, meta_key, meta_value) VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities',

Tags: #wordpress #php #web dev

Magento 1 Rest Api Multiple SKU Query

Friday 10 February 2017

Magento 1 Rest Api Multiple SKU Query It took me a long time to track down this solution to get multiple products by SKU out of the Magento Rest API... But here's the solution I've found: http://[magento host]/api/rest/products?filter[1][attribute]=sku&filter[1][in][0]=sku1&filter[1][in][1]=sku2

Tags: #magento #web development #php

Find Magento Layout Handle for Current Controller/Action

Friday 3 February 2017

Find Magento Layout Handle for Current Controller/Action I is still getting the hang of the whole Magento layout functionality but have just found a couple of tips that have helped me greatly. As I understand it the layout handle of and xml file is the node that is called when a particular…

Tags: #magento #web development #php

Magento block caching

Friday 20 January 2017

Magento block caching If you set it to false, Zend cache will get default value of 7200 seconds!! If you want infinite never expired cache set it to 9999999999, which is Zend_Cache maximum value, or something else big enough. Magento block caching • Inchoo

Tags: #magento #web development #php

Load A Joomla! Template File From A Separate View

Wednesday 10 February 2016

Load A Joomla! Template File From A Separate View I am working hard to improve the quality of my php code and one of significant technique is to use the DRY principle. However this can become a little harder to stick to when using a framework / CMS. I mostly work with…

Tags: #joomla #web development #php

Search a Multi-Dimensional PHP Array with Standard PHP Library Recursive Iterator

Wednesday 4 November 2015

Search a Multi-Dimensional PHP Array with Standard PHP Library Recursive Iterator (That's definitely the best blog post title I've ever come up with...) Messing with php arrays often messes with my head... So I needed to search a multi-dimensional array and return the results in an easily accessible format. A bit of research uncovered…

Tags: #php #web development

PHP DateTime Class - Or why it pays to read the documentation (sometimes!)

Friday 18 September 2015

PHP DateTime Class - Or why it pays to read the documentation (sometimes!) I've always struggled with dates in PHP, more specifically writing dates submitted by a PHP form to a database correctly formatted. I've done a few weird and wacky things to get the dates into the database as proper datetime…

Tags: #php #web development

Joomla! Styleguide Component

Wednesday 17 June 2015

Joomla! Styleguide Component Website Styleguides are very 'de rigueur' at the moment. I work with Joomla! a lot and felt that a Styleguide component could be useful. These website styleguides are often also called Pattern Libraries. I think they can be very useful! My component is currently available on Github

Tags: #joomla #web development #php

A Couple of Tips for Using PHP at the Command Line

Tuesday 21 April 2015

A Couple of Tips for Using PHP at the Command Line On vary rare occasion I find it useful to run php in the command line. There are a couple of easy ways to do this, but the first thing you might want to do is check your php version. This is easily…

Tags: #php #web development #terminal #commandline

error-500-php-regularexpression-limit-reached

Monday 19 November 2012

500 - PHP regular expression limit reached Starting getting this error message on a Joomla site I'm working on: 500 - PHP regular expression limit reached (pcre.backtrack_limit) I'm building my own component for the site. The weird thing was the error message went away when I echoed out the MySQL query... But as soon as…

Tags: #joomla #web design #php