Jump to content

sakkoulas

Members
  • Posts

    122
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sakkoulas

  1. Hi everyone, is it possible to show inputfieldSelect with custom values, p.e. i want to search events by current date and get only evetns that they have not closed. event 1 date: 13/5/2013 time: 9:00 event 2 date: 13/5/2013 time: 9:30 event 3 date: 13/5/2013 time: 10:30 so i want a select input filed with values like 8:00 8:30 // 9:00 until 10:00 is existing events from above 10:00 // 10:30 is existing event from above so go to 11 11:00 11:30 etc is difficult for me to explained, i hope you have understand. this is what i have until now, but i cant implemented inside form.. $today = strtotime( date('Y-m-d')); $day_end = strtotime( "23:59:59" ); $searchDate = wire('pages')->get('/orders/')->children("date>=$today, date<=$day_end"); foreach ($searchDate as $s) { $currentTime = substr($s->date,11,5) ; $closedTimes[] = $currentTime; } echo "<select>"; $orders= $closedTimes; $start = "08:00"; $end = "15:00"; $tStart = strtotime($start); $tEnd = strtotime($end); $tNow = $tStart; while ($tNow <= $tEnd) { $newdate = date("H:i", $tNow); if (in_array($newdate, $orders)) { echo "something"; } else { echo "<option value='time'>" .date("H:i", $tNow). "</option>"; } $tNow = strtotime('+30 minutes', $tNow); } echo "</select>"; }
  2. it doesnt do enything, I'm glad I could help, if it helps i can give you the password for my test page to see by your self the structure but is all in greek in there so... - events <-this is the parent event template, has page url 'events' it doesn't matter what fields you have in there . in this page i have put the code <div class="tab-pane" id="calendary"> <div id='loading' style='display:none'>loading...</div> <div id='calendar' class='calendar-page'></div> </div> all the children pages,of 'events' page are actually the pages that been shown in calendar it doesn't matter what template you use but it must have the fields title body date_start date_end summary headline images
  3. Home Page - company - events -- first event -- second event -- third event -- fourth event -- other event Contact Admin Trash is this what you're looking for?
  4. Hi pitbull Download the fullcalendar from the link below http://arshaw.com/fullcalendar/download/ Upload the fullcalendar.css , fullcalendar.print.css and fullcalendar.js to your server end embedded in your page header like this <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates ?>assets/css/styleaahaeota.css"> <link href='<?php echo $config->urls->templates ?>assets/calendar/fullcalendar.css' rel='stylesheet' /> <link href='<?php echo $config->urls->templates ?>assets/calendar/fullcalendar.print.css' rel='stylesheet' media='print' /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="<?php echo $config->urls->templates ?>assets/js/bootstrap.js"></script> <script src='<?php echo $config->urls->templates ?>assets/calendar/fullcalendar.js'></script> add the code below in your header after the <script src='<?php echo $config->urls->templates ?>assets/calendar/fullcalendar.js'></script> <script> $(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: false, events: "http://weborange.gr/aahaeota/json-events.php", eventRender: function(event, element, view ) { var image = '<img src="'+event.img+'" />'; if (view.name === "agendaDay") { element.find('.fc-event-title').append("<br/>" + event.description); } // on event hover pop up a small discription of the event and an image, // i use bootsrap framework so popoever is curently works only for // bootsrap details in http://twitter.github.io/bootstrap/javascript.html#popovers //if you dont want this, delete it or take the code from my last post element.popover({ html: true, trigger: 'hover', title: event.title, placement: 'top', content: image + '<span class="calendar-detail-time"> ' + event.ddate + ' until ' + event.dend + '</span>' + '<br/>' + event.description , }); }, eventDrop: function(event, delta) { alert(event.title + ' was moved ' + delta + ' days\n' + '(should probably update your database)'); }, loading: function(bool) { if (bool) $('#loading').show(); else $('#loading').hide(); } }); $oldTable.remove(); }); </script> create a new php file called json-events.php and upload it in your root folder. Inside json-events.php add the below code <?php include("index.php"); // bootstrap ProcessWire function pagesToJSON(PageArray $events) { $json = array(); foreach($events as $event) { $json[] = pageToArray($event); } return json_encode($json); } function pageToArray(Page $event) { $data = array( 'id' => $event->id, 'title' => $event->title, 'start' => date("Y-m-d H:i",$event->date_start), 'end' => date("Y-m-d H:i",$event->date_end), 'url' => "$event->url", // event ID is the url segment 'description' => "$event->summary", //event summary for bootsrap popover 'allDay' => false, 'img' => $event->images->first()->url, //event image for bootsrap popover 'ddate' => date("d-m-Y H:i",$event->date_start), //event date start for bootsrap popover 'dend' => date("d-m-Y H:i",$event->date_end), //event date for bootsrap popover ); return $data; } // end else $eventPage = $wire->pages->get('/events/')->children(); echo pagesToJSON($eventPage); ?> and final in the template that you want to render the calendar add <div class="tab-pane" id="calendary"> <div id='loading' style='display:none'>loading...</div> <div id='calendar' class='calendar-page'></div> </div> that's it, you can see example here just go one month before from the upper left arrows sorry for my bad english , i hope that this is going to help you
  5. add this in header $(document).ready(function() { $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: false, events: "json-code.php", eventRender: function(event, element, view ) { if (view.name === "agendaDay") { element.find('.fc-event-title').append("<br/>" + event.description); } }, eventDrop: function(event, delta) { alert(event.title + ' was moved ' + delta + ' days\n' + '(should probably update your database)'); }, loading: function(bool) { if (bool) $('#loading').show(); else $('#loading').hide(); } }); $oldTable.remove(); this in json-code.php function pagesToJSON(PageArray $events) { $json = array(); foreach($events as $event) { $json[] = pageToArray($event); } return json_encode($json); } function pageToArray(Page $event) { $data = array( 'id' => $event->id, 'title' => $event->title, 'start' => date("Y-m-d H:i:s",$event->date_start), 'end' => date("Y-m-d H:i:s",$event->date_end), 'url' => "$event->url", // event ID is the url segment 'description' => "$event->summary", 'allDay' => false, ); return $data; } // end else $calendarPosts=$wire->pages->get('/events/')->children(); echo pagesToJSON($calendarPosts); end in page where you want the calendar, <div class="tab-pane" id="calendary"> <div id='loading' style='display:none'>loading...</div> <div id='calendar' class='calendar-page'></div> </div>
  6. thanks renobird that was exactly what i was looking for. i allso add 'allDay' => false, after 'url' => "./$event->id", // event ID is the url segment and now shows the event start - end time inside calendar
  7. this is fantastic thanks again soma
  8. yes i am on a category page from other sites i can see they use /posts/today, and /posts/dd-mm-yyyy for other pages so i think this is the way i use url segments i have a pagination there for test purposes ok i'll try with this, thanks soma
  9. i am using blog profile module so i have posts parent with post children and categories with category items
  10. I'm a little bit ashamed for my code but ok $today = date('Y-m-d'); $dayBefore = date("Y m, d", strtotime("yesterday")); echo "today: $today </br>"; echo "lastdate $dayBefore </br>"; $results = $pages->find("sort=-publish_from, categories=$page,publish_from>=$today"); foreach ($results as $result) { echo "$result->title </br>"; } $next = $results->getNext($result); $prev = $results->getPrev($result); if($prev) echo "<a href='$prev->url'>Prev</a> "; if($next) echo "<a href='$next->url'>Next</a> ";
  11. hi soma no just $page->prev() and $page->next(); I have experimented with ryan code that i have found in forum
  12. hi people can anyone tell me some tips to paginate by date. i want to show todays day posts, and have two links with next day and before day. i can't figure how to check if there are posts from past dates. thanks
  13. You are right Pete, just realized this , thank you
  14. oooo i like it, thanks diogo what exactly $page->of(false) means;
  15. hi, does anyone know if is it possible to count the views of a post?? thanks
  16. hm ryan you do magic? i can't understand, now works... ; thanks anyway
  17. hello forum i have insert a datetime field and it shows me the correct day with wrong hour, i changed the $config->timezone inside site/config.php from America/New_York to Europe/Athens as seen here but then i get (31 December 1969 7:00 pm) i have try and with other europe citys and i get the same date i do something wrong? thanks.
  18. thank you for your help joss. I will try those I was ment that they look like directories.
  19. ok i understand, i think, every time you insert a new article you must also select template for the current article with directories i mean all articles sport soccer local soccer team article 1 basketball politics .. ... economy
  20. hi Jose, thank you for response, can you explain me more, what you mean with : have several article types, this is page field, or directories inside home like articles video photoblog ..... thanks again
  21. hi everyone, i will appreciate some help of you. if you had to build a news portal with multiple categories and tons of articles, How would you build it? solution 1 home page category 1 item item category 2 item item solution 2 Home Page news category1| template 1 article | template 1,2 article | template 1,2 category2 | template 2 article | template 2,2 article | template 2,2 solution 3 Home Page news | template 1 article -> page field selected category | template 2 article -> page field selected category | template 2 article -> page field selected category | template 2 category page field category 1 category 2 category 3 of course i have study Ryans blog module and i know he use the third solution but i am afraid if this style gone be hard after some thousands of articles to be filtered, searched. thanks
  22. hi Ryan you can add also the transliteration of greek language if you want it. there is also a drupal transliteration module with (i think) all languages, i do not know if this can help you http://drupal.org/project/transliteration thanks. 'α' => 'a', 'ά' => 'a', 'αι' => 'ai', 'αί' => 'ai', 'αϊ' => 'aï', 'αυ' => 'ay', 'αύ' => 'ay', 'β' => 'v', 'γ' => 'g', 'γγ' => 'gg', 'γκ' => 'gk', 'γχ' => 'gch', 'δ' => 'd', 'ε' => 'e', 'έ' => 'e', 'ει' => 'ei', 'εί' => 'ei', 'έι' => 'ei', 'ευ' => 'ef', 'εϊ' => 'eï', 'ζ' => 'z', 'η' => 'i', 'ή' => 'i', 'θ' => 'th', 'ι' => 'i', 'ί' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'μπ' => 'mp', 'ν' => 'n', 'ντ' => 'nt', 'ξ' => 'x', 'ο' => 'o', 'ό' => 'o', 'οι' => 'oi', 'οϊ' => 'oi', 'οί' => 'oi', 'ου' => 'oy', 'οϋ' => 'oy', 'ού' => 'oy', 'π' => 'p', 'ρ' => 'r', 'σ' => 's', 'ς' => 's', 'τ' => 't', 'υ' => 'y', 'ύ' => 'y', 'φ' => 'f', 'χ' => 'ch', 'ψ' => 'ps', 'ω' => 'o', 'ώ' => 'o',
  23. Thanks guys ... sorry for the delay, i have figured out, is the first time I use filters .. and already like the way it works
×
×
  • Create New...