Skip to content

Instantly share code, notes, and snippets.

$view = new view;
$view->name = 'events';
$view->description = 'events';
$view->tag = 'events';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
@charleyramm
charleyramm / cck partner
Created April 4, 2011 13:14
cck partner fields
$content['type'] = array (
'name' => 'People',
'type' => 'people',
'description' => 'Artists, musicians and contributors.',
'title_label' => 'Title',
'body_label' => 'Body',
'min_word_count' => '0',
'help' => '',
'input_formats' =>
array (
$view = new view;
$view->name = 'Partners';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
<?php
/*
* /masterpieces/events/index.php
* Simple PHP events block
* Display events block, ignoring those events that have already happened
* 20 June 2013
* c.ramm@uea.ac.uk
*
*/
@charleyramm
charleyramm / add.php
Created June 20, 2013 14:30
Source: http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html Clean and simple design #HTML should look like HTML #Keep the PHP code in the views extremely simple: function calls, simple loops and variable substitutions should be all you need Secure #Input validation using pecl/filter as a data firewall #When possible, avoi…
<?php
include './ui.inc'; // Common View Helper functions
include './add_c.inc'; // Controller
head();
?>
<div id="tItems" class="ta">
<table cellspacing="0" cellpadding="3" width="100%">
<?php foreach($items as $i=>$elem) {
$s = $i%2;
echo <<<EOB
!/usr/bin/perl -w
use strict;
use warnings;
use utf8;
#compiled from source like: http://www.imagemagick.org/script/perl-magick.php
use Image::Magick;
#rock through the directory index
my @files = <*.{jpg,jpeg,png,gif}>;
<!DOCTYPE html>
<!-- this theme has suffered minor modifications since being created by Peter Vidani under the name 'Default' c.ramm@uea.ac.uk -->
<html>
<head>
<title>{Title}{block:SearchPage} ({lang:Search results for SearchQuery}){/block:SearchPage}{block:PermalinkPage}{block:PostSummary} — {PostSummary}{/block:PostSummary}{/block:PermalinkPage}</title>
<meta charset="utf-8">
<meta name="description" content="{block:IndexPage}{block:Description}{MetaDescription}{/block:Description}{/block:IndexPage}{block:PermalinkPage}{block:PostSummary}{PostSummary}{/block:PostSummary}{/block:PermalinkPage}" />
<meta name="color:Accent" content="blue"/>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/*
Replicates WordPress function the_meta() but outputs dt and dd elements instead of li.
Wrap with <dd> tags in your template.
*/
function cairnie_the_attributes() {
if ( $keys = get_post_custom_keys() ) {
foreach ( (array) $keys as $key ) {
$keyt = trim($key);
if ( is_protected_meta( $keyt, 'post' ) )
continue;