Skip to content

Instantly share code, notes, and snippets.

<?php
function timeline($fieldname, $options = array(), $timeline = null)
{
$timeline = $timeline || get_current_timeline();
try {
$text = strtolower($timeline->$fieldname);
} catch (Exception $e) {
'"' . $fieldName . '"" does not exist for timelines!';
import os, sys
for subdir, dirs, files in os.walk(sys.argv[1]):
print subdir
for file in files:
print file
f = open(subdir+'/'+file, 'r')
lines = f.readlines()
f.close()
f = open(subdir+'/'+file, 'w')
var mysql = require('mysql');
var client = mysql.createConnection({
host: 'localhost',
user: 'omeka',
password: 'omeka',
port: 8889,
database: 'neatline'
});
var mysql = require('mysql');
var randy = require('randy');
var _ = require('underscore');
// Query base.
var sql = 'INSERT INTO omeka_neatline_records (' +
'exhibit_id,'+
'title,'+
'description,'+
'map_active,'+
SVGtoWKT.convert('<svg><polygon points="1,2 3,4 5,6" /><line x1="7" y1="8" x2="9" y2="10" /></svg>');
>>> "GEOMETRYCOLLECTION(POLYGON((1 -2,3 -4,5 -6,1 -2)),LINESTRING(7 -8,9 -10))"
SVGtoWKT.line(1, 2, 3, 4);
>>> "LINESTRING(1 -2,3 -4)"
SVGtoWKT.polyline('1,2 3,4');
>>> "LINESTRING(1 -2,3 -4)"
SVGtoWKT.polygon('1,2 3,4');
>>> "POLYGON((1 -2,3 -4,1 -2))"