<commit_before><?php
require_once('inc/seo.php');
require_once('inc/hashbang.php');
require_once('inc/acf.php');
require_once('inc/schedule-frontend.php');
require_once('inc/schedule-backend.php');
require_once('inc/schedule-favorites.php');
require_once('inc/socialfeed.php');

if( function_exists('acf_add_options_page') ) {
    acf_add_options_page();
}



/*------------------------------------*\
    HELPERS
\*------------------------------------*/


function has($v){
    return (isset($v)&&!empty($v));
}

function is_login_page() {
    return $GLOBALS['pagenow'] == 'wp-login.php';
}

function is_banged(){
    return isset($_COOKIE['big-screen']);
}

function remove_hashbang($url){
    return str_replace('#!/', '', $url);
};

function is_ajax(){
   global $wp_query;
   return isset($wp_query->query_vars['ajax']);
}

function get_header_once(){
    global $post, $header_rendered, $main_ID;
    if(!has($header_rendered)){
      get_header();
      $header_rendered = true;
      $main_ID = $post->ID;
    }
}
function get_footer_once(){
    global $post, $header_rendered, $main_ID;
    if(has($main_ID) && $main_ID==$post->ID){
      wp_reset_query();
      get_footer();
    }
}

function include_page_part($ID){
    global $post;
    query_posts(array(<commit_msg>added referer to is_banged detection<commit_after><?php
require_once('inc/seo.php');
require_once('inc/hashbang.php');
require_once('inc/acf.php');
require_once('inc/schedule-frontend.php');
require_once('inc/schedule-backend.php');
require_once('inc/schedule-favorites.php');
require_once('inc/socialfeed.php');

if( function_exists('acf_add_options_page') ) {
    acf_add_options_page();
}



/*------------------------------------*\
    HELPERS
\*------------------------------------*/


function has($v){
    return (isset($v)&&!empty($v));
}

function is_login_page() {
    return $GLOBALS['pagenow'] == 'wp-login.php';
}

function is_banged(){
    return isset($_COOKIE['big-screen']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['WP_HOME']) !== false;
}

function remove_hashbang($url){
    return str_replace('#!/', '', $url);
};

function is_ajax(){
   global $wp_query;
   return isset($wp_query->query_vars['ajax']);
}

function get_header_once(){
    global $post, $header_rendered, $main_ID;
    if(!has($header_rendered)){
      get_header();
      $header_rendered = true;
      $main_ID = $post->ID;
    }
}
function get_footer_once(){
    global $post, $header_rendered, $main_ID;
    if(has($main_ID) && $main_ID==$post->ID){
      wp_reset_query();
      get_footer();
    }
}

function include_page_part($ID){
    global $post;
    query_posts(array(
{'fraction_non_alphanumeric': 0.23169811320754716, 'fraction_numerical': 0.0, 'mean_word_length': 3.5549828178694156, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5883685', 'n_tokens_mistral': 923, 'n_tokens_neox': 909, 'n_words': 132}