Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#601 2008-08-10 09:54:19

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

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

what can i say???
THX A LOT!!!
i’ìll try asap and i’ll make you know.
Gio

pepebe wrote:

Hi Infrarosso,

Last edited by infrarosso (2008-08-11 09:06:04)

Offline

#602 2008-08-11 09:10:51

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

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

i’m back!
ok i did everything i was supposed to but the result was terrible :(

i’ve to put in http://www.limezine.it/ instead of “Il portale degli eventi e dei locali di Firenze e dintorni”
when i try the code made from pepebe i get no numbers (i mean that i get “Events today:” and nothing more). Moreover the css get crazy. like if i didn’t close the sponsor div (see code for understanding).
Thx again in advance if anybody can help.

Offline

#603 2008-08-11 09:33:40

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

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

Hi infrarosso,

please send me your event.php or the pluginfile you hacked. I’ll have a look. Also it would be a good thing to have a general idea about other plugins you have installed and activated.

CU,

pepebe

P.S Besides, nice work. I love the colours!

P.P.S I hope you didn’t use ied_plugin_composer to upload the plugin. For some reasons it cuts off the last 20+ lines of code. Besides did you copy your hacked zem_event.php to your plugin directory and deactivated the original zem_event in the plugin tab?

Last edited by pepebe (2008-08-11 16:05:59)

Offline

#604 2008-08-11 13:57:54

Alex007
Member
Registered: 2007-10-24
Posts: 57

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

Great – thanks pepebe your a super star!

Offline

#605 2008-08-11 14:58:32

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

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

Alex007 wrote:

Great – thanks pepebe your a super star!

Thanks Alex007,

I expect it worked like it was supposed to do. In fact I thought about counting events a couple of days earlier, but dismissed the “problem” as something I could do sometime later. Your question brought me back on the track and so I have to say thank YOU, really!

CU

pepebe

P.S. Please stop to give me compliments like that or my head will blow off… ;)

Offline

#606 2008-08-11 16:03:50

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

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

Ok, just to sum up current developments.

In the past few days I have added a couple of new features to zem_event

- New calendar views: “Week” and “Three Days”
- New calendar navigation: “Week”, “Day”
- Start of the week can now be shifted from Sunday to any other day by applying “offset=n” to zem_event_calendar.
- Count events: zem_event_list can now count the number of events in any combination of section and/or category and return the number of events along with some predefined label.

The next things I’m working on:

- Mark certain recurring events as postponed (along with some kind of message and the option to move this individual event entry to another day and/or time.
- I also think about how to handle recurring events that happen only from monday to friday (this will be easy) or only every 2nd thuesday in any even numbered month (don’t laugh, but this was a feature request from one of my customers).

This is a turning point for several reasons:

1. I have to split zem_event. As I was told, there is a limit of approx. 65K characters for a plugin’s code. I have exceeded that limit by more than 2k characters now and this will make publishing the final plugin in one piece impossible. So splitting the code into two or more chunks will be necessary. This will lead to somthing like zem_event_reborn and I feel that something like this requires Mr. Squaredeyed’s and/or zem’s permission.

2. Betatesters: Working on zem_event_reborn will take much more time and a bunch of serious beta testers willing to participate. Please write a short message if you want to help me with that matter. Edit: I’ll send everybody interested in my current work a copy of my personal zem_event.php. Just drop me a mail…

3. Knowledge: Also, some support by other php savy people here would be welcomed. Especially, if they would like to share with us their own hacks and tricks with zem_event (I’m sure there are quite a few of them arround).

4. Documentation: We need one, that’s a fact. There have been made some efforts, but the guys responsible for those need our support.

5. Feature requests: Tell us what you need or what you are missing.

6. Coordination: My finaly request. All those effords have to be coordinated. Subversion would be great, but a wiki, a messageboard and a mailing list would be a good start.

Please give me as much feedback as possible. If you want to mail me, that’s also fine.

Yours,

pepebe

Last edited by pepebe (2008-08-11 21:44:59)

Offline

#607 2008-08-11 16:32:22

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

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

Thanks for all the work on this pepebe. I’ve not tried your version yet but it sounds much improved.

There are a number of fixes for various things floating round this thread. I think you’ve already caught most of them, including the one I made a while ago regarding padding the numbers 1-9 with leading zeroes to avoid bad links.

If you want a hand on the code front I can try to help (a bit) but zem’s stuff tends to be a level or 3 above my coding skill. I can certainly beta test if you like when I get a bit of free time.

One thing that has bugged me and I can’t figure a way of doing it is if you’re browsing the months: the URL changes to ?date=2008-05 or something. If you then click an event on the calendar it shows that event, but the calendar itself “resets” to the current month so you don’t know what else is on in the future (or past) in that month.

It may just be me being stupid and missing something obvious (in which case I’d love a pointer in the right direction!) or it may need something extra to offer the option to “remember” the current month in the URL when viewing events.

Either way, top job on working up momentum on this excellent plugin again. I’ll do what I can on the back end to help ease development with the plugin composer!

EDIT: github has been cited as an excellent coding resource over SVN. Might wanna check it out.

Last edited by Bloke (2008-08-11 16:33: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

#608 2008-08-11 21:10:57

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

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

Edit: Sorry, there is something completely wrong with this approach. Please ignore the following lines or read them to learn how to make a complete fool out of yourself.I should spend less time in front of my laptop and more time in catching some zzzs.

If you are interested in this topic you may as well go to my following post

@Bloke

Ok, lets see if I can solve that problem.

If I catch your drift you want to have a link like this:

http://yoursite/index.php?id=5&date=2008-09-10

The link in a typical calandar entry is created by a form – zem_event_cal_entry wich in turn uses zem_permlink to create your link. After browsing through the code I came to the conclusion that neither permlink nor link will help us to achieve what we want.

To achieve this effect we need a new “type” of zem_event_permlink

open zem_event and go to approx. line 648 (more or less, just look within function zem_data_field…). There you will find the following lines:

if ($type 'permlink')@ @ $out = permlink(array('class'=>$class,'id'=>$out),$linktext);@ @ elseif ($type 'link')
$out = href($linktext, $out);

Edit: How the §$!”§”§”§!!!! can I force line breaks into that chunk of code??? This makes me crazy, really!

add the following two lines:

elseif ($type == 'permlink2')
$out = href($linktext, "?id=".$out."&date=".gps('date'));

Voila ,permlink2 is born!

Now open your calendar’s form (the default one would be zem_event_cal_entry) and find the following lines:

<txp:zem_event_permlink wraptag="" >
<txp:zem_event_name label="" wraptag="" />
</txp:zem_event_permlink>

Give zem_event_permlink the “permlink2” type to call permlink2 from zem_event_permlink (Note: The default type of permlink is “permlink”)

<txp:zem_event_permlink wraptag="" type="permlink2" >
<txp:zem_event_name label="" wraptag="" />
</txp:zem_event_permlink>

That should do the trick.

Have fun,

pepebe

P.S. To ensure, that the date given to the url has the YYYY-MM-DD format, you also have to change a few lines arround line 1009. Have a look at this post (This will also solve the issue with the first 9 days of a month not properly showing up in a minicalandar.

Last edited by pepebe (2008-08-12 15:46:43)

Offline

#609 2008-08-12 15:37:51

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

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

OK, here is a solution that actually works. Sorry for the previous attempt, but I think I was a bit tired by then…

The problem with the idea above was the fact that each calendar entry has a individual ‘date’. Fetching it from the url isn’t possible for obvious reasons, so we have to dig deeper into zem_event.

Again, go to zem_data_field and right between

elseif ($type == 'emaillink')
$out = href($linktext,'mailto:'.eE($out));

and

"$pre = '';"

insert the elseif condition for “ type=‘permlink2’ “

elseif ($type == 'permlink2'){
$date = zem_event_date(zem_event_thisevent());
$out = href($linktext, "?id=".$out."&date=".$date);
}

There is one problem though. By default zem_event_date will wrap a date into a span (we don’t need that) and output will be different from what we need (%x). I have failed to tell zem_event_date to use wraptag=’‘ (empty) and format=”%Y-%m-%d”. Until I find a solution to this problem or somebody tells me how to do it, you have to go to zem_event_date and permanently change the default values for both attributes.

The result should look like this:

function zem_event_date($atts) {
$latts = lAtts(array(
'type' => 'date',
'field' => 'event_date',
'format' => '%Y-%m-%d', // instead of 'x'
'wraptag' => '', // instead of 'span'
'class' => __FUNCTION__,
),$atts, 0);

return zem_data_field(zem_event_thisevent(), $latts + $atts);
}

Now we have the necessary function to create permlinks containing the event’s id as well as a date that will fix a calendar on the same page to a certain date.

I hope this will work for you as expected.

Good Luck,

pepebe

Last edited by pepebe (2008-08-14 07:15:40)

Offline

#610 2008-08-17 12:34:03

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

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

Hello txp:friends,

the event is from mo 18.aug.08 until mo 28.sep.2008 but not on wed and fri. the event starts at 20:00.
I tried to make for each day a new event with upm_savenew but it does not save new the events only the article part.

what can I do?
Tom from bavaria

Offline

#611 2008-08-17 17:58:22

Alex007
Member
Registered: 2007-10-24
Posts: 57

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

Hi pepebe

I am trying to add a target=“nor” or ID=”“ to the zem_event_url and zem_event_location_url.

<a href="zem_event_url" target="new">Link</a>

Is this possible to do? i have something like this

<txp:php>
$cat=zem_event_categories (array(‘link’ => ‘0’));
$eventurl=zem_event_url (array(‘link’));
$class=strtr ($cat,” “,”_”);
if($class==“External_events”){
echo “<a href=\”$eventurl\”>MAP</a>”;
}</txp:php>

But it doesnt render the URL am i not passing the correct arguments into this function?

$eventurl=zem_event_url (array(‘link’));

Thanks for any help you can give.
A.

Last edited by Alex007 (2008-08-17 17:59:57)

Offline

#612 2008-08-18 19:23:47

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

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

Hi TomBus,

“the event is from mo 18.aug.08 until mo 28.sep.2008 but not on wed and fri. the event starts at 20:00.
I tried to make for each day a new event with upm_savenew but it does not save new the events only the article part.”

This is a tricky thing to do. Until I can have a look at the code this is my guess.

First of all, I THINK that this will not work, because technically you have a specific article with a unique ID and by saving it with upm_savenew you just create a new article with the same article contents but a NEW ID. I believe the event part is handled by function zem_event_save () and as far as I remember the later one updates only “CHANGED” contents regarding the ORIGINAL article ID.

As a result you will not notice that a new article created by upm_savenew will not carry along the event information of its source article.

Bad luck ;(

Solution: I think you have to tweak zem_event a bit here and there and then you should get what you want. I’m a bit tied up right now, so I can’t help you myself. Sorry, really.

Regards,

pepebe

Offline

Board footer

Powered by FluxBB