Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#457 2007-09-17 02:59:25

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

<txp:zem_event_time format="%I:%M %p" /> worked fine.

The result is the following: 08:00 pm

I wish I could get rid of the 0 in front of the 8 though.

Last edited by mattmikulla (2007-09-17 03:01:12)


Art Rogue – Fine Art Photography

Offline

#458 2007-09-17 03:59:30

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

so %#I didn’t help there?

Offline

#459 2007-09-23 16:23:46

sisushka
Member
Registered: 2007-07-30
Posts: 14

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

Hello :)

Is there any way to have two different zem_event_calendars on site? I basically need the Slovak one (showing the slovak events) and the English one (showing the events written in English). How could I do two separate calendars? Any ideas, please?

Thankies in advance :)

Offline

#460 2007-09-29 11:00:42

sisushka
Member
Registered: 2007-07-30
Posts: 14

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

Is there any way how to let only the articles from specified category to be displayed in zem_event_calendar? Does the atribute category work for zem_event_calendar?

Offline

#461 2007-10-03 06:19:35

cybikorpg
New Member
Registered: 2007-10-03
Posts: 1

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

If you know anything, please assist.

Hi! I need help. I have been looking for a week for a solution to this problem but no remedy as of now.

When I attempt to install the plugin zem_event to my textpattern i receive the error: “Badly formed or empty plugin code.”

Using any version of the plugin this occurs. I am running textpattern 4.0.4 and would downgrade if I could find an old version. It is important that I have a working calendar and zem seems like the best method for integrating a great one into textpattern. If anyone has suggestions or can fix the code, please post!

Thanks.

Last edited by cybikorpg (2007-10-09 17:09:07)

Offline

#462 2007-10-05 10:03:20

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

Hi all,

I’m still struggling to get zem_event to sort elements as I need. I’m using txp:zem_events_list to display a list of events and need everything to sort as follows:

  • Main heading (zem_event_category)
    • Sub heading 1 (Category1)
      • Sub heading 2 (zem_event_date.event_date)
        • Sub heading 3 (zem_event_date.event_time)

I’m using the txp:if_different tag to create information blocks in a table. The 3 sub heading are no problem, but I can’t get zem_event_category to be the main sort element. I’m using the following code:

sort="zem_event_category asc, Category1 asc, zem_event_date.event_date asc, zem_event_date.event_time asc"

But this returns the following error Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource on line 290. The textbook entry for zem_event_list states “sort: This attribute’s value will be used as a SQL order by clause and can thus contain every table row of the textpattern database table followed by SQL sort order indications asc and desc respectively.”

Any help would be greatly appreciated.

Last edited by decoderltd (2007-10-15 17:09:43)

Offline

#463 2007-10-08 10:55:06

ettober
New Member
Registered: 2004-08-10
Posts: 5

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

hi!
I think I need some help… I’m trying to make work zem_event with MLP, I’m aware of the reported problem with mini_calendar but this is not a blocking problem for me, I’m just trying to display a list of event with infos on start/end dates/time and locations on a multilanguage site.
I get this: when I clone an event it loose all his event attributes, then when browsing the public area with my second language I can see my events displayed correctly with date and location but can’t get any event_name/permalink.

It’s just me? Is there some workaround to fix this?

Thanks in advance for your help!

Ettore
———-

txp 4.0.5, MLP l10n 0.6.600, zem_event 0.35, textdrive

Offline

#464 2007-10-15 12:30:43

infrarosso
New Member
Registered: 2007-10-15
Posts: 6

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

I had a problem using minical_nav. Basically i wanted that not only the beginning day of an event would be highlighted but also all the days in between the start date and the end day. For doing that i (with a friend of mine, thx marco!) made a sort of hack on the plugin. Trying to debug that i realized that there was a problem in the firsts 9 days of each months, due to a formatting matter of the date itself. I don’t know if it was an incompatibility between the pluging and my hack but still, i solved it (actually marco did it :P) and that’s the result. If you want to use it, simply modify the plugin changing the old zem_event_mini_calendar function with that one. I hope it is clear ;)

function intervallo_giorni($from, $to){

  $efrom = explode("-", $from);
  $afrom = mktime(11, 00, 00, $efrom[1], $efrom[2], $efrom[0]);
  if (isset($to)) {
	  $eto = explode("-", $to);
	  $ato = mktime(11, 00, 00, $eto[1], $eto[2], $eto[0]);
  } else 
	{ $ato = $afrom;  }
  for($i=$afrom;$i<=$ato;$i=$i+86400){
    $w[] = date("Y-m-d", $i);
  }
  return $w;
}


function zem_event_mini_calendar($atts) {
	// a mini calendar intended as a navigation control for sidebars etc
	global $pretext;

	extract(lAtts(array(
		'table'       => 'table',
		'tr'          => 'tr',
		'td'          => 'td',
		'th'          => 'th',
		'caption'     => 'caption',
		'col'         => 'col',
		'colgroup'    => 'colgroup',
		'thead'       => 'thead',
		'tbody'       => 'tbody',
		'cellspacing' => '',

		'date'       => gps('date'),
		'class'       => __FUNCTION__,
		'class_row_num' => 'number',
		'class_row_day' => 'day',
		'class_event' => '',
		'class_empty' => '',
		'class_noday' => '',
		'class_link'  => '',
		'labeltag'    => 'h3',
		'section'     => @$pretext['s'],
	),$atts));

	$y = ''; $m = '';
	if ($date)
		@list($y, $m, $d) = split('-', $date);
	if (!is_numeric($y))
		$y = strftime('%Y');
	if (!is_numeric($m))
		$m = strftime('%m');

	// day number of the first of the month (Sunday = 0)
	$first = mktime(0,0,0,$m, 1, $y);
	$firstday = strftime('%w', $first);
	// number of days in the month
	$numdays = strftime('%d',strtotime('-1 day', strtotime('+1 month', $first)));

	$out = array();

	# caption
	$out[] = doTag(strftime('%B %Y', $first), 'caption');

	# column groups
	$row = array();
	for ($d=1; $d<=7; $d++)
		$row[] = doTag('', 'col', strftime('%a', mktime(0,0,0,$m, ($d+7-$firstday), $y)));
	$out[] = doTag(n.join(n, $row).n, 'colgroup');

	# table headings
	$row = array();
	for ($d=1; $d<=7; $d++)
		$row[] = doTag(strftime('%a', mktime(0,0,0,$m, ($d+7-$firstday), $y)), $th, '', ' scope="col"');
	$out[] = doTag(n.tr(n.join(n, $row).n).n, 'thead');

	$body = array();

	$numrows = ceil(($numdays + $firstday)/7);
	$days = array();
	$w = zem_event_timeq("$y-$m-01", "$y-$m-$numdays");
	$rs = safe_rows('zem_event_date.*', 'zem_event_calendar,zem_event_date,textpattern', 'zem_event_calendar.id=zem_event_date.event_id and zem_event_calendar.article_id = textpattern.ID and textpattern.Status >= 4 and textpattern.Posted <= now()');
	foreach ($rs as $r) {
		//added
		$ww = intervallo_giorni($r['event_date'], $r['finish_date']);
		foreach ($ww as $zz) {
			$days[$zz]=true;
		}
		//end Added
        //$days[$r['event_date']] = true;

	}

	# display each cell in the calendar, 7 x 5 grid
	for ($w=0; $w<$numrows; $w++) {
		$day_row = array();
		for ($d=1; $d<=7; $d++) {
			$daynum = ($w*7) + $d;
			$dayofmonth = $daynum - $firstday;

			if (checkdate($m, $dayofmonth, $y)) {
				// this is a real day
				$Odayofmonth = sprintf("%02s", $dayofmonth);
				if (isset($days["$y-$m-$Odayofmonth"])) {
					$url = '<a class="'.$class_link.'" href="'.pagelinkurl(array(
						'date' => "$y-$m-$dayofmonth",
						's'    =>$section,
						'c'    =>@$pretext['c'],
						'q'    =>@$pretext['q'],
					)).'">'.$dayofmonth.'</a>';

					$day_row[] = doTag($url, $td, $class_event);
				}
				else {
					$day_row[] = doTag($dayofmonth, $td, $class_empty);
				}
			}
			else {
				// just a blank to fill in the grid
				$day_row[] = doTag('&nbsp;', $td, $class_noday);
			}


		}
		$body[] = doTag(n.join(n, $day_row).n, $tr, $class_row_day);
	}

	$out[] = doTag(n.join(n, $body).n, 'tbody');

	return doTag(n.join(n, $out).n, $table, $class, ($cellspacing === '' ? '' : ' cellspacing="'.$cellspacing.'"'));
}

//p.s. forgive me but i'm still not able to use textile properly :(

Last edited by infrarosso (2007-10-15 12:34:04)

Offline

#465 2007-10-18 12:43:12

lreynolds
Member
From: Burlington, ON, Canada
Registered: 2007-02-09
Posts: 30
Website

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

I’m not sure if anyone is still looking, but after seeing the post about using # to remove the leading 0 in the time, I tried that, but it didn’t work. However, if i use %l for the time (l is a lower case L) it works great.

So, using format=”%l:%M%p” gets me 7:30pm. I’m on Dreamhost, so it is unix based.

Offline

#466 2007-10-18 14:30:34

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

Thanks lreynolds, it works perfectly now. That leading 0 was really starting to annoy me!

Offline

#467 2007-10-22 09:12:10

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

Hi all,

Did anyone have any ideas about my zem_event sort problem? I’ve tried many permutations, but it just won’t work.

Would really appreciate any help.

Offline

#468 2007-11-25 18:31:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: [plugin] [ORPHAN] zem_event [flexible integrated event management]

I know I’m a bit late to the party with this but I’ve only just started using this awesome plugin in anger.

Regarding events with day numbers less than 10 not showing up in the mini calendar, both billberry and cdtavijit have mentioned or supplied fixes. I concur it’s to do with the missing leading ‘0’, but neither of those solutions seem to have made it into the version 0.3.5 that I downloaded (perhaps I used an old link?)

Either way, both these fixes make changes to the display of the calendar itself, thus showing the first 9 days of the month as 01, 02, 03… instead of 1, 2, 3… For some, this may be undesirable. In this case, would using PHP’s str_pad() be better, like this:

	$daynum = ($w*7) + $d;
	$dayofmonth = $daynum - $firstday;
	if (checkdate($m, $dayofmonth, $y)) {
		// this is a real day
		if (isset($days["$y-$m-".str_pad($dayofmonth, 2, "0", STR_PAD_LEFT)])) {
...

or does it impact other functionality in ways I haven’t yet discovered? It displays working hyperlinks on the mini-calendar for all dates on my test site, while retaining the single-digit days on the actual calendar itself.

Anyone with more experience with the plugin care to comment on this? Perhaps set me straight if I’ve made an oversight here.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB