Skip to content

Instantly share code, notes, and snippets.

View philsturgeon's full-sized avatar
🌳
Planting Trees

Phil Sturgeon philsturgeon

🌳
Planting Trees
View GitHub Profile
<?php
/*
* ExternalCMS Class
*
* This class abstracts the functionality of intergrating HL cms based sites with external CMS's
* How did this happen? Were there no other options? WHY AM I WRITING THIS?!
*
* @author Phil Sturgeon
*/
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author Philip Sturgeon
* @created 04/06/2009
*/
class REST {
private $CI; // CodeIgniter instance
function getCorrectIndex(i, date)
{
// find out what day of the week it is
var day_of_the_week = date.substr(0,3);
// define what days correspond to which array indices
var days = new Object();
days.Mon = [0,5,10,15,20];
days.Tue = [1,6,11,16,21];
days.Wed = [2,7,12,17,22];
@philsturgeon
philsturgeon / MY_Parser.php
Created November 15, 2009 15:53
Subtle CodeIgniter Dwoo implementation via MY_Parser
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
<?php
class Prowl
{
var $username = '';
var $password = '';
var $application = 'CI Prowl';
/**
* Constructor - Sets Preferences
<?php
$array = array(
'Appt with my IFA: cxzcsdf Wed. 10:30',
'Transfer some cas\\zh to my SIPP ready to invest in R&M Global Opportunities on launch'."\n",
'Research and switch from my gilts fund to an emerging markets fund'
);
$serialized = serialize($array);
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
v0.9.8 Documentation
--------------------
Dont worry guys this will be broken down into page hierarchy, just filling out the content while I work out how to lay it all out.
Modules
PyroCMS is broken down into modules. A module can be frontend only (shows only to the public on the user-facing part of the site) and some might be
<?php
$g=$_GET;$c=@$g['c']?$g['c']:'Home';
if(!@include"c/$c.php")die('fail');
$m=method_exists($c,$m=@$g['m'])?$m:'index';
$o=new$c();$o->$m($g);
class MY_Loader extends CI_Loader {
function image($file_path, $mime_type_or_return = 'image/png')
{
$this->load->helper('file');
$image_content = read_file($file_path);
// Image was not found
if($image_content === FALSE)