WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
if (PAGE_ID != 3) { //:Show next #N events//:// Get_Concertsglobal $database, $wb;setlocale (LC_ALL, 'sl_SI.UTF-8'); //za vse kategorije setlocale (LC_TIME, 'sl_SI.UTF-8'); //za datumske funkcije// Show how many items, defaults to 10?if ( !isset($max) ){ $max = 10; };// year and month and section defaultsif(!isset($year)) {$year = date('Y', time()); }if(!isset($month)) {$month = date('n', time()); }if(!isset($section_id)) {$section_id = 0 ; }// Set dateformat to suit your needs, add timeformat if needed$dateformat = 'd'; // Standard php date formats$datemonth = 'M'; // Standard php date formats$dateyear = 'Y'; // Standard php date formats// Fetch base page link, if event_id = set$extrasql = '';$page_id = 0;$page_link ='';if ($section_id<>0) { $extrasql = " section_id = '".$section_id."' AND "; $sql = "SELECT page_id FROM ".TABLE_PREFIX."sections WHERE section_id = '".$section_id."'";$result = $database->query($sql);if ( $result->numRows() > 0 ) {while( $row = $result->fetchRow() ) {$page_id = $row['page_id'];}}if ($page_id <> 0) {$sql = "SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id = '".$page_id."'";$result = $database->query($sql);if ( $result->numRows() > 0 ) {while( $row = $result->fetchRow() ) {$page_link = page_link($row['link']);}}}}// Set start- and end date for query// $datestart = "$year-$month-1"; ORIGINAL = show all events in this month$datestart = date("Y-m-d"); // ALTERNATIVE = show all events in this month, starting today$dateend = "$year-$month-".cal_days_in_month(CAL_GREGORIAN, $month,$year);$mod_list = "";$mod_list.= '<h4>Prihajajoči dogodki</h4><hr>';// Fetch the items$sql = "SELECT DAY(date_start) AS day, id, custom1, date_start, time_start, date_end, time_end, name FROM ".TABLE_PREFIX."mod_procalendar_actions WHERE ".$extrasql." date_start >='$datestart' AND public_stat = 0 ORDER BY date_start,time_start LIMIT 0, ".$max." ";$mod_query = $database->query($sql);while ( $row =& $mod_query->fetchRow()){// Build url like : pages/kalendar.php?id=2&detail=1 $page_url = $page_link.'?id='.$row['id'].'&detail=1';$ds = $row['date_start']." ".substr($row['time_start'],0,5);$de = $row['date_end']." ".substr($row['time_end'],0,5);$datetime_start = mktime(substr($ds,11,2),substr($ds,14,2),0,substr($ds,5,2),substr($ds,8,2),substr($ds,0,4));$datetime_end = mktime(substr($de,11,2),substr($de,14,2),0,substr($de,5,2),substr($de,8,2),substr($de,0,4));if ($row['time_start'] !== $printTime) { $printTime = $row['time_start']; $mod_list.= '<ul class="upcoming-events"><li><div class="date"><span><span class="day">'.date($dateformat,$datetime_start).'</span><span><span class="month">'.date($datemonth,$datetime_start).'</span><span><span class="year">'.date($dateyear,$datetime_start).'</span><>'; if(date('Y-m-d',$datetime_start)==date('Y-m-d')){ $mod_list.= '<div class="event-content"><h6><a href="'.$page_url.'">'.$row["name"].'</a></h6><ul class="event-meta"><li><i class="fa fa-clock-o"> </i>'.substr($printTime,0,5).'<sup>h</sup> <div class="Danes-text">Danes!<></li><!-- <li><i class="fa fa-info-circle"> </i>'.$row["custom1"].'</li> --></ul><></li></ul>'; } else{ $mod_list.= '<div class="event-content"><h6><a href="'.$page_url.'">'.$row["name"].'</a></h6><ul class="event-meta" style="float:left;"><li><i class="fa fa-clock-o"> </i>'.substr($printTime,0,5).'<sup>h</sup></li><!-- <li><i class="fa fa-info-circle"> </i>'.$row["custom1"].'</li> --></ul><></li></ul>'; } }$mod_list .= "<hr>"; }$mod_list .= '<a href="[wblink13]#izobrazevanja" class="button transparent button-arrow" style="margin-top:-10px;">Napovednik</a><br></br>'; return $mod_list; }
while ( $row =& $mod_query->fetchRow()){// Build url like : pages/kalendar.php?id=2&detail=1
$allEntrys = $mod_query->numRows();
for($i = 0; $i < sizeof($allEntrys); $i++){
</ul><></li></ul>'; }} else{
if (PAGE_ID != 3) { //:Show next #N events//:// Get_Concertsglobal $database, $wb;setlocale (LC_ALL, 'sl_SI.UTF-8'); //za vse kategorije setlocale (LC_TIME, 'sl_SI.UTF-8'); //za datumske funkcije// Show how many items, defaults to 10?if ( !isset($max) ){ $max = 10; };// year and month and section defaultsif(!isset($year)) {$year = date('Y', time()); }if(!isset($month)) {$month = date('n', time()); }if(!isset($section_id)) {$section_id = 0 ; }// Set dateformat to suit your needs, add timeformat if needed$dateformat = 'd'; // Standard php date formats$datemonth = 'M'; // Standard php date formats$dateyear = 'Y'; // Standard php date formats// Fetch base page link, if event_id = set$extrasql = '';$page_id = 0;$page_link ='';if ($section_id<>0) { $extrasql = " section_id = '".$section_id."' AND "; $sql = "SELECT page_id FROM ".TABLE_PREFIX."sections WHERE section_id = '".$section_id."'";$result = $database->query($sql);if ( $result->numRows() > 0 ) {while( $row = $result->fetchRow() ) {$page_id = $row['page_id'];}}if ($page_id <> 0) {$sql = "SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id = '".$page_id."'";$result = $database->query($sql);if ( $result->numRows() > 0 ) {while( $row = $result->fetchRow() ) {$page_link = page_link($row['link']);}}}}// Set start- and end date for query// $datestart = "$year-$month-1"; ORIGINAL = show all events in this month$datestart = date("Y-m-d"); // ALTERNATIVE = show all events in this month, starting today$dateend = "$year-$month-".cal_days_in_month(CAL_GREGORIAN, $month,$year);$mod_list = "";$mod_list.= '<h4>Prihajajoči dogodki</h4><hr>';// Fetch the items$sql = "SELECT DAY(date_start) AS day, id, custom1, date_start, time_start, date_end, time_end, name FROM ".TABLE_PREFIX."mod_procalendar_actions WHERE ".$extrasql." date_start >='$datestart' AND public_stat = 0 ORDER BY date_start,time_start LIMIT 0, ".$max." ";$mod_query = $database->query($sql);while ( $row =& $mod_query->fetchRow()){$allEntrys = $mod_query->numRows();// Build url like : pages/kalendar.php?id=2&detail=1 $page_url = $page_link.'?id='.$row['id'].'&detail=1';$ds = $row['date_start']." ".substr($row['time_start'],0,5);$de = $row['date_end']." ".substr($row['time_end'],0,5);$datetime_start = mktime(substr($ds,11,2),substr($ds,14,2),0,substr($ds,5,2),substr($ds,8,2),substr($ds,0,4));$datetime_end = mktime(substr($de,11,2),substr($de,14,2),0,substr($de,5,2),substr($de,8,2),substr($de,0,4));if ($row['time_start'] !== $printTime) { $printTime = $row['time_start']; $mod_list.= '<ul class="upcoming-events"><li><div class="date"><span><span class="day">'.date($dateformat,$datetime_start).'</span><span><span class="month">'.date($datemonth,$datetime_start).'</span><span><span class="year">'.date($dateyear,$datetime_start).'</span><>'; if(date('Y-m-d',$datetime_start)==date('Y-m-d')) { for($i = 0; $i < sizeof($allEntrys); $i++){ $mod_list.= '<div class="event-content"><h6><a href="'.$page_url.'">'.$row["name"].'</a></h6><ul class="event-meta"><li><i class="fa fa-clock-o"> </i>'.substr($printTime,0,5).'<sup>h</sup> <div class="Danes-text">Danes!<></li><!-- <li><i class="fa fa-info-circle"> </i>'.$row["custom1"].'</li> --></ul><></li></ul>'; }} else{ $mod_list.= '<div class="event-content"><h6><a href="'.$page_url.'">'.$row["name"].'</a></h6><ul class="event-meta" style="float:left;"><li><i class="fa fa-clock-o"> </i>'.substr($printTime,0,5).'<sup>h</sup></li><!-- <li><i class="fa fa-info-circle"> </i>'.$row["custom1"].'</li> --></ul><></li></ul>'; } }$mod_list .= "<hr>"; }$mod_list .= '<a href="[wblink13]#izobrazevanja" class="button transparent button-arrow" style="margin-top:-10px;">Napovednik</a><br></br>'; return $mod_list; }
if (PAGE_ID != 3) {//:Show next #N events//:// Get_Concertsglobal $database, $wb;setlocale (LC_ALL, 'sl_SI.UTF-8'); //za vse kategorijesetlocale (LC_TIME, 'sl_SI.UTF-8'); //za datumske funkcije// Show how many items, defaults to 10?if ( !isset($max) ){ $max = 10; };// year and month and section defaultsif(!isset($year)) {$year = date('Y', time()); }if(!isset($month)) {$month = date('n', time()); }if(!isset($section_id)) {$section_id = 0 ; }// Set dateformat to suit your needs, add timeformat if needed$dateformat = 'd'; // Standard php date formats$datemonth = 'M'; // Standard php date formats$dateyear = 'Y'; // Standard php date formats// Fetch base page link, if event_id = set$extrasql = '';$page_id = 0;$page_link ='';if ($section_id<>0) {$extrasql = " section_id = '".$section_id."' AND ";$sql = "SELECT page_id FROM ".TABLE_PREFIX."sections WHERE section_id = '".$section_id."'";$result = $database->query($sql);if ( $result->numRows() > 0 ) {while( $row = $result->fetchRow() ) {$page_id = $row['page_id'];}}if ($page_id <> 0) {$sql = "SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id = '".$page_id."'";$result = $database->query($sql);if ( $result->numRows() > 0 ) {while( $row = $result->fetchRow() ) {$page_link = page_link($row['link']);}}}}// Set start- and end date for query// $datestart = "$year-$month-1"; ORIGINAL = show all events in this month$datestart = date("Y-m-d"); // ALTERNATIVE = show all events in this month, starting today$dateend = "$year-$month-".cal_days_in_month(CAL_GREGORIAN, $month,$year);$mod_list = "";$mod_list.= '<h4>Prihajajoci dogodki</h4><hr>';// Fetch the items$sql = "SELECT DAY(date_start) AS day, id, custom1, date_start, time_start, date_end, time_end, name FROM ".TABLE_PREFIX."mod_procalendar_actions WHERE ".$extrasql." date_start >='$datestart' AND public_stat = 0 ORDER BY date_start,time_start LIMIT 0, ".$max." ";$mod_query = $database->query($sql);$allEntrys = $mod_query->numRows();while ( $row =& $mod_query->fetchRow()){for($i = 0; $i < sizeof($allEntrys); $i++){// Build url like : pages/kalendar.php?id=2&detail=1$page_url = $page_link.'?id='.$row['id'].'&detail=1';$ds = $row['date_start']." ".substr($row['time_start'],0,5);$de = $row['date_end']." ".substr($row['time_end'],0,5);$datetime_start = mktime(substr($ds,11,2),substr($ds,14,2),0,substr($ds,5,2),substr($ds,8,2),substr($ds,0,4));$datetime_end = mktime(substr($de,11,2),substr($de,14,2),0,substr($de,5,2),substr($de,8,2),substr($de,0,4));if ($row['time_start'] !== $printTime) { $printTime = $row['time_start'];$mod_list.= '<ul class="upcoming-events"><li><div class="date"><span><span class="day">'.date($dateformat,$datetime_start).'</span><span><span class="month">'.date($datemonth,$datetime_start).'</span><span><span class="year">'.date($dateyear,$datetime_start).'</span><>';if(date('Y-m-d',$datetime_start)==date('Y-m-d')) { $mod_list.= '<div class="event-content"><h6><a href="'.$page_url.'">'.$row["name"].'</a></h6><ul class="event-meta"><li><i class="fa fa-clock-o"> </i>'.substr($printTime,0,5).'<sup>h</sup> <div class="Danes-text">Danes!<></li><!-- <li><i class="fa fa-info-circle"> </i>'.$row["custom1"].'</li> --></ul><></li></ul>'; }} else{ $mod_list.= '<div class="event-content"><h6><a href="'.$page_url.'">'.$row["name"].'</a></h6><ul class="event-meta" style="float:left;"><li><i class="fa fa-clock-o"> </i>'.substr($printTime,0,5).'<sup>h</sup></li><!-- <li><i class="fa fa-info-circle"> </i>'.$row["custom1"].'</li> --></ul><></li></ul>'; }}$mod_list .= "<hr>";}$mod_list .= '<a href="[wblink13]#izobrazevanja" class="button transparent button-arrow" style="margin-top:-10px;">Napovednik</a><br></br>'; return $mod_list; }
Oh, so any ideas what could be wrong? It just looks weird when on site. Or any suggestion what should I do to fix this?
if ($row['time_start'] !== $printTime) { <--------- delete $printTime = $row['time_start'];...... lots of code here} <----------- delete$mod_list .= "<hr>";
Hi,Quote from: Roych on November 09, 2015, 03:31:20 PMOh, so any ideas what could be wrong? It just looks weird when on site. Or any suggestion what should I do to fix this? in your code from posting 1 findCode: [Select]if ($row['time_start'] !== $printTime) { <--------- delete $printTime = $row['time_start'];...... lots of code here} <----------- delete$mod_list .= "<hr>"; an delete the two lines marked.For what ever the reason was, these two lines mean:remember the starttime and if the next starttime is the same, do not show the event.regards