예제 #1
0
 /**
  * Save a boolean value of whether to index comments on the next rebuild
  */
 public static function saveSettings()
 {
     Bizyhood_Utility::setOption(Bizyhood_Core::KEY_API_URL, $_POST['api_url']);
     Bizyhood_Utility::setOption(Bizyhood_Core::KEY_ZIP_CODES, $_POST['zip_codes']);
     Bizyhood_Utility::setOption(Bizyhood_Core::KEY_USE_CUISINE_TYPES, $_POST['use_cuisine_types'] === 'true');
     Bizyhood_Utility::setOption(Bizyhood_Core::KEY_CATEGORIES, $_POST['categories']);
     Bizyhood_Utility::setOption(Bizyhood_Core::KEY_MAIN_PAGE_ID, $_POST['main_page_id']);
     Bizyhood_Utility::setOption(Bizyhood_Core::KEY_SIGNUP_PAGE_ID, $_POST['signup_page_id']);
     die(json_encode(array('success' => true)));
 }
예제 #2
0
<script src="https://bizyhood-common.s3.amazonaws.com/bizyhood-net/init.js"></script>
<div id="main">
      <?php 
Bizyhood_View::load('admin/global/header');
?>
      <div class="left_column">
         <?php 
if ($errors) {
    ?>
             <div class="box">
                    <div class="shadow_column">
                        <div class="title" style="padding-left: 27px; background: #F1F1F1 url('<?php 
    echo Bizyhood_Utility::getImageBaseURL();
    ?>
info.png') no-repeat scroll 7px center;">
                            Alerts
                        </div>
                        <div class="content">
                            <p>
                                Nice to have you! We've noticed some things you may want to take
                                care of:
                            </p>
                            <ol>
                                <?php 
    foreach ($errors as $error) {
        ?>
                                    <li><?php 
        echo $error;
        ?>
</li>
                                <?php 
예제 #3
0
 /**
  * Get the bizyhood zone cache
  * @return array
  */
 public static function getZoneCache()
 {
     if (self::$_zoneCache !== NULL) {
         return self::$_zoneCache;
     }
     $zones = Bizyhood_Cache::get(self::KEY_ZONE_CACHE, FALSE, FALSE);
     if ($zones === FALSE) {
         $zones = self::refreshZoneCache();
     } else {
         $kzones = array();
         foreach ($zones as $zone) {
             $kzones[$zone->id] = $zone;
         }
         $zones = $kzones;
     }
     self::$_zoneCache = $zones;
     return self::$_zoneCache;
 }
예제 #4
0
 /**
  * Handler used for modifying the way business listings are displayed
  * @param string $content The post content
  * @return string Content
  */
 public function postTemplate($content)
 {
     global $post, $wp_query;
     $api_url = Bizyhood_Utility::getApiUrl();
     # Override content for the view business page
     $post_name = $post->post_name;
     if ($post_name === 'business-overview') {
         $signup_page_id = Bizyhood_Utility::getOption(self::KEY_SIGNUP_PAGE_ID);
         // get the bizyhood_id
         if (isset($wp_query->query_vars['bizyhood_id'])) {
             $bizyhood_id = urldecode($wp_query->query_vars['bizyhood_id']);
         } else {
             $bizyhood_id = isset($_REQUEST['bizyhood_id']) ? $_REQUEST['bizyhood_id'] : '';
         }
         $response = wp_remote_retrieve_body(wp_remote_get($api_url . "/business/" . $bizyhood_id));
         $business = json_decode($response);
         return Bizyhood_View::load('listings/single/default', array('content' => $content, 'business' => $business, 'signup_page_id' => $signup_page_id), true);
     }
     return $content;
 }