set_time_limit(0);
-define ( 'BUILD_ID' , 1005 );
+define ( 'BUILD_ID' , 1007 );
define ( 'EOL', "<br />\r\n");
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
define ( 'NAMESPACE_TOMB' , 'http://purl.org/atompub/tombstones/1.0' );
define ( 'NAMESPACE_ACTIVITY', 'http://activitystrea.ms/spec/1.0/' );
define ( 'NAMESPACE_ACTIVITY_SCHEMA', 'http://activitystrea.ms/schema/1.0/');
+define ( 'NAMESPACE_SALMON_ME', 'http://salmon-protocol.org/ns/magic-env');
define ( 'ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like' );
define ( 'ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike' );
}}
+// retrieve the App structure
+// useful in functions which require it but don't get it passed to them
+
+if(! function_exists('get_app')) {
+function get_app() {
+ global $a;
+ return $a;
+}};
+
// Multi-purpose function to check variable state.
// Usage: x($var) or $x($array,'key')
$stored = intval($build);
$current = intval(BUILD_ID);
if(($stored < $current) && file_exists('update.php')) {
-
// We're reporting a different version than what is currently installed.
// Run any existing update scripts to bring the database up to current.
// load string tranlsation table for alternate language
-// not yet implemented
if(! function_exists('load_translation_table')) {
function load_translation_table($lang) {
global $a;
+ if(file_exists("view/$lang/strings.php"))
+ include("view/$lang/strings.php");
}}
// translate string if translation exists
if(! function_exists('t')) {
function t($s) {
- global $a;
+
+ $a = get_app();
if($a->strings[$s])
return $a->strings[$s];
}}
// Generic XML return
-// Outputs a basic XML status structure to STDOUT, with a value variable
-// of $st and terminates the current process.
+// Outputs a basic dfrn XML status structure to STDOUT, with a <status> variable
+// of $st and an optional text <message> of $message and terminates the current process.
if(! function_exists('xml_status')) {
-function xml_status($st) {
+function xml_status($st, $message = '') {
+
+ if(strlen($message))
+ $xml_message = "\t<message>" . xmlify($message) . "</message>\r\n";
+
header( "Content-type: text/xml" );
echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
- echo "<result><status>$st</status></result>\r\n";
+ echo "<result>\r\n\t<status>$st</status>\r\n$xml_message</result>\r\n";
killme();
}}