From fdc469ae4ce385e21c396b76628e0d427e173e92 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 14:04:00 -0800 Subject: [PATCH 01/11] move directory registration block before redirect --- mod/register.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/register.php b/mod/register.php index d97b3e0cd5..d885362325 100644 --- a/mod/register.php +++ b/mod/register.php @@ -291,6 +291,13 @@ function register_post(&$a) { } } + if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) { + $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + $url = $a->get_baseurl() . "/profile/$nickname"; + proc_run($php_path,"include/directory.php","$url"); + } + + if( $a->config['register_policy'] == REGISTER_OPEN ) { $email_tpl = load_view_file("view/register_open_eml.tpl"); $email_tpl = replace_macros($email_tpl, array( @@ -348,13 +355,6 @@ function register_post(&$a) { } - if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) { - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - $url = $a->get_baseurl() . "/profile/$nickname"; - if($url && strlen(get_config('system','directory_submit_url'))) - proc_run($php_path,"include/directory.php","$url"); - - } return; }} From 755c2245e8184ceee2ba3382e4f60143da31e6df Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 15:16:12 -0800 Subject: [PATCH 02/11] move php path setting inside proc_run --- addon/poormancron/poormancron.php | 3 +-- boot.php | 3 +++ include/poller.php | 3 +-- mod/contacts.php | 4 +--- mod/dfrn_confirm.php | 7 ++----- mod/dfrn_notify.php | 4 +--- mod/follow.php | 4 +--- mod/item.php | 10 ++-------- mod/like.php | 10 ++-------- mod/message.php | 9 +-------- mod/photos.php | 13 ++++--------- mod/profile_photo.php | 8 ++------ mod/profiles.php | 4 +--- mod/register.php | 3 +-- mod/regmod.php | 3 +-- mod/settings.php | 4 +--- 16 files changed, 25 insertions(+), 67 deletions(-) diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php index c31d2772c8..830c10ddfe 100644 --- a/addon/poormancron/poormancron.php +++ b/addon/poormancron/poormancron.php @@ -27,8 +27,7 @@ function poormancron_hook($a,&$b) { // 300 secs, 5 mins if (!$lastupdate || ($now-$lastupdate)>300) { set_config('poormancron','lastupdate', $now); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - proc_run($php_path,"include/poller.php"); + proc_run('php',"include/poller.php"); } } diff --git a/boot.php b/boot.php index 530baa7b91..d9786edcd5 100644 --- a/boot.php +++ b/boot.php @@ -2434,6 +2434,9 @@ if(! function_exists('proc_run')) { function proc_run($cmd){ $args = func_get_args(); call_hooks("proc_run", $args); + + if(count($args) && $args[0] === 'php') + $args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); foreach ($args as $arg){ $arg = escapeshellarg($arg); diff --git a/include/poller.php b/include/poller.php index 66df080a9d..d54c88e053 100644 --- a/include/poller.php +++ b/include/poller.php @@ -27,8 +27,7 @@ function poller_run($argv, $argc){ // run queue delivery process in the background - $php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - proc_run($php_path,"include/queue.php"); + proc_run('php',"include/queue.php"); // clear old cache q("DELETE FROM `cache` WHERE `updated`<'%s'", diff --git a/mod/contacts.php b/mod/contacts.php index 36f42f8e59..8e069b2bd6 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -124,9 +124,7 @@ function contacts_content(&$a) { if($cmd === 'update') { // pull feed and consume it, which should subscribe to the hub. - - $php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - proc_run($php_path,"include/poller.php","$contact_id"); + proc_run('php',"include/poller.php","$contact_id"); goaway($a->get_baseurl() . '/contacts/' . $contact_id); // NOTREACHED } diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 24e8bf106a..1b42c13b8a 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -435,11 +435,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $arr['last-child'] = 1; $i = item_store($arr); - - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"activity\" \"$i\" &", array(),$foo)); - proc_run($php_path,"include/notifier.php","activity","$i"); + if($i) + proc_run('php',"include/notifier.php","activity","$i"); } diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index cd7b0cff01..0102727392 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -369,9 +369,7 @@ function dfrn_notify_post(&$a) { if($posted_id && $parent) { - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - - proc_run($php_path,"include/notifier.php","comment-import","$posted_id"); + proc_run('php',"include/notifier.php","comment-import","$posted_id"); if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { require_once('bbcode.php'); diff --git a/mod/follow.php b/mod/follow.php index 28441eae8f..f3bd84669f 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -253,9 +253,7 @@ function follow_post(&$a) { // pull feed and consume it, which should subscribe to the hub. - $php_path = ((x($a->config,'php_path') && strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - //proc_close(proc_open("\"$php_path\" \"include/poller.php\" \"$contact_id\" &", array(), $foo)); - proc_run($php_path,"include/poller.php","$contact_id"); + proc_run('php',"include/poller.php","$contact_id"); // create a follow slap diff --git a/mod/item.php b/mod/item.php index 8c6b181c0d..c2487435e4 100644 --- a/mod/item.php +++ b/mod/item.php @@ -460,11 +460,7 @@ function item_post(&$a) { // NOTREACHED } - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - - logger('mod_item: notifier invoked: ' . "\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &"); - - proc_run($php_path, "include/notifier.php", $notify_type, "$post_id"); + proc_run('php', "include/notifier.php", $notify_type, "$post_id"); $datarray['id'] = $post_id; @@ -595,12 +591,10 @@ function item_content(&$a) { } } $drop_id = intval($item['id']); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); // send the notification upstream/downstream as the case may be - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" &", array(), $foo)); - proc_run($php_path,"include/notifier.php","drop","$drop_id"); + proc_run('php',"include/notifier.php","drop","$drop_id"); goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); //NOTREACHED diff --git a/mod/like.php b/mod/like.php index c78c1f030c..3a8ca4b7d3 100644 --- a/mod/like.php +++ b/mod/like.php @@ -101,9 +101,7 @@ function like_content(&$a) { intval($r[0]['id']) ); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", array(),$foo)); - proc_run($php_path,"include/notifier.php","like","$post_id"); + proc_run('php',"include/notifier.php","like","$post_id"); return; } @@ -173,11 +171,7 @@ EOT; ); } - - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", array(),$foo)); - proc_run($php_path,"include/notifier.php","like","$post_id"); + proc_run('php',"include/notifier.php","like","$post_id"); return; // NOTREACHED } \ No newline at end of file diff --git a/mod/message.php b/mod/message.php index ef3be2c5e9..466b0befa8 100644 --- a/mod/message.php +++ b/mod/message.php @@ -96,16 +96,9 @@ function message_post(&$a) { } } } - - - - - - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); if($post_id) { - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"mail\" \"$post_id\" &", array(),$foo)); - proc_run($php_path,"include/notifier.php","mail","$post_id"); + proc_run('php',"include/notifier.php","mail","$post_id"); notice( t('Message sent.') . EOL ); } else { diff --git a/mod/photos.php b/mod/photos.php index d4835ba5ea..bd48cfc9f9 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -182,13 +182,11 @@ foreach($_FILES AS $key => $val) { ); $drop_id = intval($rr['id']); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); // send the notification upstream/downstream as the case may be if($rr['visible']) - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",array(),$foo)); - proc_run($php_path,"include/notifier.php","drop","$drop_id"); + proc_run('php',"include/notifier.php","drop","$drop_id"); } } } @@ -232,11 +230,9 @@ foreach($_FILES AS $key => $val) { $url = $a->get_baseurl(); $drop_id = intval($i[0]['id']); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); if($i[0]['visible']) - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ", array(),$foo)); - proc_run($php_path,"include/notifier.php","drop","$drop_id"); + proc_run('php',"include/notifier.php","drop","$drop_id"); } } @@ -474,9 +470,8 @@ foreach($_FILES AS $key => $val) { $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; $item_id = item_store($arr); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - //proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"tag\" \"$item_id\" & ",array(),$foo)); - proc_run($php_path,"include/notifier.php","tag","$item_id"); + if($item_id) + proc_run('php',"include/notifier.php","tag","$item_id"); } } diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 4f0d567f40..0f84a85c92 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -87,11 +87,9 @@ function profile_photo_post(&$a) { ); // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo)); - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } else notice( t('Unable to process image') . EOL); @@ -169,11 +167,9 @@ function profile_photo_content(&$a) { ); // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo)); - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); goaway($a->get_baseurl() . '/profiles'); return; // NOTREACHED diff --git a/mod/profiles.php b/mod/profiles.php index d74219501a..4e3f03799a 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -200,11 +200,9 @@ function profiles_post(&$a) { if($is_default) { // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &", array(),$foo)); - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } } } diff --git a/mod/register.php b/mod/register.php index d885362325..97038def0b 100644 --- a/mod/register.php +++ b/mod/register.php @@ -292,9 +292,8 @@ function register_post(&$a) { } if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) { - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $a->get_baseurl() . "/profile/$nickname"; - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } diff --git a/mod/regmod.php b/mod/regmod.php index f662902d8d..00cfa06e21 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -74,10 +74,9 @@ function regmod_content(&$a) { intval($user[0]['uid']) ); if(count($r) && $r[0]['net-publish']) { - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $a->get_baseurl() . '/profile/' . $user[0]['nickname']; if($url && strlen(get_config('system','directory_submit_url'))) - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } $email_tpl = load_view_file("view/register_open_eml.tpl"); diff --git a/mod/settings.php b/mod/settings.php index dbbac8bdeb..ebe07612eb 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -179,11 +179,9 @@ function settings_post(&$a) { if($old_visibility != $net_publish) { // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo)); - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } $_SESSION['theme'] = $theme; From 352fef6208184d0609d3305010c5d74dd5e4c720 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 16:39:21 -0800 Subject: [PATCH 03/11] provide privacy policy url as mandated for Facebook apps (how bloody ironic) --- addon/facebook/facebook.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 119c2102e1..e989c90ea1 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -7,10 +7,17 @@ * view a page on your site, then add it back to the list. This will reset * all of the plugin 'hooks'. * - * 1. register an API key from developer.facebook.com + * 1. register an API key for your site from developer.facebook.com * a. We'd be very happy if you include "Friendika" in the application name - * to increase name recognition. - * b. The url should be your site URL with a trailing slash + * to increase name recognition. The Friendika icons are also present + * in the images directory and may be uploaded as a Facebook app icon. + * Use images/ff-16.jpg for the Icon and images/ff-128.jpg for the Logo. + * b. The url should be your site URL with a trailing slash. + * You may use http://portal.friendika.com/privacy as the privacy policy + * URL unless your site has different requirements, and + * http://portal.friendika.com as the Terms of Service URL unless + * you have different requirements. (Friendika is a software application + * and does not require Terms of Service, though your installation of it might). * c. Set the following values in your .htconfig.php file * $a->config['facebook']['appid'] = 'xxxxxxxxxxx'; * $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx'; From 834439b7300584350ac1676f3f43f5511a4b509b Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 18:24:29 -0800 Subject: [PATCH 04/11] cleanup plugin and post settings --- addon/facebook/facebook.css | 8 ++++++++ addon/facebook/facebook.php | 12 +++++++++--- addon/randplace/randplace.php | 3 ++- addon/statusnet/statusnet.php | 26 ++++++++++++++++++++++---- addon/twitter/twitter.php | 29 +++++++---------------------- view/theme/duepuntozero/style.css | 6 ++++++ view/theme/loozah/style.css | 7 +++++++ 7 files changed, 61 insertions(+), 30 deletions(-) create mode 100644 addon/facebook/facebook.css diff --git a/addon/facebook/facebook.css b/addon/facebook/facebook.css new file mode 100644 index 0000000000..3df65706fa --- /dev/null +++ b/addon/facebook/facebook.css @@ -0,0 +1,8 @@ + +#facebook-enable-wrapper { + margin-top: 20px; +} + +#facebook-disable-wrapper { + margin-top: 20px; +} diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index e989c90ea1..876a9740ba 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -114,14 +114,18 @@ function facebook_content(&$a) { return ''; } + $a->page['htmlhead'] .= '' . "\r\n"; + $o .= '

' . t('Facebook Connect') . '

'; - $o .= '
'; + $o .= '
'; $o .= '' . t('Install Facebook post connector') . '

'; + . $a->get_baseurl() . '/facebook/' . $a->user['nickname'] . '&scope=publish_stream,read_stream,offline_access">' . t('Install Facebook post connector') . ''; + $o .= '
'; return $o; @@ -143,8 +147,10 @@ function facebook_uninstall() { function facebook_plugin_settings(&$a,&$b) { + $b .= '
'; $b .= '

' . t('Facebook') . '

'; $b .= '' . t('Facebook Connector Settings') . '
'; + $b .= '
'; } diff --git a/addon/randplace/randplace.php b/addon/randplace/randplace.php index d7ea65c9d2..fa38de3776 100644 --- a/addon/randplace/randplace.php +++ b/addon/randplace/randplace.php @@ -167,6 +167,7 @@ function randplace_settings(&$a,&$s) { /* Add some HTML to the existing form */ + $s .= '
'; $s .= '

' . t('Randplace Settings') . '

'; $s .= '
'; $s .= ''; @@ -175,6 +176,6 @@ function randplace_settings(&$a,&$s) { /* provide a submit button */ - $s .= '
'; + $s .= '
'; } \ No newline at end of file diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 7928003bcd..e595ad7b53 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -63,6 +63,22 @@ function statusnet_uninstall() { unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); } +function statusnet_jot_nets(&$a,&$b) { + if(! local_user()) + return; + + $statusnet_post = get_pconfig(local_user(),'statusnet','post'); + if(intval($statusnet_post) == 1) { + $statusnet_defpost = get_pconfig(local_user(),'statusnet','post_by_default'); + $selected = ((intval($statusnet_defpost == 1)) ? ' selected="selected" ' : ''); + $b .= '
' + . t('Post to StatusNet') . '
'; + } +} + + + + function statusnet_settings_post ($a,$post) { if(! local_user()) return; @@ -123,7 +139,8 @@ function statusnet_settings(&$a,&$s) { $osecret = get_pconfig(local_user(), 'statusnet', 'oauthsecret' ); $enabled = get_pconfig(local_user(), 'statusnet', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); - $s .= '

'.t('StatusNet Posting Settings').'

'; + $s .= '
'; + $s .= '

'. t('StatusNet Posting Settings').'

'; if ( (!$ckey) && (!$csecret) ) { /*** @@ -185,7 +202,7 @@ function statusnet_settings(&$a,&$s) { $s .= '
'; } } - $s .= '
'; + $s .= '
'; } @@ -210,8 +227,9 @@ function statusnet_post_hook(&$a,&$b) { if($ckey && $csecret && $otoken && $osecret) { $statusnet_post = get_pconfig(local_user(),'statusnet','post'); + $statusnet_enable = (($statusnet_post && x($_POST,'statusnet_enable')) ? intval($_POST['statusnet_enable']) : 0); - if($statusnet_post) { + if($statusnet_enable && $statusnet_post) { require_once('include/bbcode.php'); $dent = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret); $max_char = $dent->get_maxlength(); // max. length for a dent @@ -241,6 +259,6 @@ function statusnet_post_hook(&$a,&$b) { $dent->post('statuses/update', array('status' => $msg)); } } - } + } } diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index 509297d4ec..0fd891d208 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -41,7 +41,6 @@ function twitter_install() { register_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); register_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets'); - register_hook('post_local_start', 'addon/twitter/twitter.php', 'twitter_post_start'); logger("installed twitter"); } @@ -51,8 +50,6 @@ function twitter_uninstall() { unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); unregister_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); unregister_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets'); - unregister_hook('post_local_start', 'addon/twitter/twitter.php', 'twitter_post_start'); - } function twitter_jot_nets(&$a,&$b) { @@ -70,19 +67,6 @@ function twitter_jot_nets(&$a,&$b) { } -function twitter_post_start(&$a,&$b) { - if(! local_user()) - return; - - if((x($b,'twitter_enable')) && (intval($b['twitter_enable']))) - set_pconfig(local_user(),'twitter','enable','1'); - else - del_pconfig(local_user(),'twitter','enable'); - - -} - - function twitter_settings_post ($a,$post) { if(! local_user()) return; @@ -134,6 +118,7 @@ function twitter_settings(&$a,&$s) { $osecret = get_pconfig(local_user(), 'twitter', 'oauthsecret' ); $enabled = get_pconfig(local_user(), 'twitter', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); + $s .= '
'; $s .= '

'. t('Twitter Posting Settings') .'

'; if ( (!$ckey) && (!$csecret) ) { @@ -167,8 +152,8 @@ function twitter_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= ''; - $s .= '
'; - $s .= '
'; + $s .= '
'; + $s .= '
'; } else { /*** * we have an OAuth key / secret pair for the user @@ -190,7 +175,7 @@ function twitter_settings(&$a,&$s) { $s .= '
'; } } - $s .= '
'; + $s .= '
'; } @@ -213,11 +198,11 @@ function twitter_post_hook(&$a,&$b) { if($ckey && $csecret && $otoken && $osecret) { - $twitter_post = get_pconfig(local_user(),'twitter','post'); - $twitter_enable = intval(get_pconfig(local_user(),'twitter','enable')); + $twitter_post = intval(get_pconfig(local_user(),'twitter','post')); + $twitter_enable = (($twitter_post && x($_POST,'twitter_enable')) ? intval($_POST['twitter_enable']) : 0); if($twitter_post && $twitter_enable) { - require_once('addon/twitter/twitteroauth.php'); + require_once('library/twitteroauth.php'); require_once('include/bbcode.php'); $tweet = new TwitterOAuth($ckey,$csecret,$otoken,$osecret); $max_char = 140; // max. length for a tweet diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index a820c381cf..9b18b5c41c 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2025,3 +2025,9 @@ a.mail-list-link { .today { color: #FF0000; } + +.settings-block { + border: 1px solid #AAA; + margin: 10px; + padding: 10px; +} diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 145123aaf6..256c98d8e7 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -2073,3 +2073,10 @@ a.mail-list-link { .today { color: #FF0000; } + + +.settings-block { + border: 1px solid #AAA; + margin: 10px; + padding: 10px; +} From 953d8ccb546997bb0201cc60e118dd4b80b38c3c Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 19:09:49 -0800 Subject: [PATCH 05/11] added hook but forgot to register --- addon/statusnet/statusnet.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index e595ad7b53..5455186224 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -53,6 +53,8 @@ function statusnet_install() { register_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); register_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); register_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + register_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); + logger("installed statusnet"); } @@ -61,6 +63,7 @@ function statusnet_uninstall() { unregister_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); unregister_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + unregister_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); } function statusnet_jot_nets(&$a,&$b) { From 15780914eca543bf14dbf211bcbf7d18e3553639 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 19:30:57 -0800 Subject: [PATCH 06/11] another template made language neutral --- boot.php | 7 ++++++- util/strings.php | 5 ++++- view/de/register-link.tpl | 1 - view/en/register-link.tpl | 1 - view/fr/register-link.tpl | 1 - view/it/register-link.tpl | 1 - view/register-link.tpl | 1 + 7 files changed, 11 insertions(+), 6 deletions(-) delete mode 100644 view/de/register-link.tpl delete mode 100644 view/en/register-link.tpl delete mode 100644 view/fr/register-link.tpl delete mode 100644 view/it/register-link.tpl create mode 100644 view/register-link.tpl diff --git a/boot.php b/boot.php index d9786edcd5..8de891f383 100644 --- a/boot.php +++ b/boot.php @@ -768,7 +768,12 @@ function escape_tags($string) { if(! function_exists('login')) { function login($register = false) { $o = ""; - $register_html = (($register) ? load_view_file("view/register-link.tpl") : ""); + $register_tpl = (($register) ? load_view_file("view/register-link.tpl") : ""); + + $register_html = replace_macros($register_tpl,array( + '$title' => t('Create a New Account'), + '$desc' => t('Register') + )); $noid = get_config('system','no_openid'); if($noid) { diff --git a/util/strings.php b/util/strings.php index 747d8ef48f..f1fb57751a 100644 --- a/util/strings.php +++ b/util/strings.php @@ -3,6 +3,8 @@ $a->strings['Not Found'] = 'Not Found'; $a->strings['Page not found.' ] = 'Page not found.' ; $a->strings['Permission denied'] = 'Permission denied'; $a->strings['Permission denied.'] = 'Permission denied.'; +$a->strings['Create a New Account'] = 'Create a New Account'; +$a->strings['Register'] = 'Register'; $a->strings['Nickname or Email address: '] = 'Nickname or Email address: '; $a->strings['Password: '] = 'Password: '; $a->strings['Login'] = 'Login'; @@ -361,7 +363,6 @@ $a->strings['Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '] = 'Yo $a->strings['Your Email Address: '] = 'Your Email Address: '; $a->strings['Choose a profile nickname. This must begin with a text character. Your global profile locator will then be \'nickname@$sitename\'.'] = 'Choose a profile nickname. This must begin with a text character. Your global profile locator will then be \'nickname@$sitename\'.'; $a->strings['Choose a nickname: '] = 'Choose a nickname: '; -$a->strings['Register'] = 'Register'; $a->strings['Please login.'] = 'Please login.'; $a->strings['Registration revoked for '] = 'Registration revoked for '; $a->strings['Account approved.'] = 'Account approved.'; @@ -508,6 +509,8 @@ $a->strings['File has an invalid extension, it should be one of '] = 'File has a $a->strings['Upload was cancelled, or server error encountered'] = 'Upload was cancelled, or server error encountered'; $a->strings['Randplace Settings'] = 'Randplace Settings'; $a->strings['Enable Randplace Plugin'] = 'Enable Randplace Plugin'; +$a->strings['Post to StatusNet'] = 'Post to StatusNet'; +$a->strings['StatusNet Posting Settings'] = 'StatusNet Posting Settings'; $a->strings['No consumer key pair for StatusNet found. Register your Friendika Account as an desktop client on your StatusNet account, copy the consumer key pair here and enter the API base root.
Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendika installation at your favorited StatusNet installation.'] = 'No consumer key pair for StatusNet found. Register your Friendika Account as an desktop client on your StatusNet account, copy the consumer key pair here and enter the API base root.
Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendika installation at your favorited StatusNet installation.'; $a->strings['OAuth Consumer Key'] = 'OAuth Consumer Key'; $a->strings['OAuth Consumer Secret'] = 'OAuth Consumer Secret'; diff --git a/view/de/register-link.tpl b/view/de/register-link.tpl deleted file mode 100644 index cf9d7976d1..0000000000 --- a/view/de/register-link.tpl +++ /dev/null @@ -1 +0,0 @@ - Registrieren diff --git a/view/en/register-link.tpl b/view/en/register-link.tpl deleted file mode 100644 index 7f3fca4d6c..0000000000 --- a/view/en/register-link.tpl +++ /dev/null @@ -1 +0,0 @@ - Register diff --git a/view/fr/register-link.tpl b/view/fr/register-link.tpl deleted file mode 100644 index 7f3fca4d6c..0000000000 --- a/view/fr/register-link.tpl +++ /dev/null @@ -1 +0,0 @@ - Register diff --git a/view/it/register-link.tpl b/view/it/register-link.tpl deleted file mode 100644 index 67fc37b228..0000000000 --- a/view/it/register-link.tpl +++ /dev/null @@ -1 +0,0 @@ - Registrati diff --git a/view/register-link.tpl b/view/register-link.tpl new file mode 100644 index 0000000000..802c5f99f0 --- /dev/null +++ b/view/register-link.tpl @@ -0,0 +1 @@ + $desc From b92150297f6670b7aeb8c8ab4e1843a69d8e14bc Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 19:54:29 -0800 Subject: [PATCH 07/11] more consistency to plugins --- addon/calc/calc.php | 2 +- addon/tictac/tictac.php | 2 +- view/theme/duepuntozero/style.css | 5 +++++ view/theme/loozah/style.css | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addon/calc/calc.php b/addon/calc/calc.php index fd6a117779..a095e3960d 100644 --- a/addon/calc/calc.php +++ b/addon/calc/calc.php @@ -10,7 +10,7 @@ function calc_uninstall() { } function calc_app_menu($a,&$b) { - $b['app_menu'] .= 'Calculator
'; + $b['app_menu'] .= ''; } diff --git a/addon/tictac/tictac.php b/addon/tictac/tictac.php index 95678302c8..f73937cdd2 100644 --- a/addon/tictac/tictac.php +++ b/addon/tictac/tictac.php @@ -11,7 +11,7 @@ function tictac_uninstall() { } function tictac_app_menu($a,&$b) { - $b['app_menu'] .= '' . t('Three Dimensional Tic-Tac-Toe') . '
'; + $b['app_menu'] .= ''; } diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 9b18b5c41c..2bffc2f17d 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2031,3 +2031,8 @@ a.mail-list-link { margin: 10px; padding: 10px; } + +.app-title { + margin: 10px; +} + diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 256c98d8e7..7e8299eb56 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -2080,3 +2080,9 @@ a.mail-list-link { margin: 10px; padding: 10px; } + + +.app-title { + margin: 10px; +} + From a247a3cedb6a137d76fa7daa70d58ca91f17ff04 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 20:43:22 -0800 Subject: [PATCH 08/11] another template down --- boot.php | 1 + view/en/logout.tpl | 6 ------ view/fr/logout.tpl | 6 ------ view/it/logout.tpl | 6 ------ view/{de => }/logout.tpl | 2 +- 5 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 view/en/logout.tpl delete mode 100644 view/fr/logout.tpl delete mode 100644 view/it/logout.tpl rename view/{de => }/logout.tpl (64%) diff --git a/boot.php b/boot.php index 8de891f383..dc92d8dbb6 100644 --- a/boot.php +++ b/boot.php @@ -800,6 +800,7 @@ function login($register = false) { } $o = replace_macros($tpl,array( + '$logout' => t('Logout'), '$register_html' => $register_html, '$classname' => $classname, '$namelabel' => $namelabel, diff --git a/view/en/logout.tpl b/view/en/logout.tpl deleted file mode 100644 index 9a6c1d763a..0000000000 --- a/view/en/logout.tpl +++ /dev/null @@ -1,6 +0,0 @@ -
-
- - -
-
diff --git a/view/fr/logout.tpl b/view/fr/logout.tpl deleted file mode 100644 index 9a6c1d763a..0000000000 --- a/view/fr/logout.tpl +++ /dev/null @@ -1,6 +0,0 @@ -
-
- - -
-
diff --git a/view/it/logout.tpl b/view/it/logout.tpl deleted file mode 100644 index 0a6868e0ac..0000000000 --- a/view/it/logout.tpl +++ /dev/null @@ -1,6 +0,0 @@ -
-
- - -
-
diff --git a/view/de/logout.tpl b/view/logout.tpl similarity index 64% rename from view/de/logout.tpl rename to view/logout.tpl index 9a6c1d763a..6a84a5bbcf 100644 --- a/view/de/logout.tpl +++ b/view/logout.tpl @@ -1,6 +1,6 @@
- +
From c98ed12e10ed9db8a69066fe4ed94f9ae84482cb Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 24 Feb 2011 02:32:46 -0800 Subject: [PATCH 09/11] generalise wallwall template and fix "via wall-to-wall" float --- mod/display.php | 6 ++++- mod/network.php | 6 ++++- mod/profile.php | 2 +- util/strings.php | 6 ++++- view/de/strings.php | 6 ++++- view/de/wallwall_item.tpl | 41 ------------------------------- view/fr/wallwall_item.tpl | 41 ------------------------------- view/it/strings.php | 4 +++ view/it/wallwall_item.tpl | 41 ------------------------------- view/theme/duepuntozero/style.css | 4 +++ view/wall_item.tpl | 6 ++--- view/{en => }/wallwall_item.tpl | 9 ++++--- 12 files changed, 37 insertions(+), 135 deletions(-) delete mode 100644 view/de/wallwall_item.tpl delete mode 100644 view/fr/wallwall_item.tpl delete mode 100644 view/it/wallwall_item.tpl rename view/{en => }/wallwall_item.tpl (72%) diff --git a/mod/display.php b/mod/display.php index bdf6a6f974..da931335c1 100644 --- a/mod/display.php +++ b/mod/display.php @@ -258,7 +258,11 @@ function display_content(&$a) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], - '$title' => t('View $name\'s profile'), + '$linktitle' => t('View $name\'s profile'), + '$olinktitle' => t('View $owner_name\'s profile'), + '$to' => t('to'), + '$wall' => t('Wall-to-Wall'), + '$vwall' => t('via Wall-To-Wall:'), '$profile_url' => $profile_link, '$name' => $profile_name, '$sparkle' => $sparkle, diff --git a/mod/network.php b/mod/network.php index 79a2f2b389..a9de402a83 100644 --- a/mod/network.php +++ b/mod/network.php @@ -412,7 +412,11 @@ function network_content(&$a, $update = 0) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], - '$title' => t('View $name\'s profile'), + '$linktitle' => t('View $name\'s profile'), + '$olinktitle' => t('View $owner_name\'s profile'), + '$to' => t('to'), + '$wall' => t('Wall-to-Wall'), + '$vwall' => t('via Wall-To-Wall:'), '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, diff --git a/mod/profile.php b/mod/profile.php index 46d13298e0..5cab6662af 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -360,7 +360,7 @@ function profile_content(&$a, $update = 0) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], - '$title' => t('View $name\'s profile'), + '$linktitle' => t('View $name\'s profile'), '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, diff --git a/util/strings.php b/util/strings.php index f1fb57751a..f74f69584e 100644 --- a/util/strings.php +++ b/util/strings.php @@ -12,6 +12,7 @@ $a->strings['Nickname/Email/OpenID: '] = 'Nickname/Email/OpenID: '; $a->strings["Password \x28if not OpenID\x29: "] = "Password \x28if not OpenID\x29: "; $a->strings['Forgot your password?'] = 'Forgot your password?'; $a->strings['Password Reset'] = 'Password Reset'; +$a->strings['Logout'] = 'Logout'; $a->strings['prev'] = 'prev'; $a->strings['first'] = 'first'; $a->strings['last'] = 'last'; @@ -193,6 +194,10 @@ $a->strings['Item not found.'] = 'Item not found.'; $a->strings['Private Message'] = 'Private Message'; $a->strings['This is you'] = 'This is you'; $a->strings['View $name\'s profile'] = 'View $name\'s profile'; +$a->strings['View $owner_name\'s profile'] = 'View $owner_name\'s profile'; +$a->strings['to'] = 'to'; +$a->strings['Wall-to-Wall'] = 'Wall-to-Wall'; +$a->strings['via Wall-To-Wall:'] = 'via Wall-To-Wall:'; $a->strings['Item has been removed.'] = 'Item has been removed.'; $a->strings['Shared content is covered by the Creative Commons Attribution 3.0 license.'] = 'Shared content is covered by the Creative Commons Attribution 3.0 license.'; $a->strings['The profile address specified does not provide adequate information.'] = 'The profile address specified does not provide adequate information.'; @@ -426,7 +431,6 @@ $a->strings[' ago'] = ' ago'; $a->strings['Create a new group'] = 'Create a new group'; $a->strings['Everybody'] = 'Everybody'; $a->strings['Birthday:'] = 'Birthday:'; -$a->strings['Logout'] = 'Logout'; $a->strings['Home'] = 'Home'; $a->strings['Apps'] = 'Apps'; $a->strings['Directory'] = 'Directory'; diff --git a/view/de/strings.php b/view/de/strings.php index cc03196066..d17037f6d6 100644 --- a/view/de/strings.php +++ b/view/de/strings.php @@ -175,7 +175,11 @@ $a->strings['Cancel'] = 'Abbrechen'; $a->strings['Global Directory'] = 'Weltweites Verzeichnis'; $a->strings['Private Message'] = 'Private Nachricht'; $a->strings['This is you'] = 'Das bist du'; -$a->strings['View $name\'s profile'] = 'Profile von $name'; +$a->strings['View $name\'s profile'] = 'Betrachte das Profil von $name'; +$a->strings['View $owner_name\'s profile'] = 'Betrachte das Profil von $owner_name'; +$a->strings['to'] = 'to'; +$a->strings['Wall-to-Wall'] = 'Wall-to-Wall'; +$a->strings['via Wall-To-Wall:'] = 'via Wall-To-Wall:'; $a->strings['Item has been removed.'] = 'Eintrag wurde entfernt.'; $a->strings['Shared content is covered by the Creative Commons Attribution 3.0 license.'] = 'Shared content is covered by the Creative Commons Attribution 3.0 license.'; $a->strings['The profile address specified does not provide adequate information.'] = 'Die angegebene Profiladresse liefert unzureichende Informationen.'; diff --git a/view/de/wallwall_item.tpl b/view/de/wallwall_item.tpl deleted file mode 100644 index b9a655582d..0000000000 --- a/view/de/wallwall_item.tpl +++ /dev/null @@ -1,41 +0,0 @@ -
-
- -
- - $owner_name -
-
Wall-To-Wall
-
- - $name -
-
- $lock - $name to $owner_name via Wall-To-Wall:
-
$ago
-
$location
- $vote -
-
-
-
$title
-
-
$body
-
-
- $plink - $drop -
-
-
- -
$dislike
-
-
- $comment -
-
- -
- diff --git a/view/fr/wallwall_item.tpl b/view/fr/wallwall_item.tpl deleted file mode 100644 index 02af17a64a..0000000000 --- a/view/fr/wallwall_item.tpl +++ /dev/null @@ -1,41 +0,0 @@ -
-
- -
- - $owner_name -
-
Wall-To-Wall
-
- - $name -
-
- $lock - $name to $owner_name via Wall-To-Wall:
-
$ago
-
$location
- $vote -
-
-
-
$title
-
-
$body
-
-
- $plink - $drop -
-
-
- -
$dislike
-
-
- $comment -
-
- -
- diff --git a/view/it/strings.php b/view/it/strings.php index 2b4a84d052..7f4b3eddd5 100644 --- a/view/it/strings.php +++ b/view/it/strings.php @@ -140,6 +140,10 @@ $a->strings['Item not found.'] = 'Elemento non trovato.'; $a->strings['Private Message'] = 'Messaggio privato'; $a->strings['This is you'] = 'Questo sei tu'; $a->strings['View $name\'s profile'] = 'Guarda il profilo di $name'; +$a->strings['View $owner_name\'s profile'] = Guarda il profilo di $owner_name'; +$a->strings['to'] = 'a'; +$a->strings['Wall-to-Wall'] = 'Bacheca-A-Bacheca'; +$a->strings['via Wall-To-Wall:'] = 'via Bacheca-A-Bacheca'; $a->strings['Item has been removed.'] = 'L\'elemento è stato rimosso.'; $a->strings['The profile address specified does not provide adequate information.'] = 'L\'indirizzo del profilo specificato non fornisce adeguate informazioni'; $a->strings['Limited profile. This person will be unable to receive direct/personal notifications from you.'] = 'Profilo limitato. Questa persona non sara\' in grado di ricevere nofiche dirette/personali da te.'; diff --git a/view/it/wallwall_item.tpl b/view/it/wallwall_item.tpl deleted file mode 100644 index bcb420748f..0000000000 --- a/view/it/wallwall_item.tpl +++ /dev/null @@ -1,41 +0,0 @@ -
-
- -
- - $owner_name -
-
Bacheca-A-Bacheca
-
- - $name -
-
- $lock - $name a $owner_name via Bacheca-A-Bacheca:
-
$ago
-
$location
- $vote -
-
-
-
$title
-
-
$body
-
-
- $plink - $drop -
-
-
- -
$dislike
-
-
- $comment -
-
- -
- diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 2bffc2f17d..3877fb2ea6 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -849,6 +849,10 @@ input#dfrn-url { float: left; } +.wallwall .wall-item-photo-end { + clear: both; +} + .wall-item-arrowphoto-wrapper { margin-top: 40px; margin-right: 20px; diff --git a/view/wall_item.tpl b/view/wall_item.tpl index 7f5f3af265..1cad411182 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -2,13 +2,13 @@
- +
$lock - $name + $name
$ago
$location
$vote diff --git a/view/en/wallwall_item.tpl b/view/wallwall_item.tpl similarity index 72% rename from view/en/wallwall_item.tpl rename to view/wallwall_item.tpl index 02af17a64a..6e61ce4f0d 100644 --- a/view/en/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -2,17 +2,18 @@
-
Wall-To-Wall
+
$wall
+
$lock - $name to $owner_name via Wall-To-Wall:
+ $name $to $owner_name $vwall
$ago
$location
$vote From 56415329368d3c93b64ad6490d56a2f0ff82ab68 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 24 Feb 2011 02:46:06 -0800 Subject: [PATCH 10/11] yet another template --- mod/display.php | 2 +- mod/network.php | 2 +- mod/photos.php | 2 +- mod/profile.php | 2 +- view/de/wall_item_drop.tpl | 4 ---- view/en/wall_item_drop.tpl | 2 -- view/fr/wall_item_drop.tpl | 2 -- view/it/wall_item_drop.tpl | 9 --------- view/wall_item_drop.tpl | 2 ++ 9 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 view/de/wall_item_drop.tpl delete mode 100644 view/en/wall_item_drop.tpl delete mode 100644 view/fr/wall_item_drop.tpl delete mode 100644 view/it/wall_item_drop.tpl create mode 100644 view/wall_item_drop.tpl diff --git a/mod/display.php b/mod/display.php index da931335c1..7cefc42e6c 100644 --- a/mod/display.php +++ b/mod/display.php @@ -234,7 +234,7 @@ function display_content(&$a) { } if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) - $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); + $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); else $drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id'])); diff --git a/mod/network.php b/mod/network.php index a9de402a83..68c9656e50 100644 --- a/mod/network.php +++ b/mod/network.php @@ -354,7 +354,7 @@ function network_content(&$a, $update = 0) { )); } - $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); + $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); diff --git a/mod/photos.php b/mod/photos.php index bd48cfc9f9..c1c6a4133f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1148,7 +1148,7 @@ function photos_content(&$a) { $drop = ''; if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) - $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); + $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); $o .= replace_macros($template,array( diff --git a/mod/profile.php b/mod/profile.php index 5cab6662af..15a3a861f9 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -339,7 +339,7 @@ function profile_content(&$a, $update = 0) { if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) $dropping = true; - $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'])); + $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete'))); $like = ((isset($alike[$item['id']])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); diff --git a/view/de/wall_item_drop.tpl b/view/de/wall_item_drop.tpl deleted file mode 100644 index 7b267f314a..0000000000 --- a/view/de/wall_item_drop.tpl +++ /dev/null @@ -1,4 +0,0 @@ -
Löschen
-
diff --git a/view/en/wall_item_drop.tpl b/view/en/wall_item_drop.tpl deleted file mode 100644 index 66777db15c..0000000000 --- a/view/en/wall_item_drop.tpl +++ /dev/null @@ -1,2 +0,0 @@ -
Delete
-
diff --git a/view/fr/wall_item_drop.tpl b/view/fr/wall_item_drop.tpl deleted file mode 100644 index 66777db15c..0000000000 --- a/view/fr/wall_item_drop.tpl +++ /dev/null @@ -1,2 +0,0 @@ -
Delete
-
diff --git a/view/it/wall_item_drop.tpl b/view/it/wall_item_drop.tpl deleted file mode 100644 index f4ef81c52c..0000000000 --- a/view/it/wall_item_drop.tpl +++ /dev/null @@ -1,9 +0,0 @@ -
- -Cancella - -
- -
-
- diff --git a/view/wall_item_drop.tpl b/view/wall_item_drop.tpl new file mode 100644 index 0000000000..9aa565f69b --- /dev/null +++ b/view/wall_item_drop.tpl @@ -0,0 +1,2 @@ +
$delete
+
From 8ed085c64e4fb097394d0cc93f8744606c15527b Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 24 Feb 2011 03:48:21 -0800 Subject: [PATCH 11/11] don't truncate names across multi-byte char sequences --- include/acl_selectors.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 94f51a9ff5..9467531d9f 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -26,7 +26,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) { $selected = " selected=\"selected\" "; else $selected = ''; - $trimmed = substr($rr['name'],0,12); + $trimmed = mb_substr($rr['name'],0,12); $o .= "\r\n"; } @@ -89,7 +89,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p else $selected = ''; - $trimmed = substr($rr['name'],0,22); + $trimmed = mb_substr($rr['name'],0,22); $o .= "\r\n"; }