aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-25 20:55:27 -0700
committerfriendica <info@friendica.com>2012-06-25 20:55:27 -0700
commitfbaca4b74237c80c380d6ccf2bdddeec5ad4f013 (patch)
treeca1ca05c84f8bd17acab9749b674d3b23fdcd2a5 /include
parent53f0aee82d61b7d61fb2271eb7f41cacc2eaf8f3 (diff)
downloadvolse-hubzilla-fbaca4b74237c80c380d6ccf2bdddeec5ad4f013.tar.gz
volse-hubzilla-fbaca4b74237c80c380d6ccf2bdddeec5ad4f013.tar.bz2
volse-hubzilla-fbaca4b74237c80c380d6ccf2bdddeec5ad4f013.zip
event summary/title
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php1
-rw-r--r--include/event.php16
2 files changed, 15 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index e219d5383..effdd0be8 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -301,6 +301,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
if(x($ev,'desc') && x($ev,'start')) {
$sub = format_event_html($ev);
+ $Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text);
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",$sub,$Text);
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",'',$Text);
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
diff --git a/include/event.php b/include/event.php
index 866ae8c3f..8aef0a263 100644
--- a/include/event.php
+++ b/include/event.php
@@ -12,6 +12,9 @@ function format_event_html($ev) {
$o = '<div class="vevent">' . "\r\n";
+
+ $o .= '<p class="summary event-summary">' . bbcode($ev['summary']) . '</p>' . "\r\n";
+
$o .= '<p class="description event-description">' . bbcode($ev['desc']) . '</p>' . "\r\n";
$o .= '<p class="event-start">' . t('Starts:') . ' <abbr class="dtstart" title="'
@@ -114,6 +117,9 @@ function format_event_bbcode($ev) {
$o = '';
+ if($ev['summary'])
+ $o .= '[event-summary]' . $ev['summary'] . '[/event-summary]';
+
if($ev['desc'])
$o .= '[event-description]' . $ev['desc'] . '[/event-description]';
@@ -148,6 +154,9 @@ function bbtoevent($s) {
$ev = array();
$match = '';
+ if(preg_match("/\[event\-summary\](.*?)\[\/event\-summary\]/is",$s,$match))
+ $ev['summary'] = $match[1];
+ $match = '';
if(preg_match("/\[event\-description\](.*?)\[\/event\-description\]/is",$s,$match))
$ev['desc'] = $match[1];
$match = '';
@@ -244,6 +253,7 @@ function event_store($arr) {
`edited` = '%s',
`start` = '%s',
`finish` = '%s',
+ `summary` = '%s',
`desc` = '%s',
`location` = '%s',
`type` = '%s',
@@ -258,6 +268,7 @@ function event_store($arr) {
dbesc($arr['edited']),
dbesc($arr['start']),
dbesc($arr['finish']),
+ dbesc($arr['summary']),
dbesc($arr['desc']),
dbesc($arr['location']),
dbesc($arr['type']),
@@ -306,9 +317,9 @@ function event_store($arr) {
// New event. Store it.
- $r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`desc`,`location`,`type`,
+ $r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`,
`adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`)
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",
+ VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",
intval($arr['uid']),
intval($arr['cid']),
dbesc($arr['uri']),
@@ -316,6 +327,7 @@ function event_store($arr) {
dbesc($arr['edited']),
dbesc($arr['start']),
dbesc($arr['finish']),
+ dbesc($arr['summary']),
dbesc($arr['desc']),
dbesc($arr['location']),
dbesc($arr['type']),