From d1243c9ad78ce75ca82f0c07829e9f277428c149 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 19 Jul 2012 20:54:23 -0700 Subject: [PATCH] allow to prefill - url/poke?f=&c=nn - nn is contact id --- mod/poke.php | 19 ++++++++++++++++++- view/poke_content.tpl | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/mod/poke.php b/mod/poke.php index 851396e68b..f4660e624d 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -107,6 +107,21 @@ function poke_content(&$a) { return; } + $name = ''; + $id = ''; + + if(intval($_GET['c'])) { + $r = q("select id,name from contact where id = %d and uid = %d limit 1", + intval($_GET['c']), + intval(local_user()) + ); + if(count($r)) { + $name = $r[0]['name']; + $id = $r[0]['id']; + } + } + + $base = $a->get_baseurl(); $a->page['htmlhead'] .= ''; @@ -146,7 +161,9 @@ EOT; '$clabel' => t('Recipient'), '$choice' => t('Choose what you wish to do to recipient'), '$verbs' => $shortlist, - '$submit' => t('Submit') + '$submit' => t('Submit'), + '$name' => $name, + '$id' => $id )); return $o; diff --git a/view/poke_content.tpl b/view/poke_content.tpl index 09b3d8db43..f81d04c6c5 100644 --- a/view/poke_content.tpl +++ b/view/poke_content.tpl @@ -8,8 +8,8 @@
$clabel

- - + +