WordPress.org

Forums

Events Calendar
Disable Lightbox? (20 posts)

  1. ianmcabee
    Member
    Posted 4 years ago #

    When the event is clicked on I would like like it to go directly to the event post and not the lightbox window. Is this possible?

    I am using the sidebar events calendar.

    Thanks

  2. ianmcabee
    Member
    Posted 4 years ago #

    Bump

  3. finddarkpoet
    Member
    Posted 3 years ago #

    BUMP

  4. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    I am working on a new version and this is a good idea. I will see what I can do.

  5. finddarkpoet
    Member
    Posted 3 years ago #

    Hi, is there anything I can do now to disable the thickbox before the next release is out? Which file i should be looking at?

    Thanks!

  6. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    In ec_js.class.php around 256 is where the information is written. The click event can be changed to have JavaScript send you to a particular location.

  7. finddarkpoet
    Member
    Posted 3 years ago #

    Thanks so much snumb130, forgive me for my stupidity as I'm not a programmer.

    I guess this is the part I need to make changes to?

    .click(function() {
           	tb_show(	"<?php echo $date_show; ?>", "<?php bloginfo('siteurl');?>?EC_view=day&EC_month=<?php echo $month;?>&EC_day=<?php echo $day;?>&EC_year=<?php echo trim($year);?>&TB_iframe=true&width=<?php echo $tbw;?>&height=<?php echo $tbh;?>", false);
    			})

    What should I do so that the click function will lead to the post of that event? I'm looking at how the event list does it, something to do with POST id, but I still don't have a clue..

    Much appreciated for the help!

  8. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    I will have to nail this down when I am back at a computer and not a phone. It might be Monday, but keep watching this thread and i'll post my response here.

  9. finddarkpoet
    Member
    Posted 3 years ago #

    thank you so much for your time.

  10. finddarkpoet
    Member
    Posted 3 years ago #

    hi snumb130, have you got a chance to look into this yet? Anyway, i will keep watching. Thank you.

  11. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    OK, looking the only problem is going to be is when you haev multiple events on the same day. If this is not going to be an issue, then you can do the following.

    File: ec_js.class.php
    Lines: 141-143
    Change:

    $lastDay = date('t', mktime(0, 0, 0, $month, 1, $year));
    
    for ($day = 1; $day <= $lastDay; $day++) {

    To:

    $lastDay = date('t', mktime(0, 0, 0, $month, 1, $year));
    $linktopost = '';
    for ($day = 1; $day <= $lastDay; $day++) {

    File: ec_js.class.php
    Lines: 157-159
    Change:

    $endTime = isset($e->eventEndTime) ? $e->eventEndTime : '';
    
    $output .= '<li class="EC-tt-widget-day-event-title">'.$title.'</li>';

    To:

    $endTime = isset($e->eventEndTime) ? $e->eventEndTime : '';
    $linktopost = isset($e->postID) && !empty($e->postID) ? get_permalink( $e->postID ) : '';
    $output .= '<li class="EC-tt-widget-day-event-title">'.$title.'</li>';

    File: ec_js.class.php
    Lines: 263
    Change:

    tb_show(	"<?php echo $date_show; ?>", "<?php bloginfo('siteurl');?>?EC_view=day&EC_month=<?php echo $month;?>&EC_day=<?php echo $day;?>&EC_year=<?php echo trim($year);?>&TB_iframe=true&width=<?php echo $tbw;?>&height=<?php echo $tbh;?>", false);

    To:

    <?php if($linktopost == '') {?>
    tb_show(	"<?php echo $date_show; ?>", "<?php bloginfo('siteurl');?>?EC_view=day&EC_month=<?php echo $month;?>&EC_day=<?php echo $day;?>&EC_year=<?php echo trim($year);?>&TB_iframe=true&width=<?php echo $tbw;?>&height=<?php echo $tbh;?>", false);
    <?php }else{?>
    window.location.href = '<?php echo $linktopost;?>';
    <?php }?>

    If you have more than one event on a day, this will cause the click to link to the first event for the day.

    Also, if there is not post for the event the thickbox will still popup.

    You can copy the code for the whole file from here.

    Hopefully this will get you by until the new version is released.

  12. finddarkpoet
    Member
    Posted 3 years ago #

    hi snumb130, thank you so much for working on it.

    My solution is, I will only use category display mode to display all of the events. So it doesn't matter which date it is or how many events there are on the same date, all will direct to the same page.

    I tried the replacing the entire php file but the site won't open after that, I'm looking into the modified lines now, and I will keep you posted.

    Thanks again, you are an amazing guy.

  13. finddarkpoet
    Member
    Posted 3 years ago #

    When I replaced the entire ec_js.class.php file , the website won't open anymore, a blank page.

    I did the changes line by line according to your last post, it works smoothly.

    I'm trying to change it from linking to individual post to linking to a fixed url.

  14. finddarkpoet
    Member
    Posted 3 years ago #

    Sorry to bother you again, if I want to link any date that has event to a fixed url, say "http://domain.com/events/", instead of the actual post to the event, which line shall I change?

  15. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    No worries.

    Changing the following should work.

    File: ec_js.class.php
    Line: 158
    Change:

    $linktopost = isset($e->postID) && !empty($e->postID) ? get_permalink( $e->postID ) : '';

    To:

    $linktopost = 'http://domain.com/events/';
  16. finddarkpoet
    Member
    Posted 3 years ago #

    It works like a charm.

    Hats off, thank you.

  17. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    Great to hear. Also, just remember that any customizations will need to be backed up before updating the plugin.

  18. denizci88
    Member
    Posted 3 years ago #

    Finally, could you summarize what you made step by step?

    Best Regards

  19. snumb130
    Member
    Plugin Author

    Posted 3 years ago #

    @dezinci88,

    I am not sure what you mean. I have the changes shown in the thread that were made.

  20. denizci88
    Member
    Posted 3 years ago #

    Thank you so much for your fast reply. I can not understand the steps. For this reason, I desired that you wrote the editting sequences.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic