diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-07-29 17:23:09 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-07-29 17:23:09 +0200 |
commit | ac6945eed1644e7a9e58c5f74dae696ff0f09d72 (patch) | |
tree | b3b13f5569869a2feffb3990ea8e33313f789e5e | |
parent | b1e766dadb1d4a9e727b2d1d5f32442392ac6bd3 (diff) | |
parent | f47d582736ddf24528dd514850d4bed76783f589 (diff) | |
download | volse-hubzilla-ac6945eed1644e7a9e58c5f74dae696ff0f09d72.tar.gz volse-hubzilla-ac6945eed1644e7a9e58c5f74dae696ff0f09d72.tar.bz2 volse-hubzilla-ac6945eed1644e7a9e58c5f74dae696ff0f09d72.zip |
Merge remote-tracking branch 'friendika/master'
33 files changed, 846 insertions, 273 deletions
diff --git a/addon/impressum/impressum.php b/addon/impressum/impressum.php index b93d9eef6..b760c7e0d 100644 --- a/addon/impressum/impressum.php +++ b/addon/impressum/impressum.php @@ -4,7 +4,7 @@ * Description: Plugin to add contact information to the about page (/friendika) * Version: 1.0 * Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias> - * License: 3-clause BSD license (same as Friendika) + * License: 3-clause BSD license */ function impressum_install() { diff --git a/addon/piwik/piwik.php b/addon/piwik/piwik.php index 3cc136d29..8389416e9 100644 --- a/addon/piwik/piwik.php +++ b/addon/piwik/piwik.php @@ -12,7 +12,7 @@ * Author: Tobias Diekershoff * tobias.diekershoff@gmx.net * - * License: 3-clause BSD license (same as Friendika) +* License: 3-clause BSD license * * Configuration: * Add the following two lines to your .htconfig.php file: diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 63cdd28df..bf6cbfbc7 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -1,7 +1,7 @@ <?php /** * Name: StatusNet Connector - * Version: 1.0 + * Version: 1.0.1 * Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias> */ @@ -10,7 +10,7 @@ * Author: Tobias Diekershoff * tobias.diekershoff@gmx.net * - * License:3-clause BSD license (same as Friendika) + * License:3-clause BSD license * * Configuration: * To activate the plugin itself add it to the $a->config['system']['addon'] @@ -155,8 +155,8 @@ function statusnet_settings_post ($a,$post) { goaway($a->get_baseurl().'/settings/addon'); } else { if (isset($_POST['statusnet-pin'])) { - // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen - logger('got a StatusNet security code'); + // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen + logger('got a StatusNet security code'); $api = get_pconfig(local_user(), 'statusnet', 'baseapi'); $ckey = get_pconfig(local_user(), 'statusnet', 'consumerkey' ); $csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' ); @@ -276,7 +276,7 @@ function statusnet_settings(&$a,&$s) { $connection = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret); $details = $connection->get('account/verify_credentials'); $s .= '<div id="statusnet-info" ><img id="statusnet-avatar" src="'.$details->profile_image_url.'" /><p id="statusnet-info-block">'. t('Currently connected to: ') .'<a href="'.$details->statusnet_profile_url.'" target="_statusnet">'.$details->screen_name.'</a><br /><em>'.$details->description.'</em></p></div>'; - $s .= '<p>'. t('If enabled all your <strong>public</strong> postings will be posted to the associated StatusNet account.') .'</p>'; + $s .= '<p>'. t('If enabled all your <strong>public</strong> postings can be posted to the associated StatusNet account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'</p>'; $s .= '<div id="statusnet-enable-wrapper">'; $s .= '<label id="statusnet-enable-label" for="statusnet-checkbox">'. t('Allow posting to StatusNet') .'</label>'; $s .= '<input id="statusnet-checkbox" type="checkbox" name="statusnet-enable" value="1" ' . $checked . '/>'; diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index 7f2b2e1c7..c3fbc3e64 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -1,7 +1,7 @@ <?php /** * Name: Twitter Connector - * Version: 1.0 + * Version: 1.0.1 * Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias> */ @@ -11,7 +11,7 @@ * Author: Tobias Diekershoff * tobias.diekershoff@gmx.net * - * License:3-clause BSD license (same as Friendika) + * License:3-clause BSD license * * Configuration: * To use this plugin you need a OAuth Consumer key pair (key & secret) @@ -87,7 +87,8 @@ function twitter_settings_post ($a,$post) { */ del_pconfig( local_user(), 'twitter', 'consumerkey' ); del_pconfig( local_user(), 'twitter', 'consumersecret' ); - del_pconfig( local_user(), 'twitter', 'post' ); + del_pconfig( local_user(), 'twitter', 'post' ); + del_pconfig( local_user(), 'twitter', 'post_by_default' ); } else { if (isset($_POST['twitter-pin'])) { // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen @@ -105,11 +106,13 @@ function twitter_settings_post ($a,$post) { set_pconfig(local_user(),'twitter', 'oauthsecret', $token['oauth_token_secret']); set_pconfig(local_user(),'twitter', 'post', 1); // reload the Addon Settings page, if we don't do it see Bug #42 - header('Location: '.$a->get_baseurl().'/settings/addon'); + goaway($a->get_baseurl().'/settings/addon'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall set_pconfig(local_user(),'twitter','post',intval($_POST['twitter-enable'])); + set_pconfig(local_user(),'twitter','post_by_default',intval($_POST['twitter-default'])); + info( t('Twitter settings updated.') . EOL); }} } function twitter_settings(&$a,&$s) { @@ -127,6 +130,9 @@ function twitter_settings(&$a,&$s) { $osecret = get_pconfig(local_user(), 'twitter', 'oauthsecret' ); $enabled = get_pconfig(local_user(), 'twitter', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); + $defenabled = get_pconfig(local_user(),'twitter','post_by_default'); + $defchecked = (($defenabled) ? ' checked="checked" ' : ''); + $s .= '<div class="settings-block">'; $s .= '<h3>'. t('Twitter Posting Settings') .'</h3>'; @@ -172,11 +178,15 @@ function twitter_settings(&$a,&$s) { $connection = new TwitterOAuth($ckey,$csecret,$otoken,$osecret); $details = $connection->get('account/verify_credentials'); $s .= '<div id="twitter-info" ><img id="twitter-avatar" src="'.$details->profile_image_url.'" /><p id="twitter-info-block">'. t('Currently connected to: ') .'<a href="https://twitter.com/'.$details->screen_name.'" target="_twitter">'.$details->screen_name.'</a><br /><em>'.$details->description.'</em></p></div>'; - $s .= '<p>'. t('If enabled all your <strong>public</strong> postings will be posted to the associated Twitter account as well.') .'</p>'; + $s .= '<p>'. t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'</p>'; $s .= '<div id="twitter-enable-wrapper">'; - $s .= '<label id="twitter-enable-label" for="twitter-checkbox">'. t('Send public postings to Twitter'). '</label>'; + $s .= '<label id="twitter-enable-label" for="twitter-checkbox">'. t('Allow posting to Twitter'). '</label>'; $s .= '<input id="twitter-checkbox" type="checkbox" name="twitter-enable" value="1" ' . $checked . '/>'; + $s .= '<div class="clear"></div>'; + $s .= '<label id="twitter-default-label" for="twitter-default">'. t('Send public postings to Twitter by default') .'</label>'; + $s .= '<input id="twitter-default" type="checkbox" name="twitter-default" value="1" ' . $defchecked . '/>'; $s .= '</div><div class="clear"></div>'; + $s .= '<div id="twitter-disconnect-wrapper">'; $s .= '<label id="twitter-disconnect-label" for="twitter-disconnect">'. t('Clear OAuth configuration') .'</label>'; $s .= '<input id="twitter-disconnect" type="checkbox" name="twitter-disconnect" value="1" />'; @@ -1,6 +1,6 @@ <?php -define ( 'FRIENDIKA_VERSION', '2.2.1047' ); +define ( 'FRIENDIKA_VERSION', '2.2.1055' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1076 ); @@ -270,7 +270,8 @@ class App { if(x($_SERVER,'SERVER_NAME')) { $this->hostname = $_SERVER['SERVER_NAME']; - + if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) + $this->hostname .= ':' . $_SERVER['SERVER_PORT']; /** * Figure out if we are running at the top of a domain * or in a sub-directory and adjust accordingly diff --git a/include/acl.js b/include/acl.js index a0a1f5dd8..82b631ee9 100644 --- a/include/acl.js +++ b/include/acl.js @@ -153,6 +153,9 @@ ACL.prototype.updateview = function(){ $('#jot-perms-icon').removeClass('lock').addClass('unlock'); $('#jot-public').show(); $('.profile-jot-net input').attr('disabled', false); + if(editor != false) { + $('#profile-jot-desc').html(ispublic); + } } else { that.showall.removeClass("selected"); @@ -160,6 +163,7 @@ ACL.prototype.updateview = function(){ $('#jot-perms-icon').removeClass('unlock').addClass('lock'); $('#jot-public').hide(); $('.profile-jot-net input').attr('disabled', 'disabled'); + $('#profile-jot-desc').html(' '); } $("#acl-list-content .acl-list-item").each(function(){ diff --git a/include/api.php b/include/api.php index 5ebf04bb9..bc981646d 100644 --- a/include/api.php +++ b/include/api.php @@ -561,3 +561,30 @@ } api_register_func('api/account/rate_limit_status','api_account_rate_limit_status',true); + + + function api_statusnet_config(&$a,$type) { + $name = $a->config['sitename']; + $server = $a->get_hostname(); + $logo = $a->get_baseurl() . '/images/friendika-64.png'; + $email = $a->config['admin_email']; + $closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false'); + $private = (($a->config['system']['block_public']) ? 'true' : 'false'); + $textlimit = (($a->config['max_import_size']) ? $a->config['max_import_size'] : '200000'); + $ssl = (($a->config['system']['have_ssl']) ? 'true' : 'false'); + $sslserver = (($ssl === 'true') ? str_replace('http:','https:',$a->get_baseurl()) : ''); + + $config = array( + 'site' => array('name' => $name,'server' => $server, 'theme' => 'default', 'path' => '', + 'logo' => $logo, 'fancy' => 'true', 'language' => 'en', 'email' => $email, 'broughtby' => '', + 'broughtbyurl' => '', 'timezone' => 'UTC', 'closed' => $closed, 'inviteonly' => 'false', + 'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl, + 'shorturllength' => '30' + ), + ); + + return api_apply_template('config', $type, array('$config' => $config)); + + } + api_register_func('api/statusnet/config','api_statusnet_config',true); + diff --git a/include/certfns.php b/include/certfns.php new file mode 100644 index 000000000..db0e4645e --- /dev/null +++ b/include/certfns.php @@ -0,0 +1,143 @@ +<?php + +require_once('library/ASNValue.class.php'); + +function DerToPem($Der, $Private=false) +{ + //Encode: + $Der = base64_encode($Der); + //Split lines: + $lines = str_split($Der, 65); + $body = implode("\n", $lines); + //Get title: + $title = $Private? 'RSA PRIVATE KEY' : 'PUBLIC KEY'; + //Add wrapping: + $result = "-----BEGIN {$title}-----\n"; + $result .= $body . "\n"; + $result .= "-----END {$title}-----\n"; + + return $result; +} + +function DerToRsa($Der) +{ + //Encode: + $Der = base64_encode($Der); + //Split lines: + $lines = str_split($Der, 65); + $body = implode("\n", $lines); + //Get title: + $title = 'RSA PUBLIC KEY'; + //Add wrapping: + $result = "-----BEGIN {$title}-----\n"; + $result .= $body . "\n"; + $result .= "-----END {$title}-----\n"; + + return $result; +} + + + + +function pkcs8_encode($Modulus,$PublicExponent) { + //Encode key sequence + $modulus = new ASNValue(ASNValue::TAG_INTEGER); + $modulus->SetIntBuffer($Modulus); + $publicExponent = new ASNValue(ASNValue::TAG_INTEGER); + $publicExponent->SetIntBuffer($PublicExponent); + $keySequenceItems = array($modulus, $publicExponent); + $keySequence = new ASNValue(ASNValue::TAG_SEQUENCE); + $keySequence->SetSequence($keySequenceItems); + //Encode bit string + $bitStringValue = $keySequence->Encode(); + $bitStringValue = chr(0x00) . $bitStringValue; //Add unused bits byte + $bitString = new ASNValue(ASNValue::TAG_BITSTRING); + $bitString->Value = $bitStringValue; + //Encode body + $bodyValue = "\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01\x05\x00" . $bitString->Encode(); + $body = new ASNValue(ASNValue::TAG_SEQUENCE); + $body->Value = $bodyValue; + //Get DER encoded public key: + $PublicDER = $body->Encode(); + return $PublicDER; +} + + +function pkcs1_encode($Modulus,$PublicExponent) { + //Encode key sequence + $modulus = new ASNValue(ASNValue::TAG_INTEGER); + $modulus->SetIntBuffer($Modulus); + $publicExponent = new ASNValue(ASNValue::TAG_INTEGER); + $publicExponent->SetIntBuffer($PublicExponent); + $keySequenceItems = array($modulus, $publicExponent); + $keySequence = new ASNValue(ASNValue::TAG_SEQUENCE); + $keySequence->SetSequence($keySequenceItems); + //Encode bit string + $bitStringValue = $keySequence->Encode(); + return $bitStringValue; + +// $bitStringValue = chr(0x00) . $bitStringValue; //Add unused bits byte +// $bitString = new ASNValue(ASNValue::TAG_BITSTRING); +// $bitString->Value = $bitStringValue; + //Encode body +// $bodyValue = "\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01\x05\x00" . $bitString->Encode(); +// $body = new ASNValue(ASNValue::TAG_SEQUENCE); +// $body->Value = $bodyValue; + //Get DER encoded public key: +// $PublicDER = $body->Encode(); +// return $PublicDER; +} + + +function metopem($m,$e) { + $der = pkcs8_encode($m,$e); + $key = DerToPem($der,false); + return $key; +} + + +function pubrsatome($key,&$m,&$e) { + require_once('library/asn1.php'); + require_once('include/salmon.php'); + + $lines = explode("\n",$key); + unset($lines[0]); + unset($lines[count($lines)]); + $x = base64_decode(implode('',$lines)); + + $r = ASN_BASE::parseASNString($x); + +// print_r($r); + + $m = base64url_decode($r[0]->asnData[0]->asnData); + $e = base64url_decode($r[0]->asnData[1]->asnData); + + +} + + +function rsatopem($key) { + pubrsatome($key,$m,$e); + return(metopem($m,$e)); +} + + +function pemtome($key,&$m,&$e) { + require_once('include/salmon.php'); + $lines = explode("\n",$key); + unset($lines[0]); + unset($lines[count($lines)]); + $x = base64_decode(implode('',$lines)); + + $r = ASN_BASE::parseASNString($x); + + $m = base64url_decode($r[0]->asnData[1]->asnData[0]->asnData[0]->asnData); + $e = base64url_decode($r[0]->asnData[1]->asnData[0]->asnData[1]->asnData); +} + +function metorsa($m,$e) { + $der = pkcs1_encode($m,$e); + $key = DerToRsa($der); + return $key; +} + diff --git a/include/conversation.php b/include/conversation.php index 82a107c07..50032cd36 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -347,7 +347,7 @@ function conversation(&$a, $items, $mode, $update) { if(($toplevelpost) && (! $item['self']) && ($mode !== 'profile')) { - if($item['type'] === 'wall') { + if($item['wall']) { // On the network page, I am the owner. On the display page it will be the profile owner. // This will have been stored in $a->page_contact by our calling page. @@ -359,7 +359,7 @@ function conversation(&$a, $items, $mode, $update) { $template = $wallwall; $commentww = 'ww'; } - if(($item['type'] === 'remote') && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) { + if((! $item['wall']) && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) { // Could be anybody. diff --git a/include/datetime.php b/include/datetime.php index a056eaa60..3033b88af 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -84,12 +84,47 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d function dob($dob) { list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d'); $y = datetime_convert('UTC',date_default_timezone_get(),'now','Y'); - $o = datesel('',1920,$y,true,$year,$month,$day); + $f = get_config('system','birthday_input_format'); + if(! $f) + $f = 'ymd'; + $o = datesel($f,'',1920,$y,true,$year,$month,$day); + return $o; +} + + +function datesel_format($f) { + + $o = ''; + + if(strlen($f)) { + for($x = 0; $x < strlen($f); $x ++) { + switch($f[$x]) { + case 'y': + if(strlen($o)) + $o .= '-'; + $o .= t('year'); + break; + case 'm': + if(strlen($o)) + $o .= '-'; + $o .= t('month'); + break; + case 'd': + if(strlen($o)) + $o .= '-'; + $o .= t('day'); + break; + default: + break; + } + } + } return $o; } // returns a date selector. +// $f = format string, e.g. 'ymd' or 'mdy' // $pre = prefix (if needed) for HTML name and class fields // $ymin = first year shown in selector dropdown // $ymax = last year shown in selector dropdown @@ -99,40 +134,52 @@ function dob($dob) { // $d = already selected day if(! function_exists('datesel')) { -function datesel($pre,$ymin,$ymax,$allow_blank,$y,$m,$d) { +function datesel($f,$pre,$ymin,$ymax,$allow_blank,$y,$m,$d) { $o = ''; - $o .= "<select name=\"{$pre}year\" class=\"{$pre}year\" size=\"1\">"; - if($allow_blank) { - $sel = (($y == '0000') ? " selected=\"selected\" " : ""); - $o .= "<option value=\"0000\" $sel ></option>"; - } - if($ymax > $ymin) { - for($x = $ymax; $x >= $ymin; $x --) { - $sel = (($x == $y) ? " selected=\"selected\" " : ""); - $o .= "<option value=\"$x\" $sel>$x</option>"; - } - } - else { - for($x = $ymax; $x <= $ymin; $x ++) { - $sel = (($x == $y) ? " selected=\"selected\" " : ""); - $o .= "<option value=\"$x\" $sel>$x</option>"; - } - } + if(strlen($f)) { + for($z = 0; $z < strlen($f); $z ++) { + if($f[$z] === 'y') { + + $o .= "<select name=\"{$pre}year\" class=\"{$pre}year\" size=\"1\">"; + if($allow_blank) { + $sel = (($y == '0000') ? " selected=\"selected\" " : ""); + $o .= "<option value=\"0000\" $sel ></option>"; + } + + if($ymax > $ymin) { + for($x = $ymax; $x >= $ymin; $x --) { + $sel = (($x == $y) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"$x\" $sel>$x</option>"; + } + } + else { + for($x = $ymax; $x <= $ymin; $x ++) { + $sel = (($x == $y) ? " selected=\"selected\" " : ""); + $o .= "<option value=\"$x\" $sel>$x</option>"; + } + } + } + elseif($f[$z] == 'm') { - $o .= "</select> <select name=\"{$pre}month\" class=\"{$pre}month\" size=\"1\">"; - for($x = (($allow_blank) ? 0 : 1); $x <= 12; $x ++) { - $sel = (($x == $m) ? " selected=\"selected\" " : ""); - $y = (($x) ? $x : ''); - $o .= "<option value=\"$x\" $sel>$y</option>"; - } - - $o .= "</select> <select name=\"{$pre}day\" class=\"{$pre}day\" size=\"1\">"; - for($x = (($allow_blank) ? 0 : 1); $x <= 31; $x ++) { - $sel = (($x == $d) ? " selected=\"selected\" " : ""); - $y = (($x) ? $x : ''); - $o .= "<option value=\"$x\" $sel>$y</option>"; + $o .= "</select> <select name=\"{$pre}month\" class=\"{$pre}month\" size=\"1\">"; + for($x = (($allow_blank) ? 0 : 1); $x <= 12; $x ++) { + $sel = (($x == $m) ? " selected=\"selected\" " : ""); + $y = (($x) ? $x : ''); + $o .= "<option value=\"$x\" $sel>$y</option>"; + } + } + elseif($f[$z] == 'd') { + + $o .= "</select> <select name=\"{$pre}day\" class=\"{$pre}day\" size=\"1\">"; + for($x = (($allow_blank) ? 0 : 1); $x <= 31; $x ++) { + $sel = (($x == $d) ? " selected=\"selected\" " : ""); + $y = (($x) ? $x : ''); + $o .= "<option value=\"$x\" $sel>$y</option>"; + } + } + } } $o .= "</select>"; diff --git a/include/event.php b/include/event.php index aab195d24..99f685d0b 100644 --- a/include/event.php +++ b/include/event.php @@ -197,6 +197,7 @@ function event_store($arr) { $arr['type'] = (($arr['type']) ? $arr['type'] : 'event' ); $arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0); $arr['uri'] = (x($arr,'uri') ? $arr['uri'] : item_new_uri($a->get_hostname(),$arr['uid'])); + $arr['private'] = ((x($arr,'private')) ? intval($arr['private']) : 0); if($arr['cid']) $c = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", @@ -275,7 +276,7 @@ function event_store($arr) { $object .= '</object>' . "\n"; - q("UPDATE `item` SET `body` = '%s', `object` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1", + q("UPDATE `item` SET `body` = '%s', `object` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `edited` = '%s', `private` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", dbesc(format_event_bbcode($arr)), dbesc($object), dbesc($arr['allow_cid']), @@ -283,6 +284,7 @@ function event_store($arr) { dbesc($arr['deny_cid']), dbesc($arr['deny_gid']), dbesc($arr['edited']), + intval($arr['private']), intval($r[0]['id']), intval($arr['uid']) ); @@ -341,10 +343,11 @@ function event_store($arr) { $item_arr['author-link'] = $contact['url']; $item_arr['author-avatar'] = $contact['thumb']; $item_arr['title'] = ''; - $item_arr['allow_cid'] = $str_contact_allow; - $item_arr['allow_gid'] = $str_group_allow; - $item_arr['deny_cid'] = $str_contact_deny; - $item_arr['deny_gid'] = $str_group_deny; + $item_arr['allow_cid'] = $arr['allow_cid']; + $item_arr['allow_gid'] = $arr['allow_gid']; + $item_arr['deny_cid'] = $arr['deny_cid']; + $item_arr['deny_gid'] = $arr['deny_gid']; + $item_arr['private'] = $arr['private']; $item_arr['last-child'] = 1; $item_arr['visible'] = 1; $item_arr['verb'] = ACTIVITY_POST; diff --git a/include/items.php b/include/items.php index 6593647ba..014d75872 100644 --- a/include/items.php +++ b/include/items.php @@ -1349,6 +1349,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee $ev['uid'] = $importer['uid']; $ev['uri'] = $item_id; $ev['edited'] = $datarray['edited']; + $ev['private'] = $datarray['private']; if(is_array($contact)) $ev['cid'] = $contact['id']; diff --git a/include/main.js b/include/main.js index 288fd6f01..d17d923e4 100644 --- a/include/main.js +++ b/include/main.js @@ -150,7 +150,7 @@ in_progress = true; var udargs = ((netargs.length) ? '/' + netargs : ''); - var update_url = 'update_' + src + udargs + '?p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0); + var update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0); $.get(update_url,function(data) { in_progress = false; diff --git a/include/notifier.php b/include/notifier.php index 59e573762..9f5b27148 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -145,7 +145,7 @@ function notifier_run($argv, $argc){ $parent = $items[0]; - if($parent['type'] === 'remote' && (! $expire)) { + if($parent['wall'] == 0 && (! $expire)) { // local followup to remote post $followup = true; $notify_hub = false; // not public @@ -504,7 +504,7 @@ function notifier_run($argv, $argc){ // send additional slaps to mentioned remote tags (@foo@example.com) - if($slap && count($url_recipients) && $followup && $notify_hub && (! $expire)) { + if($slap && count($url_recipients) && ($followup || $top_level) && $notify_hub && (! $expire)) { if(! get_config('system','dfrn_only')) { foreach($url_recipients as $url) { if($url) { @@ -194,6 +194,12 @@ if(strlen($a->module)) { */ if(! $a->module_loaded) { + + // Stupid browser tried to pre-fetch our ACL img template. Don't log the event or return anything - just quietly exit. + if((x($_SERVER,'QUERY_STRING')) && strpos($_SERVER['QUERY_STRING'],'{0}') !== false) { + killme(); + } + if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) { logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']); goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']); diff --git a/library/ASNValue.class.php b/library/ASNValue.class.php new file mode 100644 index 000000000..8a6aced97 --- /dev/null +++ b/library/ASNValue.class.php @@ -0,0 +1,172 @@ +<?php +//----------------------------------------------------------------------------- +// ASNValue class by A.Oliinyk +// contact@pumka.net +//----------------------------------------------------------------------------- +class ASNValue +{ + const TAG_INTEGER = 0x02; + const TAG_BITSTRING = 0x03; + const TAG_SEQUENCE = 0x30; + + public $Tag; + public $Value; + + function __construct($Tag=0x00, $Value='') + { + $this->Tag = $Tag; + $this->Value = $Value; + } + + function Encode() + { + //Write type + $result = chr($this->Tag); + + //Write size + $size = strlen($this->Value); + if ($size < 127) { + //Write size as is + $result .= chr($size); + } + else { + //Prepare length sequence + $sizeBuf = self::IntToBin($size); + + //Write length sequence + $firstByte = 0x80 + strlen($sizeBuf); + $result .= chr($firstByte) . $sizeBuf; + } + + //Write value + $result .= $this->Value; + + return $result; + } + + function Decode(&$Buffer) + { + //Read type + $this->Tag = self::ReadByte($Buffer); + + //Read first byte + $firstByte = self::ReadByte($Buffer); + + if ($firstByte < 127) { + $size = $firstByte; + } + else if ($firstByte > 127) { + $sizeLen = $firstByte - 0x80; + //Read length sequence + $size = self::BinToInt(self::ReadBytes($Buffer, $sizeLen)); + } + else { + throw new Exception("Invalid ASN length value"); + } + + $this->Value = self::ReadBytes($Buffer, $size); + } + + protected static function ReadBytes(&$Buffer, $Length) + { + $result = substr($Buffer, 0, $Length); + $Buffer = substr($Buffer, $Length); + + return $result; + } + + protected static function ReadByte(&$Buffer) + { + return ord(self::ReadBytes($Buffer, 1)); + } + + protected static function BinToInt($Bin) + { + $len = strlen($Bin); + $result = 0; + for ($i=0; $i<$len; $i++) { + $curByte = self::ReadByte($Bin); + $result += $curByte << (($len-$i-1)*8); + } + + return $result; + } + + protected static function IntToBin($Int) + { + $result = ''; + do { + $curByte = $Int % 256; + $result .= chr($curByte); + + $Int = ($Int - $curByte) / 256; + } while ($Int > 0); + + $result = strrev($result); + + return $result; + } + + function SetIntBuffer($Value) + { + if (strlen($Value) > 1) { + $firstByte = ord($Value{0}); + if ($firstByte & 0x80) { //first bit set + $Value = chr(0x00) . $Value; + } + } + + $this->Value = $Value; + } + + function GetIntBuffer() + { + $result = $this->Value; + if (ord($result{0}) == 0x00) { + $result = substr($result, 1); + } + + return $result; + } + + function SetInt($Value) + { + $Value = self::IntToBin($Value); + + $this->SetIntBuffer($Value); + } + + function GetInt() + { + $result = $this->GetIntBuffer(); + $result = self::BinToInt($result); + + return $result; + } + + function SetSequence($Values) + { + $result = ''; + foreach ($Values as $item) { + $result .= $item->Encode(); + } + + $this->Value = $result; + } + + function GetSequence() + { + $result = array(); + $seq = $this->Value; + while (strlen($seq)) { + $val = new ASNValue(); + $val->Decode($seq); + $result[] = $val; + } + + return $result; + } +} + + +?> diff --git a/mod/community.php b/mod/community.php index 73feaabc6..cf43598b5 100644 --- a/mod/community.php +++ b/mod/community.php @@ -27,7 +27,7 @@ function community_content(&$a, $update = 0) { if(! $update) { $o .= '<script> $(document).ready(function() { $(\'#nav-community-link\').addClass(\'nav-selected\'); });</script>'; $o .= '<div id="live-community"></div>' . "\r\n"; - $o .= "<script> var profile_uid = -1; var netargs = ''; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; + $o .= "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; } if(x($a->data,'search')) diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 0dc96f8a7..f284b8b38 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -704,6 +704,7 @@ function dfrn_notify_post(&$a) { $ev['uid'] = $importer['uid']; $ev['uri'] = $item_id; $ev['edited'] = $datarray['edited']; + $ev['private'] = $datarray['private']; $r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), diff --git a/mod/events.php b/mod/events.php index b0b54601f..27ca69830 100644 --- a/mod/events.php +++ b/mod/events.php @@ -297,6 +297,12 @@ function events_content(&$a) { $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : 0); $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : 0); + $f = get_config('system','event_input_format'); + if(! $f) + $f = 'ymd'; + + $dateformat = datesel_format($f); + $timeformat = t('hour:minute'); require_once('include/acl_selectors.php'); @@ -306,14 +312,14 @@ function events_content(&$a) { '$cid' => $cid, '$uri' => $uri, '$e_text' => t('Event details'), - '$e_desc' => t('Format is year-month-day hour:minute. Starting date and Description are required.'), + '$e_desc' => sprintf( t('Format is %s %s. Starting date and Description are required.'),$dateformat,$timeformat), '$s_text' => t('Event Starts:') . ' <span class="required">*</span> ', - '$s_dsel' => datesel('start',$syear+5,$syear,false,$syear,$smonth,$sday), + '$s_dsel' => datesel($f,'start',$syear+5,$syear,false,$syear,$smonth,$sday), '$s_tsel' => timesel('start',$shour,$sminute), '$n_text' => t('Finish date/time is not known or not relevant'), '$n_checked' => $n_checked, '$f_text' => t('Event Finishes:'), - '$f_dsel' => datesel('finish',$fyear+5,$fyear,false,$fyear,$fmonth,$fday), + '$f_dsel' => datesel($f,'finish',$fyear+5,$fyear,false,$fyear,$fmonth,$fday), '$f_tsel' => timesel('finish',$fhour,$fminute), '$a_text' => t('Adjust for viewer timezone'), '$a_checked' => $a_checked, diff --git a/mod/install.php b/mod/install.php index 970ff6af8..27cc6af84 100644 --- a/mod/install.php +++ b/mod/install.php @@ -123,15 +123,15 @@ function install_content(&$a) { $o .= replace_macros($tpl, array( '$lbl_01' => t('Friendika Social Network'), '$lbl_02' => t('Installation'), - '$lbl_03' => t('In order to install Friendika we need to know how to contact your database.'), + '$lbl_03' => t('In order to install Friendika we need to know how to connect to your database.'), '$lbl_04' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'), - '$lbl_05' => t('The database you specify below must already exist. If it does not, please create it before continuing.'), + '$lbl_05' => t('The database you specify below should already exist. If it does not, please create it before continuing.'), '$lbl_06' => t('Database Server Name'), '$lbl_07' => t('Database Login Name'), '$lbl_08' => t('Database Login Password'), '$lbl_09' => t('Database Name'), '$lbl_10' => t('Please select a default timezone for your website'), - '$lbl_11' => t('Site administrator email address. Your account email address will need match this.'), + '$lbl_11' => t('Site administrator email address. Your account email address must match this in order to use the web admin panel.'), '$baseurl' => $a->get_baseurl(), '$tzselect' => ((x($_POST,'timezone')) ? select_timezone($_POST['timezone']) : select_timezone()), '$submit' => t('Submit'), diff --git a/mod/network.php b/mod/network.php index 28e540283..7bdd3f3f1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -125,10 +125,11 @@ function network_content(&$a, $update = 0) { $o .= '<div id="live-network"></div>' . "\r\n"; $o .= "<script> var profile_uid = " . $_SESSION['uid'] - . "; var netargs = '" . substr($a->cmd,8) - . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') - . ((x($_GET,'search')) ? '?search=' . $_GET['search'] : '') - . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '') + . "; var netargs = '" . substr($a->cmd,8) + . '?f=' + . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') + . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') + . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; } @@ -208,7 +209,6 @@ function network_content(&$a, $update = 0) { $sql_extra .= " AND `item`.`body` REGEXP '" . dbesc(escape_tags($_GET['search'])) . "' "; - $r = q("SELECT COUNT(*) AS `total` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 diff --git a/mod/photos.php b/mod/photos.php index 4a72bb680..cb13b7603 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -903,7 +903,7 @@ function photos_content(&$a) { $album = hex2bin($datum); $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' - $sql_extra GROUP BY `resource-id`", + AND `scale` <= 4 $sql_extra GROUP BY `resource-id`", intval($owner_uid), dbesc($album) ); @@ -913,7 +913,7 @@ function photos_content(&$a) { } $r = q("SELECT `resource-id`, `id`, `filename`, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s' - $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", + AND `scale` <= 4 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", intval($owner_uid), dbesc($album), intval($a->pager['start']), diff --git a/mod/profile.php b/mod/profile.php index e9b144ffd..71912458f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -21,7 +21,7 @@ function profile_init(&$a) { profile_load($a,$which,$profile); - if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] & PAGE_COMMUNITY)) { + if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) { $a->page['htmlhead'] .= '<meta name="friendika.community" content="true" />'; } if(x($a->profile,'openidserver')) @@ -160,7 +160,7 @@ function profile_content(&$a, $update = 0) { if($tab === 'posts') { $o .= '<div id="live-profile"></div>' . "\r\n"; $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] - . "; var netargs = ''; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; + . "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; } } diff --git a/mod/profiles.php b/mod/profiles.php index 160ca13bc..64fab797f 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -361,6 +361,9 @@ function profiles_content(&$a) { $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl())); $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>"; + $f = get_config('system','birthday_input_format'); + if(! $f) + $f = 'ymd'; $is_default = (($r[0]['is-default']) ? 1 : 0); $tpl = get_markup_template("profile_edit.tpl"); @@ -375,7 +378,7 @@ function profiles_content(&$a) { '$lbl_fullname' => t('Your Full Name:'), '$lbl_title' => t('Title/Description:'), '$lbl_gender' => t('Your Gender:'), - '$lbl_bd' => t("Birthday \x28y/m/d\x29:"), + '$lbl_bd' => sprintf( t("Birthday \x28%s\x29:"),datesel_format($f)), '$lbl_address' => t('Street Address:'), '$lbl_city' => t('Locality/City:'), '$lbl_zip' => t('Postal/Zip Code:'), diff --git a/view/apiconfig.tpl b/view/api_config_xml.tpl index 71ab241ce..3281e59dd 100644 --- a/view/apiconfig.tpl +++ b/view/api_config_xml.tpl @@ -1,25 +1,24 @@ -<?xml version="1.0" encoding="UTF-8"?> <config> <site> - <name>$sitedesc</name> - <server>$sitename</server> + <name>$config.site.name</name> + <server>$config.site.server</server> <theme>default</theme> <path></path> - <logo>$sitelogo</logo> + <logo>$config.site.logo</logo> <fancy>true</fancy> <language>en</language> - <email>$adminemail</email> + <email>$config.site.email</email> <broughtby></broughtby> <broughtbyurl></broughtbyurl> <timezone>UTC</timezone> - <closed>$siteclosed</closed> + <closed>$config.site.closed</closed> <inviteonly>false</inviteonly> - <private>$siteprivate</private> - <textlimit>$textlimit</textlimit> - <ssl>$has_ssl</ssl> - <sslserver>$ssl_server</sslserver> + <private>$config.site.private</private> + <textlimit>$config.site.textlimit</textlimit> + <ssl>$config.site.ssl</ssl> + <sslserver>$config.site.sslserver</sslserver> <shorturllength>30</shorturllength> </site> diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 061f6a71d..6195c5bbc 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -4,75 +4,79 @@ var editor=false; var textlen = 0; -function initEditor(){ - $("#profile-jot-text-loading").show(); - tinyMCE.init({ - theme : "advanced", - mode : "specific_textareas", - editor_selector: /(profile-jot-text|prvmail-text)/, - plugins : "bbcode,paste,autoresize", - theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "", - theme_advanced_toolbar_location : "top", - theme_advanced_toolbar_align : "center", - theme_advanced_blockformats : "blockquote,code", - paste_text_sticky : true, - entity_encoding : "raw", - add_unload_trigger : false, - remove_linebreaks : false, - force_p_newlines : false, - force_br_newlines : true, - forced_root_block : '', - convert_urls: false, - content_css: "$baseurl/view/custom_tinymce.css", - theme_advanced_path : false, - setup : function(ed) { - //Character count - ed.onKeyUp.add(function(ed, e) { - var txt = tinyMCE.activeEditor.getContent(); - textlen = txt.length; - if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { - $('#profile-jot-desc').html(ispublic); - } - else { - $('#profile-jot-desc').html(' '); - } +function initEditor(cb){ + if (editor==false){ + $("#profile-jot-text-loading").show(); + tinyMCE.init({ + theme : "advanced", + mode : "specific_textareas", + editor_selector: /(profile-jot-text|prvmail-text)/, + auto_focus: "profile-jot-text", + plugins : "bbcode,paste,autoresize", + theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "center", + theme_advanced_blockformats : "blockquote,code", + paste_text_sticky : true, + entity_encoding : "raw", + add_unload_trigger : false, + remove_linebreaks : false, + force_p_newlines : false, + force_br_newlines : true, + forced_root_block : '', + convert_urls: false, + content_css: "$baseurl/view/custom_tinymce.css", + theme_advanced_path : false, + setup : function(ed) { + //Character count + ed.onKeyUp.add(function(ed, e) { + var txt = tinyMCE.activeEditor.getContent(); + textlen = txt.length; + if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { + $('#profile-jot-desc').html(ispublic); + } + else { + $('#profile-jot-desc').html(' '); + } + + if(textlen <= 140) { + $('#character-counter').removeClass('red'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('grey'); + } + if((textlen > 140) && (textlen <= 420)) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('red'); + $('#character-counter').addClass('orange'); + } + if(textlen > 420) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('red'); + } + $('#character-counter').text(textlen); + }); + + ed.onInit.add(function(ed) { + ed.pasteAsPlainText = true; + $("#profile-jot-text-loading").hide(); + $("#profile-jot-submit-wrapper").show(); + if (typeof cb!="undefined") cb(); + }); - if(textlen <= 140) { - $('#character-counter').removeClass('red'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('grey'); - } - if((textlen > 140) && (textlen <= 420)) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('red'); - $('#character-counter').addClass('orange'); - } - if(textlen > 420) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('red'); - } - $('#character-counter').text(textlen); - }); - - ed.onInit.add(function(ed) { - ed.pasteAsPlainText = true; - $("#profile-jot-text-loading").hide(); - $("#profile-jot-submit-wrapper").show(); - }); - - } - }); - editor = true; - - // setup acl popup - $("#profile-jot-acl-wrapper").hide(); - $("a#jot-perms-icon").fancybox({ - 'transitionIn' : 'none', - 'transitionOut' : 'none' - }); + } + }); + editor = true; + // setup acl popup + $("a#jot-perms-icon").fancybox({ + 'transitionIn' : 'none', + 'transitionOut' : 'none' + }); + } else { + if (typeof cb!="undefined") cb(); + } } </script> @@ -181,12 +185,17 @@ function initEditor(){ } } + function jotShare(id) { $('#like-rotator-' + id).show(); $.get('share/' + id, function(data) { - tinyMCE.execCommand('mceInsertRawHTML',false,data); - $('#like-rotator-' + id).hide(); - $(window).scrollTop(0); + if (!editor) $("#profile-jot-text").val(""); + initEditor(function(){ + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#like-rotator-' + id).hide(); + $(window).scrollTop(0); + }); + }); } @@ -203,8 +212,11 @@ function initEditor(){ if(reply && reply.length) { $('#profile-rotator').show(); $.get('parse_url?url=' + reply, function(data) { - tinyMCE.execCommand('mceInsertRawHTML',false,data); - $('#profile-rotator').hide(); + if (!editor) $("#profile-jot-text").val(""); + initEditor(function(){ + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#profile-rotator').hide(); + }); }); } } diff --git a/view/photo_edit.tpl b/view/photo_edit.tpl index ceb1ddca3..839e41ee7 100644 --- a/view/photo_edit.tpl +++ b/view/photo_edit.tpl @@ -19,13 +19,15 @@ <div id="photo-edit-tags-end"></div> <div id="photo-edit-perms" class="photo-edit-perms" > - <div id="photo-edit-perms-menu" class="fakelink" onClick="openClose('photo-edit-perms-select');" >$permissions</div> + <a href="#photo-edit-perms-select" id="photo-edit-perms-menu" title="$permissions"/> + <span id="jot-perms-icon" class="icon $lockstate" ></span>$permissions + </a> <div id="photo-edit-perms-menu-end"></div> - - <div id="photo-edit-perms-select" style="display: none;" > - - $aclselect - + + <div style="display: none;"> + <div id="photo-edit-perms-select" > + $aclselect + </div> </div> </div> <div id="photo-edit-perms-end"></div> @@ -35,3 +37,10 @@ <div id="photo-edit-end"></div> </form> + +<script> + $("a#photo-edit-perms-menu").fancybox({ + 'transitionIn' : 'none', + 'transitionOut' : 'none' + }); +</script> diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl index eb88f00c1..155595056 100644 --- a/view/theme/dispy/jot-header.tpl +++ b/view/theme/dispy/jot-header.tpl @@ -2,74 +2,104 @@ <script language="javascript" type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script> <script language="javascript" type="text/javascript"> -var editor; +var editor=false; var textlen = 0; -tinyMCE.init({ - theme : "advanced", - mode : "specific_textareas", - editor_selector: /(profile-jot-text|prvmail-text)/, - plugins : "bbcode,paste,fullscreen,autoresize", - theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "", - theme_advanced_toolbar_location : "top", - theme_advanced_toolbar_align : "center", - theme_advanced_blockformats : "blockquote,code", - //theme_advanced_resizing : true, - //theme_advanced_statusbar_location : "bottom", - paste_text_sticky : true, - entity_encoding : "raw", - add_unload_trigger : false, - remove_linebreaks : false, - force_p_newlines : false, - force_br_newlines : true, - forced_root_block : '', - convert_urls: false, - content_css: "$baseurl/view/custom_tinymce.css", - theme_advanced_path : false, - setup : function(ed) { - //Character count - ed.onKeyUp.add(function(ed, e) { - var txt = tinyMCE.activeEditor.getContent(); - textlen = txt.length; - if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { - $('#profile-jot-desc').html(ispublic); - } - else { - $('#profile-jot-desc').html(' '); - } - - if(textlen <= 140) { - $('#character-counter').removeClass('red'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('grey'); - } - if((textlen > 140) && (textlen <= 420)) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('red'); - $('#character-counter').addClass('orange'); - } - if(textlen > 420) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('red'); - } - $('#character-counter').text(textlen); - }); - - ed.onInit.add(function(ed) { - ed.pasteAsPlainText = true; - }); - - } -}); - +function initEditor(cb) { + if (editor==false) { + $("#profile-jot-text-loading").show(); + tinyMCE.init({ + theme : "advanced", + mode : "specific_textareas", + editor_selector: /(profile-jot-text|prvmail-text)/, + plugins : "bbcode,paste,fullscreen,autoresize", + theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code,fullscreen", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "center", + theme_advanced_blockformats : "blockquote,code", + //theme_advanced_resizing : true, + //theme_advanced_statusbar_location : "bottom", + paste_text_sticky : true, + entity_encoding : "raw", + add_unload_trigger : false, + remove_linebreaks : false, + force_p_newlines : false, + force_br_newlines : true, + forced_root_block : '', + convert_urls: false, + content_css: "$baseurl/view/custom_tinymce.css", + theme_advanced_path : false, + setup : function(ed) { + //Character count + ed.onKeyUp.add(function(ed, e) { + var txt = tinyMCE.activeEditor.getContent(); + textlen = txt.length; + if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { + $('#profile-jot-desc').html(ispublic); + } + else { + $('#profile-jot-desc').html(' '); + } + + if(textlen <= 140) { + $('#character-counter').removeClass('red'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('grey'); + } + if((textlen > 140) && (textlen <= 420)) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('red'); + $('#character-counter').addClass('orange'); + } + if(textlen > 420) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('red'); + } + $('#character-counter').text(textlen); + }); + ed.onInit.add(function(ed) { + ed.pasteAsPlainText = true; + $("#profile-jot-text-loading").hide(); + $("#profile-jot-submit-wrapper").show(); + $("#profile-upload-wrapper").show(); + $("#profile-attach-wrapper").show(); + $("#profile-link-wrapper").show(); + $("#profile-youtube-wrapper").show(); + $("#profile-video-wrapper").show(); + $("#profile-audio-wrapper").show(); + $("#profile-location-wrapper").show(); + $("#profile-nolocation-wrapper").show(); + $("#profile-title-wrapper").show(); + $("#profile-jot-plugin-wrapper").show(); + $("#character-counter").show(); + if (typeof cb!="undefined") cb(); + }); + } + }); + editor = true; + // setup acl popup + $("a#jot-perms-icon").fancybox({ + 'transitionIn' : 'none', + 'transitionOut' : 'none' + }); + } else { + if (typeof cb!="undefined") cb(); + } +} // initEditor </script> <script type="text/javascript" src="include/ajaxupload.js" ></script> <script> var ispublic = '$ispublic'; $(document).ready(function() { + /* enable tinymce on focus */ + $("#profile-jot-text").focus(function(){ + if (editor) return; + $(this).val(""); + initEditor(); + }); var uploader = new window.AjaxUpload( 'wall-image-upload', { action: 'wall_upload/$nickname', @@ -179,9 +209,12 @@ tinyMCE.init({ function jotShare(id) { $('#like-rotator-' + id).show(); $.get('share/' + id, function(data) { - tinyMCE.execCommand('mceInsertRawHTML',false,data); - $('#like-rotator-' + id).hide(); - $(window).scrollTop(0); + if (!editor) $("#profile-jot-text").val(""); + initEditor(function(){ + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#like-rotator-' + id).hide(); + $(window).scrollTop(0); + }); }); } @@ -198,8 +231,11 @@ tinyMCE.init({ if(reply && reply.length) { $('#profile-rotator').show(); $.get('parse_url?url=' + reply, function(data) { - tinyMCE.execCommand('mceInsertRawHTML',false,data); - $('#profile-rotator').hide(); + if (!editor) $("#profile-jot-text").val(""); + initEditor(function(){ + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#profile-rotator').hide(); + }); }); } } diff --git a/view/theme/dispy/jot.tpl b/view/theme/dispy/jot.tpl index f87b6fbb3..d5e81a925 100644 --- a/view/theme/dispy/jot.tpl +++ b/view/theme/dispy/jot.tpl @@ -2,7 +2,7 @@ <div id="profile-jot-wrapper" > <div id="profile-jot-banner-wrapper"> <div id="profile-jot-desc" > </div> - <div id="character-counter" class="grey">0</div> + <div id="character-counter" class="grey" style="display: none;">0</div> <div id="profile-rotator-wrapper" style="display: $visitor;" > <img id="profile-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display:none;" /> </div> @@ -17,58 +17,59 @@ <input type="hidden" name="title" id="jot-title" value="" /> <input type="hidden" name="post_id" value="$post_id" /> - <textarea rows="5" style="width:100%" class="profile-jot-text" id="profile-jot-text" name="body" >$content</textarea> + <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> + <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea> + {{ if $content }}<script>initEditor();</script>{{ endif }} -<div id="profile-jot-submit-wrapper" > - <div id="profile-jot-perms" class="profile-jot-perms" style="display: $visitor;" ><a id="jot-perms-icon" class="icon $lockstate" title="$permset" onClick="openClose('profile-jot-acl-wrapper'); openClose('profile-jot-email-wrapper'); openClose('profile-jot-networks');return false;"></a>$bang</div> +<div id="profile-jot-submit-wrapper" style="display:none"> + <div id="profile-jot-perms" class="profile-jot-perms" style="display: $visitor;" > + <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon $lockstate" title="$permset" ></a>$bang</div> <input type="submit" id="profile-jot-submit" name="submit" value="$share" /> </div> - <div id="profile-upload-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-upload-wrapper" class="jot-tool" style="display: none;" > <div id="wall-image-upload-div" ><a onclick="return false;" id="wall-image-upload" class="icon border camera" title="$upload"></a></div> </div> - <div id="profile-attach-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-attach-wrapper" class="jot-tool" style="display: none;" > <div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="icon border attach" title="$attach"></a></div> </div> - <div id="profile-link-wrapper" class="jot-tool" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" > + <div id="profile-link-wrapper" class="jot-tool" style="display: none;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" > <a id="profile-link" class="icon border link" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a> </div> - <div id="profile-youtube-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-youtube-wrapper" class="jot-tool" style="display: none;" > <a id="profile-youtube" class="icon border youtube" title="$youtube" onclick="jotGetVideo(); return false;"></a> </div> - <div id="profile-video-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-video-wrapper" class="jot-tool" style="display: none;" > <a id="profile-video" class="icon border video" title="$video" onclick="jotVideoURL(); return false;"></a> </div> - <div id="profile-audio-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-audio-wrapper" class="jot-tool" style="display: none;" > <a id="profile-audio" class="icon border audio" title="$audio" onclick="jotAudioURL(); return false;"></a> </div> - <div id="profile-location-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-location-wrapper" class="jot-tool" style="display: none;" > <a id="profile-location" class="icon border globe" title="$setloc" onclick="jotGetLocation(); return false;"></a> </div> <div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;" > <a id="profile-nolocation" class="icon border noglobe" title="$noloc" onclick="jotClearLocation(); return false;"></a> </div> - <div id="profile-title-wrapper" class="jot-tool" style="display: $visitor;" > + <div id="profile-title-wrapper" class="jot-tool" style="display: none;" > <a id="profile-title" class="icon border article" title="$title" onclick="jotTitle(); return false;"></a> </div> - <div id="profile-jot-plugin-wrapper"> + <div id="profile-jot-plugin-wrapper" style="display: none;"> $jotplugins </div> - <div id="profile-jot-tools-end"></div> - <div id="profile-jot-email-wrapper" style="display: none;" > - <div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle"> - <div id="profile-jot-email-end"></div> - </div> - <div id="profile-jot-networks" style="display: none;" > - $jotnets - </div> - <div id="profile-jot-networks-end"></div> - <div id="profile-jot-acl-wrapper" style="display: none;" >$acl</div> - + <div style="display: none;"> + <div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;"> + $acl + <hr style="clear:both"/> + <div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" /> + <div id="profile-jot-email-end"></div> + $jotnets + </div> + </div> <div id="profile-jot-end"></div> </form> diff --git a/view/theme/dispy/nav.tpl b/view/theme/dispy/nav.tpl index 2455105f2..d1a396f99 100644 --- a/view/theme/dispy/nav.tpl +++ b/view/theme/dispy/nav.tpl @@ -21,6 +21,9 @@ $langselector {{ if $nav.network }}<li><a id="nav-network-link" class="nav-commlink $nav.network.2" href="$nav.network.0">$nav.network.1</a></li>{{ endif }} + {{ if $nav.community }} + <li><a id="nav-community-link" class="nav-commlink $nav.community.2" href="$nav.community.0" title="$nav.community.3" >$nav.community.1</a></li> + {{ endif }} {{ if $nav.notifications }}<li><a id="nav-notify-link" class="nav-commlink $nav.notifications.2" href="$nav.notifications.0">$nav.notifications.1</a></li>{{ endif }} {{ if $nav.messages }}<li><a id="nav-messages-link" class="nav-commlink $nav.messages.2" href="$nav.messages.0">$nav.messages.1</a></li>{{ endif }} diff --git a/view/theme/dispy/style.css b/view/theme/dispy/style.css index c04a67ec9..e9d11d601 100644 --- a/view/theme/dispy/style.css +++ b/view/theme/dispy/style.css @@ -321,9 +321,10 @@ aside #viewcontacts { text-align: right;} padding: 5px; } #profile-jot-acl-wrapper { - margin: 0px 10%; + margin: 0px 10px; border: 1px solid #555753; border-top: 0px; + display:block!important; } #group_allow_wrapper, #group_deny_wrapper, @@ -342,25 +343,6 @@ aside #viewcontacts { text-align: right;} - -#acl-permit-wrapper, -#acl-deny-wrapper { padding: 5px; } - -#acl-allow-group-label, -#acl-allow-contact-label, -#acl-deny-group-label, -#acl-deny-contact-label { display: block } - -#group_allow, #contact_allow, -#group_deny, #contact_deny, -#profile-jot-acl-wrapper select { width: 100%; } - -#acl-wrapper-end, -#profile-jot-end { clear: both; height: 5px; } - - - - /** * section */ @@ -1130,3 +1112,107 @@ div[id$="wrapper"] br { clear: left; } .cc-license { margin-top: 100px; font-size: 0.7em; } footer { display: block; margin: 50px 20%; clear: both; } +#profile-jot-text { + height: 20px; + color:#cccccc; + border: 1px solid #cccccc; +} +/** acl **/ +#photo-edit-perms-select, +#photos-upload-permissions-wrapper, +#profile-jot-acl-wrapper{ + display:block!important; +} + +#acl-wrapper { + width: 690px; + float:left; +} +#acl-search { + float:right; + background: #ffffff url("../../../images/search_18.png") no-repeat right center; + padding-right:20px; +} +#acl-showall { + float: left; + display: block; + width: auto; + height: 18px; + background-color: #cccccc; + background-image: url("../../../images/show_all_off.png"); + background-position: 7px 7px; + background-repeat: no-repeat; + padding: 7px 10px 7px 30px; + -webkit-border-radius: 5px ; + -moz-border-radius: 5px; + border-radius: 5px; + color: #999999; +} +#acl-showall.selected { + color: #000000; + background-color: #ff9900; + background-image: url("../../../images/show_all_on.png"); +} + +#acl-list { + height: 210px; + border: 1px solid #cccccc; + clear: both; + margin-top: 30px; + overflow: auto; +} +#acl-list-content { +} +.acl-list-item { + display: block; + width: 150px; + height: 30px; + border: 1px solid #cccccc; + margin: 5px; + float: left; +} +.acl-list-item img{ + width:22px; + height: 22px; + float: left; + margin: 4px; +} +.acl-list-item p { font-size: 10px; margin: 0px; padding: 2px 0px 1px; } +.acl-list-item a { + font-size: 8px; + display: block; + width: 40px; + height: 10px; + float: left; + color: #999999; + background-color: #cccccc; + background-position: 3px 3px; + background-repeat: no-repeat; + margin-right: 5px; + -webkit-border-radius: 2px ; + -moz-border-radius: 2px; + border-radius: 2px; + padding-left: 15px; +} +#acl-wrapper a:hover { + text-decoration: none; + color:#000000; +} +.acl-button-show { background-image: url("../../../images/show_off.png"); } +.acl-button-hide { background-image: url("../../../images/hide_off.png"); } + +.acl-button-show.selected { + color: #000000; + background-color: #9ade00; + background-image: url("../../../images/show_on.png"); +} +.acl-button-hide.selected { + color: #000000; + background-color: #ff4141; + background-image: url("../../../images/hide_on.png"); +} +.acl-list-item.groupshow { border-color: #9ade00; } +.acl-list-item.grouphide { border-color: #ff4141; } +/** /acl **/ + + diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 6a909bc7d..3edc603f4 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -45,7 +45,7 @@ code { border: 1px solid #444; background: #EEE; color: #444; - padding: 0px 10px 10px 10px; + padding: 10px; margin-top: 20px; } /*blockquote:before { @@ -1487,10 +1487,12 @@ input#dfrn-url { height: 20px; color:#cccccc; border: 1px solid #cccccc; + padding: 3px 0px 0px 5px; } /** acl **/ +#photo-edit-perms-select, #photos-upload-permissions-wrapper, #profile-jot-acl-wrapper{ display:block!important; diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 96702d320..c58bda5bb 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -1569,6 +1569,7 @@ padding: 5px 10px 0px; /** acl **/ +#photo-edit-perms-select, #photos-upload-permissions-wrapper, #profile-jot-acl-wrapper{ display:block!important; |