Modify EP

24 views
Skip to first unread message

Jenny.S

unread,
Dec 29, 2011, 9:37:12 AM12/29/11
to event...@googlegroups.com
Hello Kunal,

Congrates on your new platform in FB! Hope you enjoy the new place!

Since FB takes you away from us, I decide to modify EP for current BP1.5. I've been using BPCP for most of my stuffs and understand the structures very well. so, there are not much difficulties on converting the wrapper. There are some details, not really a question about BPCP, but hope to get some help here--  when it comes to the part of "current_event", I don't know what to do.
        $bp->events->current_event = new $current_ep_class( );
$current_ep_class is supose to be the $ep_models['events'] , a class to store data for the current BP item. ep data saved in posts, but what should I put here  $this->current_event = ?

Another thing is that I moved tags and cats to front end, replaced them and submit box with WP standard meta box(the standard ones at back end), loaded all the required javascripts at front end. With all the WP post related files included at front end ( as bpcp does ), do I still need to check and update meta when Save_Post ?

Thanks for your time!
Jenny

Kunal Bhalla

unread,
Dec 30, 2011, 3:53:21 AM12/30/11
to event...@googlegroups.com
Hey -- great to see that someone's working on EP! So, for cats/tags --
you'll probably still have to save them manually; as far as I
remember, the default backend code for the metaboxes isn't invoked
while saving a post from BPCP in the front end.

I'm not too sure about what you meant by the current_ep_class?

Kunal

Andre Dublin

unread,
Dec 30, 2011, 8:36:32 AM12/30/11
to eventpress
Do you have a github repo of EP?

On Dec 29, 9:37 am, "Jenny.S" <jennysong...@gmail.com> wrote:
> Hello Kunal,
>
> Congrates on your new platform in FB! Hope you enjoy the new place!
>
> Since FB takes you away from us, I decide to modify EP for current BP1.5.
> I've been using BPCP for most of my stuffs and understand the structures
> very well. so, there are not much difficulties on converting the wrapper.
> There are some details, not really a question about BPCP, but hope to get
> some help here--  when it comes to the part of "current_event", I don't
> know what to do.
>        * $bp->events->current_event = new $current_ep_class( );*
> $current_ep_class is supose to be the $ep_models['events'] , a class to
> store data for the current BP item. ep data saved in posts, but what should
> I put here  $this->current_event = ?
>
> Another thing is that I moved tags and cats to front end, replaced them and
> submit box with *WP standard meta box*(the standard ones at back end),

Kunal Bhalla

unread,
Dec 30, 2011, 12:49:19 PM12/30/11
to event...@googlegroups.com
Well, I moved to github a long time ago. The default branch is
reboot, which is my--sadly, aborted--attempt to rewrite EP with unit
tests to ensure that it's stable, apart from some more tricks I was
trying (JSON based config, etc). You'll probably want to grab the
master branch which has the latest original version of EventPress.

https://github.com/kunalb/EventPress

Kunal

Jenny.S

unread,
Dec 30, 2011, 6:43:02 PM12/30/11
to event...@googlegroups.com
Hello Kunal,
Google Group is blocked by my region so that I can only read and reply from gmail. If this create a new topic--sorry for confusing.

By " $bp->events->current_event",  I meant, the way buddypress address the current object when setup root component, for example--
 if bp is single group, then, $this->current_group = new BP_Groups_Group($group_id);
the BP_Groups_Group is the class where group save all data.
It seems to me this is where a post's data can join into BP's business.
In EP, I need to setup $this->current_event = ....?

When create event, I can set $bp->events->current_event = get_default_post_to_edit(); this works.
Yesterday, I figured out how you assign a post to bp current object-- use Query based on slug
        $bp->is_single_item = true;
        query_posts( Array(  'post_type' => $this->id, 'name' => $bp->current_action ) );


So, maybe I can say--
 $bp->events->current_event = new WP_Query( array('post_type' = 'ep-event',  'post_name' = $bp->current_action ) )

This is my new finding after posted my question, do I get it right?

Thanks for your answer on the save meta part. If WP doesn't take care of front end cats/tags, I will code my own cats/tags boxes to gain more flexibility.

Jenny

Kunal Bhalla

unread,
Dec 30, 2011, 7:48:33 PM12/30/11
to event...@googlegroups.com
This should work, I guess. But the query will return an array of posts
-- and you only want the first one, I guess -- you might want to add
code to grab the 0-indexed element there.

Saving the metabox data shouldn't be too hard -- try using
wp_die(print_r($_POST)); where BPCP processes posts to see where the
new cat/tag data is being added, and maybe you can just copy/paste the
wp code there; though this isn't really future proof for when WP
changes.

Kunal

Jenny.S

unread,
Jan 1, 2012, 3:01:09 AM1/1/12
to event...@googlegroups.com
Hello Kunal,
Thanks for your answers!
I am going to work in this direction.

Happy new year to you and your family!

Jenny

Kal

unread,
Mar 17, 2012, 4:44:02 AM3/17/12
to event...@googlegroups.com
Hi Jenny -- I'm also using eventpress quite extensively but still on the old BP version. How can I get in touch with you to chat about the modifications you've been making them and potentially implement them on my side? 

You can reach me by email kal at joffr.es.

Cheers,
Kal
Reply all
Reply to author
Forward
0 new messages