Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Help needed with Countdown Calendar extension

135

Comments

  • Many thanks for that code SirNot, doesn't really make much sense to me though unfortunately :(
  • [ bump! ] Apologies for being so retarded, I bet I'm getting right on your nerves now eh?
  • http://php.net/sscanf http://php.net/mktime
  • When I use the extension and calculate the $diff, the values of the $diff is being displayed as your days or hours. The if statements would then seem to be wrong.
  • Many thanks SirNot, I get the basic usage of it, but have no idea how to convert it to Unix code so I can do my calculations. What do you mean btw jimw? I've checked my if statements and can't see anything wrong with them (or at least I don't think so, never done php/if statements before this you see)
  • In each IF statement, you are doing a calculation on $diff. In the first IF, you are checking for month. You calculate the $diff to be number of months, yet in the IF that does the display, you are still using the value of 2592000. You should use 2 instead. That is, it should read if ($diff < 2). It should also be that way in your second IF and in th else. Then in the else just make it: else if {$diff >0) That seems to work for me.
  • jimw. I love you <3 Thank you so much chap, really appreciate it. I've still got the stray date at the bottom though which I'm not quite sure why it's showing up! else if ($diff > 0 and $diff < 86400 ) Is the code for hours, and it certainly doesn't fall into that short a timescale!
  • edited August 2006
    When I go to your site, I don't see any stray date. I see 5. Is it the last one that is wrong?
  • # All I Need, Marks Set Go! and Dispatch 1 month left, at Le Pub, Newport # All I Need, Marks Set Go! and Dispatch 1 hour left, at Le Pub, Newport Duplicates it, and has a different time difference :(
  • :(
  • edited August 2006
    Can you send me your cal.txt file? Nevermind, you need to make the second IF an ELSE IF.
  • Ah ha! Utterly fantastic, thank you so much for your ongoing help mate, really appreciate it :) <3
  • Just released it, hopefully it'll benefit at least one or two people :)
  • Very nice extension.

    You should just replace:
    $Context->Dictionary['EnableCalendar'] = 'Enable the gig calendar?';
    by:$Context->SetDefinition('EnableCalendar', 'Enable the gig calendar?');

    and:
    $diff = $diff + 3600; // Ammendment made due to server being one hour out of synch
    by$Context->Configuration['GigCalendarSynch'] = 3600; ... $diff = $diff + ForceInt($Context->Configuration['GigCalendarSynch'], 0); // Ammendment made due to server being one hour out of synch
  • Sorry for being dumb, but what exactly would that do? Surely the gig calendar option in the control panel is completely seperate to the date ammendment thing?

    Again, sorry for being dumb. :)
  • $Context->SetDefinition allow your extension to be translated.

    For the other one, I don't know why you need to synch the time, I just supposed it depends of your server and it should be a setting you can easely change
  • edited August 2006
    You should also make " month left, at", " day left, at", "hour left, at"... Dictionary entries.
  • Ahh I see, thank you, I'll make the changes :) I've no idea how to make "month left" etc was dictionary entries though!

    I had to shift the time becuase of the server, it was an hour out, so if the event was in 8 hours time, it was showing up as being 7 hours ;o
  • Fatal error: Call to undefined function: setdefinition() in /home/glosunit/public_html/extensions/Calendar/default.php on line 13

    :(
  • Do you have vanilla 1.0.1?
This discussion has been closed.