Skip to content

Instantly share code, notes, and snippets.

@JayGreentree
JayGreentree / NowPlaying.php
Last active May 14, 2024 00:16
php now playing
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Now Playing</title>
<style type="text/css" media="all">@import "./style.css";</style>
</head>
<body>
<div class="wrapper">
<br />
<?php
/*!
Theme Name: Blocksy
Theme URI: https://creativethemes.com/blocksy/
Author: CreativeThemes
Author URI: https://creativethemes.com
Description: Blocksy is a blazing fast and lightweight WordPress theme built with the latest web technologies. It was built with the Gutenberg editor in mind and has a lot of options that makes it extendable and customizable. You can easily create any type of website, such as business agency, shop, corporate, education, restaurant, blog, portfolio, landing page and so on. It works like a charm with popular WordPress page builders, including Elementor, Beaver Builder, Visual Composer and Brizy. Since it is responsive and adaptive, translation ready, SEO optimized and has WooCommerce built-in, you will experience an easy build and even an increase in conversions. Note: Blocksy is built with the latest web technologies in order to bring you the smoothest experience, that told, old browsers like IE 11 and below may not work as expected. We strongly recommend you to update/switch to
{% cache key:'ne-services' duration:'1800' %}
{% assign domain = "https://9embers.online.church" %}
{% assign jsonResults = '' %}
{% webrequest url:'{{domain}}/auth/guest' method:'POST' return:'auth' %}
{%- assign dateTimeNow = 'Now' | Date:'yyyy-MM-ddTHH:mm:ss zzz' %}
{%- capture body -%}{"operationName":"ServicesConnectionQuery","variables":{"limit":1,"from":"{{dateTimeNow}}"},"query":"query ServicesConnectionQuery($from: Timestamp, $limit: Int = 0) {currentOrganization { id servicesConnection(from: $from, limit: $limit) { services { id startTime scheduleTime endTime __typename } __typename } __typename }}"}{%- endcapture -%}
{% webrequest url:'{{domain}}/graphql' method:'POST' body:'{{body}}' requestcontenttype:'application/json' headers:'Authorization^Bearer {{auth.access_token}}' %}
{% assign jsonResults = results | ToJSON %}
{% endwebrequest %}
{% endwebrequest %}
@JayGreentree
JayGreentree / ShowLivebtn.php
Created January 24, 2022 01:53
Show a LIVE now button when streaming
<!--
If today is Sunday && Service time is 10:30am-12pm show live button otherwise hide it
to change day of week replace 0 after == with one of the following options:
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
<?php
if ((date("w") == 0) && (date("Hi")>845) && (date("Hi")<1240)) $config->live = true;
if ((date("w") == 0) && (date("Hi")>859) && (date("Hi")<1240)) $config->live_need_countdown = true;
?>
<?php foreach($page->children() as $campus): ?>
<div class="pd-xs"><a href="#"><img class="img-responsive img-full-width" src="<?= $campus->img->url; ?>" style="width:343; height:156;" /></a>
<h3><?= $campus->title; ?></h3>
<p class="campus-times"><?php echo $page->service_times;?></p>
<ul class="fa-ul">
<li><?php echo $page->street_adress;?></li>
<li><?php echo $page->phone_number;?></li>
</ul>
<div class='mg-t-sm2'><a href="<?php echo $page->google_maps;?>" target="_blank" class='btn btn-default btn-left '>
<i class='icon-right-4 icon-fw'></i> Get Directions</a></div></div>
{%- assign scheduleid = 240 -%}
<script type="text/javascript">
$(function () {
var holiday = new Date();
holiday = new Date("{[ scheduledcontent schedulecategoryid:'{{scheduleid}}' showwhen:'notlive' ]}{{ NextOccurrenceDateTime | Date: 'yyyy/MM/dd HH:mm:ss' }}{[ endscheduledcontent ]}{[ scheduledcontent schedulecategoryid:'{{scheduleid}}' showwhen:'live' ]}islive{[ endscheduledcontent ]}");
$('#expireMessage').countdown({until: shortly,
expiryText: '<div class="over">It\'s all over</div>'});
$('#expireMessageStart').click(function() {
shortly = new Date();
<iframe width="100%" height="100%"
src="https://www.youtube.com/embed/live_stream?channel=UCZfh7wXSDMbtXcolvAXVVHw&fbclid=IwAR3Pwl9ms7unWF0pms-_3yrlOS7NHEdU2L8anRnv4I-Q5krqCiNFaSyuKi8"
frameborder="0" allow="accelerometer;
autoplay; encrypted-media; gyroscope;
picture-in-picture" allowfullscreen></iframe>

Keybase proof

I hereby claim:

  • I am jaygreentree on github.
  • I am jaygreentree (https://keybase.io/jaygreentree) on keybase.
  • I have a public key ASCtp2Tc14orMttffoYQbw4I9z9YgNe8I5fsyaS5xcdR-wo

To claim this, I am signing this object:

var __tracked = 0;
nwindow["trackVisitorCount"] = function(count) {
__tracked = 1;
$(".close - reveal - modal").click();
ga(" send ", " event ", " Online Service ", " viewer ", count.toString());
var $img = $( < img > );
$img.attr(" style ", " display: none; ");
$img.attr(" src ", \" http: //my.thursdaychurch.org/WebHooks/OnlineCampusAttendance.ashx?count=" + count.toString()); $img.appendTo("body");
};