PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Brauche dringend Hilfe


falloutboy
08.06.2006, 22:08:53
hallo, ich habe folgendes Problem.
Ich habe ein Textfeld (description) und will dort folgenden html code eingeben.
<a href="http://www.portlandpirates.com/schedule.asp">Hier ist der Link</a>
<img src="http://localhost/html/projekt01/media/img/font_small.gif" />
Mit Php habe ich folgendes gemacht.
<?php
if ( ! empty ( $allow_html_description ) &&
$allow_html_description == 'Y' ) {
$str = str_replace ( '&', '&amp;', $description );
$str = str_replace ( '&amp;amp;', '&amp;', $str );
// If there is no html found, then go ahead and replace
// the line breaks ("\n") with the html break.
if ( strstr ( $str, "<" ) && strstr ( $str, ">" ) ) {
// found some html...
echo $str;
} else {
echo nl2br ( activate_urls ( $str ) );
}
} else {
echo nl2br ( activate_urls ( htmlspecialchars ( $description ) ) );
}
?>

Und das hier kommt raus.

&lt;a href=&quot;<a href="http://www.portlandpirates.com/schedule.asp&quot;&gt;Hier">http://www.portlandpirates.com/schedule.asp&quot;&gt;Hier</a> ist der Link&lt;/a&gt;<br />
&lt;img src=&quot;<a href="http://localhost/html/projekt01/media/img/font_small.gif&quot;">http://localhost/html/projekt01/media/img/font_small.gif&quot;</a> /&gt;

Wäre jemand von euch bereit, mir zu helfen, damit das raus kommt, was ich in html eingebe.
Danke

Ich bin absoluter Anfänger.

Opendix
08.06.2006, 22:16:47
nun ist das script von dir?
Dann wirst du auch wissen was htmlspecialchars macht... bzw. nl2br!

das script das du hier zeigst macht eigenltich genau das was du nicht willst... für was hast du das eigenltich drin wenn du es nicht brauchst? :S

falloutboy
09.06.2006, 10:53:39
nun ist das script von dir?
Nein, das Script ist nicht von mir. Ich habe es aus einer anderen Datei rauskopiert, bei der mein html code richtig angezeigt wird, in der Hoffnung das es in der neuen Datei auch so funktioniert.
Wärst Du bereit, mir zu erklären, wie ich vorgehen könnte?
Danke

Opendix
09.06.2006, 15:14:35
ok... erstmal zu deiner problemstellung...

du willst html in eine textbox eingeben... und dann dieses html irgendwo ablegen? vielleicht datenbank? irgendeine datei?

oder willst du eifnach den knopf drücke und es soll angezeigt werden?

falloutboy
09.06.2006, 15:33:31
ok... erstmal zu deiner problemstellung...

du willst html in eine textbox eingeben... und dann dieses html irgendwo ablegen? vielleicht datenbank? irgendeine datei?

oder willst du eifnach den knopf drücke und es soll angezeigt werden?
Das html wird in einer datenbank abgelegt.

Soll ich mal die datei posten, bei der es geht und dann die bei der es nicht geht?

MatMel
09.06.2006, 15:59:31
Ist bei dir $allow_html_description auf "Y" gesetzt? Wenn nein dann mach das mal...

Dann noch dieses "activate_urls" : ist das ne eigene Funktion ? Ich kann die nämlich im Handbuch & Google nicht finden... Wenn es eine eigene Funktion ist, könnt ich mir vorstellen das da der Fehler liegt und du solltest die auch mal Posten.

falloutboy
09.06.2006, 16:19:54
Ist bei dir $allow_html_description auf "Y" gesetzt? Wenn nein dann mach das mal...
$allow_html_description ist auf "Y" gesetzt

die funktion heißt

function activate_urls ( $text ) {
$str = eregi_replace ( "(http://[^[:space:]$]+)",
"<a href=\"\\1\">\\1</a>", $text );
$str = eregi_replace ( "(https://[^[:space:]$]+)",
"<a href=\"\\1\">\\1</a>", $str );
return $str;
}

MatMel
09.06.2006, 16:28:12
Hmmm, aus irgendeinem Grund springt er gleich zu Anfang in das "else" (da sowohl htmlspecialcharsals auch activate_urls ausgeführt werden wie man z.B. an den &lt sieht).
Schmeiß mal das "! empty ( $allow_html_description ) &&" ganz raus. php wirds auch nich stören wenn das leer sein sollte.
Außerdem schau mal nach dass du das "Y" groß geschrieben hast. (eigentlich wär da der Gebrauch von einer bool Variable sinnvoll. Wenn das keine große Arbeit ist, kannste des ja noch ändern)

falloutboy
09.06.2006, 17:04:11
Schmeiß mal das "! empty ( $allow_html_description ) &&" ganz raus. php wirds auch nich stören wenn das leer sein sollte.
Das ändert nichts
(eigentlich wär da der Gebrauch von einer bool Variable sinnvoll.
was heißt das?

MatMel
09.06.2006, 18:21:42
Boolsche Variablen sind Variablen die nur zwei Werte annehmen können - nämlich true oder false.
Das wäre bei deinem Programm in soweit sinnvoll da ja entweder Y oder N möglich sind - also nur zwei Fälle.
Aber das nur nebenbei es wird dein Problem auch nicht lösen.

Ich habe dein Problem mal wie folgt nachgestellt:

<html><head></head>
<body>
<form action="test.php" method=get>
<textarea name="description"></textarea>
<input type="submit" name="action" value="Los">
</form>
<?php
function activate_urls ( $text ) {
$str = eregi_replace ( "(http://[^[:space:]$]+)", "<a href=\"\\1\">\\1</a>", $text );
$str = eregi_replace ( "(https://[^[:space:]$]+)", "<a href=\"\\1\">\\1</a>", $str );
return $str;
}

$allow_html_description = 'N';

if($_GET['action'] == "Los")
{

$description = $_GET['description'];

if( ! empty ( $allow_html_description ) && $allow_html_description == 'Y' )
{
$str = str_replace ( '&', '&amp;', $description );
$str = str_replace ( '&amp;amp;', '&amp;', $str );

if ( strstr ( $str, "<" ) && strstr ( $str, ">" ) )
{

echo $str;
}
else{

echo nl2br ( activate_urls ( $str ) );
}
}
else
{
echo nl2br ( activate_urls ( htmlspecialchars ( $description ) ) );
}

}
?>
</body>
</html>


Bei mir funktionierts damit wunderbar...
Da muss noch irgendwas bei dir drin sein. Könntest du mal die ganze Datei posten?


Gruß,
Matze

falloutboy
10.06.2006, 09:30:24
Ich muss die Datei auf zweimal posten
Hier der erste Teil:
<?php
$DEDI_DMW = true;
$cat_id = DEDI_WEBCAL_CAT;
$disableStyle = true;
include_once 'includes/init.php';
include_once 'includes/site_extras.php';

/*if (($user != $login) && $is_nonuser_admin) {
load_user_layers ($user);
} else { */
load_user_layers ();
//}

load_user_categories ();

$next = mktime ( 3, 0, 0, $thismonth + 1, 1, $thisyear );
$nextyear = date ( "Y", $next );
$nextmonth = date ( "m", $next );
//$nextdate = date ( "Ymd" );

$prev = mktime ( 3, 0, 0, $thismonth - 1, 1, $thisyear );
$prevyear = date ( "Y", $prev );
$prevmonth = date ( "m", $prev );
//$prevdate = date ( "Ymd" );

if ( ! empty ( $bold_days_in_year ) && $bold_days_in_year == 'Y' ) {
$boldDays = true;
$startdate = sprintf ( "%04d%02d01", $prevyear, $prevmonth );
$enddate = sprintf ( "%04d%02d31", $nextyear, $nextmonth );
} else {
$boldDays = false;
$startdate = sprintf ( "%04d%02d01", $thisyear, $thismonth );
$enddate = sprintf ( "%04d%02d31", $thisyear, $thismonth );
}

$HeadX = '';
if ( $auto_refresh == "Y" && ! empty ( $auto_refresh_time ) ) {
$refresh = $auto_refresh_time * 60; // convert to seconds
$HeadX = "<meta http-equiv=\"refresh\" content=\"$refresh; url=month.php?$u_url" .
"year=$thisyear&amp;month=$thismonth$caturl" .
( ! empty ( $friendly ) ? "&amp;friendly=1" : "") . "\" />\n";
}
$INC = array('js/popups.php');
//print_header($INC,$HeadX);

/* Pre-Load the repeated events for quicker access */
$repeated_events = read_repeated_events (
( ! empty ( $user ) && strlen ( $user ) ) ? $user : $login, $cat_id, $startdate );

/* Pre-load the non-repeating events for quicker access */
$events = read_events ( ( ! empty ( $user ) && strlen ( $user ) )
? $user : $login, $startdate, $enddate, $cat_id );
?>
<div class="title">
<a title="<?php etranslate("Previous")?>" class="prev" href="<?php echo DEDI_WEBCAL_MODEPATH_MONTH . $u_url . 'month=' . $prevmonth . '&amp;year=' . $prevyear . $caturl; ?>"><?php etranslate("Previous")?></a>
<span class="date"><?php
echo date_to_str ( sprintf ( "%04d%02d01", $thisyear, $thismonth ),
$DATE_FORMAT_MY, false, false );
?></span>
<a title="<?php etranslate("Next")?>" class="next" href="<?php echo DEDI_WEBCAL_MODEPATH_MONTH . $u_url . 'month=' . $nextmonth . '&amp;year=' . $nextyear . $caturl; ?>"><?php etranslate("Next")?></a>
</div>
<?PHP
if(DEDI_WEBCAL_MONTH_SMALLMONTH){
mod_display_small_month ( $prevmonth, $prevyear, DEDI_WEBCAL_MONTH_SHOWYEAR, DEDI_WEBCAL_MONTH_WEEKNUMS, 'prevmonth', DEDI_WEBCAL_MODEPATH_MONTH);
mod_display_small_month ( $nextmonth, $nextyear, DEDI_WEBCAL_MONTH_SHOWYEAR, DEDI_WEBCAL_MONTH_WEEKNUMS, 'nextmonth', DEDI_WEBCAL_MODEPATH_MONTH);
}
?>
<table class="main month">
<tr>
<?php if ( $WEEK_START == 0 ) { ?><th><?php etranslate("Sun")?></th><?php } ?>
<th><?php etranslate("Mon")?></th>
<th><?php etranslate("Tue")?></th>
<th><?php etranslate("Wed")?></th>
<th><?php etranslate("Thu")?></th>
<th><?php etranslate("Fri")?></th>
<th><?php etranslate("Sat")?></th>
<?php if ( $WEEK_START == 1 ) { ?><th><?php etranslate("Sun")?></th><?php } ?>
</tr>
<?php

// We add 2 hours on to the time so that the switch to DST doesn't
// throw us off. So, all our dates are 2AM for that day.
//$sun = get_sunday_before ( $thisyear, $thismonth, 1 );
if ( $WEEK_START == 1 ) {
$wkstart = get_monday_before ( $thisyear, $thismonth, 1 );
} else {
$wkstart = get_sunday_before ( $thisyear, $thismonth, 1 );
}
// generate values for first day and last day of month
$monthstart = mktime ( 3, 0, 0, $thismonth, 1, $thisyear );
$monthend = mktime ( 3, 0, 0, $thismonth + 1, 0, $thisyear );

// debugging
//echo "<p>sun = " . date ( "D, m-d-Y", $sun ) . "</p>\n";
//echo "<p>monthstart = " . date ( "D, m-d-Y", $monthstart ) . "</p>\n";
//echo "<p>monthend = " . date ( "D, m-d-Y", $monthend ) . "</p>\n";

// NOTE: if you make HTML changes to this table, make the same changes
// to the example table in pref.php.
for ( $i = $wkstart; date ( "Ymd", $i ) <= date ( "Ymd", $monthend );
$i += ( 24 * 3600 * 7 ) ) {
print "<tr>\n";
for ( $j = 0; $j < 7; $j++ ) {
$date = $i + ( $j * 24 * 3600 );
if ( date ( "Ymd", $date ) >= date ( "Ymd", $monthstart ) &&
date ( "Ymd", $date ) <= date ( "Ymd", $monthend ) ) {
$thiswday = date ( "w", $date );
$is_weekend = ( $thiswday == 0 || $thiswday == 6 );
if ( empty ( $WEEKENDBG ) ) {
$is_weekend = false;
}
print "<td";
$class = "";
if ( date ( "Ymd", $date ) == date ( "Ymd", $today ) ) {
$class = "today";
}
if ( $is_weekend ) {
if ( strlen ( $class ) ) {
$class .= " ";
}
$class .= "weekend";
}
if ( strlen ( $class ) ) {
echo " class=\"$class\"";
}
echo ">\n";
//echo date ( "D, m-d-Y H:i:s", $date ) . "<br />";
mod_print_date_entries ( date ( "Ymd", $date ),
( ! empty ( $user ) ) ? $user : $login, false );
print "</td>\n";
} else {
print "<td>&nbsp;</td>\n";
}
}
print "</tr>\n";
}
?></table>
<?php
//if ( ! empty ( $eventinfo ) ) echo $eventinfo;

display_unapproved_events ( ( $is_assistant || $is_nonuser_admin ? $user : $login ) );


function mod_display_small_month ( $thismonth, $thisyear, $showyear, $show_weeknums=false, $minical_id='', $month_link ) {
global $WEEK_START, $user, $login, $boldDays, $get_unapproved;
global $DISPLAY_WEEKNUMBER;
global $SCRIPT, $thisday; // Needed for day.php
global $caturl, $today;
if ( $user != $login && ! empty ( $user ) ) {
$u_url = "user=$user" . "&amp;";
} else {
$u_url = '';
}

//start the minical table for each month
echo '<table class="minical month' . (empty($minical_id) ? '' : ' ') . $minical_id . "\">\n";

$monthstart = mktime(2,0,0,$thismonth,1,$thisyear);
$monthend = mktime(2,0,0,$thismonth + 1,0,$thisyear);

$month_ago = date ( "Ymd", mktime ( 3, 0, 0, $thismonth - 1, $thisday, $thisyear ) );
$month_ahead = date ( "Ymd", mktime ( 3, 0, 0, $thismonth + 1, $thisday, $thisyear ) );

echo "<tr class=\"monthnav\"><th colspan=\"" . ($show_weeknums ? 8 : 7) . "\"><a href=\"" . DEDI_WEBCAL_MODEPATH_MONTH . "month=" .$thismonth. "&amp;year=" .$thisyear. "\">";
echo month_name ( $thismonth - 1 );
if ( $showyear != '' ) {
echo " $thisyear";
}
echo "</a></th></tr>\n<tr>\n";
//}

//determine if the week starts on sunday or monday
if ( $WEEK_START == "1" ) {
$wkstart = get_monday_before ( $thisyear, $thismonth, 1 );
} else {
$wkstart = get_sunday_before ( $thisyear, $thismonth, 1 );
}
//print the headers to display the day of the week (sun, mon, tues, etc.)

// if we're showing week numbers we need an extra column
if ( $show_weeknums && $DISPLAY_WEEKNUMBER == 'Y' )
echo "<th class=\"empty\">&nbsp;</th>\n";
//if the week doesn't start on monday, print the day
if ( $WEEK_START == 0 ) echo "<th>" .
weekday_short_name ( 0 ) . "</th>\n";
//cycle through each day of the week until gone
for ( $i = 1; $i < 7; $i++ ) {
echo "<th>" . weekday_short_name ( $i ) . "</th>\n";
}
//if the week DOES start on monday, print sunday
if ( $WEEK_START == 1 )
echo "<th>" . weekday_short_name ( 0 ) . "</th>\n";
//end the header row
echo "</tr>\n";
for ($i = $wkstart; date("Ymd",$i) <= date ("Ymd",$monthend);
$i += (24 * 3600 * 7) ) {
echo "<tr>\n";
if ( $show_weeknums && $DISPLAY_WEEKNUMBER == 'Y' ) {
echo "<td class=\"weeknumber\"><a href=\"" . DEDI_WEBCAL_MODEPATH_WEEK . $u_url .
"date=".date("Ymd", $i)."\">(" . week_number($i) . ")</a></td>\n";
}
for ($j = 0; $j < 7; $j++) {
$date = $i + ($j * 24 * 3600);
$dateYmd = date ( "Ymd", $date );
$hasEvents = false;
if ( $boldDays ) {
$ev = get_entries ( $user, $dateYmd, $get_unapproved );
if ( count ( $ev ) > 0 ) {
$hasEvents = true;
} else {
$rep = get_repeating_entries ( $user, $dateYmd, $get_unapproved );
if ( count ( $rep ) > 0 )
$hasEvents = true;
}
}
if ( $dateYmd >= date ("Ymd",$monthstart) &&
$dateYmd <= date ("Ymd",$monthend) ) {
echo "<td";
$wday = date ( 'w', $date );
$class = '';
//add class="weekend" if it's saturday or sunday
if ( $wday == 0 || $wday == 6 ) {
$class = "weekend";
}
//if the day being viewed is today's date AND script = day.php
if ( $dateYmd == $thisyear . $thismonth . $thisday &&
$SCRIPT == 'day.php' ) {
//if it's also a weekend, add a space between class names to combine styles
if ( $class != '' ) {
$class .= ' ';
}
$class .= "selectedday";
}
if ( $hasEvents ) {
if ( $class != '' ) {
$class .= ' ';
}
$class .= "hasevents";
}
if ( $class != '' ) {
echo " class=\"$class\"";
}
if ( date ( "Ymd", $date ) == date ( "Ymd", $today ) ){
echo " id=\"today\"";
}
echo "><a href=\"" . DEDI_WEBCAL_MODEPATH_DAY . $u_url . "date=" . $dateYmd .
"\">";
echo date ( "d", $date ) . "</a></td>\n";
} else {
echo "<td class=\"empty\">&nbsp;</td>\n";
}
} // end for $j
echo "</tr>\n";
} // end for $i
echo "</table>\n";
}

falloutboy
10.06.2006, 09:31:38
Hier kommt der Rest:

function mod_print_date_entries ( $date, $user, $ssi ) {
global $events, $readonly, $is_admin, $login,
$public_access, $public_access_can_add, $cat_id;
$cnt = 0;
$get_unapproved = ( $GLOBALS["DISPLAY_UNAPPROVED"] == "Y" );
// public access events always must be approved before being displayed
if ( $user == "__public__" )
$get_unapproved = false;

$year = substr ( $date, 0, 4 );
$month = substr ( $date, 4, 2 );
$day = substr ( $date, 6, 2 );
$dateu = mktime ( 3, 0, 0, $month, $day, $year );
/*$can_add = ( $readonly == "N" || $is_admin );
if ( $public_access == "Y" && $public_access_can_add != "Y" &&
$login == "__public__" )
$can_add = false;
if ( $readonly == 'Y' )
$can_add = false;
if ( ! $ssi && $can_add ) {
print "<a title=\"" .
translate("New Entry") . "\" href=\"edit_entry.php?";
if ( strcmp ( $user, $GLOBALS["login"] ) )
print "user=$user&amp;";
if ( ! empty ( $cat_id ) )
print "cat_id=$cat_id&amp;";
print "date=$date\"><img src=\"new.gif\" alt=\"" .
translate("New Entry") . "\" class=\"new\" /></a>";
$cnt++;
} */
if ( ! $ssi ) {
echo "<p class=\"dayofmonth\">$day</p>\n";
if ( $GLOBALS["DISPLAY_WEEKNUMBER"] == "Y" &&
date ( "w", $dateu ) == $GLOBALS["WEEK_START"] ) {
echo "<a title=\"" .
translate("Week") . " " . week_number ( $dateu ) . "\" href=\"" . DEDI_WEBCAL_MODEPATH_WEEK . "date=$date";
if ( strcmp ( $user, $GLOBALS["login"] ) )
echo "&amp;user=$user";
if ( ! empty ( $cat_id ) )
echo "&amp;cat_id=$cat_id";
echo "\" class=\"weeknumber\">";
echo "(" .
translate("Week") . " " . week_number ( $dateu ) . ")</a>\n";
}
//print "<br />\n";
$cnt++;
}

// get all the repeating events for this date and store in array $rep
$rep = get_repeating_entries ( $user, $date, $get_unapproved );
$cur_rep = 0;

// get all the non-repeating events for this date and store in $ev
$ev = get_entries ( $user, $date, $get_unapproved );

for ( $i = 0; $i < count ( $ev ); $i++ ) {
// print out any repeating events that are before this one...
while ( $cur_rep < count ( $rep ) &&
$rep[$cur_rep]['cal_time'] < $ev[$i]['cal_time'] ) {
if ( $get_unapproved || $rep[$cur_rep]['cal_status'] == 'A' ) {
if ( ! empty ( $rep[$cur_rep]['cal_ext_for_id'] ) ) {
$viewid = $rep[$cur_rep]['cal_ext_for_id'];
$viewname = $rep[$cur_rep]['cal_name'] . " (" .
translate("cont.") . ")";
} else {
$viewid = $rep[$cur_rep]['cal_id'];
$viewname = $rep[$cur_rep]['cal_name'];
}
mod_print_entry ( $viewid,
$date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'],
$viewname, $rep[$cur_rep]['cal_description'],
$rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'],
$rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'],
$rep[$cur_rep]['cal_category'] );
$cnt++;
}
$cur_rep++;
}
if ( $get_unapproved || $ev[$i]['cal_status'] == 'A' ) {
if ( ! empty ( $ev[$i]['cal_ext_for_id'] ) ) {
$viewid = $ev[$i]['cal_ext_for_id'];
$viewname = $ev[$i]['cal_name'] . " (" .
translate("cont.") . ")";
} else {
$viewid = $ev[$i]['cal_id'];
$viewname = $ev[$i]['cal_name'];
}
mod_print_entry ( $viewid,
$date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'],
$viewname, $ev[$i]['cal_description'],
$ev[$i]['cal_status'], $ev[$i]['cal_priority'],
$ev[$i]['cal_access'], $ev[$i]['cal_login'],
$ev[$i]['cal_category'] );
$cnt++;
}
}
// print out any remaining repeating events
while ( $cur_rep < count ( $rep ) ) {
if ( $get_unapproved || $rep[$cur_rep]['cal_status'] == 'A' ) {
if ( ! empty ( $rep[$cur_rep]['cal_ext_for_id'] ) ) {
$viewid = $rep[$cur_rep]['cal_ext_for_id'];
$viewname = $rep[$cur_rep]['cal_name'] . " (" .
translate("cont.") . ")";
} else {
$viewid = $rep[$cur_rep]['cal_id'];
$viewname = $rep[$cur_rep]['cal_name'];
}
mod_print_entry ( $viewid,
$date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'],
$viewname, $rep[$cur_rep]['cal_description'],
$rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'],
$rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'],
$rep[$cur_rep]['cal_category'] );
$cnt++;
}
$cur_rep++;
}
if ( $cnt == 0 )
echo "&nbsp;"; // so the table cell has at least something
}


function mod_print_entry ( $id, $date, $time, $duration,
$name, $description, $status,
$pri, $access, $event_owner, $event_cat=-1 ) {
global $eventinfo, $login, $user, $PHP_SELF, $TZ_OFFSET;
static $key = 0;

global $layers;

?>
<?php
if ( ! empty ( $allow_html_description ) &&
$allow_html_description == 'Y' ) {
$str = str_replace ( '&', '&amp;', $description );
$str = str_replace ( '&amp;amp;', '&amp;', $str );
// If there is no html found, then go ahead and replace
// the line breaks ("\n") with the html break.
if ( strstr ( $str, "<" ) && strstr ( $str, ">" ) ) {
// found some html...
echo $str;
} else {
echo nl2br ( activate_urls ( $str ) );
}
} else {
echo nl2br ( activate_urls ( htmlspecialchars ( $description ) ) );
}
?>
<?php

if ( $login != $event_owner && strlen ( $event_owner ) ) {
$class = "layerentry";
} else {
$class = "entry";
if ( $status == "W" ) $class = "unapprovedentry";
}
// if we are looking at a view, then always use "entry"
if ( strstr ( $PHP_SELF, "view_m.php" ) ||
strstr ( $PHP_SELF, "view_w.php" ) ||
strstr ( $PHP_SELF, "view_v.php" ) ||
strstr ( $PHP_SELF, "view_t.php" ) )
$class = "entry";

if ( $pri == 3 ) echo "<strong>";
$popupid = "eventinfo-$id-$key";
$key++;
//echo "<a title=\"" .
translate("View this entry") . "\" class=\"$class\" href=\"" . DEDI_WEBCAL_MODEPATH_DETEILS . "id=$id&amp;date=$date";
if ( strlen ( $user ) > 0 )
echo "&amp;user=" . $user;



// echo "\">" /* . translate("View this entry") */;
$icon = "circle.gif";
$catIcon = '';
if ( $event_cat > 0 ) {
$catIcon = "icons/cat-" . $event_cat . ".gif";
if ( ! file_exists ( $catIcon ) )
$catIcon = '';
}

if ( ! empty ( $catIcon ) ) {
echo "<img src=\"$catIcon\" alt=\"$catIcon\" />";
}

if ( $login != $event_owner && strlen ( $event_owner ) ) {
if ($layers) foreach ($layers as $layer) {
if ($layer['cal_layeruser'] == $event_owner) {
echo("<span style=\"color:" . $layer['cal_color'] . ";\">");
}
}
}


$timestr = "";
if ( $duration == ( 24 * 60 ) ) {
$timestr = translate("All day event");
} else if ( $time != -1 ) {
$timestr = display_time ( $time );
$time_short = preg_replace ("/(:00)/", '', $timestr);
// echo '<span class="timeless">' . $timestr . '</span> ';
if ( $duration > 0 ) {
// calc end time
$h = (int) ( $time / 10000 );
$m = ( $time / 100 ) % 100;
$m += $duration;
$d = $duration;
while ( $m >= 60 ) {
$h++;
$m -= 60;
}
$end_time = sprintf ( "%02d%02d00", $h, $m );
$timestr .= " - " . display_time ( $end_time );
}
}
if ( $login != $user && $access == 'R' && strlen ( $user ) ) {
echo "(" . translate("Private") . ")";
} else if ( $login != $event_owner && $access == 'R' &&
strlen ( $event_owner ) ) {
echo "(" . translate("Private") . ")";
} else {
echo htmlspecialchars ( $name );
}

if ( $login != $event_owner && strlen ( $event_owner ) ) {
if ($layers) foreach ($layers as $layer) {
if($layer['cal_layeruser'] == $event_owner) {
echo "</span>";
}
}
}

//echo "</a>\n";






if ( $pri == 3 ) echo "</strong>\n"; //end font-weight span
//echo "<br />";
if ( $login != $user && $access == 'R' && strlen ( $user ) )
$eventinfo .= build_event_popup ( $popupid, $event_owner,
translate("This event is confidential"), "" );
else
if ( $login != $event_owner && $access == 'R' && strlen ( $event_owner ) )
$eventinfo .= build_event_popup ( $popupid, $event_owner,
translate("This event is confidential"), "" );
else
$eventinfo .= build_event_popup ( $popupid, $event_owner,
$description, $timestr, site_extras_for_popup ( $id ) );
}
?>