/**
 * Adds extra post classes
 *
 * @since 1.0.0
 * @param array $classes
 * @return array
 */
function wpcm_post_class($classes)
{
    if (is_sponsor()) {
        $classes[] = 'wpcm-single-sponsors';
    }
    if (is_club()) {
        $classes[] = 'wpcm-single-club';
    }
    if (is_player()) {
        $classes[] = 'wpcm-single-player';
    }
    if (is_staff()) {
        $classes[] = 'wpcm-single-staff';
    }
    if (is_match()) {
        $classes[] = 'wpcm-single-match';
    }
    return $classes;
}
 /**
  * Loads the JSON-LD structured data.
  *
  * @since  1.3
  * @access public
  * @return void
  */
 public function load_json_ld($post)
 {
     global $post, $wpclubmanager;
     $club = get_option('wpcm_default_club');
     $post_url = get_permalink();
     $post_thumb = wp_get_attachment_url(get_post_thumbnail_id($club));
     if (is_front_page()) {
         $data['@context'] = 'http://schema.org/';
         $data['@type'] = 'Organization';
         $data['name'] = get_bloginfo('name');
         $data['logo'] = $post_thumb;
         $data['url'] = site_url();
         echo '<script type="application/ld+json">';
         echo json_encode($data);
         echo '</script>';
     }
     if (is_match()) {
         $venues = get_the_terms($post->ID, 'wpcm_venue');
         if (is_array($venues)) {
             $venue = reset($venues);
             $t_id = $venue->term_id;
             $venue_meta = get_option('taxonomy_term_$t_id');
             $address = $venue_meta['wpcm_address'];
         } else {
             $venue = null;
             $address = null;
         }
         $data['@context'] = 'http://schema.org/';
         $data['@type'] = 'SportsEvent';
         $data['name'] = $post->post_title;
         $data['image'] = $post_thumb;
         $data['url'] = $post_url;
         $data['location'] = array('@type' => 'Place', 'name' => $venue->name, 'address' => array('@type' => 'PostalAddress', 'name' => $address));
         $data['startDate'] = $post->post_date;
         echo '<script type="application/ld+json">';
         echo json_encode($data);
         echo '</script>';
     }
 }
Exemple #3
0
                if (($rep = math($data)) !== NULL) {
                    send_qun_msg($v['value']['from_uin'], $rep, $cookie['login']['psessionid'], $cookie['clientid']);
                    continue;
                }
                // ip查询
                if ($ip_data = is_ip($data)) {
                    send_qun_msg($v['value']['from_uin'], $ip_data, $cookie['login']['psessionid'], $cookie['clientid']);
                    continue;
                }
                // 呼叫人工回复
                if ($info = is_call($data)) {
                    send_buddy_msg(4092490351, "qun:{$v['value']['from_uin']}--->{$info}", $cookie['login']['psessionid'], $cookie['clientid']);
                    continue;
                }
                // 职能取词
                if (($data = is_match($data)) && array_key_exists($data, $reply)) {
                    if (is_array($reply[$data]) && ($count = count($reply[$data]))) {
                        send_qun_msg($v['value']['from_uin'], $reply[$data][mt_rand(0, $count - 1)], $cookie['login']['psessionid'], $cookie['clientid']);
                    } else {
                        send_qun_msg($v['value']['from_uin'], $reply[$data], $cookie['login']['psessionid'], $cookie['clientid']);
                    }
                    continue;
                }
            }
        }
    }
    if ($msg['retcode'] == 121) {
        exit("退出");
    }
}
/*
}
function mb_fix_addr($str)
{
    $pattern = array('^(.{3,5})?臺北縣', '^(.{3,5})?(..)縣', '^(.*市)?(.{2,5}?)[鎮|鄉|市]', '^(.*)?村');
    $replacement = array('\\1新北市', '\\1\\2市', '\\1\\2區', '\\1里');
    for ($i = 0; $i < sizeof($pattern); $i++) {
        $str = mb_ereg_replace($pattern[$i], $replacement[$i], $str);
    }
    return $str;
}
$query = "select * from stud_base where stud_study_cond='0'";
$res = $CONN->Execute($query);
while (!$res->EOF) {
    $sn = $res->fields['student_sn'];
    $addr[1] = $res->fields['stud_addr_1'];
    $addr[2] = $res->fields['stud_addr_2'];
    for ($i = 1; $i < sizeof($addr) + 1; $i++) {
        $str = gsub($addr[$i]);
        if (is_match($str)) {
            $ok = mb_fix_addr($str);
        } else {
            $ok = $str;
        }
        printf("%s<br><font color=blue>%s</font><br>", $addr[$i], $ok);
        $db_str = "stud_addr_" . $i;
        ${$db_str} = $ok;
        $query2 = "update stud_base set stud_addr_1='" . addslashes($stud_addr_1) . "', stud_addr_2='" . addslashes($stud_addr_2) . "' where student_sn='{$sn}'";
        $CONN->Execute($query2);
    }
    $res->MoveNext();
}
/**
 * is_wpclubmanager - Returns true if on a page which uses WPClubManager templates (cart and checkout are standard pages with shortcodes and thus are not included)
 *
 * @access public
 * @return bool
 */
function is_wpclubmanager()
{
    return apply_filters('is_wpclubmanager', is_match() || is_club() || is_player() || is_staff() || is_sponsor() ? true : false);
}
Exemple #6
0
function rearrange_statements($stats, $resource_id)
{
    foreach ($stats as $i => $value) {
        $rule_id = $stats[$i]['rule_id'];
        $stats[$i]['color'] = get_current_color($stats[$i]['verb']);
        if (is_match($rule_id)) {
            $stats[$i]['match'] = True;
        } else {
            if (display_me($rule_id)) {
                $stats[$i]['shown'] = True;
            } else {
                $stats[$i]['rest'] = True;
            }
        }
    }
    $result = display_statements(compact('matched', 'shown', 'rest', 'resource_id', 'stats'));
    return $result;
}
Exemple #7
0
function external_script($sms)
{
    $config = external_script_initialize();
    $phone = $sms->SenderNumber;
    $content = $sms->TextDecoded;
    $id = $sms->ID;
    $shell_path = $config['ext_script_path'];
    // Load all rules
    foreach ($config['ext_script'] as $rule) {
        $script_name = $rule['name'];
        $value = $parameter = "";
        // evaluate rule key
        switch ($rule['key']) {
            case 'sender':
                $value = $phone;
                break;
            case 'content':
                $value = $content;
                break;
        }
        // evaluate rule type
        switch ($rule['type']) {
            case 'match':
                $is_valid = is_match($rule['value'], $value);
                break;
            case 'contain':
                $is_valid = is_contain($rule['value'], $value);
                break;
        }
        // if we got valid rules
        if ($is_valid) {
            // build extra parameters
            if (!empty($rule['parameter'])) {
                $valid_param = array('phone', 'content', 'id');
                $param = explode("|", $rule['parameter']);
                foreach ($param as $tmp) {
                    if (in_array($tmp, $valid_param)) {
                        $parameter .= " " . ${$tmp};
                    }
                }
            }
            // execute it
            exec($shell_path . " " . $script_name . " " . $parameter);
        }
    }
}
<?php

require 'processor.php';
session_start();
$error = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $con = db_connect();
    // escape variables for security
    $username = mysqli_real_escape_string($con, $_POST['username']);
    $password = mysqli_real_escape_string($con, $_POST['password']);
    $result = is_match($con, $username, $password);
    if ($result) {
        $row = mysqli_fetch_array($result);
        $_SESSION['session_id'] = $row['id'];
        if ($row['username'] == $username && $row['password'] == $password) {
            header('location:home.php');
        } else {
            $error = "Authentication Failure!";
        }
    }
    mysqli_close($con);
}
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Arangu2K15</title>
		
		<script>
		window.onload = function(){
   		document.getElementById("username").focus();