Hallo,

Marc Deichmann schrieb:

Moin!

Hat jemand schon mal Calendar Events (ics, vcs) von Hand erstellt? Google und apt-cache (eine mikrige perl library) search finden da nix vern�nftiges. Ich habe auch versucht mir aus einer exportierten Datei von Korganizer alles n�tige zusammenzustellen, will aber auch nicht wirklich. Zumindest hat es Korganizer danach nicht geschluckt.

Fall: - Hol dir von einer Webseite Daten
- Mache eine importierbare Datei f�r Korganizer daraus




habe einmal in php f�r ein sf Projekt eine solche Funktion geschrieben.
Diese hat aus internen Termindaten einer Newsdatenbank herunterladbare .VCS Dateien erstellt.
Wichtig war damals, dass autschlook die auch importieren konnte, daher die "Deppenreturns"..


Vielleicht kannst Du ja damit etwas anfangen.

Gr��e,
Christian


------------------8<------------------ fncAppointment-----

function fncAppointment ($newsid) {
global $strServerPath;
$strSql = "select A.AppDtStart, A.AppDtEnd, A.AppLocation";
$strSql .= " ,N.NewsTitle, N.NewsLink, N.NewsText, N.NewsPriority, N.NewsReadableFor";
$strSql .= " ,U.UsrFirstname, U.UsrLastname, U.UsrEmail1, C.CatName, I.InstURL ";
$strSql .= " from tbl_Appointment A inner join tbl_News N on A.FK_News_ID = N.PK_News_ID";
$strSql .= " inner join tbl_User U on A.AppCreatedBy = U.PK_Usr_ID";
$strSql .= " inner join tbl_Categories C on N.FK_Cat_ID = C.PK_Cat_ID";
$strSql .= " inner join tbl_Institutions I on N.FK_Inst_ID = I.PK_Inst_ID";
$strSql .= " where A.FK_News_ID = ".$newsid;
$arrResult = mysql_query($strSql) or die (mysql_errno().fncSqlErr());
$arrApp = mysql_fetch_array($arrResult);
if ($arrApp["NewsIsReadableFor"] == 0) {
$strType = "PUBLIC";
} else {
$strType = "PRIVATE";
}
$strNewsText = strip_tags(substr($arrApp["NewsText"],0,79));
$strApp = "BEGIN:VCALENDAR\r\n";
$strApp .= "PRODID:-//cNews ".$strMainInst." //-\r\n";
$strApp .= "VERSION:1.0\r\n";
$strApp .= "BEGIN:VEVENT\r\n";
$strApp .= "ORGANIZER;CN=\"".$arrApp["UsrFirstname"]." ".$arrApp["UsrLastname"]."\":MAILTO:".$arrApp["UsrEmail1"]."\r\n";;
$strApp .= "DTSTART:".date("Ymd", strtotime($arrApp["AppDtStart"]))."T".date("His", strtotime($arrApp["AppDtStart"]))."Z\r\n";
$strApp .= "DTEND:".date("Ymd", strtotime($arrApp["AppDtEnd"]))."T".date("His", strtotime($arrApp["AppDtEnd"]))."Z\r\n";
$strApp .= "LOCATION:".$arrApp["AppLocation"]."\r\n";
$strApp .= "CATEGORIES:MEETING ".$arrApp["CatName"]."\r\n";
$strApp .= "CREATED:".date("Ymd\ZHis", time())."\r\n";
$strApp .= "URL:".$arrApp["InstURL"]."\r\n";
$strApp .= "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:".str_replace("\r", "", str_replace("\n", "", $strNewsText ))."\r\n";
$strApp .= "SUMMARY;ENCODING=QUOTED-PRINTABLE:".$arrApp["NewsTitle"]."\r\n";
$strApp .= "PRIORITY:5\r\n";
$strApp .= "CLASS:".$strType."\r\n";
$strApp .= "END:VEVENT\r\n";
$strApp .= "END:VCALENDAR\r\n";
if ($intHandle = fopen($strServerPath."cal/cNewsCal".$newsid.".vcs","w+")) {
fwrite($intHandle, $strApp);
}
return true;
}
------------------>8------------------ fncAppointment-----



--
Haeufig gestellte Fragen und Antworten (FAQ): http://www.de.debian.org/debian-user-german-FAQ/


Zum AUSTRAGEN schicken Sie eine Mail an [EMAIL PROTECTED]
mit dem Subject "unsubscribe". Probleme? Mail an [EMAIL PROTECTED] (engl)



Antwort per Email an