Browse Source

Merge remote-tracking branch 'friendika/master' into newui

pull/1/head
Fabio Comuni 10 years ago
parent
commit
0283cbfcd3
  1. 4
      addon/facebook/README
  2. 28
      addon/facebook/facebook.php
  3. 2
      addon/impressum/README
  4. 22
      addon/statusnet/README
  5. 5
      addon/statusnet/statusnet.php
  6. 12
      addon/twitter/README
  7. 2
      addon/widgets/widget_like.php
  8. 6
      boot.php
  9. 10
      database.sql
  10. 8
      doc/Installing-Connectors.md
  11. 16
      include/Scrape.php
  12. 66
      include/bb2diaspora.php
  13. 84
      include/bbcode.php
  14. 2
      include/conversation.php
  15. 15
      include/crypto.php
  16. 5
      include/delivery.php
  17. 31
      include/diaspora.php
  18. 6
      include/group.php
  19. 9
      include/items.php
  20. 20
      include/notifier.php
  21. 4
      include/text.php
  22. 2
      library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
  23. 4
      mod/admin.php
  24. 18
      mod/crepair.php
  25. 22
      mod/item.php
  26. 44
      mod/localtime.php
  27. 56
      mod/network.php
  28. 10
      mod/parse_url.php
  29. 3
      mod/photos.php
  30. 25
      update.php
  31. 4
      view/crepair.tpl
  32. 4
      view/cs/htconfig.tpl
  33. 2
      view/cs/lostpass_eml.tpl
  34. 2
      view/cs/mail_received_html_body_eml.tpl
  35. 2925
      view/cs/messages.po
  36. 4
      view/cs/passchanged_eml.tpl
  37. 4
      view/cs/register_open_eml.tpl
  38. 6
      view/cs/register_verify_eml.tpl
  39. 453
      view/cs/strings.php
  40. 2
      view/de/strings.php
  41. 4
      view/it/messages.po
  42. 2
      view/it/strings.php
  43. 2
      view/theme/dispy/style.css
  44. 22
      view/theme/duepuntozero/style.css
  45. 26
      view/theme/loozah/style.css
  46. 304
      zot.txt

4
addon/facebook/README

@ -33,3 +33,7 @@ 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:
http://creativecommons.org/licenses/by/3.0/ )

28
addon/facebook/facebook.php

@ -273,6 +273,10 @@ function facebook_post(&$a) {
$no_linking = get_pconfig($uid,'facebook','no_linking');
$no_wall = ((x($_POST,'facebook_no_wall')) ? intval($_POST['facebook_no_wall']) : 0);
set__pconfig($uid,'facebook','no_wall',$no_wall);
$linkvalue = ((x($_POST,'facebook_linking')) ? intval($_POST['facebook_linking']) : 0);
set_pconfig($uid,'facebook','no_linking', (($linkvalue) ? 0 : 1));
@ -359,12 +363,11 @@ function facebook_content(&$a) {
$checked = (($no_linking) ? '' : ' checked="checked" ');
$o .= '<input type="checkbox" name="facebook_linking" value="1"' . $checked . '/>' . ' ' . t('Link all your Facebook friends and conversations') . EOL ;
$hidden = (($a->user['hidewall'] || get_config('system','block_public')) ? true : false);
if(! $hidden) {
$o .= EOL;
$o .= t('Warning: Your Facebook privacy settings can not be imported.') . EOL;
$o .= t('Linked Facebook items <strong>may</strong> be publicly visible, depending on your privacy settings for this website/account.') . EOL;
}
$no_wall = get_pconfig(local_user(),'facebook','no_wall');
$checked = (($no_wall) ? ' checked="checked" ' : '');
$o .= '<input type="checkbox" name="facebook_no_wall" value="1"' . $checked . '/>' . ' ' . t('Do not link your Facebook profile wall posts - as these could be visible to people that would not be able to see them on Facebook.') . EOL ;
$o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form></div>';
}
@ -766,12 +769,13 @@ function fb_consume_all($uid) {
if(! $access_token)
return;
$s = fetch_url('https://graph.facebook.com/me/feed?access_token=' . $access_token);
if($s) {
$j = json_decode($s);
logger('fb_consume_stream: wall: ' . print_r($j,true), LOGGER_DATA);
fb_consume_stream($uid,$j,true);
if(! get_pconfig($uid,'facebook','no_wall')) {
$s = fetch_url('https://graph.facebook.com/me/feed?access_token=' . $access_token);
if($s) {
$j = json_decode($s);
logger('fb_consume_stream: wall: ' . print_r($j,true), LOGGER_DATA);
fb_consume_stream($uid,$j,true);
}
}
$s = fetch_url('https://graph.facebook.com/me/home?access_token=' . $access_token);
if($s) {

2
addon/impressum/README

@ -7,7 +7,7 @@ License: 3-clause BSD license (same as Friendika)
About
This plugin adds an Impressum block to the /friendika page with informations
about the page operator/owner and how to countact you in case of any questions.
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.

22
addon/statusnet/README

@ -3,30 +3,30 @@ by Tobias Diekershoff
tobias.diekershoff(at)gmx.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This addon is currently in under development. If you have any problem !!
!! This addon is currently under development. If you have any problem !!
!! with it, please contact the Author. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
With this addon to Friendika you can give your user the possibility to post
their public messages to any StatusNet instance like identi.ca for example. The
messages will be strapped their rich context and shortened to to the character
their public messages to any StatusNet instance (like identi.ca for example).
The messages will be strapped their rich context and shortened to to the character
limit of the StatusNet instance in question if necessary. If shortening of the
message was performed a link will be added to the notice pointing to the
original message on your server.
There is a similar plugin to forward public messages to Twitter Twitter Plugin.
There is a similar plugin to forward public messages to Twitter: Twitter Plugin.
Online version of this document: http://ur1.ca/35mpb
___ Requirements ___
Due to the distributed nature of the StatusNet network, each user who wishes to
forward public messages to a StatusNet account has get the OAuth credentials
for themselves, which makes this addon a little bit more user unfriendly then
the Twitter Plugin is. Nothing to geeky though!
forward public messages to a StatusNet account has to get the OAuth credentials
for themselves, which makes this addon a little bit more user unfriendly than
the Twitter Plugin is. Nothing too geeky though!
The inclusion of a shorturl for the original posting in cases when the message
was longer then the maximal allowed notice length requires it, that you have
was longer than the maximal allowed notice length requires it, that you have
PHP5+ and curl on your server.
Where to find
@ -58,7 +58,7 @@ To get the OAuth Consumer key pair the user has to (a) ask her Friendika admin
if a pair already exists or (b) has to register the Friendika server as a
client application on the StatusNet server. This can be done from the account
settings under "Connect -> Connections -> Register an OAuth client application
-> Register new application".
-> Register a new application".
During the registration of the OAuth client remember the following:
* there is no callback url
@ -69,7 +69,7 @@ During the registration of the OAuth client remember the following:
After the required credentials for the application are stored in the
configuration you have to actually connect your Friendika account with
StatusNet. To do so follow the Sign in with StatusNet button, allow the access
and copy the security code into the addon configuration. Friendika will then
and copy the security code into the plugin configuration. Friendika will then
try to acquire the final OAuth credentials from the API, if successful the
addon settings will allow you to select to post your public messages to your
plugin settings will allow you to select to post your public messages to your
StatusNet account.

5
addon/statusnet/statusnet.php

@ -355,7 +355,10 @@ function statusnet_post_hook(&$a,&$b) {
logger('StatusNet post invoked');
if((local_user()) && (local_user() == $b['uid']) && (! $b['private']) && (!$b['parent']) ) {
if((local_user()) && (local_user() == $b['uid']) && (! $b['private'])) {
// mike 2-9-11 there was a restriction to only allow this for top level posts
// now relaxed so should allow one's own comments to be forwarded through the connector as well.
// Status.Net is not considered a private network
if($b['prvnets'])

12
addon/twitter/README

@ -3,7 +3,7 @@ By Tobias Diekershoff
tobias.diekershoff(at)gmx.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This addon is currently in under development. If you have any problem !!
!! This addon is currently under development. If you have any problem !!
!! with it, please contact the Author. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -29,7 +29,7 @@ After you registered the application you get an OAuth consumer key / secret
pair that identifies your app, you will need them for configuration.
The inclusion of a shorturl for the original posting in cases when the
message was longer then 140 characters requires it, that you have *PHP5+* and
message was longer than 140 characters requires it, that you have *PHP5+* and
*curl* on your server.
___ Where to find ___
@ -51,19 +51,19 @@ To activate this addon add @twitter@ to the list of active addons in your
.htconfig.php file
$a->config['system']['addon'] = "twitter, ..."
Afterwards you need to add your OAuth consumer key / secret pair to it by
adding the following to lines
adding the following two lines
$a->config['twitter']['consumerkey'] = 'your consumer KEY here';
$a->config['twitter']['consumersecret'] = 'your consumer SECRET here';
When this is done your user can now configure their Twitter connection at
"Settings -> Addon Settings" and enable the forwarding of their *public*
"Settings -> Plugin Settings" and enable the forwarding of their *public*
messages to Twitter.
__ User Configuration __
When the OAuth consumer informations are correctly placed into the
configuration file and a user visits the "Addon Settings" page they can now
configuration file and a user visits the "Plugin Settings" page they can now
connect to Twitter. To do so one has to follow the _Sign in with Twitter_
button (the page will be opened in a new browser window/tab) and get a PIN from
Twitter. This PIN has to be entered on the settings page. After submitting the
@ -71,7 +71,7 @@ PIN the plugin will get OAuth credentials identifying this user from the
Friendika account.
If this first step was successful the Twitter configuration will be changed
on the "Addon Settings" page displaying two check boxes. One to enable/disable
on the "Plugin Settings" page displaying two check boxes. One to enable/disable
the forwarding of *all public* postings to Twitter and one to clear the
personal configuration from the Twitter credentials.

2
addon/widgets/widget_like.php

@ -4,7 +4,7 @@ function like_widget_name() {
return "Shows likes";
}
function like_widget_help() {
return "Search first item wich contains <em>KEY</em> and print like/dislike count";
return "Search first item which contains <em>KEY</em> and print like/dislike count";
}
function like_widget_args(){

6
boot.php

@ -8,9 +8,9 @@ require_once("include/pgettext.php");
require_once('include/nav.php');
define ( 'FRIENDIKA_VERSION', '2.2.1087' );
define ( 'FRIENDIKA_VERSION', '2.2.1093' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1084 );
define ( 'DB_UPDATE_VERSION', 1087 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -675,6 +675,8 @@ function login($register = false) {
'$lostlink' => $lostlink
));
call_hooks('login_hook',$o);
return $o;
}}

10
database.sql

@ -58,6 +58,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`network` char(255) NOT NULL,
`name` char(255) NOT NULL,
`nick` char(255) NOT NULL,
`attag` char(255) NOT NULL,
`photo` text NOT NULL,
`thumb` text NOT NULL,
`micro` text NOT NULL,
@ -205,6 +206,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`pubmail` tinyint(1) NOT NULL DEFAULT '0',
`visible` tinyint(1) NOT NULL DEFAULT '0',
`starred` tinyint(1) NOT NULL DEFAULT '0',
`bookmark` tinyint(1) NOT NULL DEFAULT '0',
`unseen` tinyint(1) NOT NULL DEFAULT '1',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
`last-child` tinyint(1) unsigned NOT NULL DEFAULT '1',
@ -612,3 +614,11 @@ CREATE TABLE IF NOT EXISTS `deliverq` (
`item` INT NOT NULL ,
`contact` INT NOT NULL
) ENGINE = MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `search` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`uid` INT NOT NULL ,
`term` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
INDEX ( `uid` ),
INDEX ( `term` )
) ENGINE = MyISAM DEFAULT CHARSET=utf8;

8
doc/Installing-Connectors.md

@ -12,7 +12,7 @@ All three of these plugins require an account on the target network. In addition
**Site Configuration**
Plugins must be installed by the site administrator before they can be use. This is accomplished through the site
Plugins must be installed by the site administrator before they can be used. This is accomplished through the site
configuration file ".htconfig.php".
The configuration directive looks like:
@ -84,7 +84,7 @@ To get the OAuth Consumer key pair the user has to
(a) ask her Friendika admin if a pair already exists or
(b) has to register the Friendika server as a client application on the StatusNet server.
This can be done from the account settings under "Settings -> Connections -> Register an OAuth client application -> Register new application".
This can be done from the account settings under "Settings -> Connections -> Register an OAuth client application -> Register a new application".
During the registration of the OAuth client remember the following:
@ -133,8 +133,8 @@ d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set Site URL
to yoursubdomain.yourdomain.com. Set Site Domain to your yourdomain.com.
Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
and click 'Install Facebook Connector'.
Visit the Facebook Settings section of the "Settings->Plugin Settings" page.
And click 'Install Facebook Connector'.
This will ask you to login to Facebook and grant permission to the
plugin to do its stuff. Allow it to do so.

16
include/Scrape.php

@ -332,10 +332,12 @@ function probe_url($url, $mode = PROBE_NORMAL) {
if(! $url)
return $result;
$network = null;
$diaspora = false;
$diaspora_base = '';
$diaspora_guid = '';
$diaspora_key = '';
$has_lrdd = false;
$email_conversant = false;
$twitter = ((strpos($url,'twitter.com') !== false) ? true : false);
@ -352,6 +354,8 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$links = lrdd($url);
if(count($links)) {
$has_lrdd = true;
logger('probe_url: found lrdd links: ' . print_r($links,true), LOGGER_DATA);
foreach($links as $link) {
if($link['@attributes']['rel'] === NAMESPACE_ZOT)
@ -493,7 +497,7 @@ function probe_url($url, $mode = PROBE_NORMAL) {
if($network !== NETWORK_ZOT && $network !== NETWORK_DFRN && $network !== NETWORK_MAIL) {
if($diaspora)
$network = NETWORK_DIASPORA;
else
elseif($has_lrdd)
$network = NETWORK_OSTATUS;
$priority = 0;
@ -637,7 +641,7 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$vcard['nick'] = trim(substr($vcard['nick'],0,strpos($vcard['nick'],' ')));
}
if(! $network)
$network = 'feed';
$network = NETWORK_FEED;
if(! $priority)
$priority = 2;
}
@ -651,10 +655,14 @@ function probe_url($url, $mode = PROBE_NORMAL) {
if(! $profile)
$profile = $url;
$vcard['fn'] = notags($vcard['fn']);
$vcard['nick'] = str_replace(' ','',notags($vcard['nick']));
// No human could be associated with this link, use the URL as the contact name
if(($network === NETWORK_FEED) && ($poll) && (! x($vcard,'fn')))
$vcard['fn'] = $url;
$vcard['fn'] = notags($vcard['fn']);
$vcard['nick'] = str_replace(' ','',notags($vcard['nick']));
$result['name'] = $vcard['fn'];
$result['nick'] = $vcard['nick'];
$result['url'] = $profile;

66
include/bb2diaspora.php

@ -16,7 +16,10 @@ function diaspora2bb($s) {
$s = preg_replace("/\*(.+?)\*/", '[i]$1[/i]', $s);
$s = preg_replace("/\_(.+?)\_/", '[i]$1[/i]', $s);
$s = str_replace(array('-^doublestar^-','-^doublescore-^','-^star^-','-^score^-'), array('**','__','*','_'), $s);
$s = preg_replace('/\!\[(.+?)\]\((.+?)\)/','[img]$2[/img]',$s);
$s = preg_replace('/\[(.+?)\]\((.+?)\)/','[url=$2]$1[/url]',$s);
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
$s = escape_tags($s);
return $s;
@ -40,6 +43,11 @@ function bb2diaspora($Text,$preserve_nl = false) {
$Text = str_replace("<", "&lt;", $Text);
$Text = str_replace(">", "&gt;", $Text);
// If we find any event code, turn it into an event.
// After we're finished processing the bbcode we'll
// replace all of the event code with a reformatted version.
$ev = bbtoevent($Text);
if($preserve_nl)
$Text = str_replace(array("\n","\r"), array('',''),$Text);
@ -54,8 +62,9 @@ function bb2diaspora($Text,$preserve_nl = false) {
// [img]pathtoimage[/img]
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '[$1]($1)', $Text);
$Text = preg_replace("(\[url\=([$URLSearchString]*)\](.*?)\[/url\])", '[$2]($1)', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '[$1]($1)', $Text);
$Text = preg_replace("/\#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[#$2]($1)', $Text);
$Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[$2]($1)', $Text);
// $Text = preg_replace("/\[img\](.*?)\[\/img\]/", t('Image/photo: ') . '$1', $Text);
// $Text = preg_replace("/\[img\](.*?)\[\/img\]/", t('image/photo'), $Text);
@ -156,19 +165,20 @@ function bb2diaspora($Text,$preserve_nl = false) {
// oembed tag
// $Text = oembed_bbcode2html($Text);
// $Text = oembed_bbcode2html($Text);
// If we found an event earlier, strip out all the event code and replace with a reformatted version.
// if(x($ev,'desc') && x($ev,'start')) {
// $sub = format_event_html($ev);
if(x($ev,'desc') && x($ev,'start')) {
// $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/is",$sub,$Text);
//$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/is",'',$Text);
// $Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/is",'',$Text);
// $Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/is",'',$Text);
// $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",'',$Text);
// }
$sub = format_event_diaspora($ev);
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/is",$sub,$Text);
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/is",'',$Text);
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/is",'',$Text);
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/is",'',$Text);
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",'',$Text);
}
@ -176,3 +186,37 @@ function bb2diaspora($Text,$preserve_nl = false) {
return $Text;
}
function format_event_diaspora($ev) {
if(! ((is_array($ev)) && count($ev)))
return '';
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
$o = 'Friendika event notification:' . "\n";
$o .= '**' . bb2diaspora($ev['desc']) . '**' . "\n";
$o .= t('Starts:') . ' '
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format)))
. "\n";
if(! $ev['nofinish'])
$o .= t('Finishes:') . ' '
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format )))
. "\n";
if(strlen($ev['location']))
$o .= t('Location:') . bb2diaspora($ev['location'])
. "\n";
$o .= "\n";
return $o;
}

84
include/bbcode.php

@ -43,65 +43,65 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\%\$\!\+\,]+)/", '$1<a href="$2" target="external-link">$2</a>', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" target="external-link">$1</a>', $Text);
$Text = preg_replace("(\[url\=([$URLSearchString]*)\](.*?)\[/url\])", '<a href="$1" target="external-link">$2</a>', $Text);
//$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/m", '<a href="$1" target="external-link">$1</a>', $Text);
$Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/m", '<a href="$1" target="external-link">$2</a>', $Text);
//$Text = preg_replace("/\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[\/url\]/m", '<a href="$1" target="_blank">$2</a>', $Text);
// Perform MAIL Search
$Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
$Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '<a href="mailto:$1">$1</a>', $Text);
$Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);
// Check for bold text
$Text = preg_replace("(\[b\](.*?)\[\/b\])is",'<strong>$1</strong>',$Text);
$Text = preg_replace("(\[b\](.*?)\[\/b\])ism",'<strong>$1</strong>',$Text);
// Check for Italics text
$Text = preg_replace("(\[i\](.*?)\[\/i\])is",'<em>$1</em>',$Text);
$Text = preg_replace("(\[i\](.*?)\[\/i\])ism",'<em>$1</em>',$Text);
// Check for Underline text
$Text = preg_replace("(\[u\](.*?)\[\/u\])is",'<u>$1</u>',$Text);
$Text = preg_replace("(\[u\](.*?)\[\/u\])ism",'<u>$1</u>',$Text);
// Check for strike-through text
$Text = preg_replace("(\[s\](.*?)\[\/s\])is",'<strike>$1</strike>',$Text);
$Text = preg_replace("(\[s\](.*?)\[\/s\])ism",'<strike>$1</strike>',$Text);
// Check for over-line text
$Text = preg_replace("(\[o\](.*?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
$Text = preg_replace("(\[o\](.*?)\[\/o\])ism",'<span class="overline">$1</span>',$Text);
// Check for colored text
$Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])is","<span style=\"color: $1;\">$2</span>",$Text);
$Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])ism","<span style=\"color: $1;\">$2</span>",$Text);
// Check for sized text
$Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])is","<span style=\"font-size: $1;\">$2</span>",$Text);
$Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1;\">$2</span>",$Text);
// Check for list text
$Text = preg_replace("/\[list\](.*?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=1\](.*?)\[\/list\]/is", '<ul class="listdecimal">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=i\](.*?)\[\/list\]/s",'<ul class="listlowerroman">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=I\](.*?)\[\/list\]/s", '<ul class="listupperroman">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=a\](.*?)\[\/list\]/s", '<ul class="listloweralpha">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=A\](.*?)\[\/list\]/s", '<ul class="listupperalpha">$1</ul>' ,$Text);
$Text = preg_replace("/\[li\](.*?)\[\/li\]/s", '<li>$1</li>' ,$Text);
$Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '<ul class="listdecimal">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=i\](.*?)\[\/list\]/sm",'<ul class="listlowerroman">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=I\](.*?)\[\/list\]/sm", '<ul class="listupperroman">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=a\](.*?)\[\/list\]/sm", '<ul class="listloweralpha">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=A\](.*?)\[\/list\]/sm", '<ul class="listupperalpha">$1</ul>' ,$Text);
$Text = preg_replace("/\[li\](.*?)\[\/li\]/sm", '<li>$1</li>' ,$Text);
$Text = preg_replace("/\[td\](.*?)\[\/td\]/s", '<td>$1</td>' ,$Text);
$Text = preg_replace("/\[tr\](.*?)\[\/tr\]/s", '<tr>$1</tr>' ,$Text);
$Text = preg_replace("/\[table\](.*?)\[\/table\]/s", '<table>$1</table>' ,$Text);
$Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '<td>$1</td>' ,$Text);
$Text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '<tr>$1</tr>' ,$Text);
$Text = preg_replace("/\[table\](.*?)\[\/table\]/sm", '<table>$1</table>' ,$Text);
$Text = preg_replace("/\[table border=1\](.*?)\[\/table\]/s", '<table border="1" >$1</table>' ,$Text);
$Text = preg_replace("/\[table border=0\](.*?)\[\/table\]/s", '<table border="0" >$1</table>' ,$Text);
$Text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '<table border="1" >$1</table>' ,$Text);
$Text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '<table border="0" >$1</table>' ,$Text);
// $Text = str_replace("[*]", "<li>", $Text);
// Check for font change text
$Text = preg_replace("(\[font=(.*?)\](.*?)\[\/font\])","<span style=\"font-family: $1;\">$2</span>",$Text);
$Text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/m","<span style=\"font-family: $1;\">$2</span>",$Text);
// Declare the format for [code] layout
$Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/is",'stripcode_br_cb',$Text);
$Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/ism",'stripcode_br_cb',$Text);
$CodeLayout = '<code>$1</code>';
// Check for [code] text
$Text = preg_replace("/\[code\](.*?)\[\/code\]/is","$CodeLayout", $Text);
$Text = preg_replace("/\[code\](.*?)\[\/code\]/ism","$CodeLayout", $Text);
@ -109,22 +109,22 @@ function bbcode($Text,$preserve_nl = false) {
// Declare the format for [quote] layout
$QuoteLayout = '<blockquote>$1</blockquote>';
// Check for [quote] text
$Text = preg_replace("/\[quote\](.*?)\[\/quote\]/is","$QuoteLayout", $Text);
$Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism","$QuoteLayout", $Text);
// Images
// [img]pathtoimage[/img]
$Text = preg_replace("/\[img\](.*?)\[\/img\]/", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
// html5 video and audio
$Text = preg_replace("/\[video\](.*?)\[\/video\]/", '<video src="$1" controls="controls" width="425" height="350"><a href="$1">$1</a></video>', $Text);
$Text = preg_replace("/\[video\](.*?)\[\/video\]/ism", '<video src="$1" controls="controls" width="425" height="350"><a href="$1">$1</a></video>', $Text);
$Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '<audio src="$1" controls="controls"><a href="$1">$1</a></audio>', $Text);
$Text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '<audio src="$1" controls="controls"><a href="$1">$1</a></audio>', $Text);
$Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/", '<iframe src="$1" width="425" height="350"><a href="$1">$1</a></iframe>', $Text);
$Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '<iframe src="$1" width="425" height="350"><a href="$1">$1</a></iframe>', $Text);
// [img=widthxheight]image source[/img]
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text);
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text);
if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){
// use oembed for youtube links
@ -132,13 +132,15 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("/\[\/youtube\]/",'[/embed]',$Text);
} else {
// Youtube extensions
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text);
$Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
}
// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
// oembed tag
$Text = oembed_bbcode2html($Text);
@ -148,11 +150,11 @@ function bbcode($Text,$preserve_nl = false) {
if(x($ev,'desc') && x($ev,'start')) {
$sub = format_event_html($ev);
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/is",$sub,$Text);
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/is",'',$Text);
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/is",'',$Text);
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/is",'',$Text);
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",'',$Text);
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",$sub,$Text);
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",'',$Text);
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);
}

2
include/conversation.php

@ -80,8 +80,6 @@ function localize_item(&$item){
}
// fix bad embeds
$item['body'] = str_replace('http://www.youtube.com/embed/http:','http:',$item['body']);
}

15
include/crypto.php

@ -262,24 +262,27 @@ function aes_unencapsulate($data,$prvkey) {
}
function zot_encapsulate($data,$sender,$pubkey) {
// This has been superceded.
function zot_encapsulate($data,$envelope,$pubkey) {
$res = aes_encapsulate($data,$pubkey);
openssl_public_encrypt($sender,$s,$pubkey);
$s1 = base64url_encode($s,true);
return <<< EOT
<?xml version='1.0' encoding='UTF-8'?>
<zot:env xmlns:zot='http://purl.org/zot/1.0'>
<zot:msg xmlns:zot='http://purl.org/zot/1.0'>
<zot:key>{$res['key']}</zot:key>
<zot:iv>{$res['iv']}</zot:iv>
<zot:sender>$s1</zot:sender>
<zot:env>$s1</zot:env>
<zot:sig key_id="$keyid">$sig</zot:sig>
<zot:alg>AES-256-CBC</zot:alg>
<zot:data type='application/magic-envelope+xml'>{$res['data']}</zot:data>
</zot:env>
</zot:msg>
EOT;
}
// so has this
function zot_unencapsulate($data,$prvkey) {
$ret = array();
$c = array();

5
include/delivery.php

@ -140,6 +140,8 @@ function delivery_run($argv, $argc){
$owner = $r[0];
$walltowall = ((($top_level) && ($owner['id'] != $items[0]['contact-id'])) ? true : false);
$public_message = true;
// fill this in with a single salmon slap if applicable
@ -417,7 +419,8 @@ function delivery_run($argv, $argc){
diaspora_send_relay($target_item,$owner,$contact);
break;
}
elseif($top_level) {
elseif(($top_level) && (! $walltowall)) {
// currently no workable solution for sending walltowall
logger('delivery: diaspora status: ' . $contact['name']);
diaspora_send_status($target_item,$owner,$contact);
break;

31
include/diaspora.php

@ -398,6 +398,7 @@ function diaspora_request($importer,$xml) {
function diaspora_post($importer,$xml) {
$a = get_app();
$guid = notags(unxmlify($xml->guid));
$diaspora_handle = notags(unxmlify($xml->diaspora_handle));
@ -457,7 +458,14 @@ function diaspora_post($importer,$xml) {
$datarray['body'] = $body;
$datarray['app'] = 'Diaspora';
item_store($datarray);
$message_id = item_store($datarray);
if($message_id) {
q("update item set plink = '%s' where id = %d limit 1",
dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
intval($message_id)
);
}
return;
@ -465,6 +473,7 @@ function diaspora_post($importer,$xml) {
function diaspora_comment($importer,$xml,$msg) {
$a = get_app();
$guid = notags(unxmlify($xml->guid));
$parent_guid = notags(unxmlify($xml->parent_guid));
$diaspora_handle = notags(unxmlify($xml->diaspora_handle));
@ -576,6 +585,13 @@ function diaspora_comment($importer,$xml,$msg) {
$message_id = item_store($datarray);
if($message_id) {
q("update item set plink = '%s' where id = %d limit 1",
dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
intval($message_id)
);
}
if(! $parent_author_signature) {
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($message_id),
@ -595,6 +611,7 @@ function diaspora_comment($importer,$xml,$msg) {
function diaspora_photo($importer,$xml,$msg) {
$a = get_app();
$remote_photo_path = notags(unxmlify($xml->remote_photo_path));
$remote_photo_name = notags(unxmlify($xml->remote_photo_name));
@ -732,8 +749,8 @@ function diaspora_like($importer,$xml,$msg) {
}
if($parent_author_signature) {
// $owner_signed_data = $guid . ';' . $parent_guid . ';' . $target_type . ';' . $positive . ';' . $msg['author'];
$owner_signed_data = $guid . ';' . $parent_guid . ';' . $target_type . ';' . $positive . ';' . $diaspora_handle;
$owner_signed_data = $guid . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $diaspora_handle;
$parent_author_signature = base64_decode($parent_author_signature);
@ -805,6 +822,14 @@ EOT;
$message_id = item_store($arr);
if($message_id) {
q("update item set plink = '%s' where id = %d limit 1",
dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
intval($message_id)
);
}
if(! $parent_author_signature) {
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($message_id),

6
include/group.php

@ -154,7 +154,7 @@ $o .= <<< EOT
<div id="sidebar-group-list">
<ul id="sidebar-group-ul">
<li class="sidebar-group-li" ><a href="$every" $selected >$linktext</a></li>
<li class="sidebar-group-li" ><a href="$every" class="sidebar-group-element" $selected >$linktext</a></li>
EOT;
@ -170,10 +170,10 @@ EOT;
$selected = (($group_id == $rr['id']) ? ' class="group-selected" ' : '');
$o .= ' <li class="sidebar-group-li">'
. (($edit) ? "<a href=\"group/{$rr['id']}\" title=\"" . t('Edit')
. "\" ><img src=\"images/spencil.gif\" alt=\"" . t('Edit') . "\"></a> " : "")
. "\" class=\"groupsideedit\" ><img src=\"images/spencil.gif\" alt=\"" . t('Edit') . "\"></a> " : "")
. (($cid) ? '<input type="checkbox" class="' . (($selected) ? 'ticked' : 'unticked') . '" onclick="contactgroupChangeMember(' . $rr['id'] . ',' . $cid . ');return true;" '
. ((in_array($rr['id'],$member_of)) ? ' checked="checked" ' : '') . '/>' : '')
. "<a href=\"$each/{$rr['id']}\" $selected >{$rr['name']}</a></li>\r\n";
. "<a href=\"$each/{$rr['id']}\" class=\"sidebar-group-element\" $selected >{$rr['name']}</a></li>\r\n";
}
}
$o .= " </ul>\r\n </div>";

9
include/items.php

@ -20,6 +20,8 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
for($x = 2; $x < $a->argc; $x++) {
if($a->argv[$x] == 'converse')
$converse = true;
if($a->argv[$x] == 'starred')
$starred = true;
}
}
@ -376,6 +378,10 @@ function get_atom_elements($feed,$item) {
if($dguid)
$res['guid'] = unxmlify($dguid[0]['data']);
$bm = $item->get_item_tags(NAMESPACE_DFRN,'bookmark');
if($bm)
$res['bookmark'] = ((unxmlify($bm[0]['data']) === 'true') ? 1 : 0);
/**
* If there's a copy of the body content which is guaranteed to have survived mangling in transit, use it.
@ -731,6 +737,7 @@ function item_store($arr,$force_parent = false) {
$arr['deny_cid'] = ((x($arr,'deny_cid')) ? trim($arr['deny_cid']) : '');
$arr['deny_gid'] = ((x($arr,'deny_gid')) ? trim($arr['deny_gid']) : '');
$arr['private'] = ((x($arr,'private')) ? intval($arr['private']) : 0 );
$arr['bookmark'] = ((x($arr,'bookmark')) ? intval($arr['bookmark']) : 0 );
$arr['body'] = ((x($arr,'body')) ? trim($arr['body']) : '');
$arr['tag'] = ((x($arr,'tag')) ? notags(trim($arr['tag'])) : '');
$arr['attach'] = ((x($arr,'attach')) ? notags(trim($arr['attach'])) : '');
@ -1704,6 +1711,8 @@ function atom_entry($item,$type,$author,$owner,$comment = false) {
if($item['extid'])
$o .= '<dfrn:extid>' . xmlify($item['extid']) . '</dfrn:extid>' . "\r\n";
if($item['bookmark'])
$o .= '<dfrn:bookmark>true</dfrn:bookmark>' . "\r\n";
if($item['app'])
$o .= '<statusnet:notice_info local_id="' . $item['id'] . '" source="' . xmlify($item['app']) . '" ></statusnet:notice_info>' . "\r\n";

20
include/notifier.php

@ -2,6 +2,20 @@
require_once("boot.php");
/*
* This file was at one time responsible for doing all deliveries, but this caused
* big problems on shared hosting systems, where the process might get killed by the
* hosting provider and nothing would get delivered.
* It now only delivers one message under certain cases, and invokes a queued
* delivery mechanism (include/deliver.php) to deliver individual contacts at
* controlled intervals.
* This has a much better chance of surviving random processes getting killed
* by the hosting provider.
* A lot of this code is duplicated in include/deliver.php until we have time to go back
* and re-structure the delivery procedure based on the obstacles that have been thrown at
* us by hosting providers.
*/
function notifier_run($argv, $argc){
global $a, $db;
@ -129,6 +143,7 @@ function notifier_run($argv, $argc){
logger('notifier: top level post');
$top_level = true;
}
}
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
@ -144,6 +159,8 @@ function notifier_run($argv, $argc){
$owner = $r[0];
$walltowall = ((($top_level) && ($owner['id'] != $items[0]['contact-id'])) ? true : false);
$hub = get_config('system','huburl');
// If this is a public conversation, notify the feed hub
@ -591,7 +608,8 @@ function notifier_run($argv, $argc){
diaspora_send_relay($target_item,$owner,$contact);
break;
}
elseif($top_level) {
elseif(($top_level) && (! $walltowall)) {
// currently no workable solution for sending walltowall
diaspora_send_status($target_item,$owner,$contact);
break;
}

4
include/text.php

@ -610,12 +610,14 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
if(! function_exists('search')) {
function search($s,$id='search-box',$url='/search') {
function search($s,$id='search-box',$url='/search',$save = false) {
$a = get_app();
$o = '<div id="' . $id . '">';
$o .= '<form action="' . $a->get_baseurl() . $url . '" method="get" >';
$o .= '<input type="text" name="search" id="search-text" value="' . $s .'" />';
$o .= '<input type="submit" name="submit" id="search-submit" value="' . t('Search') . '" />';
if($save)
$o .= '<input type="submit" name="save" id="search-save" value="' . t('Save') . '" />';
$o .= '</form></div>';
return $o;
}}

2
library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js

@ -70,6 +70,7 @@
// example: <strong> to [b]
rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
@ -119,6 +120,7 @@
rep(/\[\/i\]/gi,"</em>");
rep(/\[u\]/gi,"<u>");
rep(/\[\/u\]/gi,"</u>");
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");

4
mod/admin.php

@ -344,7 +344,7 @@ function admin_page_site(&$a) {
* Users admin page
*/
function admin_page_users_post(&$a){
$pending = ( x(£_POST, 'pending') ? $_POST['pending'] : Array() );
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : Array() );
$users = ( x($_POST, 'user') ? $_POST['user'] : Array() );
if (x($_POST,'page_users_block')){
@ -632,7 +632,7 @@ function admin_page_logs(&$a){
$f = get_config('system','logfile');
$size = filesize($f);
if($size > 5000000)
if($size > 5000000 || $size < 0)
$size = 5000000;
$data = '';

18
mod/crepair.php

@ -18,15 +18,16 @@ function crepair_post(&$a) {
$contact = $r[0];
$nick = ((x($_POST,'nick')) ? $_POST['nick'] : null);
$url = ((x($_POST,'url')) ? $_POST['url'] : null);
$request = ((x($_POST,'request')) ? $_POST['request'] : null);
$confirm = ((x($_POST,'confirm')) ? $_POST['confirm'] : null);
$notify = ((x($_POST,'notify')) ? $_POST['notify'] : null);
$poll = ((x($_POST,'poll')) ? $_POST['poll'] : null);
$nick = ((x($_POST,'nick')) ? $_POST['nick'] : '');
$url = ((x($_POST,'url')) ? $_POST['url'] : '');
$request = ((x($_POST,'request')) ? $_POST['request'] : '');
$confirm = ((x($_POST,'confirm')) ? $_POST['confirm'] : '');
$notify = ((x($_POST,'notify')) ? $_POST['notify'] : '');
$poll = ((x($_POST,'poll')) ? $_POST['poll'] : '');
$attag = ((x($_POST,'attag')) ? $_POST['attag'] : '');
$r = q("UPDATE `contact` SET `nick` = '%s', `url` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s'
$r = q("UPDATE `contact` SET `nick` = '%s', `url` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s', `attag` = '%s'
WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($nick),
dbesc($url),
@ -34,6 +35,7 @@ function crepair_post(&$a) {
dbesc($confirm),
dbesc($notify),
dbesc($poll),
dbesc($attag),
intval($contact['id']),
local_user()
);
@ -84,6 +86,7 @@ function crepair_content(&$a) {
$o .= replace_macros($tpl, array(
'$label_name' => t('Name'),
'$label_nick' => t('Account Nickname'),
'$label_attag' => t('@Tagname - overrides Name/Nickname'),
'$label_url' => t('Account URL'),
'$label_request' => t('Friend Request URL'),
'$label_confirm' => t('Friend Confirm URL'),
@ -97,6 +100,7 @@ function crepair_content(&$a) {
'$confirm' => $contact['confirm'],
'$notify' => $contact['notify'],
'$poll' => $contact['poll'],
'$contact_attag' => $contact['attag'],
'$lbl_submit' => t('Submit')
));

22
mod/item.php

@ -332,6 +332,15 @@ function item_post(&$a) {
}
}
// embedded bookmark in post? convert to regular url and set bookmark flag
$bookmark = 0;
if(preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/m",$body,$match)) {
$bookmark = 1;
$body = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/m",'[url=$1]$2[/url]',$body);
}
/**
* Fold multi-line [code] sequences
*/
@ -353,7 +362,7 @@ function item_post(&$a) {
* and we are replying, and there isn't one already
*/
if(($parent_contact) && ($parent_contact['network'] === 'stat')
if(($parent_contact) && ($parent_contact['network'] === NETWORK_OSTATUS)
&& ($parent_contact['nick']) && (! in_array('@' . $parent_contact['nick'],$tags))) {
$body = '@' . $parent_contact['nick'] . ' ' . $body;
$tags[] = '@' . $parent_contact['nick'];
@ -404,7 +413,8 @@ function item_post(&$a) {
);
}
else {
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
$r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
dbesc($name),
dbesc($name),
intval($profile_uid)
);
@ -508,6 +518,7 @@ function item_post(&$a) {
$datarray['private'] = $private;
$datarray['pubmail'] = $pubmail_enable;
$datarray['attach'] = $attachments;
$datarray['bookmark'] = intval($bookmark);
$datarray['thr-parent'] = $thr_parent;
/**
@ -550,8 +561,8 @@ function item_post(&$a) {
$r = q("INSERT INTO `item` (`guid`, `uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `received`, `changed`, `uri`, `thr-parent`, `title`, `body`, `app`, `location`, `coord`,
`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach` )
VALUES( '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s' )",
`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private`, `pubmail`, `attach`, `bookmark` )
VALUES( '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d )",
dbesc($datarray['guid']),
intval($datarray['uid']),
dbesc($datarray['type']),
@ -584,7 +595,8 @@ function item_post(&$a) {
dbesc($datarray['deny_gid']),
intval($datarray['private']),
intval($datarray['pubmail']),
dbesc($datarray['attach'])
dbesc($datarray['attach']),
intval($datarray['bookmark'])
);
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",

44
mod/localtime.php

@ -0,0 +1,44 @@
<?php
require_once('include/datetime.php');
function localtime_post(&$a) {
$t = $_REQUEST['time'];
if(! $t)
$t = 'now';
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
if($_POST['timezone'])
$a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
}
function localtime_content(&$a) {
$t = $_REQUEST['time'];
if(! $t)
$t = 'now';
$o .= '<h3>' . t('Time Conversion') . '</h3>';
$o .= '<p>' . t('Friendika provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
if(x($a->data,'mod-localtime'))
$o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
$o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
$o .= '<form action ="' . $a->get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
$o .= '<p>' . t('Please select your timezone:') . '</p>';
$o .= select_timezone();
$o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
return $o;
}

56
mod/network.php

@ -14,10 +14,31 @@ function network_init(&$a) {
$a->page['aside'] = '';
$search = ((x($_GET,'search')) ? escape_tags($_GET['search']) : '');
$srchurl = '/network' . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '');
$srchurl = '/network'
. ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '')
. ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '')
. ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '');
if(x($_GET,'save')) {
$r = q("select * from `search` where `uid` = %d and `term` = '%s' limit 1",
intval(local_user()),
dbesc($search)
);
if(! count($r)) {
q("insert into `search` ( `uid`,`term` ) values ( %d, '%s') ",
intval(local_user()),
dbesc($search)
);
}
}
if(x($_GET,'remove')) {
q("delete from `search` where `uid` = %d and `term` = '%s' limit 1",
intval(local_user()),
dbesc($search)
);
}
$a->page['aside'] .= search($search,'netsearch-box',$srchurl);
$a->page['aside'] .= search($search,'netsearch-box',$srchurl,true);
$a->page['aside'] .= '<div id="network-new-link">';
@ -49,8 +70,34 @@ function network_init(&$a) {
$a->page['aside'] .= '</div>';
$a->page['aside'] .= group_side('network','network',true,$group_id);
$a->page['aside'] .= saved_searches();
}
function saved_searches() {
$o = '';
$r = q("select `term` from `search` WHERE `uid` = %d",
intval(local_user())
);
if(count($r)) {
$o .= '<h3>' . t('Saved Searches') . '</h3>' . "\r\n";
$o .= '<div id="saved-search-list"><ul id="saved-search-ul">' . "\r\n";
foreach($r as $rr) {
$o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
$o .= '</ul></div>' . "\r\n";
}
return $o;
}
function network_content(&$a, $update = 0) {
@ -70,6 +117,7 @@ function network_content(&$a, $update = 0) {
$cid = ((x($_GET['cid'])) ? intval($_GET['cid']) : 0);
$star = ((x($_GET['star'])) ? intval($_GET['star']) : 0);
$bmark = ((x($_GET['bmark'])) ? intval($_GET['bmark']) : 0);
if(($a->argc > 2) && $a->argv[2] === 'new')
$nouveau = true;
@ -130,6 +178,7 @@ function network_content(&$a, $update = 0) {
. ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
. ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '')
. ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
. ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
. "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}
@ -151,6 +200,9 @@ function network_content(&$a, $update = 0) {
$star_sql = (($star) ? " AND `starred` = 1 " : '');
if($bmark)
$star_sql .= " AND `bookmark` = 1 ";
$sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql ) ";
if($group) {

10
mod/parse_url.php

@ -13,7 +13,7 @@ function parse_url_content(&$a) {
$text = null;
$template = "<br /><a href=\"%s\" >%s</a>%s<br />";
$template = "<br /><a class=\"bookmark\" href=\"%s\" >%s</a>%s<br />";
$arr = array('url' => $url, 'text' => '');
@ -119,6 +119,12 @@ function parse_url_content(&$a) {
$text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
}
echo sprintf($template,$url,($title) ? $title : $url,$text);
$title = str_replace("\n",'',$title);
$result = sprintf($template,$url,($title) ? $title : $url,$text);
logger('parse_url: returns: ' . $result);
echo $result;
killme();
}

3
mod/photos.php

@ -414,7 +414,8 @@ function photos_post(&$a) {
);
}
else {
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
$r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
dbesc($name),
dbesc($name),
intval($page_owner_uid)
);

25
update.php

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1084 );
define( 'UPDATE_VERSION' , 1087 );
/**
*
@ -704,6 +704,25 @@ function update_1083() {
`cmd` CHAR( 32 ) NOT NULL ,
`item` INT NOT NULL ,
`contact` INT NOT NULL
) ENGINE = MYISAM ;");
) ENGINE = MYISAM ");
}
function update_1084() {
q("ALTER TABLE `contact` ADD `attag` CHAR( 255 ) NOT NULL AFTER `nick` ");
}
function update_1085() {
q("CREATE TABLE IF NOT EXISTS `search` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`uid` INT NOT NULL ,
`term` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
INDEX ( `uid` ),
INDEX ( `term` )
) ENGINE = MYISAM ");
}
function update_1086() {
q("ALTER TABLE `item` ADD `bookmark` tinyint(1) NOT NULL DEFAULT '0' AFTER `starred` ");
}
}

4
view/crepair.tpl

@ -7,6 +7,10 @@
<input type="text" id="crepair-nick" name="nick" value="$contact_nick" />
<div class="clear"></div>
<label id="crepair-attag-label" for="crepair-attag">$label_attag</label>
<input type="text" id="crepair-attag" name="attag" value="$contact_attag" />
<div class="clear"></div>
<label id="crepair-url-label" for="crepair-url">$label_url</label>
<input type="text" id="crepair-url" name="url" value="$contact_url" />
<div class="clear"></div>

4
view/cs/htconfig.tpl

@ -24,6 +24,10 @@ $default_timezone = '$timezone';
$a->config['sitename'] = "Moje síť přátel";
// Nastavení defaultního jazyka webu
$a->config['system']['language'] = 'cs';
// Vaše možnosti jsou REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED.
// Ujistěte se, že jste si vytvořili Váš osobníúčet dříve, než nastavíte
// REGISTER_CLOSED. 'register_text' (pokud je nastaven) se bude zobrazovat jako první text na

2
view/cs/lostpass_eml.tpl

@ -15,7 +15,7 @@ Následně si toto heslo můžete změnit z vašeho účtu na stránce Nastaven
Přihlašovací údaje jsou tato:
Adresa webu: $siteurl
Adresa webu: $siteurl
Přihlašovací jméno: $email
S pozdravem,

2
view/cs/mail_received_html_body_eml.tpl

@ -16,7 +16,7 @@
<td style="padding-top:22px;"><a href="$url">$from</a></td></tr>
<tr><td style="font-weight:bold;padding-bottom:5px;">$title</td></tr>
<tr><td style="padding-right:22px;">$htmlversion</td></tr>
<tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Přihlaste se na <a href="$siteurl">$siteurl$<a/> pro čtení a zaslání odpovědí na Vaše soukromé zprávy.</td></tr>
<tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Přihlaste se na <a href="$siteurl">$siteurl<a/> pro čtení a zaslání odpovědí na Vaše soukromé zprávy.</td></tr>
<tr><td></td><td>Díky,</td></tr>
<tr><td></td><td>$siteName administrátor</td></tr>
</tbody>

2925
view/cs/messages.po

File diff suppressed because it is too large

4
view/cs/passchanged_eml.tpl

@ -4,9 +4,9 @@ Milý/Milá $username,
Vaše přihlašovací údaje jsou tato:
Adresa webu: $siteurl
Adresa webu: $siteurl
Přihlašovací jméno: $email
Heslo: $new_password
Heslo: $new_password
Toto heslo si můžete změnit z vašeho účtu na stránce Nastavení poté, co se přihlásíte.

4
view/cs/register_open_eml.tpl

@ -2,9 +2,9 @@ Milý/milá $username,
Díky za registraci na $sitename. Váš účet byl vytvořen.
Vaše přihlašovací údaje jsou tato:
Adresa webu: $siteurl
Adresa webu: $siteurl
Přihlašovací jméno: $email
Heslo: $password
Heslo: $password
Toto heslo si můžete změnit z vašeho účtu na stránce "Nastavení" poté, co se přihlásíte.

6
view/cs/register_verify_eml.tpl

@ -3,9 +3,9 @@ Na webu $sitename byla vytvořena nová uživatelská registrace, která vyžadu
Přihlašovací údaje jsou tato:
Celé jméno: $username
Adresa webu: $siteurl
Přihlašovací jméno: $email
Celé jméno: $username
Adresa webu: $siteurl
Přihlašovací jméno: $email
Pro odsouhlasení tohoto požadavku prosím klikněte na následující odkaz:

453
view/cs/strings.php

@ -5,25 +5,49 @@ function string_plural_select($n){
}
;
$a->strings["Post successful."] = "Příspěvek úspěšně odeslán";
$a->strings["Contact settings applied."] = "Opravit nastavení kontaktu";
$a->strings["Contact settings applied."] = "Nastavení kontaktu změněno";
$a->strings["Contact update failed."] = "Aktualizace kontaktu selhala.";
$a->strings["Permission denied."] = "Přístup odmítnut.";
$a->strings["Contact not found."] = "Kontakt nenalezen.";
$a->strings["Repair Contact Settings"] = "Opravit nastavení kontaktu";
$a->strings["<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact will stop working."] = "<strong>VAROVÁNÍ: Toto je velmi pokročilé nastavení,</strong> pokud zadáte nesprávné informace, komunikace s tímto kontaktem přestane fungovat.";
$a->strings["Please use your browser 'Back' button <strong>now</strong> if you are uncertain what to do on this page."] = "Aktualizace kontaktu selhala";
$a->strings["Please use your browser 'Back' button <strong>now</strong> if you are uncertain what to do on this page."] = "Prosím použijte <strong>ihned</strong> v prohlížeči tlačítko \"zpět\" pokud si nejste jistí co dělat na této stránce.";
$a->strings["Name"] = "Jméno";
$a->strings["Account Nickname"] = "Přezdívka účtu";
$a->strings["Account URL"] = "URL adresa účtu";
$a->strings["Friend Request URL"] = "Žádost o přátelství URL";
$a->strings["Friend Confirm URL"] = "URL adresa potvrzení přátelství";
$a->strings["Notification Endpoint URL"] = "Notifikační URL adresa";
$a->strings["Poll/Feed URL"] = "Sdílený obsah v síti Friendika je poskytována pod <a href=\"http://creativecommons.org/licenses/by/3.0/cz/\">licencí Creative Commons Attribution 3.0</a>";
$a->strings["Poll/Feed URL"] = "Poll/Feed URL adresa";
$a->strings["Submit"] = "Odeslat";
$a->strings["Help:"] = "Nápověda:";
$a->strings["Help"] = "Nápověda";
$a->strings["File exceeds size limit of %d"] = "Velikost souboru přesáhla limit %d";
$a->strings["File upload failed."] = "Nahrání souboru se nezdařilo.";
$a->strings["Friend suggestion sent."] = "Návrhy přátelství odeslány ";
$a->strings["Suggest Friends"] = "Navrhněte přátelé";
$a->strings["Suggest a friend for %s"] = "Navrhněte přátelé pro uživatele %s";
$a->strings["Status"] = "Stav";
$a->strings["Profile"] = "Profil";
$a->strings["Photos"] = "Fotografie";
$a->strings["Events"] = "Události";
$a->strings["Personal Notes"] = "Osobní poznámky";
$a->strings["Create New Event"] = "Vytvořit novou událost";
$a->strings["Previous"] = "Předchozí";
$a->strings["Next"] = "Následující";
$a->strings["l, F j"] = "l, F j";
$a->strings["Edit event"] = "Editovat událost";
$a->strings["link to source"] = "odkaz na zdroj";
$a->strings["hour:minute"] = "hodina:minuta";
$a->strings["Event details"] = "Detaily události";
$a->strings["Format is %s %s. Starting date and Description are required."] = "Formát je %s %s. Datum zahájení a popis jsou povinné.";
$a->strings["Event Starts:"] = "Událost začíná:";
$a->strings["Finish date/time is not known or not relevant"] = "Datum/čas konce není zadán nebo není relevantní";
$a->strings["Event Finishes:"] = "Akce končí:";
$a->strings["Adjust for viewer timezone"] = "Nastavit časové pásmo pro uživatele s právem pro čtení";
$a->strings["Description:"] = "Popis:";
$a->strings["Location:"] = "Místo:";
$a->strings["Share this event"] = "Sdílet tuto událost";
$a->strings["Cancel"] = "Zrušit";