Skip to content

Instantly share code, notes, and snippets.

View rjmackay's full-sized avatar

Robbie Mackay rjmackay

View GitHub Profile
@rjmackay
rjmackay / Upgrader.diff
Created July 24, 2012 22:34
Better table prefix handling in Upgrader
@ -319,19 +319,25 @@ class Upgrade_Controller extends Admin_Controller {
if ($table_prefix)
{
$find = array(
'CREATE TABLE IF NOT EXISTS `',
'INSERT INTO `',
+ 'INSERT IGNORE INTO `',
'ALTER TABLE `',
- 'UPDATE `'
+ 'UPDATE `',
@rjmackay
rjmackay / MY_Controller.php
Created May 10, 2012 04:56
Ushahidi MY_Controller
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Base Controller
* Enforces basic access control, ie. for private deployments
*
* PHP version 5
* LICENSE: This source file is subject to LGPL license
* that is available through the world-wide-web at the following URI:
* http://www.gnu.org/copyleft/lesser.html
*
@rjmackay
rjmackay / gist:983085
Created May 20, 2011 14:58
Add gids parameter to node/XXX/edit urls - so noderelationships has context
/*
* Implementation of hook_nodeapi()
* Add gids parameter to node/XXX/edit urls - so noderelationships has context
*/
function og_country_nodeapi(&$node, $op) {
if ($op != 'prepare') return;
if (!empty($_REQUEST['gids'])) return;
if (arg(2) == 'edit' && $node->og_groups) {