habe nun 2 Fragen:
ich möchte das jeweilige Event in einem POP up öffnen lassen:
leider stimmt in dem Quelltext etwas nicht (wahrscheinlich der Link):
Ich hab diesen mal markiert: Die Zahl 10 steht im mom für ein Event, ich weiß nun leider nicht, welche Variable dort hin muss ?!
Das Script findet ihr hier: http://www.ikemcg.com/scripts/pec/downloads.html
Und 2. wie kann ich die Uhrzeit als 01.04.2005 ausgeben also führende Nullen sollen angezeigt werden ?
Freundliche Grüße
ich möchte das jeweilige Event in einem POP up öffnen lassen:
leider stimmt in dem Quelltext etwas nicht (wahrscheinlich der Link):
Ich hab diesen mal markiert: Die Zahl 10 steht im mom für ein Event, ich weiß nun leider nicht, welche Variable dort hin muss ?!
Das Script findet ihr hier: http://www.ikemcg.com/scripts/pec/downloads.html
<?PHP
//session_start();
//little add-on for the neat phpEventCalendar (ikemcg.com) by Nick77
//this is version 0.1.3, third and hopefully final correction of the SQL Statement to show only events in the future
//License: of course GPL;-)
//and sorry for the mess; it's my *first* work in php)
require("../config.php");
require("../lang/lang." . LANGUAGE_CODE . ".php");
$id = $HTTP_GET_VARS['id'];
//if you want a.m./p.m. displayed in your time, change %k:%i to %l:%i:%p in the following sql command
//if you want to limit the number of events displayed to X events, place 'LIMIT X' (without the " ' " signs) at the end of the $sql statement right before the closing ".
mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$sql = "SELECT id, y, m, d, title, text, TIME_FORMAT(start_time, '%k:%i') AS stime, ";
$sql .= "TIME_FORMAT(end_time, '%k:%i') AS etime, " . DB_TABLE_PREFIX . "users.uid, fname, lname ";
$sql .= "FROM " . DB_TABLE_PREFIX . "mssgs ";
$sql .= "LEFT JOIN " . DB_TABLE_PREFIX . "users ";
$sql .= "ON (" . DB_TABLE_PREFIX . "mssgs.uid = " . DB_TABLE_PREFIX . "users.uid) ";
$sql .= "WHERE text IS NOT NULL AND (y*10000+m*100+d) >= ";
$sql .= "(YEAR(NOW())*10000+MONTH(NOW())*100+DAYOFMONTH(NOW())) ";
$sql .= "ORDER BY y, m, d, start_time limit 5";
$result = mysql_query($sql) or die(mysql_error());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Your Title goes here</title>
<link rel="stylesheet" type="text/css" href="css/popwin.css">
</head>
<body bgcolor="#5787D3" style="text-align: left">
<script language="JavaScript">
function openPosting(pId) {
eval("page" + pId + " = window.open('http://www.die-schlingel.de/die-schlingel/eventkalender/eventdisplay.php?id=" + pId + "', 'mssgDisplay', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=340,height=400');");
}
</script>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#003565" width="450" height="1" id="AutoNumber1">
<tr>
<td width="450" height="1" bgcolor="#9FC5F5"><b>
<font face="Verdana" size="2">Eventkalender</font></b></td>
</tr>
</table>
<img src="unsaved:///images/clear.gif" width="4" height="3" border="0"><br clear="all">
<!-- we first ask, where in our database the entries are not NULL and take place in the future To customize the timeinterval (for example: next week) of which events should be displayed: read below!-->
<?
//we get todays date
$day = date("j");
$month = date("n");
$year = date("Y") ;
//HOW TO NARROW THE DISPLAYED TIME INTERVAL
//this is not implemented yet in this version. If you want to add it or have already done, please let me know!
//number of events found
$num_rows = mysql_num_rows($result);
//if we find some entries, we go on...
if ($myrow = mysql_fetch_array($result)) {
//Main title of the site
//as long as there is another event we build our tables;-)
do {
$wday = date ("w", mktime(0,0,0,$myrow['m'],$myrow['d'],$myrow['y']));
$title = stripslashes($myrow["title"]);
$body = stripslashes(str_replace("\n", "br" , $myrow["text"]));
//this sets how the time should be displayed:
//1. start-time 0:00->no time displayed
//2. start-time = end-time -> only start-time displayed
//3. normal start- and end-time
//If you want to use German language you have to write Uhr instead of o'clock of course;-)
if ($myrow["stime"] == "55:55") {
$timestr = "";
}
elseif ($myrow["stime"] == $myrow["etime"]) {
$timestr = $myrow["stime"] . " o'clock";
} else {
$timestr = $myrow["stime"] . "-" . $myrow["etime"] . " o'clock";
}
global $lang;
?>
<table style="BORDER-COLLAPSE: collapse" borderColor="#111111" height="22" cellSpacing="0" cellPadding="0" width="450" bgColor="#5787d3" border="0">
<tr>
<td vAlign="top" align="left" width="450" bgColor="#5787d3" height="1">
<table cellSpacing="0" cellPadding="0" bgColor="#003565">
<tr>
<td>
<table cellSpacing="1" cellPadding="0" width="450" border="0">
<tr vAlign="top" bgColor="#5787d3">
<td>
<table cellSpacing="0" cellPadding="0" width="448" border="0">
<tr>
<td bgcolor="#5787D3" width="60" align="left"><span class="display_title"><font face="VERDANA,ARIAL,GENEVA" size="2"><?= $lang['days'][$wday]. "," ?></font></td>
<td bgcolor="#5787D3" width="60" align="right"><span class="display_title"><font face="VERDANA,ARIAL,GENEVA" size="2"><?= $myrow["d"] . ".", $myrow["m"] . ".", $myrow["y"] ?></font></td>
<! End Poting Date !>
<td width="248" bgcolor="#5787D3"><a href="javascriptpenPosting(10)">
<b><font face="VERDANA,ARIAL,GENEVA" size="2" color="#FFFFFF"><span class="display_title">
<?= $title ?></font></b></span> </a> </td>
<td bgcolor="#5787D3" width="22">
<font face="VERDANA,ARIAL,GENEVA" size="2">
<img src="unsaved:///images/clear.gif" width="20" height="1" border="0"></font></td>
<td align="right" nowrap="" bgcolor="#5787D3" width="7"><span class="display_title"><?= $timestr ?></span></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
} while ($myrow = mysql_fetch_array($result));
} else {
echo "Sorry, no events were found!";
}
?>
//session_start();
//little add-on for the neat phpEventCalendar (ikemcg.com) by Nick77
//this is version 0.1.3, third and hopefully final correction of the SQL Statement to show only events in the future
//License: of course GPL;-)
//and sorry for the mess; it's my *first* work in php)
require("../config.php");
require("../lang/lang." . LANGUAGE_CODE . ".php");
$id = $HTTP_GET_VARS['id'];
//if you want a.m./p.m. displayed in your time, change %k:%i to %l:%i:%p in the following sql command
//if you want to limit the number of events displayed to X events, place 'LIMIT X' (without the " ' " signs) at the end of the $sql statement right before the closing ".
mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$sql = "SELECT id, y, m, d, title, text, TIME_FORMAT(start_time, '%k:%i') AS stime, ";
$sql .= "TIME_FORMAT(end_time, '%k:%i') AS etime, " . DB_TABLE_PREFIX . "users.uid, fname, lname ";
$sql .= "FROM " . DB_TABLE_PREFIX . "mssgs ";
$sql .= "LEFT JOIN " . DB_TABLE_PREFIX . "users ";
$sql .= "ON (" . DB_TABLE_PREFIX . "mssgs.uid = " . DB_TABLE_PREFIX . "users.uid) ";
$sql .= "WHERE text IS NOT NULL AND (y*10000+m*100+d) >= ";
$sql .= "(YEAR(NOW())*10000+MONTH(NOW())*100+DAYOFMONTH(NOW())) ";
$sql .= "ORDER BY y, m, d, start_time limit 5";
$result = mysql_query($sql) or die(mysql_error());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Your Title goes here</title>
<link rel="stylesheet" type="text/css" href="css/popwin.css">
</head>
<body bgcolor="#5787D3" style="text-align: left">
<script language="JavaScript">
function openPosting(pId) {
eval("page" + pId + " = window.open('http://www.die-schlingel.de/die-schlingel/eventkalender/eventdisplay.php?id=" + pId + "', 'mssgDisplay', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=340,height=400');");
}
</script>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#003565" width="450" height="1" id="AutoNumber1">
<tr>
<td width="450" height="1" bgcolor="#9FC5F5"><b>
<font face="Verdana" size="2">Eventkalender</font></b></td>
</tr>
</table>
<img src="unsaved:///images/clear.gif" width="4" height="3" border="0"><br clear="all">
<!-- we first ask, where in our database the entries are not NULL and take place in the future To customize the timeinterval (for example: next week) of which events should be displayed: read below!-->
<?
//we get todays date
$day = date("j");
$month = date("n");
$year = date("Y") ;
//HOW TO NARROW THE DISPLAYED TIME INTERVAL
//this is not implemented yet in this version. If you want to add it or have already done, please let me know!
//number of events found
$num_rows = mysql_num_rows($result);
//if we find some entries, we go on...
if ($myrow = mysql_fetch_array($result)) {
//Main title of the site
//as long as there is another event we build our tables;-)
do {
$wday = date ("w", mktime(0,0,0,$myrow['m'],$myrow['d'],$myrow['y']));
$title = stripslashes($myrow["title"]);
$body = stripslashes(str_replace("\n", "br" , $myrow["text"]));
//this sets how the time should be displayed:
//1. start-time 0:00->no time displayed
//2. start-time = end-time -> only start-time displayed
//3. normal start- and end-time
//If you want to use German language you have to write Uhr instead of o'clock of course;-)
if ($myrow["stime"] == "55:55") {
$timestr = "";
}
elseif ($myrow["stime"] == $myrow["etime"]) {
$timestr = $myrow["stime"] . " o'clock";
} else {
$timestr = $myrow["stime"] . "-" . $myrow["etime"] . " o'clock";
}
global $lang;
?>
<table style="BORDER-COLLAPSE: collapse" borderColor="#111111" height="22" cellSpacing="0" cellPadding="0" width="450" bgColor="#5787d3" border="0">
<tr>
<td vAlign="top" align="left" width="450" bgColor="#5787d3" height="1">
<table cellSpacing="0" cellPadding="0" bgColor="#003565">
<tr>
<td>
<table cellSpacing="1" cellPadding="0" width="450" border="0">
<tr vAlign="top" bgColor="#5787d3">
<td>
<table cellSpacing="0" cellPadding="0" width="448" border="0">
<tr>
<td bgcolor="#5787D3" width="60" align="left"><span class="display_title"><font face="VERDANA,ARIAL,GENEVA" size="2"><?= $lang['days'][$wday]. "," ?></font></td>
<td bgcolor="#5787D3" width="60" align="right"><span class="display_title"><font face="VERDANA,ARIAL,GENEVA" size="2"><?= $myrow["d"] . ".", $myrow["m"] . ".", $myrow["y"] ?></font></td>
<! End Poting Date !>
<td width="248" bgcolor="#5787D3"><a href="javascriptpenPosting(10)">
<b><font face="VERDANA,ARIAL,GENEVA" size="2" color="#FFFFFF"><span class="display_title">
<?= $title ?></font></b></span> </a> </td>
<td bgcolor="#5787D3" width="22">
<font face="VERDANA,ARIAL,GENEVA" size="2">
<img src="unsaved:///images/clear.gif" width="20" height="1" border="0"></font></td>
<td align="right" nowrap="" bgcolor="#5787D3" width="7"><span class="display_title"><?= $timestr ?></span></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
} while ($myrow = mysql_fetch_array($result));
} else {
echo "Sorry, no events were found!";
}
?>
Und 2. wie kann ich die Uhrzeit als 01.04.2005 ausgeben also führende Nullen sollen angezeigt werden ?
Freundliche Grüße