From 2fe8bae7a59ae61b2b0708a480d250e46dab7673 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 8 May 2014 17:08:34 -0700 Subject: show hidden connections in contact block if and only if the observer is the profile owner --- mod/viewconnections.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/viewconnections.php b/mod/viewconnections.php index f5e7ab213..b6a6b483c 100644 --- a/mod/viewconnections.php +++ b/mod/viewconnections.php @@ -28,11 +28,19 @@ function viewconnections_content(&$a) { return; } + $is_owner = ((local_user() && local_user() == $a->profile['uid']) ? true : false); + + $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF; + $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED; + if(! $is_owner) { + $abook_flags = $abook_flags | ABOOK_FLAGS_HIDDEN; + $xchan_flags = $xchan_flags | XCHAN_FLAGS_HIDDEN; + } $r = q("SELECT count(*) as total FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d ) and not ( xchan_flags & %d ) ", intval($a->profile['uid']), - intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF), - intval(XCHAN_FLAGS_HIDDEN|XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED) + intval($abook_flags), + intval($xchan_flags) ); if($r) { $a->set_pager_total($r[0]['total']); @@ -40,8 +48,8 @@ function viewconnections_content(&$a) { $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not ( abook_flags & %d ) and not ( xchan_flags & %d ) order by xchan_name LIMIT %d , %d ", intval($a->profile['uid']), - intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF), - intval(XCHAN_FLAGS_HIDDEN|XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED), + intval($abook_flags), + intval($xchan_flags), intval($a->pager['start']), intval($a->pager['itemspage']) ); -- cgit v1.2.3 From 22b79207f9c30ce54d65e134303bd179ea21b377 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 8 May 2014 19:59:26 -0700 Subject: event form hard-wired tinymce=on, made selectable --- mod/events.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/events.php b/mod/events.php index d243f61ba..8bf8c6ce1 100755 --- a/mod/events.php +++ b/mod/events.php @@ -158,8 +158,17 @@ function events_content(&$a) { } + $plaintext = true; + + if(feature_enabled(local_user(),'richtext')) + $plaintext = false; + + $htpl = get_markup_template('event_head.tpl'); - $a->page['htmlhead'] .= replace_macros($htpl,array('$baseurl' => $a->get_baseurl())); + $a->page['htmlhead'] .= replace_macros($htpl,array( + '$baseurl' => $a->get_baseurl(), + '$editselect' => (($plaintext) ? 'none' : 'textareas') + )); $o =""; // tabs @@ -400,7 +409,6 @@ function events_content(&$a) { if($orig_event['event_xchan']) $sh_checked .= ' disabled="disabled" '; - $tpl = get_markup_template('event_form.tpl'); $sdt = ((x($orig_event)) ? $orig_event['start'] : 'now'); $fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now'); @@ -439,6 +447,7 @@ function events_content(&$a) { 'deny_gid' => $channel['channel_deny_gid'] ); + $tpl = get_markup_template('event_form.tpl'); $o .= replace_macros($tpl,array( -- cgit v1.2.3 From ed5cebd3d6b87a5c2254f3fa48b03d93558fa7bc Mon Sep 17 00:00:00 2001 From: root Date: Sat, 10 May 2014 11:15:27 -0700 Subject: Made code changes to serve higher resolution images in displays with high pixel density. --- mod/photo.php | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/photo.php b/mod/photo.php index 1319f9569..b351ce17f 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -80,6 +80,22 @@ function photo_init(&$a) { * Other photos */ + /* Check for a cookie to indicate display pixel density, in order to detect high-resolution + displays. This procedure was derived from the "Retina Images" by Jeremey Worboys, + used in accordance with the Creative Commons Attribution 3.0 Unported License. + Project link: https://github.com/Retina-Images/Retina-Images + License link: http://creativecommons.org/licenses/by/3.0/ + */ + $cookie_value = false; + if (isset($_COOKIE['devicePixelRatio'])) { + $cookie_value = intval($_COOKIE['devicePixelRatio']); + } + else { + // Force revalidation of cache on next request + $cache_directive = 'no-cache'; + $status = 'no cookie'; + } + $resolution = 0; if(strpos($photo,'.') !== false) @@ -88,7 +104,24 @@ function photo_init(&$a) { if(substr($photo,-2,1) == '-') { $resolution = intval(substr($photo,-1,1)); $photo = substr($photo,0,-2); + // Serve high-resolution images regardless (this is rude): + // [Note: this can be improved by setting a cookie to indicate that the user is viewing on a high-resolution display] + if ($resolution == 2 && ($cookie_value > 1)) + { + $resolution = 1; + } } + + // If using resolution 1, make sure it exists before proceeding: + if ($resolution == 1) + { + $r = q("SELECT uid FROM photo WHERE resource_id = '%s' AND scale = %d LIMIT 1", + dbesc($photo), + intval($resolution) + ); + if (!($r)) + $resolution = 2; + } $r = q("SELECT uid FROM photo WHERE resource_id = '%s' AND scale = %d LIMIT 1", dbesc($photo), @@ -125,7 +158,7 @@ function photo_init(&$a) { dbesc($photo), intval($resolution) ); - + if($r) { logger('mod_photo: forbidden. ' . $a->query_string); $observer = $a->get_observer(); -- cgit v1.2.3 From 874b8d40ff14e39bac4875efbaee2f24121d20bd Mon Sep 17 00:00:00 2001 From: root Date: Sat, 10 May 2014 11:22:00 -0700 Subject: Changed some comments. --- mod/photo.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/photo.php b/mod/photo.php index b351ce17f..9302278b6 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -104,8 +104,7 @@ function photo_init(&$a) { if(substr($photo,-2,1) == '-') { $resolution = intval(substr($photo,-1,1)); $photo = substr($photo,0,-2); - // Serve high-resolution images regardless (this is rude): - // [Note: this can be improved by setting a cookie to indicate that the user is viewing on a high-resolution display] + // If viewing on a high-res screen, attempt to serve a higher resolution image: if ($resolution == 2 && ($cookie_value > 1)) { $resolution = 1; -- cgit v1.2.3 From 2c27ba66a5a05a52a6f0144ebd3e65562edba14b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 13 May 2014 20:17:52 -0700 Subject: zrlify (turn into zmg) any relevant img tags in a post. --- mod/item.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 164b345f0..9470a2b9c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -440,6 +440,11 @@ function item_post(&$a) { $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','red_unescape_codeblock',$body); + // fix any img tags that should be zmg + + $body = preg_replace_callback('/\[img(.*?)\](.*?)\[\/img\]/ism','red_zrlify_img_callback',$body); + + /** * -- cgit v1.2.3 From 722b6c78cbf8f0eb53c29fcc0995a488cf862031 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 14 May 2014 03:10:36 -0700 Subject: fix author delete (non-owner) --- mod/item.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 9470a2b9c..68582e580 100644 --- a/mod/item.php +++ b/mod/item.php @@ -852,10 +852,10 @@ function item_content(&$a) { require_once('include/security.php'); if((argc() == 3) && (argv(1) === 'drop') && intval(argv(2))) { + require_once('include/items.php'); - $i = q("select id, uid, author_xchan, owner_xchan, source_xchan, item_restrict from item where id = %d and uid = %d limit 1", - intval(argv(2)), - intval(local_user()) + $i = q("select id, uid, author_xchan, owner_xchan, source_xchan, item_restrict from item where id = %d limit 1", + intval(argv(2)) ); if($i) { -- cgit v1.2.3 From e68bb132a701d170ef1e13752a8f64107eac7353 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 May 2014 16:43:42 -0700 Subject: some backend stuff for apps --- mod/apps.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'mod') diff --git a/mod/apps.php b/mod/apps.php index 43540a3de..678af74e7 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -1,17 +1,21 @@ get_apps(); - if(count($apps) == 0) - notice( t('No installed applications.') . EOL); + $apps = get_system_apps(); + + $o .= print_r($apps,true); + + return $o; - $tpl = get_markup_template("apps.tpl"); - return replace_macros($tpl, array( - '$title' => t('Applications'), - '$apps' => $apps, - )); +// $tpl = get_markup_template("apps.tpl"); +// return replace_macros($tpl, array( +// '$title' => t('Applications'), +// '$apps' => $apps, +// )); } -- cgit v1.2.3 From 077b97eac46989cfc7aadc14f3c4974fb31473b3 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 May 2014 19:54:37 -0700 Subject: the app menu takes form --- mod/apps.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/apps.php b/mod/apps.php index 678af74e7..51d610703 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -8,14 +8,14 @@ function apps_content(&$a) { $apps = get_system_apps(); - $o .= print_r($apps,true); +// $o .= print_r($apps,true); - return $o; +// return $o; -// $tpl = get_markup_template("apps.tpl"); -// return replace_macros($tpl, array( -// '$title' => t('Applications'), -// '$apps' => $apps, -// )); + + return replace_macros(get_markup_template('apps.tpl'), array( + '$title' => t('Applications'), + '$apps' => $apps, + )); } -- cgit v1.2.3 From 2fdc13e91d3b0ccd514a13fd7f475f045656b23f Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 May 2014 20:20:20 -0700 Subject: some sidebar content (doesn't yet do anything) --- mod/apps.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/apps.php b/mod/apps.php index 51d610703..3d06abd49 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -14,7 +14,7 @@ function apps_content(&$a) { return replace_macros(get_markup_template('apps.tpl'), array( - '$title' => t('Applications'), + '$title' => t('Apps'), '$apps' => $apps, )); -- cgit v1.2.3 From fc0967b84b5e1301c0ce3a9a41c00985ce16bc82 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 May 2014 18:08:49 -0700 Subject: most of the remaining apps basic infrastructure except a form to create the things. Don't let this fool you - there is still a lot of work, but there isn't a whole lot of work to create a demo; in fact you can demo it now. --- mod/appman.php | 26 ++++++++++++++++++++++++++ mod/apps.php | 26 ++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 mod/appman.php (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php new file mode 100644 index 000000000..48389a637 --- /dev/null +++ b/mod/appman.php @@ -0,0 +1,26 @@ + t('Apps'), + '$apps' => $apps, + )); + } - return replace_macros(get_markup_template('apps.tpl'), array( + if(argc() == 3 && argv(2) == 'edit') + $mode = 'edit'; + else + $mode = 'list'; + + $apps = array(); + $list = app_list(local_user()); + if($list) { + foreach($list as $app) + $apps[] = app_render(app_encode($app),$mode); + } + + return replace_macros(get_markup_template('myapps.tpl'), array( '$title' => t('Apps'), '$apps' => $apps, )); -- cgit v1.2.3 From cad481d94fb8cfb350e931620c788f1a2a47a994 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 May 2014 21:22:19 -0700 Subject: unfinished work for creating app --- mod/appman.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index 48389a637..4fc247a42 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -22,5 +22,49 @@ function appman_post(&$a) { app_destroy(local_user(),$papp); } + if($_SESSION['return_url']) + goaway(z_root() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/apps/personal'); + + +} + + +function appman_content(&$a) { + + if(! local_user()) { + notice( t('Permission denied.') . EOL); + return; + } + + $channel = $a->get_channel(); + $app = null; + + if($_REQUEST['appid']) { + $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", + dbesc($_REQUEST['appid']), + dbesc(local_user()) + ); + if($r) + $app = $r[0]; + } + + return replace_macros(get_markup_template('app_create.tpl'), array( + + '$banner' => t('Create App'), + '$app' => $app, + '$guid' => (($app) ? $app['app_id'] : ''), + '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']), + '$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']), + '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')), + '$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')), + '$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''), + '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_url'] : ''), t('80 x 80 pixels - optional')), + '$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''), + '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''), + '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''), + '$submit' => t('Submit') + )); + } \ No newline at end of file -- cgit v1.2.3 From 5d9f924642872e30c83ac0de4807e0beb2c15011 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 May 2014 22:25:36 -0700 Subject: more app work --- mod/appman.php | 60 ++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index 4fc247a42..6570e2fd9 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -7,6 +7,28 @@ function appman_post(&$a) { if(! local_user()) return; + if($_POST['url']) { + $arr = array( + 'uid' => intval($_REQUEST['uid']), + 'url' => escape_tags($_REQUEST['url']), + 'guid' => escape_tags($_REQUEST['guid']), + 'author' => escape_tags($_REQUEST['author']), + 'addr' => escape_tags($_REQUEST['addr']), + 'name' => escape_tags($_REQUEST['name']), + 'desc' => escape_tags($_REQUEST['desc']), + 'photo' => escape_tags($_REQUEST['photo']), + 'version' => escape_tags($_REQUEST['version']), + 'price' => escape_tags($_REQUEST['price']), + 'sig' => escape_tags($_REQUEST['sig']) + ); + + $_REQUEST['appid'] = app_install(local_user(),$arr); + if(app_installed(local_user(),$app)) + info( t('App installed.') . EOL); + return; + } + + $papp = app_decode($_POST['papp']); if(! is_array($papp)) { @@ -39,7 +61,7 @@ function appman_content(&$a) { $channel = $a->get_channel(); $app = null; - + $embed = null; if($_REQUEST['appid']) { $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($_REQUEST['appid']), @@ -47,24 +69,26 @@ function appman_content(&$a) { ); if($r) $app = $r[0]; + $embed = array('embed', t('Embed code'), app_encode($app,true),''); + } - return replace_macros(get_markup_template('app_create.tpl'), array( - - '$banner' => t('Create App'), - '$app' => $app, - '$guid' => (($app) ? $app['app_id'] : ''), - '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']), - '$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']), - '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')), - '$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')), - '$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''), - '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_url'] : ''), t('80 x 80 pixels - optional')), - '$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''), - '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''), - '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''), - '$submit' => t('Submit') - )); - + return replace_macros(get_markup_template('app_create.tpl'), array( + + '$banner' => t('Create App'), + '$app' => $app, + '$guid' => (($app) ? $app['app_id'] : ''), + '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']), + '$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']), + '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')), + '$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')), + '$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''), + '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_url'] : ''), t('80 x 80 pixels - optional')), + '$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''), + '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''), + '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''), + '$embed' => $embed, + '$submit' => t('Submit') + )); } \ No newline at end of file -- cgit v1.2.3 From 9365b7f632e06183946c78c8a70de95f36f3fef3 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 May 2014 22:45:56 -0700 Subject: this is why I didn't see the "app installed" message.... --- mod/appman.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index 6570e2fd9..6d5127b51 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -23,7 +23,7 @@ function appman_post(&$a) { ); $_REQUEST['appid'] = app_install(local_user(),$arr); - if(app_installed(local_user(),$app)) + if(app_installed(local_user(),$arr)) info( t('App installed.') . EOL); return; } -- cgit v1.2.3 From 77ca117218382b57e2d0590466d9fc38dc016e80 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 May 2014 01:55:32 -0700 Subject: make it possible to edit/delete apps via /apps/personal/edit --- mod/apps.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/apps.php b/mod/apps.php index aeedb5cda..34bbc7142 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -27,8 +27,11 @@ function apps_content(&$a) { $apps = array(); $list = app_list(local_user()); if($list) { - foreach($list as $app) + foreach($list as $app) { + if($mode == 'edit') + $app['alt_url'] = z_root() . '/appman/?f=&appid=' . $app['app_id']; $apps[] = app_render(app_encode($app),$mode); + } } return replace_macros(get_markup_template('myapps.tpl'), array( -- cgit v1.2.3 From 751fda97045ad4e399e9a01cc14d8eb058b361a8 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 May 2014 20:54:09 -0700 Subject: more app work --- mod/appman.php | 8 ++++++-- mod/apps.php | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index 6d5127b51..15f27676c 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -44,6 +44,10 @@ function appman_post(&$a) { app_destroy(local_user(),$papp); } + if($_POST['edit']) { + return; + } + if($_SESSION['return_url']) goaway(z_root() . '/' . $_SESSION['return_url']); goaway(z_root() . '/apps/personal'); @@ -58,7 +62,7 @@ function appman_content(&$a) { notice( t('Permission denied.') . EOL); return; } - +logger('content'); $channel = $a->get_channel(); $app = null; $embed = null; @@ -75,7 +79,7 @@ function appman_content(&$a) { return replace_macros(get_markup_template('app_create.tpl'), array( - '$banner' => t('Create App'), + '$banner' => (($app) ? t('Edit App') : t('Create App')), '$app' => $app, '$guid' => (($app) ? $app['app_id'] : ''), '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']), diff --git a/mod/apps.php b/mod/apps.php index 34bbc7142..e88c54c66 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -28,8 +28,6 @@ function apps_content(&$a) { $list = app_list(local_user()); if($list) { foreach($list as $app) { - if($mode == 'edit') - $app['alt_url'] = z_root() . '/appman/?f=&appid=' . $app['app_id']; $apps[] = app_render(app_encode($app),$mode); } } -- cgit v1.2.3 From 71a4abe293c12bed82f18a8118c7d0530009d369 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 May 2014 21:33:31 -0700 Subject: Time to flip the switch. --- mod/home.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/home.php b/mod/home.php index 05626dcb5..862f6303c 100644 --- a/mod/home.php +++ b/mod/home.php @@ -12,9 +12,11 @@ function home_init(&$a) { $channel = $a->get_channel(); if(local_user() && $channel && $channel['xchan_url']) { - $dest = get_pconfig(local_user(),'system','startpage'); + $dest = $channel['channel_startpage']; if(! $dest) - $dest = z_root() . '/network'; + $dest = get_pconfig(local_user(),'system','startpage'); + if(! $dest) + $dest = z_root() . '/apps'; goaway($dest); } -- cgit v1.2.3 From 20343365fd10c36e26182c26f1008474ac433f91 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 22 May 2014 19:40:31 +0100 Subject: Fix photo updates in appman. --- mod/appman.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index 15f27676c..49adcd7fa 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -87,7 +87,7 @@ logger('content'); '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')), '$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')), '$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''), - '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_url'] : ''), t('80 x 80 pixels - optional')), + '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_photo'] : ''), t('80 x 80 pixels - optional')), '$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''), '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''), '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''), @@ -95,4 +95,4 @@ logger('content'); '$submit' => t('Submit') )); -} \ No newline at end of file +} -- cgit v1.2.3 From 6f570a7df37e017184700cd0803fdd5ce9444cb1 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 22 May 2014 16:35:43 -0700 Subject: mod_display: match "message_id begins with xxxx" as well as "message_id = xxxx" --- mod/display.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index f4d4c38c3..efc3265c8 100644 --- a/mod/display.php +++ b/mod/display.php @@ -77,8 +77,8 @@ function display_content(&$a, $update = 0, $load = false) { $target_item = null; - $r = q("select id, uid, mid, parent_mid, item_restrict from item where mid = '%s' limit 1", - dbesc($item_hash) + $r = q("select id, uid, mid, parent_mid, item_restrict from item where mid like '%s' limit 1", + dbesc($item_hash . '%') ); if($r) { @@ -149,6 +149,7 @@ function display_content(&$a, $update = 0, $load = false) { if($load || ($_COOKIE['jsAvailable'] != 1)) { $r = null; + if(local_user()) { $r = q("SELECT * from item WHERE item_restrict = 0 @@ -177,7 +178,6 @@ function display_content(&$a, $update = 0, $load = false) { ); } - } else { $r = array(); -- cgit v1.2.3 From 059b6cd411e7034bd6b1b6de02dc34984259bd11 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 23 May 2014 15:30:22 -0700 Subject: add randprof app and do away with the universally hated chanview-iframe mode. It's gone. Please do not try and bring it back. We are not Diaspora and we have no desire to be like them. ("And they're all made out of ticky-tacky and they all look just the same"). Our profiles do not have to look the same and they won't anyway. We don't have to sugar coat the fact that some of the content in the matrix doesn't look like the rest of the content in the matrix. --- mod/chanview.php | 16 +++++++++------- mod/settings.php | 7 +++---- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'mod') diff --git a/mod/chanview.php b/mod/chanview.php index ca3410c8f..449a98bb1 100644 --- a/mod/chanview.php +++ b/mod/chanview.php @@ -84,15 +84,17 @@ function chanview_content(&$a) { $url = zid($url); // let somebody over-ride the iframed viewport presentation + // or let's just declare this a failed experiment. - if((! local_user()) || (get_pconfig(local_user(),'system','chanview_full'))) - goaway($url); +// if((! local_user()) || (get_pconfig(local_user(),'system','chanview_full'))) + + goaway($url); - $o = replace_macros(get_markup_template('chanview.tpl'),array( - '$url' => $url, - '$full' => t('toggle full screen mode') - )); +// $o = replace_macros(get_markup_template('chanview.tpl'),array( +// '$url' => $url, +// '$full' => t('toggle full screen mode') +// )); - return $o; +// return $o; } \ No newline at end of file diff --git a/mod/settings.php b/mod/settings.php index 3ab34f145..ad3eff261 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -150,12 +150,12 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','mobile_theme',$mobile_theme); } - $chanview_full = ((x($_POST,'chanview_full')) ? intval($_POST['chanview_full']) : 0); +// $chanview_full = ((x($_POST,'chanview_full')) ? intval($_POST['chanview_full']) : 0); set_pconfig(local_user(),'system','update_interval', $browser_update); set_pconfig(local_user(),'system','itemspage', $itemspage); set_pconfig(local_user(),'system','no_smilies',$nosmile); - set_pconfig(local_user(),'system','chanview_full',$chanview_full); +// set_pconfig(local_user(),'system','chanview_full',$chanview_full); if ($theme == $a->channel['channel_theme']){ @@ -736,7 +736,7 @@ function settings_content(&$a) { $nosmile = get_pconfig(local_user(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 - $chanview = intval(get_pconfig(local_user(),'system','chanview_full')); +// $chanview = intval(get_pconfig(local_user(),'system','chanview_full')); $theme_config = ""; if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){ @@ -757,7 +757,6 @@ function settings_content(&$a) { '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), '$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')), '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''), - '$chanview_full' => array('chanview_full', t('Do not view remote profiles in frames'), $chanview, t('By default open in a sub-window of your own site')), '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, )); -- cgit v1.2.3 From f7d99ed7ffb7ade16162b69d1b05b5a6133a8a8d Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 May 2014 18:24:27 -0700 Subject: fix the intermittent theme preview --- mod/settings.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/settings.php b/mod/settings.php index ad3eff261..e1ae0b8ec 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -714,7 +714,7 @@ function settings_content(&$a) { $unsupported = file_exists('view/theme/' . $th . '/unsupported'); $is_mobile = file_exists('view/theme/' . $th . '/mobile'); if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ - $theme_name = (($is_experimental) ? sprintf("%s - \x28Experimental\x29", $f) : $f); + $theme_name = (($is_experimental) ? sprintf(t('%s - (Experimental)'), $f) : $f); if($is_mobile) { $mobile_themes[$f]=$theme_name; } @@ -736,8 +736,6 @@ function settings_content(&$a) { $nosmile = get_pconfig(local_user(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 -// $chanview = intval(get_pconfig(local_user(),'system','chanview_full')); - $theme_config = ""; if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){ require_once($themeconfigfile); -- cgit v1.2.3 From 03e2d2ee8f048faa3328a2fdbb6c252726284db4 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 May 2014 22:25:13 -0700 Subject: missing "app installed" info msg --- mod/appman.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index 49adcd7fa..a782cb0eb 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -23,8 +23,10 @@ function appman_post(&$a) { ); $_REQUEST['appid'] = app_install(local_user(),$arr); + if(app_installed(local_user(),$arr)) info( t('App installed.') . EOL); + return; } @@ -38,6 +40,8 @@ function appman_post(&$a) { if($_POST['install']) { app_install(local_user(),$papp); + if(app_installed(local_user(),$papp)) + info( t('App installed.') . EOL); } if($_POST['delete']) { -- cgit v1.2.3 From 810515f1a10082ac7bc75550089ce9c40b44b003 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 May 2014 22:42:07 -0700 Subject: auto-highlight app embed code on click --- mod/appman.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/appman.php b/mod/appman.php index a782cb0eb..0cc108079 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -77,7 +77,7 @@ logger('content'); ); if($r) $app = $r[0]; - $embed = array('embed', t('Embed code'), app_encode($app,true),''); + $embed = array('embed', t('Embed code'), app_encode($app,true),'', 'onclick="this.select();"'); } -- cgit v1.2.3 From 30eb1b494a403acf0bcad461907ece77c707d574 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 May 2014 17:58:49 -0700 Subject: moods: simplify 'xyz is tired' rather than 'xyz is currently tired'. This is possible now that we have translation contexts, as before '$1 is $2' was ambiguous without a context - in this case 'mood'. --- mod/mood.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'mod') diff --git a/mod/mood.php b/mod/mood.php index 5075f622d..5508fcb5a 100755 --- a/mod/mood.php +++ b/mod/mood.php @@ -60,7 +60,7 @@ function mood_init(&$a) { $mid = item_message_id(); - $action = sprintf( t('%1$s is currently %2$s'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]); + $action = sprintf( t('%1$s is %2$s','mood'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]); $item_flags = ITEM_WALL|ITEM_ORIGIN|ITEM_UNSEEN; if(! $parent_mid) $item_flags |= ITEM_THREAD_TOP; @@ -93,14 +93,7 @@ function mood_init(&$a) { $item_id = $post['item_id']; if($item_id) { -// q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", -// dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id), -// intval($uid), -// intval($item_id) -// ); - proc_run('php',"include/notifier.php","activity", $item_id); - } call_hooks('post_local_end', $arr); -- cgit v1.2.3 From 2a6d7b6a079a565afc0200fe160cb2402ed7c0a3 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 May 2014 21:42:46 -0700 Subject: cleanup dead directory entries. This was a real b#tch, so keep your eye out for issues - which you shouldn't see until next weekend when this is scheduled to run. We're only setting flags, so if anything goes wrong we should be able to recover without too much pain. --- mod/post.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mod') diff --git a/mod/post.php b/mod/post.php index 1f817aa40..05053e798 100644 --- a/mod/post.php +++ b/mod/post.php @@ -646,6 +646,28 @@ function post_post(&$a) { intval($hub['hubloc_id']) ); + // a dead hub came back to life - reset any tombstones we might have + + if($hub['hubloc_status'] & HUBLOC_OFFLINE) { + q("update hubloc set hubloc_status = (hubloc_status ^ %d) where hubloc_id = %d limit 1", + intval(HUBLOC_OFFLINE), + intval($hub['hubloc_id']) + ); + if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) { + q("update hubloc set hubloc_flags = (hubloc_flags ^ %d) where hubloc_id = %d limit 1", + intval(HUBLOC_FLAGS_ORPHANCHECK), + intval($hub['hubloc_id']) + ); + } + q("update xchan set xchan_flags = (xchan_flags ^ %d) where (xchan_flags & %d) and xchan_hash = '%s' limit 1", + intval(XCHAN_FLAGS_ORPHAN), + intval(XCHAN_FLAGS_ORPHAN), + dbesc($hub['hubloc_hash']) + ); + } + + + /** * This hub has now been proven to be valid. * Any hub with the same URL and a different sitekey cannot be valid. -- cgit v1.2.3