WP Roots Theme 403 Issue

May 16th, 2013  |  Published in Themes, Wordpress  |  3 Comments

I’ve been working with WordPress 3.5.1 recently creating a new website for the agency I work for (Hangar 18), and have come across some issues using the Roots theme. At first the site was building beautifully but after working with the site in development for a couple days all my css, javascript, and image assets were returning 403 errors.

Initially I thought it must be web browser cache, or firebug playing tricks on me! Sadly this wasn’t the case. The next step for me was to do some web based research to find out more about the issue, and to see if anyone else was having it. I came across this github issue thread this didn’t help at all, so I kept looking and found this issue #708. This actually worked and was able to see the css, javascript, and image assets again, but this eliminated one of the great features of the Roots theme by modifying the file paths from assets/css/*.css, assets/js/*.js, and assets/img/*.png, to the wp standard of wp-content/themes/themename/dirname/filename. I prefer the former, so I kept looking for how to resolve this 403 issue.

Light-bulb! I figured things out myself, 403 means that it’s permissions issue, so I started to look at the site using my shell. Low and behold the issue is the media uploader had created a directory off the root of the website called assets, where all the image uploads were going. At first this didn’t make sense because I was getting 403 errors, and not 404 errors. I guess not everything needs to make sense if it works.

The Fix:

In your WP Dashboard update your media settings to use wp-content/themes/themename/assets as the image upload directory, I also suggest using the month and year based folders option. Then delete the assets directory created on the root of your website.

Media Settings

The Fix

Drupal connected iPhone application using services and authentication.

May 19th, 2010  |  Published in Drupal, iPhone, Javascript, MySQL, PHP, Titanium  |  12 Comments

So I’ve built my first Drupal connected iPhone application. It uses the services module and authentication. I couldn’t find any code examples of using authentication online anywhere so I am including some code examples in this post in hopes that it will help someone else.

Firstly, I followed the tutorial I found in the CivicActions blog, and after I saw how to use the code to connect to a web service, I decided to look for how to use authentication, since the website I am building an app for uses authentication for the web services.

I used the suggested JS SHA256 library in the CivicActions tutorial, and came up with the method to use it properly while communicating with the services module.

Here is the code you’ll need, keep in mind this is using Titanium Developer, all code is written in Javascript, and you’ll need the iPhone emulator in order to see the results.

var servicesURL = 'http://example.com/services/json';
var domain = 'example.com';
var date = new Date();
var obj = {
  method: service,
  domain_name: domain,
  domain_time_stamp: date.getTime(),
  nonce: rnd(), /* just a random function that returns a random string */
  sessid: sessionid
};

// create the hash using secure hash algorithm using 256bit encryption
obj.hash = HMAC_SHA256_MAC(apikey, obj.domain_time_stamp+";"+obj.domain_name+";"+
                 obj.nonce+";"+obj.method);
// this is your view name, be sure your authentication key allows access to views.get
obj.view_name = 'the_drupal_view';

// create the connection to our services module and send json data via POST
var xhr = Titanium.Network.createHTTPClient();
xhr.open("POST", servicesURL);
xhr.send({data: JSON.stringify(obj)});

// once our data has returned the onload function is used
xhr.onload = function(){
  // perform your code here with the data coming back,
  // data will be the object containing the response.
  var data = JSON.parse(this.responseText);
  // you can use Ti.API.info(JSON.stringify(data)) to output your response to the console
}

After I figured out how to put together the proper call out to the services from Javascript, I was able to format some data, here is my result:

iPhone application

Drupal connected iPhone application

Download the JS SHA265 library: js sha256 version 0.1

Building an iPhone app using Titanium

May 10th, 2010  |  Published in iPhone, Titanium  |  2 Comments

Today I started development on an iPhone app using Appcelerator Titanium. The app is for an adhoc distribution but may change to a full Apple app store release to the public.

The app is using Drupal is the base and the Services module to make the data connection. I’m using a modified JSON service module made available by CivicActions. CivicActions had a great drupalCon presentation on using Drupal to connect to a iPhone app using Titanium, which I am using as my inspiration to build this app.

Stay tuned for code examples on using the Services api and Drupal.

Take part in our iPhone app discussion

May 7th, 2010  |  Published in Facebook, iPhone, Social

We’re looking to open up discussion on iPhone apps. We have some ideas on what apps we want to build, and we would love to hear your ideas too! Any feedback on ideas is greatly appreciated.

You can take part in our discussions on our facebook page.

Soniccode Projects updated!

May 3rd, 2010  |  Published in Clients, Hangar 18 Creative, Karen Munnis, Magnum Creative Inc., Vacuum Design

The projects page has been updated with new portfolio pieces including:

Mountain Trek

Global Mortgage

BCAA Drupal multi-site

Karen Munnis

All of these websites are Drupal installations, custom themes, and custom programming!

Services page published

April 26th, 2010  |  Published in Services

Soniccode services page has been published. Following the new services announcement, more information is available by following the services link!

Announcing weekly and monthly services

April 23rd, 2010  |  Published in Services

We are please to announce our new weekly and monthly service plans, you can contact us for more details by calling 778.737.6260 or emailing info@soniccode.com with the subject Prepaid Services.

Our prepaid weekly and monthly services will help to lower your development costs and provide you with a expertise you may not have had before.

Soniccode can help you with:

  • PHP, HTML, CSS, jQuery, Flash and Flex
  • Drupal, WordPress, third party applications and Frameworks
  • iPhone Applications
  • Custom database applications

Soniccode Weekly and Monthly Service Promotion – PDF Download

Work in Progress Website Launched!

May 28th, 2009  |  Published in Clients, Livingblueprint

Soniccode E-Solutions created a new WordPress theme for Work in Progress, a Vancouver based company that specializing in career transition.

Working closely with Livingblueprint, the marketing strategists behind the new corporate brand, we were able to meet a tight deadline to get this website launched.

iPhone Enabled Websites

April 9th, 2009  |  Published in iPhone

Enabling a website for the Apple iPhone

To help maximize the consumer audience you can enable your website to be viewable by the largest growing mobile device, the Apple iPhone. Strict XHTML code along with cleverly placed elements will allow your site to be viewed with ease by iPhone and iPod Touch browsers.

Another method is to program your website directly for the iPhone/iPod browser by targeting it through code, and forwarding the address to your custom build website. If you try to view http://soniccode.com with your iPhone or iPod Touch, you will get forwarded to http://iphone.soniccode.com which is our iPhone capatible website.

Soniccode E-Solutions has services available to provide your website content deliverable to the iPhone/iPod browser, contact us at iphone-inquiry@soniccode.com