Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#661 2008-10-20 22:08:29

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

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

Hello everybody,

the weekend was quite productive and I was able to rebuild most of the former functionality. Hopefully I will present the results within the next days (deja vue?).

Anyway, I have an idea about another function, but somehow I have the feeling that I’m throwing a huge rock at a tiny bird.

I created a 3 day calendar showing one day before as well as after a given date (which will be standing in the middle). Piece of cake. I thought it would be nice to style the days before and after differently, so I added some custom css styles to the whole thing: “focused” and “unfocused”. This also looked fine, but then I wanted to give more details about the focused day (the one in the middle) and less about the other ones.

This brought me to the problem of calling two different forms from my zem_event_calendar tag. What I’m thinking about right now is something like this:

Call a form called “switch” form zem_event_calendar

Create a misc from called “switch”

Within this form I want to use <txp:php></txp:php> to find out wheter a certain variable within within zem_event_calendar currently has a specific value. depending on the result I want to call another form.

I know about the Gordian Knot but I have a writers block at the moment and all I get are error messages.

I’ll go and catch some zzzs know. It would be great, if somebody could kick me into the right direction while I’m sleeping…

Greetings,

pepebe

Last edited by pepebe (2008-10-20 22:09:05)

Offline

#662 2008-10-20 22:31:36

alannie
Member
From: Minnesota, USA
Registered: 2005-09-15
Posts: 150

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

Hi pepebe, the email obfuscation technique you mentioned might be worth a look. The only thing holding me back is that with my limited PHP knowledge, it takes me a lot longer to troubleshoot when things don’t play nice together. If anyone’s actually incorporated ALA’s email obfuscation into a TXP site I would love to see how it was done, where everything goes, etc.

Offline

#663 2008-10-22 07:40:38

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

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

Hi there,

I just want to let you now that it wont take long now. Right now I’m setting up a dummy website with the revised plugin and some documentation how to use it.

While creating some forms utilizing the hCalendar microformat I encountered the problem that creating a line like

<div id="InsertEventNameHere" class="vevent">

is problematic, because an id must be represented by a single word.

For this reason “My wonderful Event” is not a valid id name.

To circumvent this problem I came up with a simple function. It is a container tag that will exchange one character within a string with another one:

I wouldn’t call this a plugin, but it might be useful every once in a while. If you want to use it, create a php file and put it into your plugin directory (or create a plugin yourself).

<?php
function ppb_exchange($atts, $thing='') {
extract(lAtts(array(
'exchange' => '',
'with' => '',
), $atts));
if ($thing) {
$string = parse($thing);
$string = str_replace($exchange,$with,$string);
}
return $string;
}
?>

It is simple to use:

<txp:ppb_exchange exchange=" " with="_">
<txp:zem_event_name wraptag="" class=""/>
</txp:ppb_exchange>

This will do for now.

Of course this function will be integrated in zem_event_reloaded. Depending on my spare time and an actual need, a future version might be much more enhanced. It could make sure that an id will start with a letter (no id=“2fast4you”) and also get rid off other inconvenient characters.

CU

pepebe

Edit1:
Note: If you want to use the function above, keep in mind that ALL blanks will be converted. If you leave a blank between the container tags, they will be converted as well. This can happen quite easily when inserting manual line breaks into your code…

Example:
<txp:ppb_exchange> <txp:zem_event_name wrapttag="" class="" /> </txp:ppb_exchange>
will create something like this:
__Some_Event_Name__

Last edited by pepebe (2008-10-25 07:54:42)

Offline

#664 2008-10-22 16:27:43

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

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

Great news about the plugin, thanks.

pepebe wrote:

To circumvent this problem I came up with a simple function. It is a container tag that will exchange one character within a string with another one

Very cool. If you get a chance to enhance it that’d be even more useful. One thing if you want to try a shortcut, will the sanitizeForUrl() function (in txplib_misc.php) help you? It’ll convert spaces to hyphens, and any non-ascii chars get dumbed down in the process. Won’t fix the ‘starting with a number thing’, which is why your plugin/function will be very useful for making up HTML IDs, but might be good enough for now.

Last edited by Bloke (2008-10-22 16:31:11)


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

#665 2008-10-30 07:32:40

freischwimmen
Member
From: Cologne
Registered: 2007-05-28
Posts: 71
Website

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

Hi Pepebe,
great to hear this plugin will get an overhaul,
this is what i was missing with zem event as well,
maybe i did it wrong…

anyways, this is what i want to achieve:
“lets say i have a page which main focus is the date section, a bar, concert venue or something.
Now on the frontpage in the main content area i would like to display only the next event that is lined up,
complete with flyer, description and all that jazz…
in the sidebar of the frontpage i want to display the next 10 events from now on in a short version, just the date and title of the event.

the dates in the sidebar are shown and also ordered nicely by date without adding much to
<txp:zem_event_list />, so far so good.
also when i click on a certain date within that list, the full event (including description, flyer etc)
is shown in the main content area, right where i want it to be.

Now my problem:
Once i enter the dates section on the site frontend, not the next date lined up is showing in the main content area
but the last date i posted… aaaaargh!
also, events that have happened already and should be expired show up there as well if that particular date is the last one i posted…

no switch to the next lined up date is taking place, and that should be the case right?”

hope that outlines my needs…
just a simple list of upcoming events, each with a single article view,
and by default ONLY the next date should show up on the frontpage in detail view, rest remains
in listform and each date within that list has a single article view one gets to when clicking the title…

thanks all!

Offline

#666 2008-10-30 15:41:55

pepebe
Member
From: Mannheim, Germany
Registered: 2005-02-07
Posts: 74

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

Hello freischwimmer (or rather Hallo?),

I’m a bit busy at the moment. The zem_event_reloaded site is weeks behind the initial schedule and I have lot of other things to do. This weekend it should be online (propably next…). So please be patient for a while. zem_event_reloaded should do all the things you want (and much more). Date sensitive permlinks will be included and so I don’t think your problems couldn’t be solved. Perhaps you will need some if tags and a bit of txp:php but I’m sure it will be possible.

I can’t promisse you anything, but if you want to let me have a look at your page templates and your forms, I might be able to help you. Send them to pepebe(at as in at)zem-event-reloaded.pepebe.de.

CU,

pepebe

Offline

#667 2008-10-30 16:16:29

freischwimmen
Member
From: Cologne
Registered: 2007-05-28
Posts: 71
Website

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

hallo is fine Pepebe :D

will send you something later today, your support is second to none!
DANKE!

Offline

#668 2008-11-23 15:01:17

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

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

pepebe

Hope you’re ok and keeping busy. I have one more thing to add to the list of stuff if it’s not already been covered. The way zem_event_handler injects the ‘Event’ table into the page is incorrect; it should first check the $_POST variable from_view and only show the table if the variable equals text. Otherwise the link shows up at the bottom when you hit the vertical ‘HTML’ and ‘Preview’ buttons.

Just a heads up in case it’s not already been caught.


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

#669 2008-11-27 08:35:51

FireFusion
Member
Registered: 2005-05-10
Posts: 698

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

Hi pepebe,

looking forward to the new plugin. any news?

Offline

#670 2008-11-29 16:25:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

To avoid PHP Notice messages in debug mode when using zem_event combined with TXP 4.0.7, these changes are required. Note that changing this makes the plugin incompatible with earlier TXP versions:

--- zem_event-0.3.5.orig 2008-11-29 16:50:00.000000000 +0100
+++ zem_event-0.3.5.new 2008-11-29 16:50:00.000000000 +0100
@@ -690,16 +690,16 @@
 		if (!$cats_id)
 			$cats_id = array(0);
 		$where = "zem_event_calendar.id=zem_event_category.k1 and zem_event_category.k2 IN (".join(',', quote_list($cats_id)).") and ".$where;
 		$grand_total = safe_count('zem_event_calendar, zem_event_date, textpattern, zem_event_category', $where.' group by zem_event_calendar.id order by '.$sort, $debug);
 		$lim = zem_event_paginate($limit, $grand_total);
-		$rs = safe_rows_start('zem_event_calendar.*, zem_event_date.*, textpattern.*, unix_timestamp(Posted) as uPosted', 'zem_event_calendar, zem_event_date, textpattern, zem_event_category', $where.' group by zem_event_calendar.id order by '.$sort.$lim, $debug);
+		$rs = safe_rows_start('zem_event_calendar.*, zem_event_date.*, textpattern.*, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod', 'zem_event_calendar, zem_event_date, textpattern, zem_event_category', $where.' group by zem_event_calendar.id order by '.$sort.$lim, $debug);
 	}
 	else {
 		$grand_total = safe_count('zem_event_calendar, zem_event_date, textpattern', $where.' order by '.$sort, $debug);
 		$lim = zem_event_paginate($limit, $grand_total);
-		$rs = safe_rows_start('*, unix_timestamp(Posted) as uPosted', 'zem_event_calendar, zem_event_date, textpattern', $where.' order by '.$sort.$lim, $debug);
+		$rs = safe_rows_start('*, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod', 'zem_event_calendar, zem_event_date, textpattern', $where.' order by '.$sort.$lim, $debug);
 	}

 	$out = array();
 	while ($row = nextRow($rs)) {
 		article_push();

Offline

#671 2009-01-05 08:54:07

TomBus
Member
From: Bavaria
Registered: 2005-07-06
Posts: 85

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

Hi

for the event every Day from 2008-02-12 until 2008-02-27 i use the repeat option.
To show the first day of the event i use <txp:zem_event_date>. Is there any tag for the last day of the event?
Not the datafield ‘finish_date’ – I want to show the content of ‘repeat_to’ in the table ‘zem_event_calendar’.
Is there something like ‘zem_event_repeat_to_date’ ?

tombus

Offline

#672 2009-01-05 09:03:56

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

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

TomBus wrote:

Is there any tag for the last day of the event?

Not that I’m aware of, but someone else may know differently.

fwiw, smd_calendar handles this natively. Should be released imminently if it’s any use to you.


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