Skip to main content

GeoffStratton.com

  • About/Contact
  • GitHub
  • LinkedIn

Tag: PHP

Drupal: Programmatically Create a Block

October 8, 2015March 15, 2022 Geoff Stratton Leave a comment

So you want to add a block to your module in Drupal 7. First, define its internal name and human-readable title (for the Blocks UI) with hook_block_info(): Then, give it the permissions needed to view it, a title (to appear for your site visitors), and some content with hook_block_view(): If you want to give the […]

Loading

Read More

Customize the Drupal Search Form

September 23, 2015March 16, 2022 Geoff Stratton Leave a comment

Here’s an easy one: you want to customize the Drupal search form provided by the Search module in your Drupal 7 site. Fortunately, Drupal provides an easy way to do this, via hook_form_alter(). Put something like this in your theme’s template.php: This defines the appearance of the search block form, which you can then place […]

Loading

Read More

Drupal Module Development Tutorial

September 22, 2015March 16, 2022 Geoff Stratton Leave a comment

On my Drupal 7 site here, I wanted to create a method of automatically injecting my Google Ad banners on all content pages before the Disqus comments thread. You could do this manually, say by adding a text field to your basic page content_type with a default value of all the Google Ads JavaScript, but […]

Loading

Read More

Install the APC Opcode Cache

August 19, 2014March 16, 2022 Geoff Stratton Leave a comment

Note: This is an old article, and the APC Opcode Cache is now abandoned. Strongly consider installing Zend OPcache instead. APC is now effectively unsupported, although you can still install and use it. Furthermore, OPcache is included in the PHP core as of PHP 5.5, and OPcache is also available and fully supported for PHP […]

Loading

Read More

Ubuntu 14 Web Server With Apache and PHP

August 17, 2014March 16, 2022 Geoff Stratton Leave a comment

Ubuntu 14.04 LTS has been out for a while now, and it offers some nice enhancements over 12.04 in its default repos: Apache 2.4, PHP 5.5, and MySQL 5.5.3x. Starting from a bare server image, here’s how to get an Ubuntu 14 web server up and running for PHP. Install the Web Server Note: If […]

Loading

Read More

Drupal 7 File Descriptions

August 5, 2014March 16, 2022 Geoff Stratton Leave a comment

I needed to increase the maximum length of the Drupal 7 file description field that appears when you enable the File module and allow uploads in nodes. By default, the file description field restricts input to 128 characters. The Drupal 7 File Description Field This is set in file.field.inc in the File module in core […]

Loading

Read More

Posts pagination

Newer posts 1 2

About

This is the home server of Geoff Stratton. There's a little more about me on the About page. The server itself lives in Softlayer's DAL02/06 data center in downtown Dallas, Texas, geolocation 32 47 32.599 N 96 48 53.11 W 125m 10m 100m 10m.

I use this place mostly as a personal knowledge base, although I keep it public in case anything useful emerges. Caveat emptor, and don't go handling snake-skin.

Consider everything posted here to be covered by the GNU Public License Version 3. You should read the whole license, but essentially it means you can do anything you want with the code, including bundle it up and sell it as a new application. The catch is that if you make and distribute a new app, you are required to make all the source code available for free to everyone.

Tip Jar

Did you find something useful here? Please consider a tip. Many thanks!


Buy Me A Coffee


Categories

Tags

Ansible Apache awk Bash C# CentOS Debian DNS Docker Drupal Drush Fedora grep Hardware Hosting IP JavaScript jQuery LDAP Linux Mail Server mtr MySQL Nginx OTRS Perl PHP Plone Pound Python Redis sed SpamAssassin SQL SSL tcpdump TrueCrypt Tutorials ufw Varnish VB.NET Webform Windows WordPress Zope

Archives

sparkling Theme by Colorlib Powered by WordPress