vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [NOT PERTAINING TO VBB] Help with calendar script (https://vborg.vbsupport.ru/showthread.php?t=34187)

Shenlong 01-16-2002 09:14 PM

I wrote a calendar script and I need help, it keeps having an error, try uploading it to a server to see. If not, i will tell u. Baiscally it is ment to have a dropdown to choose the month and the year, when u choose the month the name changes on the top, it doesnt. Also, the start of month day wont change ( a green table is supossed to move when the day changes). Anyway, check it our for yourself:

PHP Code:

<?php
$PageTitle 
"Celandar";
require (
"header.php");
// If the $Month and the $Year values don't exsist, make them the current month and year.
if ((!$Month) && (!$Year)) {
$Month date ("m");
$Year date ("Y");
}
// Calculate the viewed Month.
$Timestamp mktime (000$Month1$Year);
$MonthName date("F"$TimeStamp);
// Make a table with the proper month.
print ("<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 ALIGN=CENTER>");
print (
"<TR BGCOLOR=BLUE><TD COLSPAN=7 ALIGN=CENTER><FONT COLOR=WHITE><B> $MonthName $Year</B></FONT></TD></TR>");
print (
"<TR BGCOLOR=BLUE>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>Su</FONT></B></TD>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>M</FONT></B></TD>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>Tu</FONT></B></TD>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>W</FONT></B></TD>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>Th</FONT></B></TD>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>F</FONT></B></TD>
<TD ALIGN=CENTER WIDTH=20><B>
<FONT COLOR=WHITE>Sa</FONT></B></TD>
</TD>\n"
);
$MonthStart date("w"$TimeStamp);
if (
$MonthStart == 0) {
$MonthStart 7;
}
$LastDay date("d"mktime (000$Month+10$Year));
$StartDate = -$MonthStart;
for (
$k 1$k <= 6$k++) { // Print 6 rows.
print ("<TR BGCOLOR=WHITE>");
for (
$i 1$i <= 7$i++) { // Use 7 columns
$StartDate++;
if ((
$StartDate <=0) ||
(
$StartDate $LastDay)) {
print (
"<TD BGCOLOR=GREEN> &nbsp</TD>");
} elseif ((
$StartDate >= 1) && ($StartDate <=$LastDay)) {
print (
"<TD ALIGN=CENTER> $StartDate</TD>");
}
}
print (
"</TR>\n");
}
print (
"</TABLE>\n");
// Make te form.

print ("<FORM ACTON=\"calendar.php\" METHOD=GET>\n");
print (
"Select a new month to view:\n");
print (
"<SELECT NAME=Month>
<OPTION VALUE=1>January</OPTION>\n
<OPTION VALUE=2>Febuary</OPTION>\n
<OPTION VALUE=3>March</OPTION>\n
<OPTION VALUE=4>April</OPTION>\n
<OPTION VALUE=5>May</OPTION>\n
<OPTION VALUE=6>June</OPTION>\n
<OPTION VALUE=7>July</OPTION>\n
<OPTION VALUE=8>August</OPTION>\n
<OPTION VALUE=9>September</OPTION>\n
<OPTION VALUE=10>November</OPTION>\n
<OPTION VALUE=11>October</OPTION>\n
<OPTION VALUE=12>December</OPTION>\n
</SELECT>\n"
);
print (
"<SELECT NAME=Year>

<OPTION VALUE=2002>2002</OPTION>\n
<OPTION VALUE=2003>2003</OPTION>\n
<OPTION VALUE=2004>2004</OPTION>\n
</SELECT>\n"
);
print (
"<INPUT TYPE=SUBMIT NAME=SUBMIT Value=\"Submit!\">\n");
print (
"</FORM>\n");
require (
"footer.php");
?>


Shenlong 01-20-2002 03:55 AM

^^bump^^


All times are GMT. The time now is 09:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01091 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete