WordPress.org

Ready to get started?Download WordPress

Forums

"Big" events calendar (main page, not sidebar) (31 posts)

  1. likoma
    Member
    Posted 9 years ago #

    I'm trying to get an Events Calendar that:

    1.) Sees to the future,
    2.) Is a full page, not just in the sidebar,
    3.) Is integrated with WP (by Category or not),

    I've been messing with <a href="http://codex.wordpress.org/Plugins/EventCalendar2">Events Calendar 2</a>, <a href="http://drosselmeyer.bpa.nu/photo">Photo Calendar</a>, and <a href="http://garrickvanburen.com/archive/introducing-the-wp-ical-plugin">wp-ical</a> which I can't get to work.

    I'm trying to get these <a href="http://www.writingsalons.com/classes">classes</a> into something like <a href="http://www.826valencia.org/events/2005_03">826 Valencia</a> (done in MT) or <a href="http://www.ikemcg.com/scripts/pec/phpEventCalendar/index.php">phpEventCalendar</a>, but using the WP entries that are already in there.

    <a href="http://www.writingsalons.com/classes/index-1.php?m=200503">This</a> is what I have so far, which isn't too bad, but I'd really like the class names to be visible, not just on hover. There's got to be a way I can get the hover text (which is just the name of link and of course links to that page) into the little box that is that date.

    I'm just about to give up and use phpEventCalendar but then of course that means entering all entries twice (unless I could link up those two SQL tables or something).

    Any tips, directions, links, ideas ... thanks.

    - Bradley

  2. likoma
    Member
    Posted 9 years ago #

    Well, that was a coding mess ... here's a little better, I hope.

    I'm trying to get an Events Calendar that:

    1.) Sees to the future,
    2.) Is a full page, not just in the sidebar,
    3.) Is integrated with WP (by Category or not),

    I've been messing with Events Calendar 2, Photo Calendar, and wp-ical which I can't get to work.

    I'm trying to get these classes into something like 826 Valencia (done in MT) or phpEventCalendar, but using the WP entries that are already in there.

    This is what I have so far, which isn't too bad, but I'd really like the class names to be visible, not just on hover. There's got to be a way I can get the hover text (which is just the name of link and of course links to that page) into the little box that is that date.

    I'm just about to give up and use phpEventCalendar but then of course that means entering all entries twice (unless I could link up those two SQL tables or something).

    Any tips, directions, links, ideas ... thanks.

    - Bradley

  3. likoma
    Member
    Posted 9 years ago #

    Well, I figured it out:

    The Writing Salon

    I made different pages (e.g. index-12.php, etc.) for the different categories and on each page put in the number of that category I wanted to show (e.g.

    <?php get_event_calendar(12,'sun',3,True,3); ?>).

    Where '12' is the category ID, show 3 months, etc.

    I also got the titles into the days by changing line 261 of eventcalendar2.php like so:

    echo "' title=\"" . $calendar_entries[$day]['titles'] . "\"" . $calendar_entries[$day]['class'] // may be empty string
    . ">$day</a>";
    echo "" . $calendar_entries[$day]['titles'] . ""; // may be empty string

    I got the multiple listings per day to be divided by * * * by changing line 200 to:

    } else {
    $ak_title_separator = '<br />* * *<br />';
    }

    I also messed with the CSS file to get the calendar to be large on the page, but it's too much to paste here. If someone wants it, ask and I'll paste it in here.

    I may have done a few more things, but I've done so many, I can't remember! If you'd like all the code, lemme know.

    Thanks, Alex Tingle, for making a fantastic Plugin!

    - Bradley

  4. Jaqueline
    Member
    Posted 9 years ago #

    Oh GOD, very nice work! I liked it a lot!

  5. Natron
    Member
    Posted 9 years ago #

    If you could post a link to the css file, that would be fantastic. Great work! Thanks for your efforts!

  6. water111
    Member
    Posted 9 years ago #

    Could you write up the steps involved to do something like this? I would love to add what you did to one of my sites.

    Thanks!

  7. dirtyverbs
    Member
    Posted 9 years ago #

    Bradley,

    Truely well done. I'm working on something similar and this will help quite a bit. And yes, please do link to the CSS. Thanks.

  8. likoma
    Member
    Posted 9 years ago #

    Water111: the steps as best I will remember them are just the changes to the file as I mentioned in this post on 2005-03-22 above. I hope that's enough.

    I'm not sure how to link to the CSS file (just a link?); I suppose you could go to the Writing Salon site and look at the source code for the CSS file? So here's the relevant (I hope) CSS. I didn't do full checks on all Mac browsers.

    #wp-calendar table {
    border: 1px solid #ddd;
    empty-cells: show;
    font-size: 24px;
    width: 740px;
    }

    #wp-calendar table #next a {
    padding-right: 1px;
    text-align: center;
    }

    #wp-calendar table #prev a {
    padding-left: 1px;
    text-align: center;
    }

    #wp-calendar table a {
    display: block;
    text-decoration: none;
    background-color: #CC9933;
    color: #FFFFFF;
    width: 100%;
    }

    #wp-calendar table a:hover {
    color: #333;
    }

    #wp-calendar table caption {
    color: #CC9933;
    font-size: 1em;
    text-align: center;
    padding-bottom: 2px;
    padding-left: 2px;
    border-bottom-width: thin;
    border-bottom-style: solid;
    border-bottom-color: #CC9933;
    }

    #wp-calendar table td {
    color: #000000;
    font: normal 11px Verdana, Geneva, sans-serif;
    padding: 0px;
    text-align: center;
    width: 100px;
    height: 50px;
    border: 1px solid #CCCCCC;
    vertical-align: top;
    margin-right: -5px;
    margin-left: -5px;
    }

    #wp-calendar table td.pad:hover {
    background: #fff;
    }

    #wp-calendar table #today {
    background: url(http://www.dianelebow.com/images/today.gif);
    color: #666;
    }

    #wp-calendar table th {
    color: #CC9933;
    font-style: normal;
    text-transform: capitalize;
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: .5em;
    text-align: center;
    vertical-align: middle;
    }
    #wp-calendar a.eventday {
    color:#FFFFFF;
    }

    I didn't yet (05/06/05) integrate into this Writing Salon site, but I figured out a way to show both past and future posts AND have them counted in both the Categories and Archives! See this post.

    If anyone improves on this, I'd love to see some links here.

    Best regards,

    - Bradley

  9. Michael Bishop

    Posted 9 years ago #

    http://www.writingsalons.com/includes/wp-layout.css

    The aforementioned style sheet.
    Nice work.

  10. Phunky
    Member
    Posted 9 years ago #

    Im looking to take this a step further and be able to add a 'Custom Field' to the Events that will have a 'Finish Date' which will allow us to flag the event up for each day inbetween the Timestamp date of the post (Event Start) and the Custom Field 'Finish Date'

    Im going to attempt to use the EventCalendar2 as the basis of my plugin but i have a feeling im going to be starting again from scratch, if anyone has done this or has a idea of how to achive this please reply!

  11. Micki
    Member
    Posted 9 years ago #

    Since this post was so helpful to me, I thought I'd provide an update. With the advent of EventCalendar3, I had to hack away at the eventcalendar3.php file to make it do the same thing as The Writing Salon site.

    1) To put the post titles inside the calendar find

    // insert day
    $day_id = $date->day_id();
    echo "<td id='$day_id'";

    and below it make the following tweaks

    if(array_key_exists($day_id,$calendar_days))
    {
    echo ' class="ec3_postday';
    if($calendar_days[$day_id]->is_event)
    echo ' ec3_eventday';
    //echo '>' . $date->day_num;
    echo '">';
    echo 'day_link() . '" title="' . $calendar_days[$day_id]->get_titles() . '"';

    if($calendar_days[$day_id]->is_event)
    echo ' class="eventday"';
    echo ">$date->day_num
    ";
    echo $calendar_days[$day_id]->get_titles() ;
    }
    else
    {
    echo '>' . $date->day_num;
    }

    echo '</td>';

    2) To change the seperator for multiple posts in one day, use

    function get_titles()
    {
    //return implode(', ',$this->titles);
    return implode('<br>***<br>',$this->titles);
    }

    3) Don't forget http://wordpress.org/support/topic/15109. Thanks Bradley for the link, it helped me a lot. I couldn't figure out why my future events weren't showing up.

    4) Also, instead of making putting individual index-12.php pages, the new WP uses category-12.php (where 12 is the category id) pages inside your theme folder. This drove me nuts for hours. I hope it helps someone else.

    Thanks again!

  12. Micki
    Member
    Posted 8 years ago #

    Thanks to Marisa who pointed out a few mistakes in my code above. The "insert day" code should actually read:

    // insert day
    $day_id = $date->day_id();
    echo "<td id='$day_id'";

    if(array_key_exists($day_id,$calendar_days))
    {
    echo ' class="ec3_postday';
    if($calendar_days[$day_id]->is_event)
    echo ' ec3_eventday';
    //echo '>' . $date->day_num;
    echo '">';
    echo 'day_link() . '" title="' . $calendar_days[$day_id]->get_titles() . '"';

    if($calendar_days[$day_id]->is_event)
    echo ' class="eventday"';
    echo ">$date->day_num
    ";
    echo $calendar_days[$day_id]->get_titles() ;
    }
    else
    {
    echo '>' . $date->day_num;
    }

    echo '</td>';

  13. cokeyko
    Member
    Posted 8 years ago #

    I still don't know how to use this. Could anyone kindly write a step by step tutorial?

    Or anyone knows any plugin like 826's event calendar

  14. nearlythere
    Member
    Posted 8 years ago #

    bradley/likoma: i'm so impressed, great calendar. are you using event calendar 3 yet?

    i'm confused... how did you get subcategories? you only added the number of the category to the call for the function, but you didn't have to edit the function?

    i don't understand... this is really difficult!

    would you pastebin your code for how the index-12.php file is? or even your event calendar plugin code that you modified?
    http://pastebin.com/

    thank you!

  15. likoma
    Member
    Posted 8 years ago #

    Cokeyko: Funny, my Writing Salon client mentioned that same website for its calendar. Their calendar was my goal. EC2 (and EC3) are the best I found and I think they're doing a pretty good job.

    Nearlythere: I have used EC3, but I haven't managed to do what Micki did above (I haven't tried either). I only get to these things when a client asks me for it, so when that time comes--and I'm sure it will--I'll post anything I learn here. That said, it looks like Micki has figured it out although I had a look at what I think is her site and I didn't see EC3 in use.

  16. rmhsmusic
    Member
    Posted 8 years ago #

    When I use the revised code that Micki wrote I get a parse error on line 619. It seems to have an extra ' in it, but I can't figure out where. Has anyone gotten this to work in 1.5.2?

  17. wahaca
    Member
    Posted 8 years ago #

    rmhsmusic I found your error...cuz I had the same problem.

    bad part:
    echo 'day_link() . '" title="' . $calendar_days[$day_id]->get_titles() . '"';

    should be:
    echo 'day_link()' . '" title="' . $calendar_days[$day_id]->get_titles() . '"';

    I've been looking for something like this...I think I'll start making some modifications on it as well...if I can get it to work...

    A few Ideas I have:
    1) use "pages" instead of categories...(see this post for why I want to do that...hehe)
    2) make calender integrated with page...not sure if that's what Micki did...still trying to make it work.
    3) make events on calendar click able.

    I'll let you know if I get anywhere.

  18. rmhsmusic
    Member
    Posted 8 years ago #

    wahaca, thanks for that -- I'm going to give it a try tonight. I think using "pages" is the better way to go, but I haven't figured it out either.

  19. twistedemotions
    Member
    Posted 8 years ago #

    x

  20. tonygray216
    Member
    Posted 8 years ago #

    from Micki's post above.

    3) Don't forget http://wordpress.org/support/topic/15109. Thanks Bradley for the link, it helped me a lot. I couldn't figure out why my future events weren't showing up.

    Does this apply to WordPress 2.0? The code is not that same. I got everything working but my future events are not showing up in the calendar.

    The stylesheet is not prefected yet but the calendar is working (kinda). Can anyone help me with the events not showing up?
    http://desotohillsyouth.com/events

  21. Biblio
    Member
    Posted 8 years ago #

    I implemented the suggestions in this thread and have a little problem. I put this in my eventcalendar3.php:
    // insert day
    $day_id = $date->day_id();
    echo "<td id='$day_id'";
    if(array_key_exists($day_id,$calendar_days))
    {
    echo ' class="ec3_postday';
    if($calendar_days[$day_id]->is_event)
    echo ' ec3_eventday';
    //echo '>' . $date->day_num;
    echo '">';
    echo 'day_link()' . '" title="' . $calendar_days[$day_id]->get_titles() . '"';
    if($calendar_days[$day_id]->is_event)
    echo ' class="eventday"';
    echo ">$date->day_num";
    echo $calendar_days[$day_id]->get_titles() ;
    }
    else
    {
    echo '>' . $date->day_num;
    }
    echo '</td>';

    but now my titles show up with bits of code in them. My calendar is here.
    Any ideas?

  22. clarke1866
    Member
    Posted 8 years ago #

    There are a couple of lines that look suspicious in that quotes and stuff are confused. PHP functions and variables need to be outside of quotes while the text that you want to echo needs to be inside quotes. Maybe this revised code might help....

    Putting quotes around the whole phrase just echo's the whole phrase.

    // insert day
    $day_id = $date->day_id();
    echo '<td id='.$day_id;
    if(array_key_exists($day_id,$calendar_days))
    {
    echo ' class="ec3_postday';
    if($calendar_days[$day_id]->is_event)
    echo ' ec3_eventday';
    //echo '>' . $date->day_num;
    echo '">';
    echo day_link() . ' title="' . $calendar_days[$day_id]->get_titles() . '"';
    if ($calendar_days[$day_id]->is_event)
    echo ' class="eventday"';
    echo '>' . $date->day_num;
    echo $calendar_days[$day_id]->get_titles() ;
    }
    else
    {
    echo '>' . $date->day_num;
    }
    echo '</td>';

  23. Biblio
    Member
    Posted 8 years ago #

    Well, I tried that, and got an error. As of now I've restored the original settings in the code, so you won't see the issue I've described, but I am still interested in getting this to work.

  24. Nnyan
    Member
    Posted 8 years ago #

    Thanks to this post I got EC3.04 looking nice in its own page. I still would like something a little more robust, anyone know of a good event calendar for WP2?

  25. likoma
    Member
    Posted 8 years ago #

    Here we go again!

    Got the request from a client for a full-page calendar so I've just put in EC 3.0.4 on a full page:

    Left Coast Writers. (If before site switch, link here.)

    Here's what I did so far:

    1.) Page Template
    I made a page template (e.g. calendar.php, I think you need this at the top: <?php /* Template Name: Calendar */ ?>) and put this code just after the_content like so:

    <div class="storycontent">
    <?php the_content(); ?>
    <?php ec3_get_calendar(); ?>
    </div>

    I removed the sidebar from this template so the calendar could go full page width.

    2.) Show Titles in Day Cell
    Following the (recent) steps above, I couldn't get it working. I'm no coder, but messed around and finally came up with this:

    // insert day
    $day_id = $date->day_id();
    echo "<td id='$day_id'";

    if(array_key_exists($day_id,$calendar_days))
    {
    echo ' class="ec3_postday';
    if($calendar_days[$day_id]->is_event)
    echo ' ec3_eventday';
    echo '">';
    echo '<a href="' . $date->day_link()
    . '" title="' . $calendar_days[$day_id]->get_titles() . '"';
    echo ' class="eventday"';
    echo ">$date->day_num</a>";
    echo $calendar_days[$day_id]->get_titles();
    }
    else
    {
    echo '>' . $date->day_num;
    }

    echo '</td>';

    The link was going to the title name, but I wanted it to go the date archive for that day, so I did some fiddling. Ideally, I'd like the links to be to the event post itself and I bet it can be done as the "function ec3_get_events" can do it! I don't know how to do it, though.

    3.) Multiple Events Per Day
    I also followed Micki's code to get two events to show up above each other with something of a break. That code (e.g. *** does show up in the hover-over title. I'm not too worried about multiple events per day.

    So I just finished this and I'd bet there are some glitches and improvements to be made, but I wanted to add to this thread before I forgot what I did !

    My CSS is about the same as what I have way above when I started this thread.

    Please post any findings back here.

    - Bradley

  26. lunac
    Member
    Posted 8 years ago #

    First of all. THANK YOU to all of you who helped figure this out. Oh, it is SUCH a big help.

    To re-pay in kind, I figured the link part out.

    First, you have to remove the "title" attribute in the link-- or it will screw things up. So

    echo '<a>day_link(). '" title="' . calendar_days[$day_id]->get_titles() . '"';
    becomes:
    echo '<a>day_link();

    Next, add to the beginning of the add_post() in the ec3_Day class.

    $link =get_permalink($entry->id);
    $safe_title = '</a><a href="' . $link . '">';

    AND change the next variable to
    $safe_title .=

    Lastly, close your link attribute:
    // $safe_title.=' @'.$time ;<br />
    $safe_title.=' @'.$time . '</a>';

    I hope this helps.

  27. lunac
    Member
    Posted 8 years ago #

    Ok... on retrospect this doesn't work. It links all events to the last event. hmm.... back to the drawing boards

  28. brittanie
    Member
    Posted 8 years ago #

    I have used this thread with some great results but now I am stuck and hoping someone can help me — I've signed up for EC's mailing list but haven't had any luck there.

    My calendar is here.
    Three things:
    1. Previous and next post links take you to the archives for the next month, not the calendar page. I'd like it to "page" though the calendar instead.
    2. Most of my events are holidays or festivals — all-day events. I'd like to get rid of the post time in the calendar and just have the event title.
    3. Clicking the day of the event takes you to the archives for that entire day. Instead, I'd like it to just go straight to the permalink for that particular event.

    Thanks in advance. I'm hoping this thread's not dead...

  29. Bertha
    Member
    Posted 8 years ago #

    I, too, wanted to say thanks to all those who've posted their examples and ideas--it's been a big help with a page I've set up to use both the small and large version of the calendar (raleighracers.org). The big calendar needs a little styling, and I seem to have killed the nice javascript popups somehow, but otherwise it's working pretty much how I want it to. Now I have to stop fiddling with the calendar and work on some content.

  30. navigadget
    Member
    Posted 8 years ago #

    I'm also trying to install the ec3 calendar under a test domain. (http://www.tkexport.com/blog/calendar/).

    If you point to the url you'll see a vertical border cutting through my calendar. I can't find where it is coming from. How do I get rid of it? Can somebody please help?

Topic Closed

This topic has been closed to new replies.

About this Topic