aboutsummaryrefslogtreecommitdiffstats
path: root/include/comanche.php
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-19 13:41:38 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-19 13:41:38 -0700
commit82f2765f7bbc990c7106b3d1b3185c8bf04112fb (patch)
treee94602dd0874209a188d8befec108ef05798de4b /include/comanche.php
parent01efda6850db9347351f290da6026d6cbc0abe49 (diff)
parent71117628bc0cba92b75caea46379b45c64c2cf43 (diff)
downloadvolse-hubzilla-82f2765f7bbc990c7106b3d1b3185c8bf04112fb.tar.gz
volse-hubzilla-82f2765f7bbc990c7106b3d1b3185c8bf04112fb.tar.bz2
volse-hubzilla-82f2765f7bbc990c7106b3d1b3185c8bf04112fb.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'include/comanche.php')
-rw-r--r--include/comanche.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/comanche.php b/include/comanche.php
index fcf50d67e..e0d3af985 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -133,7 +133,19 @@ function comanche_get_channel_id() {
return $channel_id;
}
-function comanche_block($name) {
+function comanche_block($s) {
+ $var = array();
+ $matches = array();
+ $name = $s;
+
+ $cnt = preg_match_all("/\[var=(.*?)\](.*?)\[\/var\]/ism", $s, $matches, PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $var[$mtch[1]] = $mtch[2];
+ $name = str_replace($mtch[0], '', $name);
+ }
+ }
+
$o = '';
$channel_id = comanche_get_channel_id();
@@ -143,12 +155,12 @@ function comanche_block($name) {
dbesc($name)
);
if($r) {
- $o = '<div class="bblock">';
+ $o .= (($var['wrap'] == 'none') ? '' : '<div class="bblock">');
if($r[0]['title'])
$o .= '<h3>' . $r[0]['title'] . '</h3>';
$o .= prepare_text($r[0]['body'], $r[0]['mimetype']);
- $o .= '</div>';
+ $o .= (($var['wrap'] == 'none') ? '' : '</div>');
}
}