| Precedente :: Successivo |
| Autore |
Messaggio |
gianpy81 Nuovo del Forum


Registrato: Aug 11, 2007 Messaggi: 19
|
Inviato: Lun Gen 04, 2010 1:20 pm Oggetto: Modulo Kalendermx, alcuni tag html non li accetta |
|
|
Salve a tutti. Ho un piccolo ma fastidioso problemino col modulo kalendermx. In pratica tempo fa vi applicai l'fckeditor, funziona perfettamente dà solo una piccola noia sui tag html. In pratica formatto la news, nell'editor si vede come dico io poi faccio "invia" e mi mostra la news senza alcuni tag di formattazione come ad es il <br>, il <p> me lo fa solo come riga (cioè funziona come un br semplice e nn come salto di paragrafo), quando metto un immagine e gli do gli spazi ai lati in orizzontale e verticale nemmeno me li fa... In pratica accetta solo i tag <strong> <img> e corsivo...
Come faccio per fargli capire che deve accettarmi la news con tutti i tag html? Vi riporto il foglio del modulo kalender dove vi ho applicato l'fckeditor (kalender/includes/functions.php):
| Codice: |
/**
* KalenderMx v1.4
* Copyright (c) 2004 by A.Ellsel (kalender@pragmamx.org)
* http://www.pragmamx.org & http://www.shiba-design.de
*
* KalenderMx was based on EventCalendar 2.0
* Copyright (c) 2001 Originally by Rob Sutton
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* $Source: D:\CVS/dev-Kalender/html/modules/Kalender/includes/functions.php,v $
* $Revision: 1.12 $
* $Author: Andreas Ellsel $
* $Date: 2006/07/17 16:05:06 $
*/
if (!defined("CAL_MODULE_NAME")) die ("You can't access this file directly...");
// /////// todo: diese Zeilen vor release auskommentieren !!
// if (@file_exists(CAL_MODULE_PATH."includes/temp.php")) include_once(CAL_MODULE_PATH."includes/temp.php");
// if (defined('MX_VERSION')) { // nur für vkpMx, errorreporting einschalten
// error_reporting(E_ALL);
// }
// /////// end todo: diese Zeilen vor release entfernen !!
// ########################################################################################
// Tabellendefinitionen zum Aendern
if (!defined("CAL_TABLE_EVENTS")) define("CAL_TABLE_EVENTS", $GLOBALS["prefix"] . "_events");
if (!defined("CAL_TABLE_MX_TOPICS")) define("CAL_TABLE_MX_TOPICS", $GLOBALS["prefix"] . "_topics");
if (!defined("CAL_TABLE_MX_QUEUE")) define("CAL_TABLE_MX_QUEUE", $GLOBALS["prefix"] . "_queue");
if (!defined("CAL_TABLE_MX_AUTHORS")) define("CAL_TABLE_MX_AUTHORS", $GLOBALS["prefix"] . "_authors");
if (!defined("CAL_TABLE_MX_USERS")) define("CAL_TABLE_MX_USERS", $GLOBALS["user_prefix"] . "_users");
// ########################################################################################
// We are in PHPNuke >= 7.6
if (!defined('MX_VERSION') && isset($GLOBALS['admin_file']) && !empty($GLOBALS['Version_Num']) && version_compare($GLOBALS['Version_Num'], '7.6', '>=')) {
if (!defined("CAL_ADMIN_FILE")) define("CAL_ADMIN_FILE", $GLOBALS['admin_file'].'.php');
} else {
if (!defined("CAL_ADMIN_FILE")) define("CAL_ADMIN_FILE", 'admin.php');
}
function calDetectVersion() {
static $version;
if (isset($version)) return $version;
if (defined('MX_VERSION')) {
$version = "mx";
}
else {
global $db;
$result = $db->sql_query("SHOW COLUMNS FROM `".CAL_TABLE_MX_USERS."`");
while (list($fieldname)=$db->sql_fetchrow($result)){
$fields[$fieldname] = 1;
}
if (isset($fields['uid']) && isset($fields['uname']) && isset($fields['email'])) {
$version = "55";
}
else {
$version = "65";
}
}
return $version;
}
#########################################################################################
// weitere Moduldefinitionen
if (!defined("CAL_VERSION")) define("CAL_VERSION", "1.4.d");
if (!defined("CAL_CMS_VERSION")) define("CAL_CMS_VERSION", calDetectVersion());
switch (CAL_CMS_VERSION) {
case "mx";
define("CAL_MOD_USERINFO", "modules.php?name=Userinfo&uname=");
define("CAL_MOD_TOPICSEARCH", "modules.php?name=News&new_topic=");
break;
case "55";
define("CAL_MOD_USERINFO", "modules.php?name=Your_Account&op=userinfo&uname=");
define("CAL_MOD_TOPICSEARCH", "modules.php?name=Search&topic=");
break;
case "65";
define("CAL_MOD_USERINFO", "modules.php?name=Your_Account&op=userinfo&username=");
define("CAL_MOD_TOPICSEARCH", "modules.php?name=Search&topic=");
break;
}
define("CAL_MOD_USERLOGIN", "modules.php?name=Your_Account");
if (!defined("CAL_MODULE_LINK")) define("CAL_MODULE_LINK", ((defined('MX_BASE_URL') ? MX_BASE_URL : '')) . "modules.php?name=" . CAL_MODULE_NAME);
if (!defined("CAL_IMAGE_PATH")) define("CAL_IMAGE_PATH", ((defined('MX_BASE_URL') ? MX_BASE_URL : '')) . CAL_MODULE_PATH . "images/");
// ########################################################################################
function calGetEventDates($event)
{
setlocale (LC_TIME, _CALLOCALE);
// mxDebugFuncVars('INPUT:',$event);
// -------------- Startzeiten --------------------------------------------------------
if (empty($event["startTime"])) {
$event["startTime"] = '00:00:00';
}
if (empty($event["startAmPm"])) {
$event["startAmPm"] = 0;
}
if (isset($event["fromform"])) { // aus POST
$event["startYear"] = ($event["startYear"] < 1970) ? 1970 : $event["startYear"];
$event["startDate"] = sprintf ("%04d-%02d-%02d", $event["startYear"], $event["startMonth"], $event["startDay"]);
$event["startHour"] = ($event["startHour"] != 12) ? $event["startHour"] + $event["startAmPm"] : $event["startHour"];
$event["startTime"] = sprintf ("%02d:%02d:00", $event["startHour"], $event["startMin"]);
$event["startTimestamp"] = @mktime($event["startHour"], $event["startMin"], 0, $event["startMonth"], $event["startDay"], $event["startYear"]);
} else { // aus DB
$sqldate = $event["startDate"] . ' ' . $event["startTime"];
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $sqldate, $x);
$event["startHour"] = $x[4];
$event["startMin"] = $x[5];
$event["startMonth"] = $x[2];
$event["startDay"] = $x[3];
$event["startYear"] = ($x[1] < 1970) ? 1970 : $x[1];
$event["startTimestamp"] = @mktime($event["startHour"], $event["startMin"], 0, $event["startMonth"], $event["startDay"], $event["startYear"]);
$event["startAmPm"] = 0;
}
$event["startDateShort"] = calStrftime(_CALSHORTDATEFORMAT, $event["startTimestamp"]);
$event["startDateLong"] = calStrftime(_CALLONGDATEFORMAT, $event["startTimestamp"]);
$event["startTimeFormat"] = calStrftime(_CALTIMEFORMAT, $event["startTimestamp"]);
$event["startDateListLink"] = "m=" . $event["startMonth"] . "&d=" . $event["startDay"] . "&y=" . $event["startYear"] . "";
// -------------- Ende-Zeiten --------------------------------------------------------
if (empty($event["endTime"])) {
$event["endTime"] = '00:00:00';
}
if (empty($event["endAmPm"])) {
$event["endAmPm"] = 0;
}
if (isset($event["fromform"])) { // aus POST
$event["endYear"] = ($event["endYear"] < 1970) ? 1970 : $event["endYear"];
$event["endDate"] = sprintf ("%04d-%02d-%02d", $event["endYear"], $event["endMonth"], $event["endDay"]);
$event["endHour"] = ($event["endHour"] != 12) ? $event["endHour"] + $event["endAmPm"] : $event["endHour"];
$event["endTime"] = sprintf ("%02d:%02d:00", $event["endHour"], $event["endMin"]);
$event["endTimestamp"] = @mktime($event["endHour"], $event["endMin"], 0, $event["endMonth"], $event["endDay"], $event["endYear"]);
} else { // aus DB
$sqldate = $event["endDate"] . ' ' . $event["endTime"];
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $sqldate, $x);
$event["endHour"] = $x[4];
$event["endMin"] = $x[5];
$event["endMonth"] = $x[2];
$event["endDay"] = $x[3];
$event["endYear"] = ($x[1] < 1970) ? 1970 : $x[1];
$event["endTimestamp"] = @mktime($event["endHour"], $event["endMin"], 0, $event["endMonth"], $event["endDay"], $event["endYear"]);
$event["endAmPm"] = 0;
}
$event["endDateShort"] = calStrftime(_CALSHORTDATEFORMAT, $event["endTimestamp"]);
$event["endDateLong"] = calStrftime(_CALLONGDATEFORMAT, $event["endTimestamp"]);
$event["endTimeFormat"] = calStrftime(_CALTIMEFORMAT, $event["endTimestamp"]);
$event["endDateListLink"] = "m=" . $event["endMonth"] . "&d=" . $event["endDay"] . "&y=" . $event["endYear"] . "";
// -------------- Posting-Zeiten --------------------------------------------------------
if (empty($event["posteddate"])) {
$event["posteddate"] = sprintf ("%04d-%02d-%02d %02d:%02d:00", Date("Y"), Date("m"), Date("d"), Date("H"), Date("i"));
$event["postDateShort"] = calStrftime(_CALSHORTDATEFORMAT, time());
} else {
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $event["posteddate"], $x);
$event["postDateShort"] = calStrftime(_CALSHORTDATEFORMAT, @mktime($x[4], $x[5], 0, $x[2], $x[3], $x[1]));
}
// -------------- debug & ende --------------------------------------------------------
// ksort($event);
// mxDebugFuncVars('CONVERTED:',$event);
// exit;
// end debug
setlocale (LC_TIME, $GLOBALS["locale"]);
return $event;
}
// ########################################################################################
function calEventView($event)
{
global $calconf, $db;
global $bgcolor1, $bgcolor2, $bgcolor3, $textcolor1, $textcolor2;
$eventsdates = calGetEventDates($event);
$event = array_merge($event, $eventsdates);
if (!empty($calconf['showlinks'])) {
$event["startDateLong"] = "<a href=\"" . CAL_MODULE_LINK . "&op=day&" . $event["startDateListLink"] . "\">" . $event["startDateLong"] . "</a>";
$event["endDateLong"] = "<a href=\"" . CAL_MODULE_LINK . "&op=day&" . $event["endDateListLink"] . "\">" . $event["endDateLong"] . "</a>";
}
$event["informant"] = (empty($event["informant"])) ? $GLOBALS["anonymous"] : $event["informant"];
$event["alldayevent"] = (empty($event["alldayevent"])) ? 0 : 1;
$event["categorie"] = calGetCurrentEventPoint($event["categorie"]);
$categoriealt = calGetBarColorAlt($event["categorie"]);
$event["title"] = strip_tags($event["title"]);
if (empty($event["title"])) {
$event["title"] = "<img src=\"" . CAL_IMAGE_PATH . "caution.gif\" alt=\"\" width=\"10\" height=\"21\" border=\"0\" align=\"middle\" vspace=\"5\" hspace=\"5\"> " . _CALNOSUBJECT . "";
}
$event["hometext"] = strip_tags($event["hometext"], calGetAllowedtags());
$event["hometext"] = (empty($event["hometext"])) ? $event["title"] : $event["hometext"];
if ($calconf['usetopics'] > 0) {
if (empty($event["topic"])) {
if (calIsAdmin()) {
if ($event["eid"]) {
$topicimage = "<a href=\"".CAL_ADMIN_FILE."?op=CalendarEditEvent&eid=" . $event["eid"] . "\"><img src=\"" . $GLOBALS["tipath"] . "AllTopics.gif\" border=\"0\"><br /><span class='tiny'><img src=\"" . CAL_IMAGE_PATH . "caution.gif\" alt=\"\" width=\"10\" height=\"21\" border=\"0\" align=\"middle\" vspace=\"5\" hspace=\"5\">" . _CALSELECTTOPIC . "!</span></a>";
} else {
$topicimage = "<img src=\"" . $GLOBALS["tipath"] . "AllTopics.gif\" border=\"0\"><br /><span class='tiny'><img src=\"" . CAL_IMAGE_PATH . "caution.gif\" alt=\"\" width=\"10\" height=\"21\" border=\"0\" align=\"middle\" vspace=\"5\" hspace=\"5\">" . _CALSELECTTOPIC . "</span>";
}
} else {
$topicimage = "<img src=\"" . CAL_IMAGE_PATH . "calendar.gif\" width=\"32\" height=\"32\" border=\"0\">";
}
} else {
$result = $db->sql_query("select topicimage, topictext from ".CAL_TABLE_MX_TOPICS." where topicid=".$event["topic"]."");
list($topicimage, $topictext) = $db->sql_fetchrow($result);
$topicimage = "<a href=\"" . CAL_MOD_TOPICSEARCH . $event["topic"] . "\"><img src=\"" . $GLOBALS["tipath"] . "" . $topicimage . "\" border=\"0\" alt=\"" . strip_tags($topictext) . "\" title=\"" . strip_tags($topictext) . "\"></a>";
}
} else {
$topicimage = "<img src=\"" . CAL_IMAGE_PATH . "calendar.gif\" width=\"32\" height=\"32\" border=\"0\">";
}
$colspan = ($event["alldayevent"]) ? "colspan=\"3\"" : "";
$rowspan = ($event["startTimestamp"] == $event["endTimestamp"]) ? "rowspan=\"2\"" : "";
OpenTable();
echo "<center>";
echo "<table width=\"90%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" style=\"background-color: $bgcolor3;\">\n";
echo "<tr valign=\"top\"><td align=\"center\" colspan=\"5\" style=\"background-color: $bgcolor2;\"><br /><span class=\"title\">" . $event["title"] . "</span><br /><br /></td></tr>";
echo "<tr valign=\"top\">";
echo "<td nowrap style=\"background-color: $bgcolor2;\" $rowspan><span class=\"content\"><b>" . _CALEVENTDATETEXT . "</b>:</span></td>";
echo "<td nowrap style=\"background-color: $bgcolor1;\" $colspan $rowspan><span class=\"content\">" . $event["startDateLong"] . "</span></td>";
if (!$event["alldayevent"]) {
echo "<td nowrap style=\"background-color: $bgcolor2;\"><span class=\"content\"><b>" . _CALSTARTTIME . "</b>:</span></td>";
echo "<td style=\"background-color: $bgcolor1;\"><span class=\"content\">" . $event["startTimeFormat"] . "</span></td>";
}
echo "<td rowspan=\"4\" valign=\"top\" align=\"center\" style=\"background-color: $bgcolor2;\">$topicimage</td></tr>";
echo "<tr valign=\"top\">";
if ($event["startTimestamp"] != $event["endTimestamp"]) {
echo "<td style=\"background-color: $bgcolor2;\"><span class=\"content\"><b>" . _CALENDDATEPREVIEW . "</b>:</span></td>";
echo "<td nowrap style=\"background-color: $bgcolor1;\" $colspan><span class=\"content\">" . $event["endDateLong"] . "</span></td>";
}
if (!$event["alldayevent"]) {
echo "<td nowrap style=\"background-color: $bgcolor2;\"><span class=\"content\"><b>" . _CALENDTIME . "</b>:</span></td>";
echo "<td style=\"background-color: $bgcolor1;\"><span class=\"content\">" . $event["endTimeFormat"] . "</span></td>";
}
echo "</tr>";
echo "<tr valign=\"top\"><td style=\"background-color: $bgcolor2;\"><span class=\"content\"><b>" . _CALBARCOLORTEXT . "</b>:</span></td><td colspan=\"3\" style=\"background-color: $bgcolor1;\"><span class=\"content\"><img src=\"" . calGetBarImage("ball", $event["categorie"]) . "\" align=\"middle\" alt=\"$categoriealt\" title=\"$categoriealt\"> <a href=\"" . CAL_MODULE_LINK . "&op=list&" . $event["startDateListLink"] . "&col=" . $event["categorie"] . "\">$categoriealt</a></span></td></tr>";
echo "<tr valign=\"top\"><td style=\"background-color: $bgcolor2;\"><span class=\"content\"><b>" . _CALARTICLETEXT . "</b>:</span></td><td colspan=\"3\" style=\"background-color: $bgcolor1;\"><span class=\"content\">" . $event["hometext"] . "<br>";
/*"<center><script type=\"text/javascript\"><!--
google_ad_client = \"pub-7912222350695975\";
//468x60, creato 26/01/08
google_ad_slot = \"6781389382\";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script></center>";*/
//conteggio letture inizio
global $prefix, $dbi, $db, $eid;
$db->sql_query("UPDATE ".$prefix."_events SET counter=counter+1 WHERE eid='$eid'");
$contavisite = $db->sql_fetchrow($db->sql_query("SELECT counter FROM ".$prefix."_events WHERE eid='$eid'"));
$quante = intval($contavisite['counter']);
//conteggio letture fine
if ($categoriealt == "Eventi TequilaGroup (official Partner)") {
echo " <p>
<span style='font-size:1.3em; color:#CC0000;'><strong>Info liste e prenotazione Tavoli:</strong></span></p><br>
<span style='font-size:1.4em;'>
<p><a title=\"Vai al profilo di Lino\" href=\"http://www.parianapoli.it/modules.php?name=Your_Account&op=userinfo&username=lino\"><b>LINO</a> - 320.72.98.101</b></p>
<p><a title=\"Vai al profilo di Diego\" href=\"http://www.parianapoli.it/modules.php?name=Your_Account&op=userinfo&username=DiegoTequila\"><b>DIEGO</a> - 338.83.22.532</b></p>
</span>";
}
echo "<br><IMG src=\"modules/Kalender/images/matita-notes.gif\"> <a href=\"modules.php?name=Liste\"><span style='font-size:1.3em; color:#CC0000;'>Clicca qua per metterti in lista o prenotare un tavolo<br></span></a>";
echo "<br><div align=\"center\"><font size=\"0.8px\"><strong>N.B.:</strong> Il sito svolge solo un'attività informativa sulle serate nei locali e non è responsabile dell'organizzazione della serata, di eventuali variazioni di prezzo/condizioni non comunicateci in tempo dai locali stessi e l'inserimento in lista non garantisce l'effettiva entrata nel locale,
poichè ogni locale si riserva il diritto d'ammissione.</font></div><br></td></tr>";
echo "<tr valign=\"top\"><td nowrap colspan=\"5\" align=\"center\" style=\"background-color: $bgcolor2;\"><span class=\"tiny\">";
if (!empty($calconf['showlinks']) && $event["informant"] != $GLOBALS["anonymous"]) {
echo "" . _CALPOSTEDBY . " <a href=\"" . CAL_MOD_USERINFO . $event["informant"] . "\"><span class=\"tiny\">" . $event["informant"] . "</span></a> " . _CALPOSTEDON . " " . $event["postDateShort"] . " - <strong>$quante</strong> "._READS."";
} else {
echo "" . _CALPOSTEDBY . " " . $event["informant"] . " " . _CALPOSTEDON . " " . $event["postDateShort"] . " - <strong>$quante</strong> "._READS."";
}
/*if ($event["aid"] != $event["informant"] && $event["aid"]) {
echo "" . _CALACCEPTEDBY . " " . $event["aid"] . "";
} */
echo "</span>";
// echo "<div align=\"center\">$quante "._READS."</div>";
echo "</table></center>";
CloseTable();
echo "<br />";
}
// ########################################################################################
function calCheckEventData($event)
{
global $calconf;
if (empty($event["title"])) {
$msg[1] = _CALVALIDSUBJECT . ' (1)'; # Das Feld 'Betreff' ist zwingend notwendig.
}
if (!checkdate($event['startMonth'], $event['startDay'], $event['startYear'])) {
$msg[2] = _CALVALIDEVENTDATE . ' (2)'; #Das 'Enddatum' hat einen ungültigen Eintrag.
}
if (!checkdate($event['endMonth'], $event['endDay'], $event['endYear'])) {
$msg[3] = _CALVALIDENDDATE . ' (3)'; # Das 'Enddatum' hat einen ungültigen Eintrag.
}
if (($event['startTimestamp'] > $event['endTimestamp']) && !$event["alldayevent"]) {
$msg[4] = _CALVALIDDATES . ' (4)'; # Das 'Enddatum' muss nach oder gleich dem 'Termindatum' liegen.
}
if ((@mktime(00, 00, 00, $event['startMonth'], $event['startDay'], $event['startYear']) > @mktime(00, 00, 00, $event['endMonth'], $event['endDay'], $event['endYear'])) && $event["alldayevent"]) {
// print '<br />start: '.mktime(00, 00, 00, $event['startMonth'], $event['startDay'], $event['startYear']);
// print '<br />ende: '.mktime(00, 00, 00, $event['endMonth'], $event['endDay'], $event['endYear']);
// print '<br />';
$msg[5] = _CALVALIDDATES . ' (5)'; # Das 'Enddatum' muss nach oder gleich dem 'Termindatum' liegen.
}
if ($calconf['usetopics'] > 1 && empty($event["topic"])) {
$msg[6] = _CALVALIDTOPIC . ' (6)'; # BITTE EIN THEMA AUSWÄHLEN!
}
$outmsg = "";
if (isset($msg)) {
$outmsg = implode("<br />", $msg);
}
// mxDebugFuncVars('calCheckEventData', $outmsg, $event);
// exit;
return $outmsg;
}
// ########################################################################################
function calGetAllowedtags($entities = 0)
{
if (function_exists('mxGetAllowedHtml')) {
$allowedtags = mxGetAllowedHtml();
} else {
global $calconf;
$allowedtags = $calconf['AllowableHTML'];
}
$allowedtags = ($entities) ? ' <' . implode('> <', $allowedtags) . '>' : '<' . implode('><', $allowedtags) . '>';
return $allowedtags;
}
// ########################################################################################
function calBuildModusselectors($op, $tag, $monat, $jahr)
{
global $index, $calconf, $col;
if (calIsPrintView()) return;
if (count($_GET)) {
foreach ($_GET as $key => $value) {
$parts[$key] = $key . "=" . $value;
}
}
$parts['name'] = "name=" . CAL_MODULE_NAME;
$printerlink = "modules.php?" . implode("&", $parts);
$printerlink .= "&cprint=1";
$reqfile = (isset($_REQUEST['file'])) ? $_REQUEST['file'] : "";
$op = (empty($op)) ? $calconf['defaultview'] : $op;
if ($op == "day")
$GLOBALS['cal_pagetitle'] .= ' - ' . _CALDAYLINK;
else if ($op == "month")
$GLOBALS['cal_pagetitle'] .= ' - ' . _CALMONTHLINK;
else if ($op == "year")
$GLOBALS['cal_pagetitle'] .= ' - ' . _CALYEARLINK;
OpenTable();
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
<tr><td colspan=\"2\"><span class=\"content\"><a name=\"caltop\"> </a><b>" . _CALJUMPTOTEXT . "</b>:</span></td>";
$nextcolspan = 2;
if (!$index) {
echo "<td width=\"10%\" rowspan=\"2\"><a href=\"" . CAL_MODULE_LINK . "&op=" . $calconf['defaultview'] . "\"><img src=\"" . CAL_IMAGE_PATH . "calendar.png\" width=\"35\" height=\"35\" border=\"0\" alt=\"" . _CALLISTLINK . "\" title=\"" . _CALLISTLINK . "\"></a></td>\n";
$nextcolspan = 3;
}
echo "</tr><tr>
<td width=\"30%\" style=\"white-space: nowrap;\">
<form action=\"modules.php\" method=\"GET\" name=\"jump\" style=\"margin-bottom: 0px;\"> ";
if (_CALINTERNATIONALDATES) {
echo calBuiltDaySelect("d", $tag);
echo calBuiltMonthSelect("m", $monat);
echo calBuiltYearSelect("y", $jahr);
} else {
echo calBuiltMonthSelect("m", $monat);
echo calBuiltDaySelect("d", $tag);
echo calBuiltYearSelect("y", $jahr);
}
echo " <select name=\"op\" onChange=\"location.href='" . CAL_MODULE_LINK . "&op=' + document.jump.op.options[document.jump.op.options.selectedIndex].value + '&m=' + document.jump.m.options[document.jump.m.options.selectedIndex].value + '&d=' + document.jump.d.options[document.jump.d.options.selectedIndex].value + '&y=' + document.jump.y.options[document.jump.y.options.selectedIndex].value;\">\n<!-- KalenderMx v" . CAL_VERSION . " © by shiba-design.de -->\n
<option " . (($op == "list") ? "selected " : "") . "value=\"list\">" . _CALLISTLINK . "</option>\n
<option " . (($op == "day") ? "selected " : "") . "value=\"day\">" . _CALDAYLINK . "</option>\n
<option " . (($op == "month") ? "selected " : "") . "value=\"month\">" . _CALMONTHLINK . "</option>\n
<option " . (($op == "year") ? "selected " : "") . "value=\"year\">" . _CALYEARLINK . "</option>\n
</select>\n
<input type=\"submit\" value=\"" . _CALJUMPBUTTON . "\">
<input type=\"hidden\" name=\"name\" value=\"" . CAL_MODULE_NAME . "\">
<input type=\"hidden\" name=\"col\" value=\"$col\">
</form></td>";
if ($op == "view") {
$op = "day";
}
echo "<td width=\"60%\">
<form action=\"modules.php\" method=\"GET\" name=\"jumptoday\" style=\"margin-bottom: 0px;\">
<input type=\"submit\" value=\"" . _CALTODAY . "\">
<input type=\"hidden\" name=\"name\" value=\"" . CAL_MODULE_NAME . "\">
<input type=\"hidden\" name=\"d\" value=\"" . Date("d") . "\">
<input type=\"hidden\" name=\"m\" value=\"" . Date("m") . "\">
<input type=\"hidden\" name=\"y\" value=\"" . Date("Y") . "\">
<input type=\"hidden\" name=\"op\" value=\"$op\">
<input type=\"hidden\" name=\"col\" value=\"$col\">
</form></td>\n</tr>\n";
echo "<tr><td class='content' colspan='" . $nextcolspan . "'>";
echo "<a href=\"" . CAL_MODULE_LINK . "&op=search&sd=$jahr-$monat-$tag\"><img src=\"" . CAL_IMAGE_PATH . "info.gif\" alt=\"" . _CALSEARCHEVENT . "\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" hspace=\"5\">" . _CALSEARCHEVENT . "</a>";
if ($printerlink && $reqfile != 'submit') {
echo " <a href='" . $printerlink . "' target='calprintwin' onClick=\"window.open('" . $printerlink . "','calprintwin','left=10, top=10, width=640,height=480,toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0'); return false;\">";
echo "<img src='" . CAL_IMAGE_PATH . "print.gif' alt='" . _CALPRINTER1 . "' width='17' height='16' hspace='5' border='0' align='middle' title='" . _CALPRINTER2 . "'>" . _CALPRINTER1 . "";
echo "</a>";
}
if (calIsPostAllowed()) echo " <a href=\"" . CAL_MODULE_LINK . "&file=submit&sd=$jahr-$monat-$tag\"><img src=\"" . CAL_IMAGE_PATH . "sign.gif\" alt=\"" . _CALSUBMITEVENT . "\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" hspace=\"5\">" . _CALSUBMITEVENT . "</a>";
if (calIsAdmin()) echo " <a href=\"".CAL_ADMIN_FILE."?op=CalendarAdmin\" title=\"" . _CALNEWSUBMISSIONS . "\"><img src=\"" . CAL_IMAGE_PATH . "waiting.gif\" alt=\"" . _CALNEWSUBMISSIONS . "\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" hspace=\"5\">" . _CALSUBMISSIONSADMIN . "</a>";
// echo " </td><td align='right' class='content'>";
echo "</td>";
echo "</tr></table>";
CloseTable();
}
// ########################################################################################
function calGetTimeFormated($time)
{
if (ereg("([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $tmp)) {
$tmptime = @mktime($tmp[1], $tmp[2], 0, Date("m"), Date("d"), Date("Y"));
} else {
$tmptime = time();
}
return calStrftime(_CALTIMEFORMAT, $tmptime);
}
#########################################################################################
function calIsAdmin() {
global $db, $calconf, $Version_Num, $prefix;
static $admintest;
if (isset($admintest)) {
return $admintest;
}
$admintest = 0;
if (!isset($calconf)) {
include(CAL_MODULE_PATH . "config/config.php");
}
if (function_exists('mxGetAdminData')) {
$adata = mxGetAdminData();
$admintest = (mxGetAdminPref($calconf['AdminType'])) ? $adata['aid'] : 0;
} else if (isset($GLOBALS['admin'])) {
if ($calconf['AdminType'] == 'radmincalendar') { // falls Grundeinstellung von vkpMx
$calconf['AdminType'] = 'radminsuper';
}
if (is_array($GLOBALS['admin'])) {
$yadmin = $GLOBALS['admin'];
} else {
$xadmin = base64_decode($GLOBALS['admin']);
$yadmin = explode(":", $xadmin);
}
$xaid = (empty($yadmin[0])) ? "" : substr($yadmin[0], 0, 25);
$xpwd = (empty($yadmin[1])) ? "" : $yadmin[1];
if (!$xaid || !$xpwd) {
return 0;
}
// We are in PHPNuke >= 7.5
if (version_compare($Version_Num, '7.5', '>=')) {
// idea by Xai Rho
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM " . $prefix . "_modules WHERE title='" . CAL_MODULE_NAME . "'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM " . $prefix . "_authors WHERE aid='$xaid'"));
$admins = explode(',', $row['admins']);
for ($i = 0; $i < sizeof($admins); $i++) {
if (($row2['name'] == $admins[$i] AND !empty($row['admins'])) || ($row2['radminsuper'] == 1)) {
$admintest = 1;
}
}
} else {
$result = sql_query("select aid, pwd, " . $calconf['AdminType'] . ", radminsuper from " . CAL_TABLE_MX_AUTHORS . " where aid='" . $xaid . "'", $dbi);
list($aid, $pwd, $CalendarAdmin, $radminsuper) = sql_fetch_row($result, $dbi);
$admintest = (($pwd == $xpwd && $pwd != "") && (($CalendarAdmin == 1) || ($radminsuper == 1))) ? $aid : 0;
}
}
return $admintest;
}
// ########################################################################################
function calGetBarColorAlt ($categorie)
{
static $lastcat, $caption;
if ($categorie == $lastcat && isset($caption)) {
return $caption;
}
$points = calGetEventpoints();
$categorie = calGetCurrentEventPoint($categorie);
$caption = $points[$categorie];
return $caption;
}
// ########################################################################################
function calGetBarImage($picname, $categorie)
{
static $lastcat, $lastpic, $pic;
if ($categorie == $lastcat && $picname == $lastpic && isset($pic)) {
return $pic;
}
if (!is_numeric($categorie)) $categorie = calGetOldColors($categorie);
$categorie = (int)$categorie;
$xcategorie = ($categorie < 10) ? "0$categorie" : "$categorie";
$pic = "" . CAL_IMAGE_PATH . "colors/${picname}_${xcategorie}.gif";
return $pic;
}
// ########################################################################################
// zur Abwaertskompatibilitaet,
// ermittelt die neuen Zahlenwerte der alten Farbbuchstaben
function calGetOldColors($categorie = 'b')
{
$return = array('b' => 1,
'c' => 2,
'g' => 3,
'o' => 4,
'r' => 5,
'u' => 6,
'w' => 7,
'y' => 8,
);
return (isset($return[$categorie])) ? $return[$categorie] : 1;
}
// ########################################################################################
// zur Abwaertskompatibilitaet,
// ermittelt die alten Farbbuchstaben der neuen Zahlenwerte
function calSetOldColors($categorie = 0)
{
$categorie = intval($categorie);
$return = array(1 => 'b',
2 => 'c',
3 => 'g',
4 => 'o',
5 => 'r',
6 => 'u',
7 => 'w',
8 => 'y',
);
return (isset($return[$categorie])) ? $return[$categorie] : 'b';
}
// ########################################################################################
// gibt das Array zurueck welches in den Sprachfiles definiert ist
// nur die Schluessel mit Werten werden beruecksichtigt, der Index bleibt erhalten
function calGetEventpoints()
{
static $points;
if (empty($points)) {
global $caldotcolor;
if (!isset($caldotcolor)) {
$caldotcolor = calGetDotColors();
}
$points = array();
foreach($caldotcolor as $index => $caption) {
$caption = trim($caption);
if (!empty($caption)) {
$points[$index] = $caption;
// print "\$points[$index] = $caption;<br />";
}
}
// asort($points);
}
return $points;
}
// ########################################################################################
function calGetSqlEventpoints($categorie = 0)
{
if ($categorie) {
$categorie = (int)$categorie;
$points[$categorie] = calGetCurrentEventPoint($categorie);
} else {
$points = calGetEventpoints();
}
foreach($points as $index => $caption) {
$vari[] = $index;
if ($index < 10) $vari[] = "0$index";
if ($index <= 8) {
$vari[] = calSetOldColors($index);
}
}
$xvari = "'" . implode("','", $vari) . "'";
return $xvari;
}
// ########################################################################################
// ermittelt den Index der ersten definierte Kategorie aus dem Sprachfile
function calGetFirstEventPoint()
{
static $firstpoint;
if (empty($firstpoint)) {
$points = calGetEventpoints();
reset($points);
$firstpoint = key($points);
}
return $firstpoint;
}
// ########################################################################################
// ermittelt den gueltigen Index des uebergebenen Farbwertes
function calGetCurrentEventPoint($categorie)
{
static $lastcategorie;
$categorie = (is_numeric($categorie)) ? $categorie : calGetOldColors($categorie);
$categorie = (int)$categorie;
if (empty($lastcategorie) || empty($categorie) || ($categorie != $lastcategorie)) {
$points = calGetEventpoints();
$points = array_flip($points);
if (empty($categorie) || (!in_array ($categorie, $points))) {
$categorie = calGetFirstEventPoint();
}
$lastcategorie = $categorie;
}
return $categorie;
}
// ########################################################################################
function calBuildColorLegend($modus, $showalldot = 0, $showNewlink = 0, $categorie = "", $linkdate = "")
{
global $calconf;
$maxcols = (empty($calconf['catListCols'])) ? 6 : $calconf['catListCols'];
$maxcols = ($modus == "form") ? $maxcols-1 : $maxcols;
$eventpoints = calGetEventpoints();
// mxDebugFuncVars($eventpoints);
$catcountall = count($eventpoints);
if ($showalldot) $catcountall++;
if ($showNewlink) $catcountall++;
$catcount = 0;
$rowcount = 1;
$link = CAL_MODULE_LINK . "&op=list$linkdate";
$legend = "\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\">";
if ($showalldot && !calIsPrintView()) {
if ($catcount == $maxcols) {
$legend .= "</tr>\n<tr valign=\"top\">";
$catcount = 0;
}
$catcount++;
$imgprops = "align=\"middle\" hspace=\"1\" width=\"16\" height=\"14\" border=\"0\" vspace=\"0\" alt=\"" . _CALDOTCOLORALL . "\"";
$legend .= "<td style=\"white-space: nowrap;\"><span class=\"tiny\">";
if ($modus == "form") {
$sel = (empty($categorie)) ? "checked" : "";
$legend .= "<input type=\"radio\" $sel name=\"categorie\" value=\"0\" style=\"background-color: transparent;\"> <img src=\"" . CAL_IMAGE_PATH . "star.gif\" $imgprops>" . _CALDOTCOLORALL . "";
} else {
if (empty($categorie)) {
$legend .= "<b><img src=\"" . CAL_IMAGE_PATH . "star.gif\" $imgprops>" . _CALDOTCOLORALL . "</b>";
} else {
$legend .= "<a href=\"$link\"><img src=\"" . CAL_IMAGE_PATH . "star.gif\" $imgprops>" . _CALDOTCOLORALL . "</a>";
}
}
$legend .= "</span></td>\n";
}
$imgprops = "hspace=\"4\" vspace=\"4\" width=\"9\" height=\"9\" border=\"0\" alt=\"\" align=\"middle\"";
foreach($eventpoints as $index => $caption) {
$catcount++;
$image = calGetBarImage("ball", $index);
$legend .= "<td style=\"white-space: nowrap;\"><span class=\"tiny\">";
if ($modus == "centerblock") {
$legend .= "<a href=\"$link&col=$index\"><img src=\"$image\" $imgprops>$caption</a>";
} else if ($modus == "form") {
$sel = ((int)$categorie == (int)$index) ? "checked" : "";
$legend .= "<input type=\"radio\" $sel name=\"categorie\" value=\"$index\" style=\"background-color: transparent;\"> <img src=\"$image\" $imgprops>$caption";
} else {
if ($index == $categorie) {
$legend .= "<img src=\"$image\" $imgprops><b>$caption</b>";
} else {
$legend .= "<a href=\"$link&col=$index\"><img src=\"$image\" $imgprops>$caption</a>";
}
}
$legend .= "</span></td>";
if ($catcount == $maxcols) {
$legend .= "</tr>\n<tr valign=\"top\">";
$catcount = 0;
}
}
if ($showNewlink && calIsPostAllowed() && !calIsPrintView()) {
if ($catcount == $maxcols) {
$legend .= "</tr>\n<tr valign=\"top\">";
$catcount = 0;
}
$catcount++;
$imgprops = "width=\"16\" height=\"16\" border=\"0\" align=\"middle\" hspace=\"3\" vspace=\"0\" alt=\"" . _CALSUBMITEVENT . "\"";
$legend .= "<td style=\"white-space: nowrap;\"><span class=\"tiny\"><a href=\"" . CAL_MODULE_LINK . "&file=submit\"><img src=\"" . CAL_IMAGE_PATH . "sign.gif\" $imgprops>" . _CALSUBMITEVENT . "</a></span></td>\n";
}
$colspan = $maxcols - $catcount;
if ($colspan && $colspan < $maxcols) {
$legend .= "<td colspan=\"$colspan\"> </td>\n";
}
$legend .= "</tr>\n</table>\n";
return $legend;
}
// ########################################################################################
function calBuildColorLegendSideBlocks()
{
$link = CAL_MODULE_LINK . "&op=list";
$eventpoints = calGetEventpoints();
$imgprops = "hspace=\"2\" width=\"9\" height=\"9\" border=\"0\" alt=\"\"";
$legend = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
foreach($eventpoints as $index => $caption) {
$image = calGetBarImage("ball", $index);
$legend .= "<tr><td><img src=\"$image\" $imgprops></td><td valign=\"top\"><span class=\"tiny\">";
$legend .= "<a href=\"$link&col=$index\">$caption</a>\n";
$legend .= "</span></td></tr>";
}
$legend .= "</table>";
return $legend;
}
// ########################################################################################
function calBuildTopicsSelect($topic=0, $forsearch='') {
global $db;
if ($forsearch) {
$qry = "SELECT DISTINCT t.topicid, t.topictext
FROM " . CAL_TABLE_MX_TOPICS . " AS t INNER JOIN " . CAL_TABLE_EVENTS . " AS e ON t.topicid = e.topic
WHERE (t.topictext<>'')";
}
else {
$qry = "select topicid, topictext from " . CAL_TABLE_MX_TOPICS . " where topictext<>''";
}
$result = $db->sql_query($qry);
$option['00'] = "<option value=\"\">- " . _CALSELECTTOPIC . "</option>\n";
while(list($topicid, $topics) = $db->sql_fetchrow($result)) {
$option[$topics] = "<option value=\"" . $topicid . "\"" . (($topicid == $topic) ? " selected" : "") . ">" . calPrepareDisplay(strip_tags($topics)) . "</option>\n";
}
$out = '';
if (count($option) > 1) {
if (function_exists('array_change_key_case')) {
$option = array_change_key_case($option, CASE_UPPER);
}
ksort($option, SORT_STRING);
// mxDebugFuncVars($option);
$out .= "\n<select name=\"topic\" id=\"topic\" title=\"" . _CALSELECTTOPIC . "\">\n";
$out .= implode('', $option);
$out .= "</select>\n";
} else if (!$forsearch) {
$out .= "<b>" . _CALNOTOPICS . "</b>";
}
return $out;
}
// ########################################################################################
function calBuildCategorieSelect($categorie=0) {
global $db;
$eventpoints = calGetEventpoints();
$whereoption = '';
if (count($eventpoints)) {
$whereoption = ' AND categorie in (' . implode(',', array_keys($eventpoints)) . ')';
}
$toplist = $db->sql_query("SELECT DISTINCT categorie FROM ".CAL_TABLE_EVENTS." WHERE (activ=1)".$whereoption."");
$option['00'] = "<option value=\"\">- "._CALSELCATEGORY."</option>\n";
while(list($col) = $db->sql_fetchrow($toplist)) {
$option[$eventpoints[$col]] = "<option value=\"" . $col . "\"" . (($col == $categorie) ? " selected" : "") . ">" . calPrepareDisplay(strip_tags($eventpoints[$col])) . "</option>\n";
}
$out = '';
if (count($option) > 2) {
if (function_exists('array_change_key_case')) {
$option = array_change_key_case($option, CASE_UPPER);
}
ksort($option);
// mxDebugFuncVars($option);
$out .= "\n<select name=\"categorie\" id=\"categorie\" title=\"" . _CALSELCATEGORY . "\">\n";
$out .= implode('', $option);
$out .= "</select>\n";
}
return $out;
}
// ########################################################################################
function calBuiltMonthSelect($name, $month)
{
$out = "<select name=\"$name\" id=\"$name\" title=\"" . _CALMONTHS . "\">\n";
for ($i = 1; $i <= 12; $i++) {
$out .= "<option value=\"" . $i . "\"" . (($i == $month) ? " selected" : "") . ">" . calGetMonthName($i) . "</option>\n";
}
$out .= "</select> \n";
return $out;
}
// ########################################################################################
function calBuiltDaySelect($name, $day)
{
$out = "<select name=\"" . $name . "\" id=\"" . $name . "\" title=\"" . _CALDAYS . "\">\n";
for ($i = 1; $i <= 31; $i++) {
$out .= "<option value=\"" . $i . "\"" . (($i == $day) ? " selected" : "") . ">" . sprintf("%02d", $i) . "</option>\n";
}
$out .= "</select> \n";
return $out;
}
#########################################################################################
function calBuiltYearSelect($name, $year) {
global $db;
static $minyear;
$yrange = intval(Date("Y"));
$startyear = $yrange-10;
if (!isset($minyear)) {
$result = $db->sql_query("SELECT Min(Year(startDate)) AS minyear FROM ".CAL_TABLE_EVENTS." WHERE (Year(startDate)>=1975)");
list($minyear) = $db->sql_fetchrow($result);
}
if ($minyear <= $startyear) {
$startyear = $minyear-5;
}
// mxDebugFuncVars($startyear, $minyear);
$out = "<select name=\"" . $name . "\" id=\"" . $name . "\" title=\"" . _CALYEARS . "\">\n";
for ($i = $startyear; $i <= $yrange + 30; $i++) {
$out .= "<option value=\"" . $i . "\"" . (($i == $year) ? " selected" : "") . ">" . $i . "</option>\n";
}
$out .= "</select> \n";
return $out;
}
// ########################################################################################
function calBuildMinuteSelect($name, $min)
{
global $calconf;
// mxDebugFuncVars($calconf['minuterange'], $name, $min);
$out = "<select name=\"$name\" id=\"$name\" title=\"" . _CALMINUTES . "\">\n";
for ($i = 0; $i <= (60 - $calconf['minuterange']);) {
$out .= "<option value=\"" . $i . "\" " . (($i == $min) ? " selected" : "") . ">:" . sprintf("%02d", $i) . "</option>\n";
$i = $i + $calconf['minuterange'];
}
$out .= "</select> \n";
return $out;
}
// ########################################################################################
function calBuildHourSelect($name, $hour, $ampm)
{
if (_CALTIME24HOUR) {
$range = 23;
} else {
$range = 12;
$hour = ($hour != 12) ? $hour - $ampm : $hour;
}
$out = "<select name=\"" . $name . "\" id=\"" . $name . "\" title=\"" . _CALHOURS . "\">\n";
for ($i = 0; $i <= $range; $i++) {
$out .= "<option value=\"" . $i . "\"" . (($i == $hour) ? "selected " : "") . ">" . sprintf("%02d", $i) . "</option>\n";
}
$out .= "</select> \n";
return $out;
}
// ########################################################################################
// // wird nicht mehr verwendet
function calBuildAmPmSelect($name, $hour = 0)
{
if (_CALTIME24HOUR) {
$out = "<input type=\"hidden\" name=\"" . $name . "\" value=\"0\">\n";
} else {
$out = "<select name=\"" . $name . "\" id=\"" . $name . "\">";
$out .= "<option value=\"0\"" . (($hour < 12) ? "selected" : "") . ">AM</option>\n";
$out .= "<option value=\"12\"" . (($hour >= 12) ? "selected" : "") . ">PM</option>\n";
$out .= "</select> \n";
}
return $out;
}
// ########################################################################################
function calGetMonthName($month)
{
$month = intval($month);
$return = array(1 => _CALJAN,
2 => _CALFEB,
3 => _CALMAR,
4 => _CALAPR,
5 => _CALMAY,
6 => _CALJUN,
7 =>
|
|
|
| Torna in cima |
|
 |
|
|
Non puoi inserire nuovi Topic in questo forum Non puoi rispondere ai Topic in questo forum Non puoi modificare i tuoi messaggi in questo forum Non puoi cancellare i tuoi messaggi in questo forum Non puoi votare nei sondaggi in questo forum
|
|