From f559c91b7a7ff3e3e3bfd1ce430ce5b5615c07ea Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 5 May 2015 19:23:21 -0700 Subject: turn consensus items into diaspora polls for that network --- include/diaspora.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/diaspora.php b/include/diaspora.php index 75eac7681..4aa525838 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2427,6 +2427,20 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) { } */ + if($item['item_flags'] & ITEM_CONSENSUS) { + $poll = replace_macros(get_markup_template('diaspora_consensus.tpl'), array( + '$guid_q' => random_string(), + '$question' => '', + '$guid_y' => random_string(), + '$agree' => t('Agree'), + '$guid_n' => random_string(), + '$disagree' => t('Disagree'), + '$guid_a' => random_string(), + '$abstain' => t('Abstain') + )); + } + else + $poll = ''; $public = (($item['item_private']) ? 'false' : 'true'); @@ -2451,6 +2465,7 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) { $msg = replace_macros($tpl, array( '$body' => xmlify($body), '$guid' => $item['mid'], + '$poll' => $poll, '$handle' => xmlify($myaddr), '$public' => $public, '$created' => $created, -- cgit v1.2.3 From 9391f6f9052ae16c9789e04a2a96b8aa96adb220 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 6 May 2015 10:53:26 +0200 Subject: allow blocks to have custom classes and add a new template called zen which gives you an empty page to work with --- include/comanche.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/comanche.php b/include/comanche.php index c1a98ed6c..7115b5635 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -133,10 +133,11 @@ function comanche_get_channel_id() { return $channel_id; } -function comanche_block($s) { +function comanche_block($s, $class = '') { $var = array(); $matches = array(); $name = $s; + $class = (($class) ? $class : 'bblock widget'); $cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $s, $matches, PREG_SET_ORDER); if($cnt) { @@ -155,7 +156,7 @@ function comanche_block($s) { dbesc($name) ); if($r) { - $o .= (($var['wrap'] == 'none') ? '' : '
'); + $o .= (($var['wrap'] == 'none') ? '' : '
'); if($r[0]['title']) $o .= '

' . $r[0]['title'] . '

'; @@ -238,6 +239,13 @@ function comanche_region(&$a, $s) { } } + $cnt = preg_match_all("/\[block=(.*?)\](.*?)\[\/block\]/ism", $s, $matches, PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $s = str_replace($mtch[0],comanche_block(trim($mtch[2]),trim($mtch[1])),$s); + } + } + // need to modify this to accept parameters $cnt = preg_match_all("/\[widget=(.*?)\](.*?)\[\/widget\]/ism", $s, $matches, PREG_SET_ORDER); -- cgit v1.2.3