We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21595
    • 159 Posts
    some ideas to take in this calendar
    http://www.monket.net/wiki/monket-calendar/
      • 32241
      • 1,495 Posts
      We’ve look at those, and it looks awesome. smiley
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
        • 70
        • 23 Posts
        I found another calendar that uses a mysql db backend.
        http://www.easyphpcalendar.com

        {disclaimer}...I don’t work for or sell the calendar...I just like it.

        I am trying to integrate it into modx. How would you get the following code to work in a modx page. I’ve tried {{chunk}} and [[snippet]]

        <table width="700" border="1" align="center" cellpadding="10" cellspacing="0">
        	<tr>
        		<td width="205" align="center" valign="top" bgcolor="#FFFFFF"><?php
        				$EPCBLOG=1;
        				require("calendar/calendar.php"); 
        				?>
        		</td>
            <td align="center" valign="top" bgcolor="#F2F2F2"><?php
        				$EPCBLOG=2;
        				$template="calendar/blog.php";
        				$DF = "l, F j, Y"; 
        				require("calendar/calendar.php"); 
        				?>
        		</td>
          </tr>
        </table>
        


        {{chunk}} doesn’t render anyhing but the table

        [[snippet]] renders an error

        Parse error: parse error, unexpected '<' in /home/milette/public_html/manager/includes/document.parser.class.inc.php(667) : eval()'d code on line 1
        


        TIA

        Don
          I am but a dwarf in a land of giants... with propellars, calculators, bluetooth and beepers smiley
        • If you could copy the snippet code you’re trying to use here, that would be helpful.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 70
            • 23 Posts
            snippet name: epc-blogcal
            in a modx page I entered [[epc-blogcal]]

            snippet code
            <table width="700" border="1" align="center" cellpadding="10" cellspacing="0">
            	<tr>
            		<td width="205" align="center" valign="top" bgcolor="#FFFFFF"><?php
            				$EPCBLOG=1;
            				require("calendar/calendar.php"); 
            				?>
            		</td>
                <td align="center" valign="top" bgcolor="#F2F2F2"><?php
            				$EPCBLOG=2;
            				$template="calendar/blog.php";
            				$DF = "l, F j, Y"; 
            				require("calendar/calendar.php"); 
            				?>
            		</td>
              </tr>
            </table>
            


            "calendar" is a folder in the root of my site: http://www.my-site.com/calendar/
            calendar.php is in the calendar folder.
            blog.php is in calendar/templates folder

            calendar.php code
            <?php
            // Easy PHP Calendar
            // Version 6
            // Copyright 2001-2006 NashTech, Inc.
            // http://www.EasyPHPCalendar.com
            
            // SET ERROR REPORTING LEVEL
            error_reporting(E_ALL ^ E_NOTICE);
            
            if ($epcGetInit!=1) {
            
            // DETERMINE NAME OF CURRENT FILE
            if (!isset($thisFile) || (isset($_GET['thisFile']) || isset($_POST['thisFile']))) {
              $thisFile = $_SERVER['SCRIPT_NAME'];
              $thisFile = explode("/",trim($thisFile)); 
              $thisFile = $thisFile[count($thisFile)-1];
              if (!file_exists($thisFile)) $thisFile = htmlentities($_SERVER['PHP_SELF']);
              }
            
            // SERVER (ROOT) PATH TO ESCAL FOLDER
            // This address should start and end with a "/" unless this is on a windows server where it will start with a drive letter;
            if (!isset($serverPath) || $serverPath!="../" || $getPaths==1) {
            $serverPath="";
            }
            
            // URL PATH TO ESCAL FOLDER
            // This address should start and end with a "/". *
            // It is usually the name of the directory this file is in (Example: "/calendar/");
            // * If you enter the full URL starting with "http://", this address will not be verified by the calendar script!
            $urlPath="";
            
            }
            
            if ($getPaths!=1 && $epcGetInit!=1) {
            
            // GET HTML FUNCTIONS
            require_once($serverPath."functions/functions.inc.php");
            
            // CURRENT THEME
            $currentTheme="default";
            
            // INCLUDE CSS ROUTINE
            if ($CSS!="") {
            
              if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");
              require_once($serverPath."config.inc.php");
            
              if ($urlPath=="") {
                echo "<link href=\"theme/$currentTheme/esstyle.css\" rel=\"stylesheet\" type=\"text/css\"/>";
                require($serverPath."functions/categories.php");
            	}
              else {
                if (!isset($showTheme) && $_REQUEST['showTheme']!="") $showTheme=$_REQUEST['showTheme'];
                if (isset($showTheme)) {
            	  $checkTheme = $serverPath."theme/".$showTheme."/esstyle.css";
            	  if (file_exists($checkTheme)) {
            	    $currentTheme = $showTheme;
            		}
            	  }
                echo "<link href=\"".$urlPath."theme/$currentTheme/esstyle.css\" rel=\"stylesheet\" type=\"text/css\"/>";
            	require($serverPath."functions/categories.php");
            	}
              }
            
            if ($PCSS==1) {
              echo "<link href=\"".$urlPath."theme/$currentTheme/popup.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
              echo "<link href=\"".$urlPath."theme/$currentTheme/esstyle.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
              require($serverPath."functions/categories.php");
              }
            
            // INCLUDE OVERLIB ROUTINE
            if ($OL==1) {
              if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");
              require_once($serverPath."config.inc.php");
              
              // DETERMINE FILENAME
              $olFileName = "overlib.js";
              if (file_exists($serverPath."overLIB/overlib_mini.js")) $olFileName = "overlib_mini.js";
              
              echo "<script type=\"text/JavaScript\">\n";
              if (isset($ol_width)) echo "  var ol_width=$ol_width;\n";
              if (isset($ol_delay)) echo "  var ol_delay=$ol_delay;\n";
              if (isset($ol_fgcolor)) echo "  var ol_fgcolor=\"#$ol_fgcolor\";\n";
              if (isset($ol_bgcolor)) echo "  var ol_bgcolor=\"#$ol_bgcolor\";\n";
              if (isset($ol_offsetx)) echo "  var ol_offsetx=$ol_offsetx;\n";
              if (isset($ol_offsety)) echo "  var ol_offsety=$ol_offsety;\n";
              if (isset($ol_border)) echo "  var ol_border=$ol_border;\n";
              if ($ol_fixx!=0) echo "  var ol_fixx=$ol_fixx;\n";
              if ($ol_fixy!=0) echo "  var ol_fixy=$ol_fixy;\n";
              if ($ol_sticky!=0 || $showTheme=="system") echo "  var ol_sticky=1;\n";
              if ($ol_anchor==1) echo "  var ol_anchor=\"escOL\";";
              if ($ol_anchor==1) echo "  var ol_anchoralign=\"ul\";";
              echo "  var ol_vauto=1;\n";
              echo "</script>\n";
              echo "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div><script type=\"text/JavaScript\" src=\"".$urlPath."overLIB/".$olFileName."\"><!-- overLIB (c) Erik Bosrup --></script>";
              if ($ol_anchor==1) echo "<script src=\"".$urlPath."overLIB/overlib_anchor.js\"></script>";
              }
            
            // DISPLAY EVENT LIST
            if ($LIST==1) {
              if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
              require ($serverPath."functions/listings.php");
              }
            
            // DISPLAY EVENT LIST
            if ($EPCBLOG==1) {
              if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
              require ($serverPath."functions/calendar.php");
              }
            if ($EPCBLOG==2) {
              if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
              require ($serverPath."functions/blog.php");
              }
            
            // DISPLAY TEXT ON CALENDAR
            if ($TOC==1) {
              if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");
              if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
              require ($serverPath."functions/tocCalendar.php");
              }
            
            // SHOW MULTIPLE CALENDARS
            if ($MULTI==1) {
              if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");
              if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
              require($serverPath."plugins/multiShow.php");
              $MULTIX=1;
              }
            
            // DISPLAY CALENDAR
            if ($CSS=="" && $OL!=1 && $LIST!=1 && $PCSS=="" && $TOC=="" && $MULTIX=="" && $EPCBLOG=="") {
              if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");
              if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}
              require ($serverPath."functions/calendar.php");
              }
            
            // UNSET MODE VARIABLES
            unset ($CSS,$PCSS,$OL,$LIST,$TOC,$MULTI,$MULTIX);
            }
            ?>
            


            blog.php code
            <!--head-->
            <style type="text/css">
            <!--
            .tableListings {
            	width: 480px;
            	border: 1px solid #006699;
            	margin: 0px;
            	padding: 0px;
            }
            .tableDate {
            	font-family: Geneva, Arial, Helvetica, sans-serif;
            	font-size: 11px;
            	color: #000000;
            	text-align: left;
            	vertical-align: middle;
            	font-weight: normal;
            	padding: 2px;
            }
            .tableTitle {
            	font-family: Geneva, Arial, Helvetica, sans-serif;
            	font-size: 11px;
            	color: #004262;
            	text-align: left;
            	vertical-align: middle;
            	font-weight: bold;
            	padding: 2px;
            }
            .tableCategory {
            	width: 8px;
            }
            .tableDescr {
            	font-family: Geneva, Arial, Helvetica, sans-serif;
            	font-size: 11px;
            	color: #383838;
            	text-align: left;
            	vertical-align: middle;
            	font-weight: normal;
            }
            .tableTime {
            	font-family: Geneva, Arial, Helvetica, sans-serif;
            	font-size: 11px;
            	color: #295569;
            	font-weight: normal;
            }
            .newDate {color: #FFFFFF; font-weight: bold; font-size: 12px; }
            .newTime {color: #CCCCCC; font-weight: bold; font-size: 12px; }
            -->
            </style>
            <!--head-->
            
            <!--date-->
            <table width="100%"  border="0" cellpadding="1" cellspacing="0" bgcolor="#276983" class="tableListings">
              <tr class="tableDate">
                <td><span class="newDate">[date]</span>      <div align="right" class="newTime"></div></td>
              </tr>
            </table>
            <br />
            <!--date-->
            
            <!--body-->
            <table class="tableListings" [mouseover]>
              <tr>
                <td width="12" align="left" valign="top" class="tableCategory s2[category]"> </td>
                <td align="left" valign="top" bgcolor="#FFFDF2" class="tableTitle"><p>[title]<br>
                    <span class="tableDescr">[categories][descr][time]</span></p>
                </td>
              </tr>
            </table>
            <br />
            <!--body-->
            
            <!--foot-->
            
            <!--foot-->
            
            <!--empty-->
            <table border="0" class="tableListings tableTime">
              <tr>
                <td bgcolor="#FFFDF2"><center>There are no entries to display for this day.</center></td>
              </tr>
            </table>
            <!--empty-->
            
              I am but a dwarf in a land of giants... with propellars, calculators, bluetooth and beepers smiley
            • It’s a problem with the snippet. You’re not having it actually do anything. Snippets typically return data or set placeholders. Not being a coder I can’t tell you how to fix it, but I know that’s the first problem.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 70
                • 23 Posts
                Ryan, Thanks.
                I’m no coder either, more like hacker (reference to golf, not computers smiley )
                I figure it out. I created to snippets, then insert the snippets into a chunk. Then place the chunk into a blank modx page.

                snippet...epc-calendar
                	$EPCBLOG=1;
                	require("calendar/calendar.php");
                


                snippet...epc-blog
                	$EPCBLOG=2;
                	$template="calendar/blog.php";
                	$DF = "l, F j, Y"; 
                	require("calendar/calendar.php"); 
                


                Then I created a chunk to insert the snippets
                chunk...epc-blogcalendar
                <table width="700" border="1" align="center" cellpadding="10" cellspacing="0">
                	<tr>
                		<td width="205" align="center" valign="top" bgcolor="#FFFFFF">[[epc-calendar]]</td>
                    <td align="center" valign="top" bgcolor="#F2F2F2">[[epc-blog]]</td>
                  </tr>
                </table>
                


                Aside from some formating, here’s a link to the page.
                http://www.learning-playhouse.com/index.php?id=7

                Thanks.
                Don
                  I am but a dwarf in a land of giants... with propellars, calculators, bluetooth and beepers smiley
                • Good job!
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 32241
                    • 1,495 Posts
                    That’s a good one. I saw that calendar and use it as my inpiration when creating this calendar snippet. I like the feature rich to have several events recuring and do all the setting to repeat on several days or weeks or event years, just like outlook, but the interface/appearance will basically limited though. Notice the popup events on the date, I follow the idea on easyphpcalendar actually.

                    So anyway, good job in making it work. Two thumbs up...
                      Wendy Novianto
                      [font=Verdana]PT DJAMOER Technology Media
                      [font=Verdana]Xituz Media
                      • 70
                      • 23 Posts
                      Quote from: Djamoer at Feb 11, 2006, 11:57 PM

                      That’s a good one. I saw that calendar and use it as my inpiration when creating this calendar snippet.

                      Thanks for the accolades...but what is the reference to "creating tis calendar snippet" ??

                      ~ Don
                        I am but a dwarf in a land of giants... with propellars, calculators, bluetooth and beepers smiley