Skip to content

Instantly share code, notes, and snippets.

@nickdunn
nickdunn / form-controls.xsl
Created April 9, 2009 08:42
form-controls.xsl — build HTML forms for use with Symphony events
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:form="http://nick-dunn.co.uk/xslt/form"
extension-element-prefixes="exsl">
<!--
Utility: Form Controls (form-controls.xsl)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:form="http://nick-dunn.co.uk/xslt/form">
<xsl:import href="../utilities/form-controls.xsl"/>
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
omit-xml-declaration="yes"
encoding="UTF-8"
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" extension-element-prefixes="math">
<xsl:template match="data">
<xsl:call-template name="tag-cloud">
<xsl:with-param name="range" select="'5'"/>
<xsl:with-param name="tags" select="section-schema[@handle='articles']/*[name()='tags']//option"/>
</xsl:call-template>
/* Pagination
================================================*/
ul.pagination {
margin: 0;
}
ul.pagination li {
list-style-type: none;
font-size: 1.2em;
display: inline;
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Name: Basic Tumbler.com API Utility
Version: 1.0
Author: Josh Nichols <[email protected]>
URL: http://www.joshnichols.com/
Description:
This utility transforms a basic Tumblr.com XML source into XHTML. Each post is grouped by date and is marked up in a way that allows for easy styling with CSS.
<?php
// comes from the Akismet extension
include_once(WORKSPACE . '/assets/akismet.curl.class.php');
$comment = array(
'comment_type' => 'comment',
'comment_author' => $_POST['fields']['author'],
'comment_author_email' => $_POST['fields']['email'],
'comment_author_url' => $_POST['fields']['url'], // this might be optional?
<?php
Class CacheableDatasource extends Datasource {
private function buildCacheFilename(&$filename, &$file_age) {
$filename = null;
// get resolved values of each public property of this DS
// (sort, filters, included elements etc.)
foreach (get_class_vars(get_class($this)) as $key => $value) {
<?php
require_once(TOOLKIT . '/class.datasource.php');
Class datasourceblog_post_moderated_comment_count extends Datasource{
var $dsParamROOTELEMENT = 'blog-post-moderated-comment-count';
var $dsParamORDER = 'desc';
var $dsParamLIMIT = '9999';
var $dsParamREDIRECTONEMPTY = 'no';
server {
listen 80;
server_name localhost;
access_log /path/to/log/access.log;
error_log /path/to/log/error.log;
location / {
root /path/to/root;
index index.php;
<?php
require_once(TOOLKIT . '/class.datasource.php');
class DatasourceSearchException extends Exception {
}
class DatasourceSearch extends Datasource {
protected $fieldDefaults = array();