From b99cb511ca665bad0022de2ca43b5de78b3ffdbf Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Jan 2012 16:38:24 -0800 Subject: comment preview --- include/conversation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index ec1fd4152..d4d6a5569 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -129,7 +129,7 @@ function localize_item(&$item){ * that are based on unique features of the calling module. * */ -function conversation(&$a, $items, $mode, $update) { +function conversation(&$a, $items, $mode, $update, $preview = false) { require_once('bbcode.php'); @@ -287,7 +287,7 @@ function conversation(&$a, $items, $mode, $update) { '$like' => '', '$dislike' => '', '$comment' => '', - '$conv' => array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context')), + '$conv' => (($preview) ? '' : array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), '$wait' => t('Please wait'), )); @@ -483,6 +483,7 @@ function conversation(&$a, $items, $mode, $update) { '$myphoto' => $a->contact['thumb'], '$comment' => t('Comment'), '$submit' => t('Submit'), + '$preview' => t('Preview'), '$ww' => (($mode === 'network') ? $commentww : '') )); } -- cgit v1.2.3 From c3ada095f4156bba01e77d2d250d5821ba5e859e Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Jan 2012 20:40:48 -0800 Subject: network select widget --- include/contact_widgets.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'include') diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 3a21ff2c6..424f2997e 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -40,3 +40,36 @@ function findpeople_widget() { } +function networks_widget($baseurl,$selected = '') { + + $a = get_app(); + + if(! local_user()) + return ''; + + + $r = q("select distinct(network) from contact where uid = %d", + intval(local_user()) + ); + + $nets = array(); + if(count($r)) { + require_once('include/contact_selectors.php'); + foreach($r as $rr) { + if($rr['network']) + $nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' )); + } + } + + return replace_macros(get_markup_template('nets.tpl'),array( + '$title' => t('Networks'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('All Networks'), + '$nets' => $nets, + '$base' => $baseurl, + + )); +} + + -- cgit v1.2.3