Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Event calendar - help


Print Track
I have a panel that shows today events, i need help because i need to put a dropdown box with categories and as result returns events in that category

And i need a icon before event with category type

Viw attachment for exemple

<?php

if(!defined('IN_FUSION')) {
   die;
}


require_once(INFUSIONS.'aw_ecal_panel/include/core.php');



/****************************************************************************
 * FUNCS
 */
if(!function_exists('awec_post_process_events')) {
function awec_post_process_events(&$events, &$out)
{
   global $ec_today, $ec_tomorrow, $locale, $awec_settings;

   $count = 0;

   $out = array(
      'today'      => array(),
      'tomorrow'   => array(),
      'others'   => array(),
   );

   $current = 'others';
   $path_event = INFUSIONS.'aw_ecal_panel/view_event.php?id=';
   $path_birthday = INFUSIONS.'aw_ecal_panel/birthday.php?id=';
   $show_details = ($awec_settings['show_today_in_panel'] ? true : false);

   foreach($events as $year => $y_data) {
      ksort($y_data, SORT_NUMERIC);
      foreach($y_data as $month => $m_data) {
         ksort($m_data, SORT_NUMERIC);

         $today_month = ($ec_today['mon']==$month && $ec_today['year']==$year);
         $tomorrow_month = ($ec_tomorrow['mon']==$month && $ec_tomorrow['year']==$year);

         foreach($m_data as $mday => $d_data) {
            if($today_month && $ec_today['mday']==$mday) {
               $current = 'today';
            } else if($tomorrow_month && $ec_tomorrow['mday']==$mday) {
               $current = 'tomorrow';
            } else {
               $current = 'others';
            }


            foreach($d_data as $ev) {
               $item = '';
               if($current!='others') {
                  if($ev['start_time']) {
                     $item .= $ev['start_time'];
                     if($ev['end_time']) {
                        $item .= '-'.$ev['end_time'];
                     }
                     $item .= '&nbsp;';
                  }
               } else {
                  $item .= awec_format_****ing_date($year,
                        $month, $mday).'&nbsp;';
               }
               if($ev['is_birthday']) {
                  $path = $path_birthday.$ev['user_id'];
               } else {
                  $path = $path_event.$ev['event_id'];
               }

               $item .= '<a href="'.$path.'">'
                  .$ev['ev_title'].'</a>';

               if($show_details && $current=='today') {
                  $body = parseubb($ev['ev_body']);
                  $body = explode(stripinput(AWEC_BREAK), $body);
                  if(count($body)>1) {
                     $body[0] .= ' <a href="'.$path.'">'.$locale['EC207'].'</a>';
                  }
                  $item .= '<br /><span class="small2">'.$body[0].'</span>';
               }

               $out[$current][] = $item;
               ++$count;
            }
         }
      }
   }

   return $count;
}
}



/****************************************************************************
 * GUI
 */
opensidex("Today freerolls", "off");

$path = INFUSIONS.'aw_ecal_panel';

if(iMEMBER && false) {
   echo '
<ul>';
   if(iAWEC_POST) {
      echo '
   <li><a href="'.$path.'/edit_event.php">'.$locale['EC200'].'</a></li>';
   }
   echo '
   <li><a href="'.$path.'/my_events.php">'.$locale['EC204'].'</a></li>
   <li><a href="'.$path.'/my_logins.php">'.$locale['EC206'].'</a></li>';
   if(iSUPERADMIN) {
      echo '
   <li><a href="'.$path.'/admin.php">'.$locale['EC700'].'</a></li>';
   }
   echo '
</ul>';
}


if(iAWEC_ADMIN
   && ff_db_count("(*)", AWEC_DB_EVENTS, "(ev_status='".AWEC_PENDING."')"))
{
   echo '
<div style="text-align:center;">
<p>
   <strong><a href="'.$path.'/new_events.php">'.$locale['EC203'].'</a></strong>
</p>
</div>';
}



/*
 * show next x days
 */
if($awec_settings['next_days_in_panel']) {
   $from_time = $awec_now;
   $to_time = $from_time+($awec_settings['next_days_in_panel']-1)*86400;

   $events = array();
   $needle = array(
      'from'   => date('Y-m-d', $from_time),
      'to'   => date('Y-m-d', $to_time),
   );
   awec_get_events($needle, $events, false);


   $out = array();
   $count = awec_post_process_events($events, $out);


   if(!$count) {
      echo '
<p>
<span class="small2">'.$locale['awec_no_events'].'</span>
</p>';
   }

   $more = 0;
   foreach($out as $type => $content) {
      if(!count($content)) {
         continue;
      }
      if($type!='others' || $more) {
         echo '
<strong>'.$locale['EC209'][$type].':</strong>';
      }
      echo '
<ul>
   <li>'.implode("</li>\n\t<li>", $content).'</li>
</ul>';
      ++$more;
   }

}
echo '<strong>Help us by submiting your freerolls: <a href="http://www.tugasnopoker.com/Poker/forum/viewforum.php?forum_id=2">SPECIAL</a> | <a href="http://www.tugasnopoker.com/Poker/forum/viewforum.php?forum_id=35">DAILY</a> | <a href="http://www.tugasnopoker.com/Poker/forum/viewforum.php?forum_id=60">WEEKLY</a> | <a href="http://www.tugasnopoker.com/Poker/forum/viewforum.php?forum_id=68">MONTHLY</a></strong>
';

closesidex();
?>
Chibanga attached the following file:
exemple.jpg [46.19kB / 30 Downloads]

0 replies

author Chibanga
forumPanels and Infusions
replies1 post
viewed1,643 times
activeLast updated on 7 years ago

Related

Problems with Expanded Calendar v2.00
Started by
S
Scorp-D - 1 post
Expanded Calendar 2.x User pass disclosure exploit
Started by
1
1q2w3e4r - 2 posts
Making Calendar Panel
Started by
J
Jedi - 2 posts
ZWar calendar not to show birthdays ?
Started by
I
icb - 10 posts
Trying to find Reservation Calendar infusion
Started by
J
jiikoo - 2 posts
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Chibanga