From fdc469ae4ce385e21c396b76628e0d427e173e92 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 14:04:00 -0800 Subject: move directory registration block before redirect --- mod/register.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/register.php b/mod/register.php index d97b3e0cd..d88536232 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; }} -- cgit v1.2.3 From 755c2245e8184ceee2ba3382e4f60143da31e6df Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 23 Feb 2011 15:16:12 -0800 Subject: move php path setting inside proc_run --- 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 +--- 13 files changed, 20 insertions(+), 63 deletions(-) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index 36f42f8e5..8e069b2bd 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 24e8bf106..1b42c13b8 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 cd7b0cff0..010272739 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 28441eae8..f3bd84669 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 8c6b181c0..c2487435e 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 c78c1f030..3a8ca4b7d 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 ef3be2c5e..466b0befa 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 d4835ba5e..bd48cfc9f 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 4f0d567f4..0f84a85c9 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 d74219501..4e3f03799 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 d88536232..97038def0 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 f662902d8..00cfa06e2 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 dbbac8bde..ebe07612e 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; -- cgit v1.2.3 From c98ed12e10ed9db8a69066fe4ed94f9ae84482cb Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 24 Feb 2011 02:32:46 -0800 Subject: generalise wallwall template and fix "via wall-to-wall" float --- mod/display.php | 6 +++++- mod/network.php | 6 +++++- mod/profile.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index bdf6a6f97..da931335c 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 79a2f2b38..a9de402a8 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 46d13298e..5cab6662a 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, -- cgit v1.2.3 From 56415329368d3c93b64ad6490d56a2f0ff82ab68 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 24 Feb 2011 02:46:06 -0800 Subject: yet another template --- mod/display.php | 2 +- mod/network.php | 2 +- mod/photos.php | 2 +- mod/profile.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index da931335c..7cefc42e6 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 a9de402a8..68c9656e5 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 bd48cfc9f..c1c6a4133 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 5cab6662a..15a3a861f 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']) : ''); -- cgit v1.2.3