define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1385' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1150 );
+define ( 'DB_UPDATE_VERSION', 1151 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
`edited` datetime NOT NULL,
`start` datetime NOT NULL,
`finish` datetime NOT NULL,
+ `summary` text NOT NULL,
`desc` text NOT NULL,
`location` text NOT NULL,
`type` char(255) NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
`deny_gid` mediumtext NOT NULL,
- PRIMARY KEY (`id`)
+ PRIMARY KEY (`id`),
+ KEY `uid` ( `uid` ),
+ KEY `cid` ( `cid` ),
+ KEY `uri` ( `uri` ),
+ KEY `type` ( `type` ),
+ KEY `start` ( `start` ),
+ KEY `finish` ( `finish` ),
+ KEY `adjust` ( `adjust` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
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);
$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="'
$o = '';
+ if($ev['summary'])
+ $o .= '[event-summary]' . $ev['summary'] . '[/event-summary]';
+
if($ev['desc'])
$o .= '[event-description]' . $ev['desc'] . '[/event-description]';
$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];
`edited` = '%s',
`start` = '%s',
`finish` = '%s',
+ `summary` = '%s',
`desc` = '%s',
`location` = '%s',
`type` = '%s',
dbesc($arr['edited']),
dbesc($arr['start']),
dbesc($arr['finish']),
+ dbesc($arr['summary']),
dbesc($arr['desc']),
dbesc($arr['location']),
dbesc($arr['type']),
// 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']),
dbesc($arr['edited']),
dbesc($arr['start']),
dbesc($arr['finish']),
+ dbesc($arr['summary']),
dbesc($arr['desc']),
dbesc($arr['location']),
dbesc($arr['type']),
if(strcmp($finish,$start) < 0)
$finish = $start;
+ $summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));
$location = escape_tags(trim($_POST['location']));
$type = 'event';
$datarray = array();
$datarray['start'] = $start;
$datarray['finish'] = $finish;
+ $datarray['summary'] = $summary;
$datarray['desc'] = $desc;
$datarray['location'] = $location;
$datarray['type'] = $type;
$last_date = $d;
$edit = ((! $rr['cid']) ? array($a->get_baseurl().'/events/event/'.$rr['id'],t('Edit event'),'','') : null);
-
- list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
- $title = strip_tags($title);
+ $title = strip_tags(bbcode($rr['summary']));
+ if(! $title) {
+ list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
+ $title = strip_tags($title);
+ }
$html = format_event_html($rr);
$rr['desc'] = bbcode($rr['desc']);
$rr['location'] = bbcode($rr['location']);
$n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
+ $t_orig = ((x($orig_event)) ? $orig_event['summary'] : '');
$d_orig = ((x($orig_event)) ? $orig_event['desc'] : '');
$l_orig = ((x($orig_event)) ? $orig_event['location'] : '');
$eid = ((x($orig_event)) ? $orig_event['id'] : 0);
'$eid' => $eid,
'$cid' => $cid,
'$uri' => $uri,
+
'$title' => t('Event details'),
'$desc' => sprintf( t('Format is %s %s. Starting date and Description are required.'),$dateformat,$timeformat),
'$d_orig' => $d_orig,
'$l_text' => t('Location:'),
'$l_orig' => $l_orig,
+ '$t_text' => t('Title:'),
+ '$t_orig' => $t_orig,
'$sh_text' => t('Share this event'),
'$sh_checked' => $sh_checked,
'$acl' => (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user),false)),
<?php
-define( 'UPDATE_VERSION' , 1150 );
+define( 'UPDATE_VERSION' , 1151 );
/**
*
return UPDATE_FAILED;
return UPDATE_SUCCESS;
}
+
+
+function update_1150() {
+ $r = q("ALTER TABLE event ADD summary text NOT NULL after finish, add index ( uid ), add index ( cid ), add index ( uri ), add index ( `start` ), add index ( finish ), add index ( `type` ), add index ( adjust ) ");
+ if(! $r)
+ return UPDATE_FAILED;
+ return UPDATE_SUCCESS;
+}
+
<div id="event-adjust-break"></div>
+<div id="event-summary-text">$t_text</div>
+<input type="text" id="event-summary" name="summary" value="$t_orig" />
+
+
<div id="event-desc-text">$d_text</div>
<textarea id="event-desc-textarea" name="desc">$d_orig</textarea>
<div style="display: none;">
<div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;">
$acl
- <hr style="clear:both"/>
+ <hr style="clear:both;"/>
<div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" />
<div id="profile-jot-email-end"></div>
$jotnets
.vevent {
border: 1px solid #CCCCCC;
}
+
+.vevent .event-summary {
+ margin-left: 10px;
+ margin-right: 10px;
+ font-weight: bold;
+}
+
.vevent .event-description, .vevent .event-location {
margin-left: 10px;
margin-right: 10px;