Example #1
0
add_filter('tag_template', 'uppsite_get_webapp_page');
add_filter('archive_template', 'uppsite_get_webapp_page');
add_filter('login_redirect', 'uppsite_redirect_login', 10, 3);
add_filter('comment_post_redirect', 'uppsite_redirect_comment', 10, 3);
function uppsite_fix_youtube($content)
{
    if (!preg_match_all("/<iframe[^>]*src=\"[^\"]*youtube.com[^\"]*\"[^>]*>[^<]*<\\/iframe>/x", $content, $matches)) {
        return $content;
    }
    foreach ($matches[0] as $iframe) {
        preg_match_all("/(src|width|height)=(?:\"|')([^\"']+)(?:\"|')/", $iframe, $fields);
        $vals = array("height" => "", "width" => "", "src" => "");
        $videoId = "";
        for ($i = 0; $i < count($fields[0]); $i++) {
            $key = $fields[1][$i];
            $vals[$key] = $fields[2][$i];
            if ($key == "src") {
                $vals[$key] = preg_replace("/([^\\?]+)\\??(.*)/", "\$1", $vals[$key]);
                preg_match("/\\/embed\\/(.+)/", $vals[$key], $parts);
                $vals['videoId'] = $parts[1];
                $vals[$key] = str_replace("/embed/", "/watch?v=", $vals[$key]);
            }
        }
        $replacement = '<p><img class="uppsite-youtube-video" vid="' . $vals['src'] . '" src="http://i.ytimg.com/vi/' . $vals['videoId'] . '/0.jpg"/><img src="" height="10" width="10"/></p>';
        $content = str_replace($iframe, $replacement, $content);
    }
    return $content;
}
if (MySiteAppPlugin::detect_specific_os() == "ios") {
    add_filter('the_content', 'uppsite_fix_youtube', 100);
}
Example #2
0
<?php

$isBusiness = uppsite_is_business_panel();
$app_name = mysiteapp_get_prefs_value('app_name', get_bloginfo('name'));
$has_tabbar = mysiteapp_get_prefs_value('menu_type') ? mysiteapp_get_prefs_value('menu_type') == 0 : true;
$has_homepage = mysiteapp_get_prefs_value('has_homepage', 'true') == 'true';
$has_homepage &= MySiteAppPlugin::detect_specific_os() != "android";
$navbar_img = mysiteapp_get_prefs_value('navbar_background_url', '');
$direction = mysiteapp_get_prefs_value('direction', 'ltr');
$hideMenus = mysiteapp_get_prefs_value('hide_menus', '[]');
$add_to_contacts = mysiteapp_get_optionsbiz_value('add_to_contacts') == 'true' ? 'true' : 'false';
function bool_to_str($bool)
{
    return $bool ? "true" : "false";
}
?>
<!DOCTYPE html>
<html>
<head>
    <title><?php 
echo esc_html($app_name);
?>
</title>
    <style type="text/css">
        html, body {
            height: 100%;
        }
        #appLoadingIndicator {
            position: absolute;
            top: 50%;
            left: 50%;
Example #3
0
 static function detect_specific_os()
 {
     if (is_null(self::$os)) {
         foreach (self::$_mobile_ua_os as $osName => $ua) {
             if (self::is_specific_os($ua)) {
                 self::$os = $osName;
                 break;
             }
         }
     }
     return self::$os;
 }
Example #4
0
<?php

$native_url = uppsite_get_native_app('url');
$base_dir = get_template_directory_uri();
$app_name = mysiteapp_get_prefs_value('app_name', get_bloginfo('name'));
$navbar_img = mysiteapp_get_prefs_value('navbar_background_url', null);
$landing_bg = mysiteapp_get_prefs_value('landing_background_url', MYSITEAPP_LANDING_DEFAULT_BG);
$native_icon = "ios";
switch (MySiteAppPlugin::detect_specific_os()) {
    case "android":
        $native_icon = "android";
        break;
    case "wp":
        $native_icon = "windows";
        break;
}
$hideMenus = json_decode(mysiteapp_get_prefs_value('hide_menus', '[]'), true);
$branded = in_array('about', $hideMenus);
?>
<html>
<head>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/>
    <link type="text/css" rel="stylesheet" href="<?php 
echo $base_dir;
?>
/assets/css/layout.css"/>
    <script type="text/javascript">
        var is_permanent = "";
        function remember_func(elem) {
            if (elem.checked) {