Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#193 2007-03-10 21:23:34

transph0rmer
Member
From: Europe
Registered: 2004-12-24
Posts: 14

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

Anton wrote:

Maybe I’m missing something, but I couldn’t find a way to make zem_event_location display its title, just its name, am I missing something? The location is e.g. goteborg = Göteborg but only the first name gets displyed using txp:zem_event_location. TIA!

Would like to know that too,
Cheers
Claus

Offline

#194 2007-03-10 21:40:30

jmk
Member
Registered: 2006-09-04
Posts: 49

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

matthew, i got it!!!

you put me on the right track

here are my changes:

i added this function:

# navigation by years
function zem_event_calendar_year($atts) {
	global $pretext;
	extract(lAtts(array(
		'wraptag' => 'div',
		'break'   => '',
		'class'   => __FUNCTION__,
		'prev'    => '←',
		'prevclass' => 'prev',
		'next'    => '→',
		'nextclass' => 'next',
		'date'   => gps('date'),
		'labeltag'=> 'h3',
	),$atts, 0));
	$y = ''; $m = '';
	if ($date)
		@list($y, $m, $d) = split('-', $date);
	if (!is_numeric($y))
		$y = strftime('%Y');
	if (!is_numeric($m))
		$m = strftime('%m');
	# next and previous months
	$prev_y = strftime('%Y', strtotime('-1 year', mktime(0,0,0,$m,1,$y)));
	$next_y = strftime('%Y', strtotime('+1 year', mktime(0,0,0,$m,1,$y)));
	# next link
	$out[] = '<a rel="next" class="'.$nextclass.'" href="'.pagelinkurl(array(
		'date' => $next_y,
		's'    =>@$pretext['s'],
		'c'    =>@$pretext['c'],
		'q'    =>@$pretext['q'],
	)).'">'.$next.'</a>';
	# The Year
	$out[] = doTag(strftime('%Y', mktime(0,0,0,$m,1,$y)), $labeltag, $class);
	# prev link
	$out[] = '<a rel="prev" class="'.$prevclass.'" href="'.pagelinkurl(array(
		'date' => $prev_y,
		's'    =>@$pretext['s'],
		'c'    =>@$pretext['c'],
		'q'    =>@$pretext['q'],
	)).'">'.$prev.'</a>';
	return doWrap($out, $wraptag, $break, $class);
}

which gives me the new, very crudely named, “zem_event_calendar_year”. which does exactly what i want, instead of a navigation by month, i have a navigation by years.

i then added this ingenious <txp:if_different> tag to my form

<txp:if_different><txp:zem_event_date format="%B" class="" wraptag="" /></txp:if_different>

and BOOM i got what i wanted!

thanks for your tip!

cheers,
jmk

Offline

#195 2007-03-11 02:53:29

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

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

Well done. I’ll add it to the documentation at some point, unless someone wants to add it to the wiki docs now?


Offline

#196 2007-03-12 18:00:54

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

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

Hello All,

This is a hefty post…bear with me. : )

I’m looking for a way to do something very similar to what JMK posted:

JMK Wrote:

Is there a more elegant solution to showing a list of all events taking place this year
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-01-01” date_to=“2007-01-31” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-02-01” date_to=“2007-02-28” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-03-01” date_to=“2007-03-31” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-04-01” date_to=“2007-04-30” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-05-01” date_to=“2007-05-31” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-06-01” date_to=“2007-06-30” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-07-01” date_to=“2007-07-31” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-08-01” date_to=“2007-08-31” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-09-01” date_to=“2007-09-30” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-12-01” date_to=“2007-10-31” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-12-01” date_to=“2007-11-30” />
<tag>Month</tag>
<txp:zem_event_list date_from=“2007-12-01” date_to=“2007-12-31” />

This works well…except when listings start running into the next year.
(like right now, I already have events for Jan and Feb of 2008).
Which means if you use the method above, you have to keep reordering the list after each month passes, or make a giant list of date ranges for several years in advance.
Not really a viable solution for sites that get turned over to clients to maintain.

Here’s a thought:
Add 2 new attributes to zem_event_list:
<txp:zem_event_list listby=“month” remove=“1” sort=“zem_event_date.event_date asc” />

listby is a fictional tag that would output events by month starting with the current month.
remove is another fictional tag that could be set to remove individual events after their dates pass or leave them.

Not sure how to address recurring events that span multiple months? (like a theatre event or art exhibition)
Maybe all of this can already be done with existing tags…I could be totally overthinking this.

Just putting some thoughts out there…

Any Ideas?


Tom

Last edited by renobird (2007-03-12 18:02:20)

Offline

#197 2007-03-12 22:36:54

jmk
Member
Registered: 2006-09-04
Posts: 49

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

you are, if i may be so blunt, really overthinking it. it is really rather easy.

the default configuration of zem_event_list is to start from today and go all the way to the end. which also means that it automatically shows only events in the future.

now if you add to the zem_event_display form this really wonderful tag

<txp:if_different><txp:zem_event_date format="%B" class="" wraptag="" /></txp:if_different>

then you will have a line above an event saying the respective month, but only if it has changed from the previous. so in effect it is doing what i (and what i gathered. you too) want.

Last edited by jmk (2007-03-12 22:39:11)

Offline

#198 2007-03-13 04:32:59

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

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

jmk,

Thanks! I didn’t know about the <txp:if_different> tag…that’s pretty sweet.
I’ll check it out and see if it does what I need.

I figured I was over thinking it…sometimes the simple solution is the most difficult to see. : )

Cheers Mate.
thanks again for the help.


Tom

Offline

#199 2007-03-13 13:38:59

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

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

Okay, good people with Zem_Event interest. This plugin is taking a leap. I hope.
I present you with Zem_Event_Code, which is really nothing more than the open code for Zem_Event. Why are we doing this? Well, because while we are waiting for Alex to get back in touch with me about bug squarshing (we have $250 raised for that project), we can think about moving forward with this plugin in a new way.

Open Invitation:
I would like anybody who is skilled in PHP, or knows people who are to work with this code to produce a stronger more extensive plugin. The Google Code project presents this as an opportunity. There have been several snippets of new PHP code in this thread already, all of which I believe deserve a spot in the plugin.

Lets see where this goes :)

Matthew


Offline

#200 2007-03-13 15:22:35

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

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

Matt,

That’s great news about Zem_Event_Code!
I wish I had the skills to help.

Matt and JMK,
<txp:if_different /> is awesome! Works perfectly.
I see now that I should have read JMK’s post on navigation by years a bit more carefully.
You had already posted the solution I needed…I just missed it.

Cheers to you both.

Renobird.out

P.S. The site I’m working on has a pretty extensive events calendar, I’ll be sure to post a link when it’s done.
I don’t know how I could have done it without this plugin.

Offline

#201 2007-03-16 01:56:52

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

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

I’ve just started a tentative patch to add auto_delete (events/articles or both) capabilty to zem_event, the patch at present goes as follows:

--- zem_event-0.30.orig 2007-03-15 18:43:58.000000000 -0700
+++ zem_event-0.30.new 2007-03-15 18:43:58.000000000 -0700
@@ -113,7 +113,13 @@
    if (!in_array('repeat_to',$cal))
       safe_alter('zem_event_calendar', 'add repeat_to date default null');
+//add event and-or entry delete (article and event data) status fields
+   if (!in_array('delete_entry',$cal))
+      safe_alter('zem_event_calendar', 'add delete_entry tinyint(2) default 0');	  
+   if (!in_array('delete_event',$cal))
+      safe_alter('zem_event_calendar', 'add delete_event tinyint(2) default 0');
+
 	if (!safe_row('id', 'txp_category', "type = 'event' and name = 'root'")) {
 		safe_insert('txp_category', "type = 'event', name = 'root', title = 'root'");
 	}

Would this be the kind of thing you are going to put on zem_event_code?

Offline

#202 2007-03-16 02:15:47

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

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

Rick,
I would think so, can you explain further? Implementation from the write screen? Or auto delete about event date passed?
Just making sure I understand?

What would the att look like?

And THANKS for starting off our contributions to the zem_event plugin, that’s great!


Offline

#203 2007-03-16 02:45:51

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

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

Rick,

I think this is exactly what we had in mind. You can attach the patch to an issue if you want (you just need a google login) or we can set you up with svn commit access.

Oh you can also anonymously checkout from SVN it would probably ensure the patch applies seamlessly.

Last edited by hakjoon (2007-03-16 02:47:52)


Shoving is the answer – pusher robot

Offline

#204 2007-03-16 03:16:28

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

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

Mathew – The general idea is to add two checkmark controls to the write screen and save the result to the new database fields when the article and event is saved; from there a function or plugin could be written to use those field contents to auto delete events or articles and events when the event has passed.

hakjoon – Not having used svn before I’m not sure how comfortable I would be with commit access, perhaps when the patch is presentable. Is my Google login enough or would I need something specific to zem_event_code?

For any that may be asking the same question, my google gmail login was enough.

Last edited by rsilletti (2007-03-16 03:22:35)

Offline

Board footer

Powered by FluxBB