You must be logged in to post Login Register


Lost Your Password?

Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Integration with wp_events_category

UserPost

10:14 pm
May 24, 2009


jbjorgen

Chandler, AZ

New Member

posts 1

Post edited 4:17 am – May 25, 2009 by jbjorgen
Post edited 4:23 am – May 25, 2009 by jbjorgen


I've modified the plugin very slightly to include integration with events_category.  I was wondering if you'd consider rolling these changes into the plugin.

in ec_management.class.php:

around line 54:

     if(isset($_POST['EC_doPost'])) {
        $statusPost = $_POST['EC_statusPost'];
        $categoryPost = $_POST['EC_categoryPost'];
        $postdate = date('Y-m-d H:i:s');  
        if (function_exists(”is_events_category”)) {
           if (is_events_category($categoryPost)) {
               $postdate = $startDate . ” ” . (($startTime)?$startTime:”00:00:00″);
           }            
        }
        $data = array(
            'post_content' => $output
          , 'post_title' => $title
          , 'post_date' => $postdate
          , 'post_date_gmt' => get_gmt_from_date($postdate)
          , 'post_category' => array($categoryPost)
          , 'post_status' => $statusPost
          , 'post_author' => $wpdb->escape($this->blog_post_author)
        );
        $post_id = wp_insert_post($data);
        $results = $this->db->getLatestPost();
        $postID = $results[0]->id;
      }

around liine 186:

        <tr>
          <th width=”33%” scope=”row” valign=”center” style=”text-align:right;”><label for=”categoryPost”><?php _e('Which Post Category ?','events-calendar'); ?></label></th>
          <td width=”67%”>
             <select name=”EC_categoryPost” id=”EC_categoryPost”>
<?php

$categories = get_categories(array('type' => 'post','child_of' => 0,'orderby' => 'name','order' => 'ASC','hide_empty' => false));

foreach($categories as $cat) {
    print “              <option value=” . $cat->cat_ID . ” ” . (($cat->cat_ID==1)?”selected='selected'”:””) . “>” . $cat->cat_name  . “</option>\\n”;
}
?>
            </select>

          </td>
        </tr>

As you can see, all I've done is add a way to select the category when you insert a post, and if it is an event category, allow it to future date the post.  Very simple.  Thanks for considering.

John

12:51 pm
May 29, 2009


laplix

Admin

posts 170

Thank you jbjorgen,

Could you post that to the bug tracker and maybe attach a patch?

Maybe Heirem could have a look at that and include it in our next release. No promise though! We need to provide a release and he has still much work to do for our next 7.0 release.

Thank you very much ,

Louis

6:18 pm
August 12, 2009


laplix

Admin

posts 170

Issue #61


About the WP Events Calendar forum

Most Users Ever Online: 50

Currently Online:
11 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 4
Forums: 9
Topics: 519
Posts: 1450

Membership:

There are 877 Members

There are 5 Admins

Top Posters:

rosko – 60
Stewart – 36
bitkahuna – 20
wombat1 – 14
vickilh2 – 11
cmldesigns – 11

Recent New Members: jmccann, ntarantino, mpurcell, sparkie, zell1987, Jane

Administrators: laplix (170 Posts), Luke (48 Posts), heirem (13 Posts), Brad (10 Posts), coe (0 Posts)