tags make things look awfully weird (breaks things out of the
tag). Just convert them to 's
*/
$text = str_replace (array ('
', '
'), ' ', $text);
/* Remove
tags to prevent it from showing up in the note */
$text = str_replace (array ('
', ''), '', $text);
/* preserve linebreaks */
$text = str_replace("\n", " ", $text);
/* this will only break long lines */
if (function_exists("wordwrap")) {
$text = wordwrap($text);
}
// Preserve spacing of user notes
$text = str_replace(" ", " ", $text);
$text = "".$text."";
return $text;
}
function display_errors($errors)
{
echo '
';
if (count($errors) > 1) {
echo "You need to do the following before your submission will be accepted:
";
foreach ($errors as $error) {
echo "
$error
\n";
}
echo "
";
}
else {
echo $errors[0];
}
echo '
';
}
// Displays an event. Used in event submission
// previews and event information displays
function display_event($event, $include_date = 1)
{
global $COUNTRIES;
// Weekday names array
for ($i = 1; $i <= 7; $i++) {
$days[$i] = strftime('%A', mktime(12, 0, 0, 4, $i, 2001));
}
// Recurring possibilities
$re = array(
1 => 'First',
2 => 'Second',
3 => 'Third',
4 => 'Fourth',
-1 => 'Last',
-2 => '2nd Last',
-3 => '3rd Last'
);
// Start and end day of this event
$sday = $event['start'] ? strtotime($event['start'])
: mktime(0, 0, 1, $event['smonth'], $event['sday'], $event['syear']);
$eday = $event['end'] ? strtotime($event['end'])
: mktime(0, 0, 1, $event['emonth'], $event['eday'], $event['eyear']);
?>
", date("F j, Y", $sday), "\n";
}
// Print link in case we have one
if ($event['url']) { echo ''; }
// Print event description
echo "", stripslashes(htmlentities($event['sdesc'])), "";
// End link
if ($event['url']) { echo ""; }
// Print extra date info for recurring and multiday events
switch ($event['type']) {
case 2:
case 'multi':
echo " (", date("Y-m-d",$sday), " to ", date("Y-m-d",$eday), ")";
break;
case 3:
case 'recur':
echo " (Every ", $re[$event['recur']], " ",
$days[$event['recur_day']], " of the month)";
break;
}
// Print out country information
echo ' (' , $COUNTRIES[$event['country']] , ')';
?>
", trim($event['ldesc']));
// If we have an URL, print it out
if ($event['url']) {
echo '