Skip to content

Instantly share code, notes, and snippets.

View craigrodway's full-sized avatar

Craig A Rodway craigrodway

View GitHub Profile
@craigrodway
craigrodway / gist:928940
Created April 19, 2011 17:28
CMS Made Simple user-defined tag to show latest tweets. Includes caching. Original source listed in comments.
/**
* TWITTER FEED PARSER
*
* @version 1.1.2
* @author Jonathan Nicol
* @link http://f6design.com/journal/2010/10/07/display-recent-twitter-tweets-using-php/
*
* Notes:
* We employ caching because Twitter only allows their RSS feeds to be accesssed 150
* times an hour per user client.
@craigrodway
craigrodway / function.gmaps.php
Created April 10, 2011 22:25
Updated version of the gmaps plugin for CMS Made Simple. Static map for fallback. Code cleanup.
<?php
/*
CMS - CMS Made Simple
(c)2004-2007 by Ted Kulp (ted@cmsmadesimple.org)
This project's homepage is: http://cmsmadesimple.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@craigrodway
craigrodway / gist:792382
Created January 23, 2011 19:57
Crops an image square.
<?php
function _process_image($data){
if($data['is_image'] == TRUE){
// It's definitely an image...
// Work out essential dimensions
@craigrodway
craigrodway / printmaster-logo.php
Created January 14, 2011 08:35
Adding a logo to PrintMaster - line ~73.
<?php
/*
Copyright (C) 2010 Craig A Rodway.
This file is part of Print Master.
Print Master is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@craigrodway
craigrodway / gist:673874
Created November 12, 2010 08:39
Reports page with printer location (view file)
<?php
if(isset($printer)){
$tpl->set('title', 'Consumable installation reports for ' . $printer->getName());
} else {
$tpl->set('title', 'Consumable installation reports');
}
$tpl->place('header');
$colour = '<span style="color:#%s;">&bull;</span>';
?>
@craigrodway
craigrodway / gist:673871
Created November 12, 2010 08:34
Reports page with printer location (main page)
<?php
/*
Copyright (C) 2010 Craig A Rodway.
This file is part of Print Master.
Print Master is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.