Skip to content

Instantly share code, notes, and snippets.

@manifestuk
manifestuk / gist:3858951
Created October 9, 2012 13:51
DropDate: Display A List of Available Dates as Radio Buttons in a SafeCracker Form
<form id="custom_form">
<!-- The available date options. -->
<label><input name="dummy_date" type="radio" value="2012-10-05" /> 5th October, 2012</label>
<label><input name="dummy_date" type="radio" value="2012-10-06" /> 6th October, 2012</label>
<label><input name="dummy_date" type="radio" value="2012-10-07" /> 7th October, 2012</label>
<!-- The actual date fields (hidden). -->
<input id="real_date_fieldname_year" name="real_date_fieldname[]" type="hidden" value="null" />
<input id="real_date_fieldname_month" name="real_date_fieldname[]" type="hidden" value="null" />
<input id="real_date_fieldname_day" name="real_date_fieldname[]" type="hidden" value="null" />
@manifestuk
manifestuk / gist:2557044
Created April 30, 2012 10:22
ExpressionEngine Config Settings for GMail SMTP (Hopefully)
$env_conf['mail_protocol'] = 'smtp';
$env_conf['smtp_server'] = 'tls://smtp.gmail.com:XXX'; // Use :XXX to set the port number.
$env_conf['smtp_username'] = 'xxx@xxx.xxx';
$env_conf['smtp_password'] = 'xxx';
$env_conf['email_newline'] = "\r\n";
$env_conf['email_crlf'] = "\r\n";
@manifestuk
manifestuk / gist:2248282
Created March 30, 2012 07:05
Zoo Visitor "form array" bug fix.
// Starts around line 1100 of zoo_visitor_lib.php
foreach ($query->result_array() as $row)
{
/**
* @author Stephen Lewis
*
* Additional check to ensure that $_POST data is a string. Ensures ZV
* doesn't choke on DropDate, or any other "array" fields.
*/
@manifestuk
manifestuk / Find EE Extension Hooks
Created January 14, 2012 01:15
Output a list of every extension hook for a given ExpressionEngine installation
# Description:
# A couple of useful bash one-liners for finding all of the extension hooks in
# a given ExpressionEngine installation. Here's what it does:
#
# 1. Finds all of the native hooks, and any third-party hooks;
# 2. Sorts them alphabetically;
# 3. Outputs them to STDOUT or a file of your choosing.
#
# Usage:
# CD to the `/system/expressionengine/` directory of your site, and run
@manifestuk
manifestuk / wget.sh
Last active January 14, 2022 04:15
Gist for retrieving a full website using wget, because I always forget the options.
#
# Explanation:
# `--adjust-extension`
# Add `.html` file extension to any files of type `application/xhtml + xml` or `text/html`.
# Add `.css` file extension to any files of type `text/css`.
#
# `--convert-links`
# Convert full links to relative.
#
# `--level=inf` (`-l inf`)
/**
* Get Group Layout
*
* Gets layout information for member groups for the publish page
*
* @access public
* @param int Member group
* @param int Field group
* @return array
*/
find ./ -name ".svn" | xargs rm -Rf
# Reset the "Open With..." menu in Snow Leopard
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user