Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: JQuery Event Calendar
Forum PHP.pl > Forum > Po stronie przeglądarki > JavaScript
qsde3
Udało mi się wreszcie zainstalować kalendarz na stronie - niestety, z "braku-laku", mój wybór padł na ten oto kalendarz jQuery: http://www.vissit.com/projects/eventCalendar

Pracuję na stronie, która jest oparta o CMS, i mam zagwozdkę jak to hm.. zrobić. Wstawiłam kod do kalendarza na stronę, ale nie umiem usunąć tych przykładowych wydarzeń.


"Przepraszamy, twój post jest za długi, proszę go skrócić". Nie jestem w stanie wkleić kodów php....

WTF?questionmark.gifquestionmark.gif facepalmxd.gif
trueblue
Co podałeś w konfiguracji pluginu jako wartość eventsjson?
qsde3
  1. [
  2. { "date": "1337594400000", "type": "meeting", "title": "Project A meeting", "description": "Lorem Ipsum dolor set", "url": "http://www.event1.com/" },
  3. { "date": "1337677200000", "type": "demo", "title": "Project B demo", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "url": "http://www.event2.com/" },
  4. { "date": "1337686200000", "type": "meeting", "title": "Test Project Brainstorming", "description": "Lorem Ipsum dolor set", "url": "http://www.event3.com/" },
  5. { "date": "1337696100000", "type": "test", "title": "A very very long name for a f*cking project events", "description": "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam.", "url": "http://www.event5.com/" },
  6. { "date": "1338890400000", "type": "meeting", "title": "Project B meeting", "description": "Lorem Ipsum dolor set", "url": "http://www.event5.com/" },
  7. { "date": "1339927200000", "type": "demo", "title": "Project A demo", "description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "url": "http://www.event6.com/" },
  8. { "date": "1334656800000", "type": "meeting", "title": "Test Project C Brainstorming", "description": "Lorem Ipsum dolor set", "url": "http://www.event7.com/" }
  9. ]
trueblue
No, i to są przykładowe wydarzenia.
qsde3
Edytowałam dane w pliku events.json.php i dane znikneły. Wstawiłam taki oto kod i teraz jest pusto. Myślę jak to połączyć z systemem CMS, tak, żeby można było ustawiać datę do wydarzenia i jej opis w edytorze CMS. Ktoś wie?

  1. <?php
  2. /**
  3.   * Throw news dates
  4.   * @return array
  5.   * @param int $iNewsPage
  6.   */
  7. function throwNewsDates( $iNewsPage ){
  8. if( isset( $this->aPagesChildrens[$iNewsPage] ) && $this->aPages[$iNewsPage]['iSubpagesShow'] == 4 ){
  9. $aPages = $this->aPagesChildrens[$iNewsPage];
  10. foreach( $aPages as $iPage ){
  11. if( isset( $this->aPages[$iPage]['iTime'] ) ){
  12. $aDates[date( 'Y-m-d', $this->aPages[$iPage]['iTime'] )] = $this->aPages[$iPage]['iTime'];
  13. }
  14. } // end foreach
  15. if( isset( $aDates ) ){
  16. $content = null;
  17. $i = 0;
  18. foreach( $aDates as $iTime ){
  19. $content .= ( $i > 0 ? ',':null ).'{ "date": "'.$iTime.'000", "type": "", "title": "", "description": "", "url": "" }';
  20. $i++;
  21. }
  22. return $content;
  23. }
  24. }
  25. } // end function throwNewsDates
  26.  
  27. /**
  28.   * Throw news sorted by dates
  29.   * @return array
  30.   * @param int $iNewsPage
  31.   * @param string $sDate
  32.   */
  33. function throwNewsByDate( $iNewsPage, $sDate ){
  34. if( is_numeric( $iNewsPage ) && isset( $this->aPagesChildrens[$iNewsPage] ) && preg_match( '/[0-9]+-[0-9]+-[0-9]+/', $sDate ) ){
  35. $iTimeFrom = strtotime( $sDate.' 00:00:00' );
  36. $iTimeTo = strtotime( $sDate.' 23:59:59' );
  37. if( is_numeric( $iTimeFrom ) ){
  38. $aPages = $this->aPagesChildrens[$iNewsPage];
  39. foreach( $aPages as $iPage ){
  40. if( isset( $this->aPages[$iPage]['iTime'] ) && $this->aPages[$iPage]['iTime'] >= $iTimeFrom && $this->aPages[$iPage]['iTime'] <= $iTimeTo ){
  41. $aNews[] = $iPage;
  42. }
  43. } // end foreach
  44. if( isset( $aNews ) )
  45. return $aNews;
  46. else
  47. return false;
  48. }
  49. }
  50. } // end function throwNewsByDate
  51. ?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.