Skip to content

Instantly share code, notes, and snippets.

@iaindooley
iaindooley / step4.php
Created Apr 26, 2011
Example news.php
View step4.php
<?php
require 'curl_request.class.php';
//update this to point to your install
$base = 'http://iain-workingsoftware-com-au.mockups.decalcms.com';
$url = $base.'/index.php?h=DecalApi';
$api_key = 'qZnSiN).yH4cw(gkhPTEKx>[vsg|&mf199Y5Vi]!e5oOalKp0nW0>=&Yt3>i$=+*';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
@iaindooley
iaindooley / step1.php
Created Apr 26, 2011
Example Decal API request for Step 1 of the API docs
View step1.php
<?php
require_once('curl_request.class.php');
//update this to point to your install
$url = 'http://www.decalcms.com/index.php?h=DecalApi';
$api_key = '597990c64261faa854805f6366f9dcc4f505ed0e';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
't' => 'Home',//fetch pages that use the Home
@iaindooley
iaindooley / step1.php
Created Apr 26, 2011
Example Decal API request for Step 1 of the API docs
View step1.php
<?php
require 'curl_request.class.php';
//update this to point to your install
$url = 'http://www.decalcms.com/index.php?h=DecalApi';
$api_key = '597990c64261faa854805f6366f9dcc4f505ed0e';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
't' => 'Home',//fetch pages that use the Home
@iaindooley
iaindooley / step2.php
Created Apr 26, 2011
Example Decal API request to fetch a list of pages
View step2.php
<?php
require_once('curl_request.class.php');
//update this to point to your install
$url = 'http://www.decalcms.com/index.php?h=DecalApi';
$api_key = '597990c64261faa854805f6366f9dcc4f505ed0e';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
'list' => '1', //get the first list of pages
@iaindooley
iaindooley / step2_ex2.php
Created Apr 26, 2011
Example Decal API request to build a list of Decal plan costs
View step2_ex2.php
<?php
require_once('curl_request.class.php');
//update this to point to your install
$url = 'http://www.decalcms.com/index.php?h=DecalApi';
$api_key = '597990c64261faa854805f6366f9dcc4f505ed0e';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
't' => 'Home',
@iaindooley
iaindooley / step3_ex1.php
Created Apr 26, 2011
Example Decal API search query
View step3_ex1.php
<?php
require_once('curl_request.class.php');
//update this to point to your install
$url = 'http://www.decalcms.com/index.php?h=DecalApi';
$api_key = '597990c64261faa854805f6366f9dcc4f505ed0e';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
'search' => 'true',
@iaindooley
iaindooley / step3_ex2.php
Created Apr 26, 2011
Example Decal API search more query
View step3_ex2.php
<?php
require_once('curl_request.class.php');
//update this to point to your install
$url = 'http://www.decalcms.com/index.php?h=DecalApi';
$api_key = '597990c64261faa854805f6366f9dcc4f505ed0e';
//formulate the post fields for the request
//we'll look at the options in detail below
$fields = array('api_key' => $api_key,
'search_more' => 'true',//returns more results than "search"
@iaindooley
iaindooley / css_styles.css
Created Apr 27, 2011
Example of how to add custom styles and colours to Decal
View css_styles.css
#home p.didYouKnow /* decal: Lightbulb graphic */
{
background-image:url('lightbulb.png');
}
#home p.important /* decal: #ff0000 */
{
colour:red;
}
@iaindooley
iaindooley / decal_html_structure.html
Created Apr 27, 2011
An example of deploying a structured HTML component with Decal
View decal_html_structure.html
<div area="Homepage items">
<div class="homepageItem" component="Home page item">
<a href="" editable="true">
<img editable="true" width="100" name="Homepage item graphic" />
</a>
<h6 editable="true" tags="none">Your heading here</h6>
<p editable="true" tags="inline">Short description here</p>
<a class="learnMore" editable="true">Learn more</a>
</div>
</div>
@iaindooley
iaindooley / xpath_escape_test.php
Created Aug 21, 2011
xpathEscape() inputs and expected output
View xpath_escape_test.php
<?php
require('xpath_escape.php');
$strings = array('i think therefore i am',
'the pimp\'s "main squeeze" was talkin\' jive');
foreach($strings as $query)
echo xpathEscape($query).PHP_EOL;
/**
* EXPECTED OUTPUT: