php

Conductor, a Composer UI mglaman Sat, 10/22/2016 - 08:30

Developers have many tools. We have version control systems, we have dependency management tools, we have build and task automation tools. What is one thing they all have in common? They are command line tools.

However, the command line can be daunting to some and create a barrier to adoption. We’re currently experiencing this in the Drupal community. People are considering Composer a barrier to entry, and I believe it’s just because it’s a command line tool and something new.

Tips & Tricks: the WordPress Photo Gallery

With WordPress 3.5 came an awesome revamp of the media library that allows users to easily place a photo gallery from new and old images within the media library. The gallery shortcode was introduced and provides quite a few different features, all available from a user interface and not just shortcode attributes. There are a few things missing from the user interface that can let you make the most out of your photo galleries.

Social Icon Widget

We all want to show off our social networks on our blog or website, especially our clients. Businesses need to have a profile on all major services in modern markets, and it is not hard recreating this multiple times; but, it can be annoying. Here is some quick and dirty code you can use to make a WordPress widget.  The widget works by inputting the social network URLs, full URLs mind you not just the handle. If the URL is present it will pull an icon from the specified location. In the case of this code it is from a WordPress theme that the widget is part of.

Custom Form Fields in Joomla

When I was developing my Joomla! components to make my GRealty suite I needed a few custom fields that were not native to Joomla The process is simple and only requires one new folder and one new file in your component. In your components admin/models/  folder create a new folder called 'fields'. Create a new PHP file, name it however you want your field to be referenced within Joomla.

Simple PHP Calendar Script

Here is a simple PHP calendar script that can be easily customized and designed with CSS.
<?php

$time = time();

$numDay = date('d', $time);
$numMonth = date('m', $time);
$strMonth = date('F', $time);
$numYear = date('Y', $time);
$firstDay = mktime(0,0,0,$numMonth,1,$numYear);
$daysInMonth = cal_days_in_month(0, $numMonth, $numYear);
$dayOfWeek = date('w', $firstDay);
?>
<table>
<caption><?

Sanitize Text for SQL

Cross Site Scripting (XSS) and SQL Injections are some of the biggest security threats to a PHP application.  Every developer has different ways of preventing SQL Injections or malicious JavaScript from being inserted into the database. Here are some easy solutions to help safeguard your PHP applications.

mysql_real_escape_string()

mysql_real_escape_string() should always be used on data being placed into your SQL database.