Friday, February 28, 2014

How to get WordPress posts permalinks using SQL(database) alone

SELECT wpp.post_title, wpp.post_type, wpp.guid, wpp.post_date, CONCAT( wpo_su.option_value, REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, '%year%', DATE_FORMAT( wpp.post_date, '%Y' ) ) ,'%monthnum%', DATE_FORMAT( wpp.post_date, '%m' ) ) , '%day%', DATE_FORMAT( wpp.post_date, '%d' ) ) , '%postname%', wpp.post_name ) , '%category%', wpp.post_type ) ) AS permalink
FROM wp_posts wpp
INNER JOIN wp_options wpo ON wpo.option_name = 'permalink_structure'
INNER JOIN wp_options wpo_su ON wpo_su.option_name = 'siteurl'
wpp.post_type = 'post'
OR wpp.post_type = 'page'
AND wpp.post_status = 'publish'

Tuesday, February 25, 2014

A Target campaign

A micro site that allows user to get a free mp3 download after Facebook authentication. The site is written in PHP with MySQL database.
Application features:
  • Limits one download per user. 
  • Integration with real-time music purchasing and download.
  • Location restriction by user IP address.
  • Integration with Email injection services.
  • Twitter, Instagram and Facebook user authentication process.
  • Works on both desktop and mobile web browsers.
  • Supports high volume of traffic.