Papermashup

Latest Posts


Subscribe


Tweets


"RT @FluffSociety: "Foxes are just cat software running on dog hardware." https://t.co/bKgLycMsC7"

@ashleyford 2 weeks ago

"@TheHairpinLegCo @Justar_UK Hairpins fully installed 😃 https://t.co/SeUkdPHnfQ"

@ashleyford 4 weeks ago
Papermashup

Web design and development tutorials, scripts and downloads designed for beginners right through to advanced developers


PHP10

Show Google Plus’s – PHP function

Following on from yesterdays function to get likes and share data for a URL here’s a function to get Google Plus’s for any URL. The Code It’s worth pointing out you must have CURL enabled on your web server, I believe it’s enabled by default on PHP5 setups. Also the Key below Isn’t a unique API key you must leave [...]

AshleyAshley

Display Facebook likes / Shares PHP function

We launched a new product at Harkable last week called Daily Pulse – which tracks social data for any URL, you can also subscribe to receive email reports. I thought i’d share a bit of functionality similar to how we engineer Daily Pulse. The Code Below is a super simple function that retrieves a JSON feed of comments, likes and [...]

AshleyAshley

jQuery dynamic number ticker

This is a fascinating little script that helps you display a dynamic JSON feed of numbers that automatically updates on the page by animating up or down to the current number. A great addition as part of a realtime analytical dashboard. The Code There are three functions in total. The first one ‘format_number’ which works the same [...]

AshleyAshley

6 Useful PHP code snippets

Here’s a selection of really useful PHP code snippets that I find using on a weekly basis. You could use these as is or expand them as part of other applications or add them to a php class. Adjust server time If you have a server in a different timezone to you then you might be seeing funny things happen when you add the time to a MySQL [...]

AshleyAshley

Display breadcrumbs on your site using PHP

When you have a fully dynamic site it’s useful to show the user where they are by breaking down the URL structure so they can navigate backwards through the site. For example this url: http://papermashup.com/categories/jquery/ shows that ‘jquery’ is part of  ‘categories’ so the user could navigate backwards through [...]

AshleyAshley

Creating Automatic MySQL Database backups

Every database needs to be backed up and if you’re currently doing it manually you can stop because there’s a simple solution using PHP for small scale sites. With this script you can either pass a specific table to backup or choose to backup the whole database. How to implement The best way to use the script below is to copy the [...]

AshleyAshley

PHP Language Detection

I was looking for a simple way to automatically detect a users language using PHP and came across this interesting snippet which does just that. It uses the PHP superglobal ‘HTTP_ACCEPT_LANGUAGE’ which returns something like this for me “en-US,en;q=0.8”. This is the contents language code of the header from the current [...]

AshleyAshley

Build a MySpaceID Application

MySpaceID allows MySpace Users to easily come into your site and get going by bringing their identity with them. By allowing Users to link their MySpace account with your site, a Developer can enable social functionality. This guide is designed to give you a thorough understanding of the MySpace API as well as demonstrate with step by step [...]

AshleyAshley