Skip to content

Instantly share code, notes, and snippets.

View dkobia's full-sized avatar

David Kobia dkobia

View GitHub Profile
<?php
function _fetch_core_release()
{
// Current Version
$current = urlencode(Kohana::config('settings.ushahidi_version'));
// Extra Stats
$url = urlencode(preg_replace("/^https?:\/\/(.+)$/i","\\1", url::base()));
$ip_address = (isset($_SERVER['REMOTE_ADDR'])) ? urlencode($_SERVER['REMOTE_ADDR']) : "";
<?php
private function _get_release_version()
{
// From version.ushahidi.com/2/
$release_version = $this->release->version;
$release_version
$version_ushahidi = Kohana::config('settings.ushahidi_version');
SELECT COUNT(id) as count FROM incident WHERE incident_active=1 AND id IN (7,16,45,48,75,149,161,249,290,458,563,631,681,739,751,805,840,880,903,906,916,987,994,1045,1048,1054,1065,1074,1083,1102,1108,1199,1238,1282,1298,1337,1380,1421,1478,1573,1579,1586,1603,1618,1621,1633,1646,1738,1761,1781,1805,1819,1830,1876,1902,1932,1963,1975,1999,2017,2045,2050,2051,2062,2075,2081,2117,2120,2125,2130,2137,2153,2172,2181,2191,2202,2207,2208,2220,2232,2259,2277,2296,2302,2319,2326,2333,2334,2336,2344,2345,2346,2350,2362,2374,2389,2394,2404,2409,2413,2414,2427,2437,2445,2447,2448,2453,2467,2470,2471,2473,2482,2488,2489,2492,2514,2534,2539,2540,2543,2549,2561,2564,2565,2571,2574,2575,2579,2580,2585,2586,2616,2617,2628,2647,2655,2659,2676,2690,2697,2699,2704,2707,2708,2709,2711,2718,2723,2731,2745,2755,2763,2764,2768,2772,2775,2779,2780,2785,2787,2797,2802,2806,2811,2812,2819,2821,2826,2830,2834,2840,2843,2853,2855,2858,2863,2867,2878,2885,2886,2897,2901,2904,2908,2911,2925,2931,2972,2982,2997,3008,3013,3019,3030,3034,305
<?php
function update_translations($lang,$file,$translations){
global $USERID;
foreach($translations as $key => $string){
// First find out if we need to do an update.
// This helps us create a history entry if there's a change
$query = 'SELECT `'.mysql_escape_string($lang).'` FROM `base` WHERE CONVERT( `file` USING utf8 ) = \''.mysql_escape_string($file).'\' AND CONVERT( `key` USING utf8 ) = \''.mysql_escape_string($key).'\' LIMIT 1';
$result = mysql_query($query);
@dkobia
dkobia / git-ftp.py
Created October 13, 2010 14:47
git-ftp.py
#!/usr/bin/env python
"""
git-ftp: painless, quick and easy working copy syncing over FTP
Copyright (c) 2008-2009
Edward Z. Yang <[email protected]> and Mauro Lizaur <[email protected]>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Clickatell HTTP GET Controller
* Acts as the HTTP callback for Clickatell
*
* 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
* @author Ushahidi Team <[email protected]>
ALTER TABLE `roles` ADD `reports_view` tinyint(4) NOT NULL default '0' AFTER `description`;
ALTER TABLE `roles` ADD `reports_edit` tinyint(4) NOT NULL default '0' AFTER `reports_view`;
ALTER TABLE `roles` ADD `reports_evaluation` tinyint(4) NOT NULL default '0' AFTER `reports_edit`;
ALTER TABLE `roles` ADD `reports_comments` tinyint(4) NOT NULL default '0' AFTER `reports_evaluation`;
ALTER TABLE `roles` ADD `reports_download` tinyint(4) NOT NULL default '0' AFTER `reports_comments`;
ALTER TABLE `roles` ADD `reports_upload` tinyint(4) NOT NULL default '0' AFTER `reports_download`;
ALTER TABLE `roles` ADD `messages` tinyint(4) NOT NULL default '0' AFTER `reports_upload`;
ALTER TABLE `roles` ADD `messages_reporters` tinyint(4) NOT NULL default '0' AFTER `messages`;
ALTER TABLE `roles` ADD `stats` tinyint(4) NOT NULL default '0' AFTER `messages_reporters`;
ALTER TABLE `roles` ADD `settings` tinyint(4) NOT NULL default '0' AFTER `stats`;
{
"payload": {
"domain": "http:\/\/ushahidi.dev\/",
"incidents": [
{
"incident": {
"incidentid": "1",
"incidenttitle": "Hello Ushahidi!",
"incidentdescription": "Welcome to Ushahidi. Please replace this report with a valid incident",
"incidentdate": "2010-08-30 22:49:00",
{
"payload": {
"domain": "http:\/\/ushahidi.dev\/",
"incidents": [
{
"incident": {
"incidentid": "1",
"incidenttitle": "Hello Ushahidi!",
"incidentdescription": "Welcome to Ushahidi. Please replace this report with a valid incident",
"incidentdate": "2010-08-30 22:49:00",
"categories": {
"24": "2B. PENURIE D'EAU | WATER SHORTAGE",
"44": "2A. PENURIE D'ALIMENTS | FOOD SHORTAGE"
}