Forums / All Other Contributions/Addons / Event Calendar v3

Event Calendar v3

Locked

Views: 68,118

Results 41 to 60 of 500
This thread is locked. New replies are disabled.
27 Jun 2008, 2:42 AM
#41
fusionsp avatar

fusionsp

Zen Follower

Join Date:
Jun 2008
Posts:
204
Plugin Contributions:
0

Event Calendar v3

aled:

I've modified the file table_block.php on line 77 and it seems to work but please make some test.
replace line 77 in admin\includes\classes\table_block.php

    $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";

with:

      if(isset($contents[$i]['text'])){
    $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
    } else {
    $tableBox_string .= '>' . $contents['text'] . '</td>' . "\n";
    }

I'm not sure this modify not create some other bugs, but for the moment is the best I can do! If is there some guru who want help us, we are waiting for Him!!!
Bye

well i tried doing it my way and it didnt work. so i tried things this way and i found a glitch. when i try to edit any of the boxes or modules anywhere in the admin section...the edit area on the right hand side of the screen goes away? its there till i push the edit button?

would this change of yours do that?

http://www.fusionspiritualemporium.com
Contrib: Events Calender v1.02 update

27 Jun 2008, 11:35 AM
#42
fusionsp avatar

fusionsp

Zen Follower

Join Date:
Jun 2008
Posts:
204
Plugin Contributions:
0

Re: Event Calendar v3

:wacko:> bigjoed:

When trying to add a new event I get the following error:

Fatal error: Cannot use string offset as an array in mywebsite.com/admin/includes/classes/table_block.php on line 77

Can anybody tell me what am I doing wrong?

Thanks

ok, open admin/includes/boxes/event_drop_dns.php and look near the very bottom line of code. it will be in 2 places that has to change.

echo $box->menuBox($heading,'');

change to this:

echo $box->menuBox($heading, $info_box_contents);

should be around line 88. but i use hostmonster and the editor does not have numbers. found this through an osCommerce site

http://www.fusionspiritualemporium.com
Contrib: Events Calender v1.02 update

27 Jun 2008, 1:49 PM
#43
fusionsp avatar

fusionsp

Zen Follower

Join Date:
Jun 2008
Posts:
204
Plugin Contributions:
0

Re: Event Calendar v3

OK...:frusty:

i fixed all the errors with this contrubition. i just uploaded the new version. its working with v1.3.8

:clap:

http://www.fusionspiritualemporium.com
Contrib: Events Calender v1.02 update

28 Aug 2008, 9:15 PM
#44
solarflare avatar

solarflare

Zen Follower

Join Date:
Sep 2006
Posts:
81
Plugin Contributions:
0

Re: Event Calendar v3

Anybody seen this before? I get this on the main calendar page. I'm using ZC 1.37 and the latest version of the Event Calendar

Parse error: syntax error, unexpected '}' in /home/servername/public_html/mysitename/includes/modules/events_calendar_listing.php on line 23

Personalized candy favors and gifts: http://www.westcoastfavors.com

The Sea Crew: http://www.theseacrew.com/shop/

5 Sep 2008, 6:51 PM
#45
kmkl avatar

kmkl

New Zenner

Join Date:
Sep 2008
Posts:
1
Plugin Contributions:
0

Re: Event Calendar v3

fusionsp:

OK...:frusty:

i fixed all the errors with this contrubition. i just uploaded the new version. its working with v1.3.8

:clap:
I have downloaded and installed the latest version (1.02) and it works fine apart from not displaying all the events for a given day, or a given month, or all events. It only displays them per event item.

eg:
when the URL is ?main_page=events_calendar&_day=25&_month=09&_year=2008 ..OR
when the URL is ?main_page=events_calendar&_month=09&_year=2008 ... OR
when the URL is ?main_page=events_calendar&view=all_events ... i only get the drop down menu appearing (which i can then select to show the one item).

Does anyone know how can I get it to actually list all the items per given day, month, or year ?

The site can be found at : http://www.thecenterchurch-pm.org

Your help is highly appreciated !!

15 Sep 2008, 11:26 PM
#46
falstaffpac avatar

falstaffpac

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

Re: Event Calendar v3

I wanted to let the author know I ran into some problems with the most current version, 1.02 After playing around with it for a few hours, I decided to d/l and install version 1.01RC1 and all my problems resolved.

Unfortunately I am not a programmer, so I can't help isolate the problem but can tell you what it is doing on my end. I can tell you after I installed 1.02, the calendar displayed appropriately in the sidebox and I was able to add events via "Events Manager"

The event would be highlighted appropriately in the calendar, however when I clicked the hyperlink to the event, it would load the events calendar page, but the event would not be displayed. I simply had a "select event" dialog, and the formatting of the page was lost. I also noticed the hyperlink was not forwarding the day/month/year information.

Instead of having something like:
http://www.strungoutandwired.com/index.php?main_page=events_calendar&_day=29&_month=09&_year=2008

It showed:
http://www.strungoutandwired.com/index.php?main_page=events_calendar&_day=&_month=&_year=

Furthermore, if I typed in the address and manually entered the day/month/year values it would still go to the "select event" dialog without displaying the event information (and formatting was lost).

I hope this information is helpful, if you need me to troubleshoot something on my end, let me know. As I said, 1.01RC1 seems to be working just fine for me!

Aaron

16 Sep 2008, 11:14 AM
#47
falstaffpac avatar

falstaffpac

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

Re: Event Calendar v3

I continued to play around between the two versions (1.02 and 1.01RC) and can be a bit more specific regarding the problems I'm experiencing.

/includes/classes/calendar.php
causes the problem with forwarding the day/month/year information in the hyperlink (works in 1.01RC, does not work in 1.02)

/includes/modules/events_calendar_listing.php
causes the problem with the formatting of the events_calendar page, resulting in loss of formatting and lack of events being displayed (works in 1.01RC, does not work in 1.02)

I seem to still have a problem. If I click on an "event" from the calendar, it hyperlinks me to the events_calendar page, but only shows me a list of events. I would think this should hyperlink me to the description of the specific event, but it does not.

16 Sep 2008, 11:29 AM
#48
falstaffpac avatar

falstaffpac

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

Re: Event Calendar v3

One further observation. As I said, I am not a programmer.

If I look at the code in /includes/classes/calendar.php and /includes/modules/events_calendar_listing.php in the 1.02 release, it appears the formatting of the actual code has been lost.

When I look at the code of these two files in the 1.01RC release, the formatting of the code is preserved.

I'm viewing this code in EditPad Pro, which is a text editor designed to work with code (as opposed to notepad and wordpad, which I know can botch code).

17 Sep 2008, 12:52 PM
#49
falstaffpac avatar

falstaffpac

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

Re: Event Calendar v3

I've hand edited the two files I was having problems with:
/classes/calendar.php
/modules/events_calendar_listing.php

Some code was jumbled in with the comment lines, causing the scripts not to function. As far as I can tell, everything is working correctly now.

21 Sep 2008, 2:56 AM
#50
falstaffpac avatar

falstaffpac

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

Re: Event Calendar v3

kmkl:

I have downloaded and installed the latest version (1.02) and it works fine apart from not displaying all the events for a given day, or a given month, or all events. It only displays them per event item.

As I said in my previous post, I had to hand edit some of the code which was jumbled in with some remark lines. You might want to have a look at the code in:

/classes/calendar.php
/modules/events_calendar_listing.php

and edit them as appropriate. My events calendar correctly lists events per month and all events.

I would very much like to know how you managed to get your calendar to display the event and its description by default. I've been working on getting mine to do this for the past 3 days. You can imagine how frustrating it is when you don't understand php :)

30 Sep 2008, 4:16 PM
#51
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: Event Calendar v3

Hi Guys,

Installed this module on a vanilla ZC 1.3.8a install and all seems to work fine EXCEPT the sidebox contains that whole site!
Any ideas?

You can see it here:
http://tinyurl.com/53djkt

19 Oct 2008, 4:12 AM
#52
aussie avatar

aussie

New Zenner

Join Date:
Apr 2005
Location:
NSW - Australia
Posts:
38
Plugin Contributions:
0

Re: Event Calendar v3

Thanks falstaffpac for the info on the calendar !
Without the knowledge of knowing that the script needed cleaning up - I would have rode the module off.

But after cleaning up, my customer is now happy her ZenCart Site has a calendar :)
And a working one at that !

Appreciate your posts !

Brad :)

20 Oct 2008, 4:26 PM
#53
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Event Calendar v3

falstaffpac:

As I said in my previous post, I had to hand edit some of the code which was jumbled in with some remark lines. You might want to have a look at the code in:

/classes/calendar.php
/modules/events_calendar_listing.php

and edit them as appropriate. My events calendar correctly lists events per month and all events.

I would very much like to know how you managed to get your calendar to display the event and its description by default. I've been working on getting mine to do this for the past 3 days. You can imagine how frustrating it is when you don't understand php :)

As a newbie to php, I would greatly appreciate if you could post the edits you made to the above files.

Thanks in advance.

21 Oct 2008, 9:33 PM
#54
rgoetz avatar

rgoetz

New Zenner

Join Date:
Aug 2006
Posts:
36
Plugin Contributions:
0

Re: Event Calendar v3

aussie:

Thanks falstaffpac for the info on the calendar !
Without the knowledge of knowing that the script needed cleaning up - I would have rode the module off.

But after cleaning up, my customer is now happy her ZenCart Site has a calendar :)
And a working one at that !

Appreciate your posts !

Brad :)

I've cleaned up that the code on the two pages, but cannot get my event to list. I just get the dropdown box. Can you please provide some insight? Rhonda:dontgetit

21 Oct 2008, 9:52 PM
#55
aussie avatar

aussie

New Zenner

Join Date:
Apr 2005
Location:
NSW - Australia
Posts:
38
Plugin Contributions:
0

Re: Event Calendar v3

Hi Rhonda,

I would suggest cleaning all files.
From memory, there was only a couple of files that did not needed touching.
But all the others I did.

And it did take me a go or two to get them all.
You only need one line to be not structured properly for things not to work :(

Hence the reason, for extra scanning of each file.

My Customers website for Reference for how the current version looks.

Have a great day :)

Brad

21 Oct 2008, 9:59 PM
#56
rgoetz avatar

rgoetz

New Zenner

Join Date:
Aug 2006
Posts:
36
Plugin Contributions:
0

Re: Event Calendar v3

Thank you a nice site, but boy it would be nice if someone could just zip up the cleaned up code! I am not an expert on PHP so this is taking some effort! Rhonda

21 Oct 2008, 10:22 PM
#57
falstaffpac avatar

falstaffpac

New Zenner

Join Date:
Jul 2008
Posts:
19
Plugin Contributions:
0

Re: Event Calendar v3

dw08gm:

As a newbie to php, I would greatly appreciate if you could post the edits you made to the above files.

I'm a little reluctant to post these files because:

  1. It is not my work
  2. I am not a programmer so I cannot offer support

Unfortunately, this script has not received much support lately and I think its pretty cool when it works. So, I've included the code of the 2 files I formatted below. I hope this is enough to get your calendar working. Beyond this, I don't know that I can be of much help.

/includes/classes/calendar.php

<?php

/** --------------------------------------------------------------------- */
/** zen-cart Open Source E-commerce                                       */
/** --------------------------------------------------------------------- */
/**  Copyright (c) 2003 The zen-cart developers                           */
/**                                                                 */
/**  http://www.zen-cart.com/index.php                                    */
/**                                                                   */
/** Portions Copyright (c) 2003 osCommerce                               */
/** ----------------------------------------------------------------------   */
/** This source file is subject to version 2.0 of the GPL license,       */
/**  that is bundled with this package in the file LICENSE, and is       */
/** available through the world-wide-web at the following url:           */
/**  http://www.zen-cart.com/license/2_0.txt.                             */
/**  If you did not receive a copy of the zen-cart license and are unable */
/** to obtain it through the world-wide-web, please send a note to       */
/** [email protected] so we can mail you a copy immediately.          */
/** ----------------------------------------------------------------------  */
/** $Id: events_manager.php 2007-07-10 [email protected]  */

class Calendar
    {
    function Calendar()
    {
    }
    function getDayNames()
    {
    	return $this->dayNames;
    }
    function setDayNames($names)
    {        
    	$this->dayNames = $names;
    }
    function getMonthNames()
    {
        $this->monthNames;
    }
    function setMonthNames($names)
    {
	$this->monthNames = $names;
    }
    function getStartDay()
    {
        return $this->startDay;
    }
    function setStartDay($day)
    {
        $this->startDay = $day;
    }
    function getStartMonth()
    {
        return $this->startMonth;
    }
    function setStartMonth($month)
    {
        $this->startMonth = $month;
    }
    function getCalendarLink($month, $year)
    {
         return "&_month=$month&_year=$year";
    }
    function pad($s, $n)
    {
        $r = $s;    while (strlen($r) < $n)
    {    
       	$r = "0".$r;
    }
    	return $r;
    }
    
    function getFileName($day, $month, $year)
    {
    	return $this->pad($year, 4) ."-". $this->pad($month, 2) ."-". $this->pad($day, 2);
    }
    
    function getDbLink($day, $month, $year)
    {	
    	global $db; 
    		$dateString = $this->getFileName($day, $month, $year);    
		$event = $db->Execute("select start_date from " . TABLE_EVENTS_CALENDAR . " where '" . $dateString . "' between start_date and end_date");
    	if($event->RecordCount() > 0)
    	{
	while (!$event->EOF)
       	{	
			
/* get the first event for this day's start date for the link */

	list($year_start, $month_start, $day_start) = split ('[/.-]', $event->fields['start_date']);
	        		break; $event->MoveNext();
         	}   
        	
        $bname = FILENAME_EVENTS_CALENDAR;
    		return "index.php?main_page=".$bname."&_day=".$day_start."&_month=".$month_start."&_year=".$year_start."";
      		}
	}
        
	function getCurrentMonthView()
    {
        $d = getdate(time());
        return $this->getMonthView($d["mon"], $d["year"]);
    }
        function getCurrentYearView()
    {
        $d = getdate(time());
        return $this->getYearView($d["year"]);
    }
        function getMonthView($month, $year)
    {
        return $this->getMonthHTML($month, $year);
    }
	function getYearView($year)
    {
        return $this->getYearHTML($year);
    }
	function getDaysInMonth($month, $year)
    {
        if ($month < 1 || $month > 12)
        {
            return 0;
        }
        $d = $this->daysInMonth[$month - 1];
        if ($month == 2)
        {
            if ($year%4 == 0)
            {
                if ($year%100 == 0)
                {
                    if ($year%400 == 0)
                    {
                        $d = 29;
                    }
                }
                else
                {
                    $d = 29;
                }
            }
        }
        return $d;
    }

    function getMonthHTML($m, $y, $show = 1)
    {
        $s = "";
        $a = $this->adjustDate($m, $y);
        $month = $a[0];
        $year  = $a[1];
    	$daysInMonth = $this->getDaysInMonth($month, $year);
    	$date = getdate(mktime(12, 0, 0, $month, 1, $year));
       	$first = $date["wday"];
        $monthName = $this->monthNames[$month - 1];
    	$prev = $this->adjustDate($month - 1, $year);
    	$next = $this->adjustDate($month + 1, $year);
    	$this_month = date('m');
        $this_year = date('Y');
    	$header = $monthName . (($show > 0) ? " " . $year : "");
    	$D = $this->monthNames[11].' ';
    	$J = $this->monthNames[0].' ';
 	    	if ($show == 1)
     	{
         $prevMonth = '<a href=index.php?main_page='. FILENAME_EVENTS_CALENDAR_INCLUDE . '&eventmode=eventframe' .$this->getCalendarLink($prev[0], $prev[1]).' target=calendar title='. $this->monthNames[$month - 2] . (($month-2 < 1) ? $D.($year-1) : ' '. $year) .' ><</a>';
         
         $nextMonth = '<a href=index.php?main_page='. FILENAME_EVENTS_CALENDAR_INCLUDE . '&eventmode=eventframe' . $this->getCalendarLink($next[0], $next[1]).' target=calendar title='. $this->monthNames[$month + 0] . (($month+0 > 11) ? $J.($year+1) : ' '. $year) .' >></a>';
    	}
    	else
    	{
    	    $prevMonth = "";
    	    $nextMonth = "";
    	}
    	$s .= "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
    	$s .= "<tr class=\"calendarHeader\">\n";
    	$linkHeader = zen_href_link(FILENAME_EVENTS_CALENDAR, "_month=$month&_year=$year");
    	$s .= "<td align=\"left\"><a href=\"$linkHeader\" target=\"_parent\">$header</a></td>\n";
        $s .= "<td align=\"center\" class=\"yearHeader\">\n";

      if(mktime (0,0,0,$month ,0,$year) > mktime (0,0,0,$this_month ,0,$this_year))
	{
	        $s .= $prevMonth;
        }
		else
	{
		$s .= $prevMonth;
        }
	        $s .= "</td>\n";
	    	$s .= "<td align=\"center\" class=\"yearHeader\">$nextMonth</td></tr>\n";
	    	$s .= "<tr><td colspan=\"3\">\n";
	        $s .= "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"calendarMonth\"><tr class=\"calendarHeader\">\n";
	        $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay)%7] . "</td>\n";
	    	$s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+1)%7] . "</td>\n";
	    	$s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+2)%7] . "</td>\n";
	    	$s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+3)%7] . "</td>\n";
	    	$s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+4)%7] . "</td>\n";
	    	$s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+5)%7] . "</td>\n";
	    	$s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+6)%7] . "</td>\n";
	    	$s .= "</tr>\n";$d = $this->startDay + 1 - $first;
    	
    	while ($d > 1)
    	{
    	    $d -= 7;
    	}
    		$today = getdate(time());
        	$start_day = $this->getStartDay();
        	$click = BOX_CLICK_LINK;
        	
    	while ($d <= $daysInMonth)
    	{
    	    $s .= "<tr>\n";
    	    for ($i = 0; $i < 7; $i++)
    	    {
$class = (($i < (6-$start_day) &! $i <= $start_day) ? (($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendar" ) : (($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendarWeekend"));
  	        if ($d > 0 && $d <= $daysInMonth)
    	        {
	             $link = $this->getDbLink($d, $month, $year);
                 $s .= (($link == "") ? "<td class=\"$class\" align=\"left\" valign=\"bottom\">" : "<td class=\"$class\" onclick=top.window.location=\"$link\">" );
                
                 if($show == 1)
		{
                 $s .= (($link == "") ? $d : "<a href=\"$link\" target=\"_parent\" title=\"$click\">$d</a>");
                }
			else
			{
	                 $s .= (($link == "") ? $d : "<a href=\"$link\" title=\"$click\">$d</a>");
			}
		}
    	        else
    	        {
    	            $s .= "<td class=\"empty\"> ";
    	        }
	      	        $s .= "</td>\n";
              	        $d++;
     		}
			$s .= "</tr>\n";
        	}
		    	$s .= "</table>\n";
		    	$s .= "</td></tr></table>\n";
		
		        return $s;
  	    }
  	    
    function getYearHTML($year)
    {
        $year_view = 1;
        $s = "";
    	$prev = 'index.php?main_page='.FILENAME_EVENTS_CALENDAR . $this->getCalendarLink(1, $year - 1) .'&year_view=1';
    	$next = 'index.php?main_page='.FILENAME_EVENTS_CALENDAR . $this->getCalendarLink(1, $year + 1) .'&year_view=1';
    	$this_year = date('Y');
        $s .= "<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" >\n";
        $s .= "<tr>";
               if($year > $this_year)
        {
        $s .= "<td class=\"yearHeader\" align=\"center\" align=\"left\">" . (($prev == "") ? " " : "<a href=\"$prev\"><<</a>")  . "</td>\n";
        }
        else
        {
        $s .= "<td class=\"yearHeader\" align=\"center\" align=\"left\"> </td>\n";
        }
		$s .= "<td height=\"20\" class=\"yearHeader\" align=\"center\">" . (($this->startMonth > 1) ? $year . " - " . ($year + 1) : $year) ."</td>\n";
    		$s .= "<td class=\"yearHeader\" align=\"center\" align=\"right\">" . (($next == "") ? " " : "<a href=\"$next\">>></a>")  . "</td>\n";
        	$s .= "</tr>\n";        $s .= "<tr>";        $s .= "<td valign=\"top\">" . $this->getMonthHTML(0 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(1 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(2 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "</tr>\n";
                $s .= "<tr>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(3 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(4 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(5 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "</tr>\n";
                $s .= "<tr>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(6 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(7 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(8 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "</tr>\n";
                $s .= "<tr>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(9 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(10 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "<td valign=\"top\">" . $this->getMonthHTML(11 + $this->startMonth, $year, 0) ."</td>\n";
                $s .= "</tr>\n";
                $s .= "</table>\n";
                return $s;
            }
    function adjustDate($month, $year)
    {
        $a = array();
        $a[0] = $month;
        $a[1] = $year;
        while ($a[0] > 12)
        {
            $a[0] -= 12;
            $a[1]++;
        }
        while ($a[0] <= 0)
        {
            $a[0] += 12;
            $a[1]--;
        }
        return $a;
	}
	
    /* 
        The start day of the week. This is the day that appears in the first column
        of the calendar. Sunday = 0.
    */
    var $startDay = 0;

    /* 
        The start month of the year. This is the month that appears in the first slot
        of the calendar in the year view. January = 1.
    */
    var $startMonth = 1;

    /*
        The labels to display for the days of the week. The first entry in this array
        represents Sunday.
    */
    var $dayNames = array("S", "M", "T", "W", "T", "F", "S");
    
    /*
        The labels to display for the months of the year. The first entry in this array
        represents January.
    */
    var $monthNames = array("January", "February", "March", "April", "May", "June",
                            "July", "August", "September", "October", "November", "December");
                            
                            
    /*
        The number of days in each month. You're unlikely to want to change this...
        The first entry in this array represents January.
    */
    var $daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	}
?>

/modules/events_calendar_listing.php

<?php

/** --------------------------------------------------------------------- */
/** zen-cart Open Source E-commerce                                       */
/** --------------------------------------------------------------------- */
/**  Copyright (c) 2003 The zen-cart developers     */
/**                                                                 */
/**  [url]http://www.zen-cart.com/index.php[/url]           */
/**                                                                   */
/** Portions Copyright (c) 2003 osCommerce                               */
/** ----------------------------------------------------------------------   */
/** This source file is subject to version 2.0 of the GPL license,       */
/**  that is bundled with this package in the file LICENSE, and is       */
/** available through the world-wide-web at the following url:           */
/**  [url]http://www.zen-cart.com/license/2_0.txt[/url].                             */
/**  If you did not receive a copy of the zen-cart license and are unable */
/** to obtain it through the world-wide-web, please send a note to       */
/** [email protected] so we can mail you a copy immediately.          */
/** ----------------------------------------------------------------------  */
/** $Id: events_manager.php 2007-07-10 [email protected]  */




if(isset($listingTitle))
{
    echo '<H2>' . $listingTitle . '</H2>';
}
    $events_split = new splitPageResults($events_query_raw, MAX_DISPLAY_NUMBER_EVENTS, 'DAYOFMONTH(start_date)');
    $events_query = $db->Execute($events_query_raw);
    
    /** Show Paging Header ? */
    
if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) 
 {
 ?>
        </td>
    </tr>

<tr>
        <td>
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
                <tr>
                    <td class="smallText">
                        <?php
                             if(isset($displayPagingSuffix))
                            {
                                $displayPagingSuffix = ' : ' . $displayPagingSuffix;
                            }
                            echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES . $displayPagingSuffix);
                         ?>
                    </td>
                    <td align="right" class="smallText">
                    <?php
                     echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y')));
                    ?>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>

    <?php
}
 	 $row = 0;
 	 $list_box_contents = array();
 	 
 	 /** Add headings ... */
 	 
 	 $list_box_contents[$row][] = array('align' => 'left',
                                'params' => 'class="event_header"',
                                'text' => ' ' . TEXT_EVENT_TITLE . ' ');
 	 
 	 $list_box_contents[$row][] = array('align' => 'center',
                                'params' => 'class="event_header"',
                                'text' => ' Start ' . TEXT_EVENT_DATE . ' ');
     $list_box_contents[$row][] = array('align' => 'center',
                                'params' => 'class="event_header"',
                                'text' => ' End ' . TEXT_EVENT_DATE . ' ');

                                
	/** Add listing rows ... */
             $events = $db->Execute($events_split->sql_query);
         
	/** while($events = zen_db_fetch_array($events_query)) */
	
		while (!$events->EOF)
		{
		    $row++;
		    $list_box_contents[$row][] = array('align' => 	'left',
                                       						'params' => 'class="event_description"',
                            							'text'  =>  '<a href="index.php?main_page='
                                           . FILENAME_EVENTS_CALENDAR . '&select_event=' . $events->fields['event_id'] . '">' . $events->fields['title'] . '</a>');
   			    $events->MoveNext();
		    list($year, $month, $day) = split ( '[/.-]', $events->fields['start_date']);
	            $list_box_contents[$row][] = array( 'align'  => 'center',
	            					'params' => 'class="event_description"',
	            					'text'   => date("F j, Y", mktime(0, 0, 0, $month, $day, $year)));
	            $endDate = '-';
	            if(isset($events->fields['end_date']) && trim($events->fields['end_date']) != '')
	            {
	                list($year, $month, $day) = split ('[/.-]', $events->fields['end_date']);
	                    $endDate = date("F j, Y", mktime(0, 0, 0, $month, $day, $year));
	                    }
	                    $list_box_contents[$row][] = array('align'  => 'center',
                                       'params' => 'class="event_description"',
                                       'text'   => $endDate);
                            
   		            }
   		            
 	/** Show listing */
 	 		require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_tabular_display.php');
 	
 	/** new productListingBox($list_box_contents); */
 			if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')))
 	{
 	?>
        </td>
    </tr>
    <tr>
        <td>
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
                <tr>
                    <td class="smallText">
                        <?php
                             if(isset($displayPagingSuffix))
                            {
                                $displayPagingSuffix = ' : ' . $displayPagingSuffix;
                            }
                            echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES . $displayPagingSuffix);
                         ?>
                    </td>
                    <td align="right" class="smallText">
                        <?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y'))); ?>                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td><?php
    }
 else
{
?>
	<table border=0 width="100%" cellspacing="0" cellpadding="4">
		<tr>
                    <td class="main"><br><?php echo TEXT_NO_EVENTS; ?></td>
                </tr>
            </table>
<?php
}
?>
21 Oct 2008, 11:26 PM
#58
rgoetz avatar

rgoetz

New Zenner

Join Date:
Aug 2006
Posts:
36
Plugin Contributions:
0

Re: Event Calendar v3

Thank you so much for this! You are definitely my hero! Rhonda

22 Oct 2008, 3:40 PM
#59
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Event Calendar v3

falstaffpac

Many thanks for your time in improving the readability.

26 Oct 2008, 7:55 PM
#60
aries70 avatar

aries70

New Zenner

Join Date:
Oct 2008
Posts:
3
Plugin Contributions:
0

Re: Event Calendar v3

Thanks falstaffpac,
you have a great heart :):clap: