Browse Source

Merge branch 'master' into newui

Fabio Comuni 10 years ago
  1. 2
  2. 39
  3. 86
  4. 10
  5. 186
  6. 363
  7. 283
  8. 228
  9. 39
  10. 13
  11. 1046
  12. 7
  13. 27
  14. 27
  15. 6
  16. 76
  17. 38
  18. 1
  19. 31
  20. 1247
  21. BIN
  22. 339
  23. 24
  24. 152
  25. 125
  26. 1
  27. 1
  28. 9
  29. 62
  30. 162
  31. 18
  32. 2
  33. 46
  34. 31
  35. 31
  36. 2
  37. 9
  38. 19
  39. 1
  40. 1
  41. 2
  42. 1
  43. 6
  44. 7
  45. 1
  46. 2
  47. 154
  48. 200
  49. BIN
  50. BIN
  51. BIN
  52. BIN
  53. BIN
  54. BIN
  55. BIN
  56. BIN
  57. BIN
  58. BIN
  59. BIN
  60. BIN
  61. BIN
  62. BIN
  63. 334
  64. 21
  65. 119
  66. 1069
  67. 17
  68. 1423
  69. 171
  70. BIN
  71. 1
  72. 0
  73. 1
  74. 1
  75. 1
  76. 1
  77. 1
  78. 24
  79. 106
  80. 48
  81. 81
  82. 382
  83. 339
  84. 17
  85. 130
  86. 6
  87. 89
  88. BIN
  89. 7
  90. 43
  91. 4
  92. 8
  93. 95
  94. 64
  95. 14
  96. 180
  97. BIN
  98. BIN
  99. BIN
  100. BIN


@ -7,4 +7,4 @@ include/jquery-1.4.2.min.js


@ -1,25 +1,20 @@
The Friendika project is distributed under the following license terms:
Copyright (c) 2010, 2011 the Friendika Project
All rights reserved.
* This software is provided for any use with no license terms or restrictions.
No guarantee is provided. Use at your own risk.
Components packaged with this software may fall under different license terms.
cropper - BSD
TwitterOAuth - BSD
markdown - BSD
slinky - BSD
ajax-upload - MIT
simplepie - MIT
LightOpenID - MIT
jQuery - MIT
phpsec - LGPL
HTMLPurifer - LGPL
Facebook SDK - Apache
Addons, plugins, and themes may also be provided under their own license terms.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.


@ -1,86 +0,0 @@
* Friendika *
Friendika Communications Server
Friendika is a web application for managing social communications. Some
would call it a "social network" or "distributed social network". We think
both terms have been over-used, and don't adequately describe Friendika's
capabilities - though Friendika can also fill those roles.
At its essence, Friendika is a web application which can monitor various
information and social activity streams, and which also lets you participate
in online conversations with friends and associates, using a variety of network
protocols. These are combined into an overview of your various communications
and activities - regardless of network origin.
Friendika also manages your personal profiles and photo albums and lets
you securely present each of these to specific audiences. Your communications
can be either open and public, or closed and private. You can easily create
"groups" of contacts with which you can partition your conversations into
private social circles, and which cannot be seen outside the circle.
Friendika is decentralised. Any account on any Friendika server can connect
with any account on any other Friendika server. You can also connect to and
interact directly with friends on Facebook, Status.Net, and other federated
social web services (e.g., GNU-Social, etc.).
Outgoing communications can be directed to Friendika, existing accounts on
Facebook and Twitter, federated social web providers - or even delivered to
email contacts.
Incoming data streams aren't limited to traditional social networks.
They may include most any service which provides a syndication feed (both RSS
and Atom). This allows you to view communications from friends in other
diverse social networks - such as Diaspora, Google Buzz, and millions of
blogs, news services, and other websites. You can also import
contacts from (and write to) anybody that is accessible from your email
INBOX and view them in your social stream. Over time we will try to
build two-way bridges to other services so that you can freely
interact in both directions with anybody on an accessible network that
allows it.
Communications between Friendika servers are private and encrypted,
using military grade encryption - and require mutual identity provenance
before any data is exchanged. These same crypto mechanisms provide remote
password-less authentication; allowing you to post to profiles and view private
photo collections on other servers - without encountering any login and/or
authorisation dialogues when visiting these sites.
Friendika has no boundaries and no central ownership of the data generated
within the network. Anybody with a commodity PHP/MySQL web server or hosting
account can provide a server, and each individual server can then support
up to several thousand participating members - each with their own unique
communication and privacy needs. This allows Friendika to scale to global
levels and mimics the decentralised architecture of the web itself.
If you are creating a website which requires social interaction, Friendika
can also take the place of blog software, forum software and feed readers, and
also provide individualised communications and content management - or
simply be used as an alternative to traditional "monolithic" social networks.
Friendika is also free - in every sense of the word.
Choose freedom - join us.
Find out more about the project at
Friendika Demo Site
Friendika Downloads


@ -1,10 +0,0 @@
Friendika addons/plugins license terms are under the control of the project
author or authors.
Developers are free to set their own license terms on addons/plugins as
standalone works. These license terms apply only to the covered addon or
Addons/plugins may be licensed under copyleft or other license terms. Although
these projects may require Friendika to operate, no addon or plugin may
mandate any changes to the Friendika project license.


@ -1,186 +0,0 @@
Friendika Addon/Plugin development
This is an early specification and hook details may be subject to change.
Please see the sample addon 'randplace' for a working example of using these features.
You must register plugins with the system in the .htconfig.php file.
$a->config['system']['addon'] = 'plugin1name, plugin2name, another_name';
Plugin names cannot contain spaces and are used as filenames.
Register your plugin hooks during installation.
register_hook($hookname, $file, $function);
$hookname is a string and corresponds to a known Friendika hook
$file is a pathname relative to the top-level Friendika directory.
This *should* be 'addon/plugin_name/plugin_name.php' in most cases.
$function is a string and is the name of the function which will be executed
when the hook is called.
Your hook functions will be called with at least one and possibly two arguments
function myhook_function(&$a, &$b) {
If you wish to make changes to the calling data, you must declare them as
reference variables (with '&') during function declaration.
$a is the Friendika 'App' class - which contains a wealth of information
about the current state of Friendika, such as which module has been called,
configuration info, the page contents at the point the hook was invoked, profile
and user information, etc. It is recommeded you call this '$a' to match its usage
$b can be called anything you like. This is information which is specific to the hook
currently being processed, and generally contains information that is being immediately
processed or acted on that you can use, display, or alter. Remember to declare it with
'&' if you wish to alter it.
Current hooks:
'authenticate' - called when a user attempts to login.
$b is an array
'username' => the supplied username
'password' => the supplied password
'authenticated' => set this to non-zero to authenticate the user.
'user_record' => successful authentication must also return a valid user record from the database
'logged_in' - called after a user has successfully logged in.
$b contains the $a->user array
'display_item' - called when formatting a post for display.
$b is an array
'item' => The item (array) details pulled from the database
'output' => the (string) HTML representation of this item prior to adding it
to the page
'post_local' - called when a status post or comment is entered on the local system
$b is the item array of the information to be stored in the database
{Please note: body contents are bbcode - not HTML)
'post_local_end' - called when a local status post or comment has been stored on the local system
$b is the item array of the information which has just been stored in the database
{Please note: body contents are bbcode - not HTML)
'post_remote' - called when receiving a post from another source. This may also be used
to post local activity or system generated messages.
$b is the item array of information to be stored in the database and the item
body is bbcode.
'settings_form' - called when generating the HTML for the user Settings page
$b is the (string) HTML of the settings page before the final '</form>' tag.
'settings_post' - called when the Settings pages are submitted.
$b is the $_POST array
'plugin_settings' - called when generating the HTML for the addon settings page
$b is the (string) HTML of the addon settings page before the final '</form>' tag.
'plugin_settings_post' - called when the Addon Settings pages are submitted.
$b is the $_POST array
'profile_post' - called when posting a profile page.
$b is the $_POST array
'profile_edit' - called prior to output of profile edit page
$b is array
'profile' => profile (array) record from the database
'entry' => the (string) HTML of the generated entry
'profile_advanced' - called when the HTML is generated for the 'Advanced profile',
corresponding to the 'Profile' tab within a person's profile page.
$b is the (string) HTML representation of the generated profile
'directory_item' - called from the Directory page when formatting an item for display
$b is an array
'contact' => contact (array) record for the person from the database
'entry' => the (string) HTML of the generated entry
'profile_sidebar_enter' - called prior to generating the sidebar "short" profile for a page
$b is (array) the person's profile array
'profile_sidebar' - called when generating the sidebar "short" profile for a page
$b is an array
'profile' => profile (array) record for the person from the database
'entry' => the (string) HTML of the generated entry
'contact_block_end' - called when formatting the block of contacts/friends on a
profile sidebar has completed
$b is an array
'contacts' => contact array of entries
'output' => the (string) generated HTML of the contact block
'bbcode' - called during conversion of bbcode to html
$b is (string) converted text
'html2bbcode' - called during conversion of html to bbcode (e.g. remote message posting)
$b is (string) converted text
'page_header' - called after building the page navigation section
$b is (string) HTML of nav region
'personal_xrd' - called prior to output of personal XRD file.
$b is an array
'user' => the user record for the person
'xml' => the complete XML to be output
'home_content' - called prior to output home page content, shown to unlogged users
$b is (string) HTML of section region
'contact_edit' - called when editing contact details on an individual from the Contacts page
$b is (array)
'contact' => contact record (array) of target contact
'output' => the (string) generated HTML of the contact edit page
'contact_edit_post' - called when posting the contact edit page
$b is the $_POST array
'init_1' - called just after DB has been opened and before session start
$b is not used or passed
'page_end' - called after HTML content functions have completed
$b is (string) HTML of content div
'jot_plugin' - add tools to jot toolbar
$b is (string) HTML for tool icon
*** = subject to change
Not yet documented:
'atom_feed' ***
'atom_feed_end' ***
'parse_atom' ***
'atom_author' ***
'atom_entry' ***
'parse_link' ***


@ -1,363 +0,0 @@
* Name: Calculator App
* Description: Simple Calculator Application
* Version: 1.0
* Author: Mike Macgirvin <>
function calc_install() {
register_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
function calc_uninstall() {
unregister_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
function calc_app_menu($a,&$b) {
$b['app_menu'][] = Array('url'=>'calc', 'name'=>'Calculator');
function calc_module() {}
function calc_init($a) {
$x = <<< EOT
<script language="JavaScript">
* *
// Declare global variables
var displayText = ""
var num1
var num2
var operatorType
// Write to display
function addDisplay(n){
id = document.getElementById("display");
id.value = ""
displayText += n
id.value = displayText
// Addition
function addNumbers() {
if (displayText == "") {
displayText = result
num1 = parseFloat(displayText)
operatorType = "add"
displayText = ""
// Subtraction
function subtractNumbers() {
if (displayText == "") {
displayText = result
num1 = parseFloat(displayText)
operatorType = "subtract"
displayText = ""
// Multiplication
function multiplyNumbers() {
if (displayText == "") {
displayText = result
num1 = parseFloat(displayText)
operatorType = "multiply"
displayText = ""
// Division
function divideNumbers() {
if (displayText == "") {
displayText = result
num1 = parseFloat(displayText)
operatorType = "divide"
displayText = ""
// Sine
function sin() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = Math.sin(num1)
id.value = result
displayText = ""
else {
alert("Please write the number first")
// Cosine
function cos() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = Math.cos(num1)
id.value = result
displayText = ""
else {
alert("Please write the number first")
// ArcSine
function arcSin() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = Math.asin(num1)
id.value = result
displayText = ""
else {
alert("Please write the number first")
// ArcCosine
function arcCos() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = Math.acos(num1)
id.value = result
displayText = ""
else {
alert("Please write the number first")
// Square root
function sqrt() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = Math.sqrt(num1)
id.value = result
displayText = ""
else {
alert("Please write the number first")
// Square number (number to the power of two)
function square() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = num1 * num1
id.value = result
displayText = ""
else {
alert("Please write the number first")
// Convert degrees to radians
function degToRad() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = num1 * Math.PI / 180
id.value = result
displayText = ""
else {
alert("Please write the number first")
// Convert radians to degrees
function radToDeg() {
id = document.getElementById("display");
if (displayText == "") {
num1 = result
else {
num1 = parseFloat(displayText)
if (num1 != "") {
result = num1 * 180 / Math.PI
id.value = result
displayText = ""
else {
alert("Please write the number first")
// Calculations
function calculate() {
id = document.getElementById("display");
if (displayText != "") {
num2 = parseFloat(displayText)
// Calc: Addition
if (operatorType == "add") {
result = num1 + num2
id.value = result
// Calc: Subtraction
if (operatorType == "subtract") {
result = num1 - num2
id.value = result
// Calc: Multiplication
if (operatorType == "multiply") {
result = num1 * num2
id.value = result
// Calc: Division
if (operatorType == "divide") {
result = num1 / num2
id.value = result
displayText = ""
else {
id.value = "Oops! Error!"
// Clear the display
function clearDisplay() {
id = document.getElementById("display");
displayText = ""
id.value = ""
$a->page['htmlhead'] .= $x;
function calc_content($app) {
$o = '';
$o .= <<< EOT
<br /><br />
<table bgcolor="#af9999" border="1">
<table border="1" cellpadding="2" cellspacing="2">
<form name="calc">
<TR><TD VALIGN=top colspan=6 ALIGN="center"> <H2>Calculator</H2> </TD>
<td colspan="5"><input size="22" id="display" name="display" type="text"></td>
</tr><tr align="left" valign="middle">
<td><input name="one" value="&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;" onclick="addDisplay(1)" type="button"></td>
<td><input name="two" value="&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;" onclick="addDisplay(2)" type="button"></td>
<td><input name="three" value="&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;" onclick="addDisplay(3)" type="button"></td>
<td><input name="plus" value="&nbsp;&nbsp;+&nbsp;&nbsp;&nbsp;" onclick="addNumbers()" type="button"></td>
</tr><tr align="left" valign="middle">
<td><input name="four" value="&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;" onclick="addDisplay(4)" type="button"></td>
<td><input name="five" value="&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;" onclick="addDisplay(5)" type="button"></td>
<td><input name="six" value="&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;" onclick="addDisplay(6)" type="button"></td>
<td><input name="minus" value="&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" onclick="subtractNumbers()" type="button"></td>
</tr><tr align="left" valign="middle">
<td><input name="seven" value="&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;" onclick="addDisplay(7)" type="button"></td>
<td><input name="eight" value="&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;" onclick="addDisplay(8)" type="button"></td>
<td><input name="nine" value="&nbsp;&nbsp;9&nbsp;&nbsp;&nbsp;" onclick="addDisplay(9)" type="button"></td>
<td><input name="multiplication" value="&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;" onclick="multiplyNumbers()" type="button"></td>
</tr><tr align="left" valign="middle">
<td><input name="zero" value="&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;" onclick="addDisplay(0)" type="button"></td>
<td><input name="pi" value="&nbsp;Pi&nbsp;&nbsp;" onclick="addDisplay(Math.PI)" type="button"> </td>
<td><input name="dot" value="&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;" onclick='addDisplay(".")' type="button"></td>
<td><input name="division" value="&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;" onclick="divideNumbers()" type="button"></td>
</tr><tr align="left" valign="middle">
<td><input name="sqareroot" value="sqrt" onclick="sqrt()" type="button"></td>
<td><input name="squarex" value=" x^2" onclick="square()" type="button"></td>
<td><input name="deg-rad" value="d2r&nbsp;" onclick="degToRad()" type="button"></td>
<td><input name="rad-deg" value="r2d&nbsp;" onclick="radToDeg()" type="button"></td>
</tr><tr align="left" valign="middle">
<td><input name="sine" value="&nbsp;sin&nbsp;" onclick="sin()" type="button"></td>
<td><input name="arcsine" value="asin" onclick="arcSin()" type="button"></td>
<td><input name="cosine" value="cos" onclick="cos()" type="button"></td>
<td><input name="arccosine" value="acs" onclick="arcCos()" type="button"></td>
</tr><tr align="left" valign="middle">
<td colspan="2"><input name="clear" value="&nbsp;&nbsp;Clear&nbsp;&nbsp;" onclick="clearDisplay()" type="button"></td>
<td colspan="3"><input name="enter" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" onclick="calculate()" type="button"></td>
<B>NOTE:</B> All sine and cosine calculations are
<br>done in radians. Remember to convert first
<br>if using degrees.
return $o;


@ -1,283 +0,0 @@
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Stanislav Okhvat <> |
// | Co-authored by : CVH, Chris Hansel <> |
// +----------------------------------------------------------------------+
// $Id: UnitConvertor.php,v 1.00 2002/02/20 11:40:00 stasokhvat Exp $
* UnitConvertor is able to convert between different units and currencies.
* @author Stanislav Okhvat <,>
* @version $Id: UnitConvertor.php,v 1.00 2002/03/01 17:00:00 stasokhvat Exp $
* @package UnitConvertor
* @access public
* @history 01.03.2002 Implemented the code for regular and offset-based
* conversions
* 13.12.2004
* By Chris Hansel (CVH): changed getConvSpecs in order to have it look up
* intermediary conversions (also see comments in check_key).
* Intermediary conversions are useful when no conversion ratio is specified
* between two units when we calculate between the two. For example, we want
* to convert between Fahrenheit and Kelvin, and we have only
* specified how to convert Centigrade<->Fahrenheit and
* Centigrade<->Kelvin. While a direct (Fahrenheit->Kelvin) or
* reverse (Kelvin->Fahrenheit) lookups fail, looking for an intermediary
* unit linking the two (Centigrade) helps us do the conversion.
* 13.12.2004
* Chris Hansel (CVH): $to_array argument of addConversion method can now
* contain units as 'unit1/unit2/unit3', when all units stand for the same
* thing. See examples in unitconv.php
class UnitConvertor
* Stores conversion ratios.
* @var array
* @access private
var $conversion_table = array();
* Decimal point character (default is "." - American - set in constructor).
* @var string
* @access private
var $decimal_point;
* Thousands separator (default is "," - American - set in constructor).
* @var string
* @access private
var $thousand_separator;
* For future use
* @var array
* @access private
var $bases = array();
* Constructor. Initializes the UnitConvertor object with the most important
* properties.
* @param string decimal point character
* @param string thousand separator character
* @return void
* @access public
function UnitConvertor($dec_point = '.', $thousand_sep = ',')
$this->decimal_point = $dec_point;
$this->thousand_separator = $thousand_sep;
} // end func UnitConvertor
* Adds a conversion ratio to the conversion table.
* @param string the name of unit from which to convert
* @param array array(
* "pound"=>array("ratio"=>'', "offset"=>'')
* )
* "pound" - name of unit to set conversion ration to
* "ratio" - 'double' conversion ratio which, when
* multiplied by the number of $from_unit units produces
* the result
* "offset" - an offset from 0 which will be added to
* the result when converting (needed for temperature
* conversions and defaults to 0).
* @return boolean true if successful, false otherwise
* @access public
function addConversion($from_unit, $to_array)
if (!isset($this->conversion_table[$from_unit])) {
while(list($key, $val) = each($to_array))
if (strstr($key, '/'))
$to_units = explode('/', $key);
foreach ($to_units as $to_unit)
$this->bases[$from_unit][] = $to_unit;
if (!is_array($val))
$this->conversion_table[$from_unit."_".$to_unit] = array("ratio"=>$val, "offset"=>0);
$this->conversion_table[$from_unit."_".$to_unit] =
"offset"=>(isset($val['offset']) ? $val['offset'] : 0)
$this->bases[$from_unit][] = $key;
if (!is_array($val))
$this->conversion_table[$from_unit."_".$key] = array("ratio"=>$val, "offset"=>0);
$this->conversion_table[$from_unit."_".$key] =
"offset"=>(isset($val['offset']) ? $val['offset'] : 0)
return true;
return false;
} // end func addConversion
* Converts from one unit to another using specified precision.
* @param double value to convert
* @param string name of the source unit from which to convert
* @param string name of the target unit to which we are converting
* @param integer double precision of the end result
* @return void
* @access public
function convert($value, $from_unit, $to_unit, $precision)
if ($this->getConvSpecs($from_unit, $to_unit, $value, $converted ))
return number_format($converted , (int)$precision, $this->decimal_point, $this->thousand_separator);
} else {
return false;
} // end func
* CVH : changed this Function getConvSpecs in order to have it look up
* intermediary Conversions from the
* "base" unit being that one that has the highest hierarchical order in one
* "logical" Conversion_Array
* when taking $conv->addConversion('km',
* array('meter'=>1000, 'dmeter'=>10000, 'centimeter'=>100000,
* 'millimeter'=>1000000, 'mile'=>0.62137, 'naut.mile'=>0.53996,
* 'inch(es)/zoll'=>39370, 'ft/foot/feet'=>3280.8, 'yd/yard'=>1093.6));
* "km" would be the logical base unit for all units of dinstance, thus,
* if the function fails to find a direct or reverse conversion in the table
* it is only logical to suspect that if there is a chance
* converting the value it only is via the "base" unit, and so
* there is not even a need for a recursive search keeping the perfomance
* acceptable and the ressource small...
* CVH check_key checks for a key in the Conversiontable and returns a value
function check_key( $key) {
if ( array_key_exists ($key,$this->conversion_table)) {
if (! empty($this->conversion_table[$key])) {
return $this->conversion_table[$key];
return false;
* Key function. Finds the conversion ratio and offset from one unit to another.
* @param string name of the source unit from which to convert
* @param string name of the target unit to which we are converting
* @param double conversion ratio found. Returned by reference.
* @param double offset which needs to be added (or subtracted, if negative)
* to the result to convert correctly.
* For temperature or some scientific conversions,
* i.e. Fahrenheit -> Celcius
* @return boolean true if ratio and offset are found for the supplied
* units, false otherwise
* @access private
function getConvSpecs($from_unit, $to_unit, $value, &$converted)
$key = $from_unit."_".$to_unit;
$revkey = $to_unit."_".$from_unit;
$found = false;
if ($ct_arr = $this->check_key($key)) {
// Conversion Specs found directly
$ratio = (double)$ct_arr['ratio'];
$offset = $ct_arr['offset'];
$converted = (double)(($value * $ratio)+ $offset);
return true;
} // not found in direct order, try reverse order
elseif ($ct_arr = $this->check_key($revkey)) {
$ratio = (double)(1/$ct_arr['ratio']);
$offset = -$ct_arr['offset'];
$converted = (double)(($value + $offset) * $ratio);
return true;
} // not found test for intermediary conversion
else {
// return ratio = 1 if keyparts match
if ($key == $revkey) {
$ratio = 1;
$offset = 0;
$converted = $value;
return true;
// otherwise search intermediary
while (list($convk, $i1_value) = each($this->conversion_table)) {
// split the key into parts
$keyparts = preg_split("/_/",$convk);
// return ratio = 1 if keyparts match
// Now test if either part matches the from or to unit
if ($keyparts[1] == $to_unit && ($i2_value = $this->check_key($keyparts[0]."_".$from_unit))) {
// an intermediary $keyparts[0] was found
// now let us put things together intermediary 1 and 2
$converted = (double)(((($value - $i2_value['offset']) / $i2_value['ratio']) * $i1_value['ratio'])+ $i1_value['offset']);
$found = true;
} elseif ($keyparts[1] == $from_unit && ($i2_value = $this->check_key($keyparts[0]."_".$to_unit))) {
// an intermediary $keyparts[0] was found
// now let us put things together intermediary 2 and 1
$converted = (double)(((($value - $i1_value['offset']) / $i1_value['ratio']) + $i2_value['offset']) * $i2_value['ratio']);
$found = true;
return $found;
} // end func getConvSpecs
} // end class UnitConvertor


@ -1,228 +0,0 @@
* Name: Converter App
* Description: Unit converter application
* Version: 1.0
* Author: Mike Macgirvin <>
function convert_install() {
register_hook('app_menu', 'addon/convert/convert.php', 'convert_app_menu');
function convert_uninstall() {
unregister_hook('app_menu', 'addon/convert/convert.php', 'convert_app_menu');
function convert_app_menu($a,&$b) {
$b['app_menu'][] = Array('url'=>'convert', 'name'=>'Units Conversion');
function convert_module() {}
function convert_content($app) {
class TP_Converter extends UnitConvertor {
function TP_Converter($lang = "en")
if ($lang != 'en' ) {
$dec_point = '.'; $thousand_sep = "'";
} else {
$dec_point = '.'; $thousand_sep = ",";
$this->UnitConvertor($dec_point , $thousand_sep );
} // end func UnitConvertor
function find_base_unit($from,$to) {
while (list($skey,$sval) = each($this->bases)) {
if ($skey == $from || $to == $skey || in_array($to,$sval) || in_array($from,$sval)) {
return $skey;
return false;
function getTable($value, $from_unit, $to_unit, $precision) {
if ($base_unit = $this->find_base_unit($from_unit,$to_unit)) {
// A baseunit was found now lets convert from -> $base_unit
$cell ['value'] = $this->convert($value, $from_unit, $base_unit, $precision)." ".$base_unit;
$cell ['class'] = ($base_unit == $from_unit || $base_unit == $to_unit) ? "framedred": "";
$cells[] = $cell;
// We now have the base unit and value now lets produce the table;
while (list($key,$val) = each($this->bases[$base_unit])) {
$cell ['value'] = $this->convert($value, $from_unit, $val, $precision)." ".$val;
$cell ['class'] = ($val == $from_unit || $val == $to_unit) ? "framedred": "";
$cells[] = $cell;
$cc = count($cells);
$string = "<table class=\"framed grayish\" border=\"1\" cellpadding=\"5\" width=\"80%\" align=\"center\"><tr>";
$string .= "<td rowspan=\"$cc\" align=\"center\">$value $from_unit</td>";
foreach ($cells as $cell) {
if ($i==0) {
$string .= "<td class=\"".$cell['class']."\">".$cell['value']."</td>";
} else {
$string .= "</tr><tr><td class=\"".$cell['class']."\">".$cell['value']."</td>";
$string .= "</tr></table>";
return $string;
$conv = new TP_Converter('en');
$conversions = array(
'Temperature'=>array('base' =>'Celsius',
'Fahrenheit'=>array('ratio'=>1.8, 'offset'=>32),
'Kelvin'=>array('ratio'=>1, 'offset'=>273),
'Weight' => array('base' =>'kg',
'cwt(UK)' => 0.019684,
'cwt(US)' => 0.022046,
'ton (US)' => 0.0011023,
'ton (UK)' => 0.0009842
'Distance' => array('base' =>'km',
'Area' => array('base' =>'km 2',
'm 2'=>pow(1000,2),
'dm 2'=>pow(10000,2),
'cm 2'=>pow(100000,2),
'mm 2'=>pow(1000000,2),
'mile 2'=>pow(0.62137,2),
'naut.miles 2'=>pow(0.53996,2),
'in 2'=>pow(39370,2),
'ft 2'=>pow(3280.8,2),
'yd 2'=>pow(1093.6,2),
'Volume' => array('base' =>'m 3',
'in 3'=>61023.6,
'ft 3'=>35.315,
'cm 3'=>pow(10,6),
'dm 3'=>1000,
'yd 3'=>1.30795,
'pint' => 2113.376,
'quart' => 1056.688,
'cup' => 4266.753,
'fl oz' => 33814.02,
'tablespoon' => 67628.04,
'teaspoon' => 202884.1,
'pt (UK)'=>1000/0.56826,
'barrel petroleum'=>1000/158.99,
'Register Tons'=>2.832,
'Ocean Tons'=>1.1327
'Speed' =>array('base' =>'kmph',
'mach STP'=>0.0008380431,
'c (warp)'=>9.265669e-10
while (list($key,$val) = each($conversions)) {
$conv->addConversion($val['base'], $val['conv']);
$list[$key][] = $val['base'];
while (list($ukey,$uval) = each($val['conv'])) {
$list[$key][] = $ukey;
$o .= '<h3>Unit Conversions</h3>';
if (isset($_POST['from_unit']) && isset($_POST['value'])) {
$_POST['value'] = $_POST['value'] + 0;
$o .= ($conv->getTable($_POST['value'], $_POST['from_unit'], $_POST['to_unit'], 5))."</p>";
} else {
$o .= "<p>Select:</p>";
$value = $_POST['value'];
$value = '';
$o .= '<form action="convert" method="post" name="conversion">';
$o .= '<input name="value" type="text" id="value" value="' . $value . '" size="10" maxlength="10" />';
$o .= '<select name="from_unit" size="12">';
while(list($key,$val) = each($list)) {
$o .= "\n\t<optgroup label=\"$key\">";
while(list($ukey,$uval) = each($val)) {
$selected = (($uval == $_POST['from_unit']) ? ' selected="selected" ' : '');
$o .= "\n\t\t<option value=\"$uval\" $selected >$uval</option>";
$o .= "\n\t</optgroup>";
$o .= '</select>';
$o .= '<input type="submit" name="Submit" value="Submit" /></form>';
return $o;


@ -1,39 +0,0 @@
Installing the Friendika/Facebook connector
1. register an API key for your site from
a. We'd be very happy if you include "Friendika" in the application name
to increase name recognition. The Friendika icons are also present
in the images directory and may be uploaded as a Facebook app icon.
Use images/friendika-16.jpg for the Icon and images/friendika-128.jpg for the Logo.
b. The url should be your site URL with a trailing slash.
You may use as the privacy policy
URL unless your site has different requirements, and as the Terms of Service URL unless
you have different requirements. (Friendika is a software application
and does not require Terms of Service, though your installation of it might).
c. Set the following values in your .htconfig.php file
$a->config['facebook']['appid'] = 'xxxxxxxxxxx';
$a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx';
Replace with the settings Facebook gives you.
d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set Site URL
to Set Site Domain to your
2. Enable the facebook plugin by including it in .htconfig.php - e.g.
$a->config['system']['addon'] = 'plugin1,plugin2,facebook';
3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
and click 'Install Facebook Connector'.
4. This will ask you to login to Facebook and grant permission to the
plugin to do its stuff. Allow it to do so.
5. You're done. To turn it off visit the Plugin Settings page again and
'Remove Facebook posting'.
Vidoes and embeds will not be posted if there is no other content. Links
and images will be converted to a format suitable for the Facebook API and
long posts truncated - with a link to view the full post.
Facebook contacts will not be able to view private photos, as they are not able to
authenticate to your site to establish identity. We will address this
in a future release.
Info: please make sure that you understand all aspects due to Friendika's
default licence which is: Creative Commons Attribution 3.0 (further info: )


@ -1,13 +0,0 @@
#facebook-enable-wrapper {
margin-top: 20px;
#facebook-disable-wrapper {
margin-top: 20px;
#facebook-post-default-form input {
margin-top: 20px;
margin-right: 20px;


File diff suppressed because it is too large


@ -1,7 +0,0 @@
.fortunate {
margin-top: 25px;
margin-left: 100px;
margin-bottom: 25px;
color: #000088;
font-size: 14px;


@ -1,27 +0,0 @@
* Name: Fortunate
* Description: Add a random fortune cookie at the bottom of every pages.
* Version: 1.0
* Author: Mike Macgirvin <>
function fortunate_install() {
register_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
function fortunate_uninstall() {
unregister_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
function fortunate_fetch($a,&$b) {
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'
. $a->get_baseurl() . '/addon/fortunate/fortunate.css' . '" media="all" />' . "\r\n";
$s = fetch_url('' . mt_rand());
$b .= '<div class="fortunate">' . $s . '</div>';


@ -1,27 +0,0 @@
Impressum Plugin for Friendika
Author: Tobias Diekershoff
License: 3-clause BSD license (same as Friendika)
This plugin adds an Impressum block to the /friendika page with informations
about the page operator/owner and how to contact you in case of any questions.
In the notes and postal fields you can use HTML tags for formatting.
For configuration you can set the following variables in the .htconfig file
* $a->config['impressum']['owner'] this is the Name of the Operator
* $a->config['impressum']['ownerprofile'] this is an optional Friendika account
where the above owner name will link to
* $a->config['impressum']['email'] a contact email address (optional)
will be displayed slightly obfuscated
as name(at)example(dot)com
* $a->config['impressum']['postal'] should contain a postal address where
you can be reached at (optional)
* $a->config['impressum']['notes'] additional informations that should
be displayed in the Impressum block


@ -1,6 +0,0 @@
{{ inc field_input.tpl with $field=$owner }}{{ endinc }}
{{ inc field_input.tpl with $field=$ownerprofile }}{{ endinc }}
{{ inc field_input.tpl with $field=$postal }}{{ endinc }}
{{ inc field_input.tpl with $field=$notes }}{{ endinc }}
{{ inc field_input.tpl with $field=$email }}{{ endinc }}
<div class="submit"><input type="submit" name="page_site" value="$submit" /></div>


@ -1,76 +0,0 @@
* Name: Impressum
* Description: Plugin to add contact information to the about page (/friendika)
* Version: 1.0
* Author: Tobias Diekershoff <>
* License: 3-clause BSD license
function impressum_install() {
register_hook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
logger("installed impressum plugin");
function impressum_uninstall() {
unregister_hook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
logger("uninstalled impressum plugin");
function obfuscate_email ($s) {
$s = str_replace('@','(at)',$s);
$s = str_replace('.','(dot)',$s);
return $s;
function impressum_show($a,&$b) {
$b .= '<h3>'.t('Impressum').'</h3>';
$owner = get_config('impressum', 'owner');
$owner_profile = get_config('impressum','ownerprofile');
$postal = get_config('impressum', 'postal');
$notes = get_config('impressum', 'notes');
$email = obfuscate_email( get_config('impressum','email') );
if (strlen($owner)) {
if (strlen($owner_profile)) {
$tmp = '<a href="'.$owner_profile.'">'.$owner.'</a>';
} else {
$tmp = $owner;
if (strlen($email)) {
$b .= '<p><strong>'.t('Site Owner').'</strong>: '. $tmp .'<br /><strong>'.t('Email Address').'</strong>: '.$email.'</p>';
} else {
$b .= '<p><strong>'.t('Site Owner').'</strong>: '. $tmp .'</p>';
if (strlen($postal)) {
$b .= '<p><strong>'.t('Postal Address').'</strong><br />'. $postal .'</p>';
if (strlen($notes)) {
$b .= '<p>'.$notes.'</p>';
} else {
$b .= '<p>'.t('The impressum addon needs to be configured!<br />Please add at least the <tt>owner</tt> variable to your config file. For other variables please refer to the README file of the addon.').'</p>';
function impressum_plugin_admin_post (&$a) {
$owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : '');
$ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : '');
$postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : '');
$notes = ((x($_POST, 'notes')) ? (trim($_POST['notes'])) : '');
$email = ((x($_POST, 'email')) ? notags(trim($_POST['email'])) : '');
info( t('Settings updated.'). EOL );
function impressum_plugin_admin (&$a, &$o) {
$t = file_get_contents( dirname(__file__). "/admin.tpl" );
$o = replace_macros($t, array(
'$submit' => t('Submit'),
'$owner' => array('owner', t('Site Owner'), get_config('impressum','owner'), ''),
'$ownerprofile' => array('ownerprofile', t('Site Owners Profile'), get_config('impressum','ownerprofile'), ''),
'$postal' => array('postal', t('Postal Address'), get_config('impressum','postal'), ''),
'$notes' => array('notes', t('Notes'), get_config('impressum','notes'), ''),
'$email' => array('email', t('Email Address'), get_config('impressum','email'), ''),


@ -1,38 +0,0 @@
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="fileuploader.css" rel="stylesheet" type="text/css">
body {font-size:13px; font-family:arial, sans-serif; width:700px; margin:100px auto;}
<p><a href="">Back to project page</a></p>
<p>To upload a file, click on the button below. Drag-and-drop is supported in FF, Chrome.</p>
<p>Progress-bar is supported in FF3.6+, Chrome6+, Safari4+</p>
<div id="file-uploader-demo1">
<p>Please enable JavaScript to use file uploader.</p>
<!-- or put a simple form for upload here -->
<script src="fileuploader.js" type="text/javascript"></script>
function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('file-uploader-demo1'),
action: 'do-nothing.htm',
debug: true
// in your app create uploader as soon as the DOM is ready
// don't wait for the window to load
window.onload = createUploader;


@ -1 +0,0 @@


@ -1,31 +0,0 @@
.qq-uploader { position:relative; width: 100%;}
.qq-upload-button {
display:block; /* or inline-block */
width: 105px; padding: 7px 0; text-align:center;
background:#880000; border-bottom:1px solid #ddd;color:#fff;
.qq-upload-button-hover {background:#cc0000;}
.qq-upload-button-focus {outline:1px dotted black;}
.qq-upload-drop-area {
position:absolute; top:0; left:0; width:100%; height:100%; min-height: 70px; z-index:2;
background:#FF9797; text-align:center;
.qq-upload-drop-area span {
display:block; position:absolute; top: 50%; width:100%; margin-top:-8px; font-size:16px;
.qq-upload-drop-area-active {background:#FF7171;}
.qq-upload-list {margin:15px 35px; padding:0; list-style:disc;}
.qq-upload-list li { margin:0; padding:0; line-height:15px; font-size:12px;}
.qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-failed-text {
margin-right: 7px;
.qq-upload-file {}
.qq-upload-spinner {display:inline-block; background: url("loading.gif"); width:15px; height:15px; vertical-align:text-bottom;}
.qq-upload-size,.qq-upload-cancel {font-size:11px;}
.qq-upload-failed-text {display:none;}
.qq-upload-fail .qq-upload-failed-text {display:inline;}


File diff suppressed because it is too large


Binary file not shown.


Width:  |  Height:  |  Size: 1.6 KiB


@ -1,339 +0,0 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent