Ejemplo n.º 1
0
 function pages($default = array())
 {
     try {
         if (SharePress::is_business()) {
             return array();
         }
         $result = Sharepress::api(Sharepress::me('id') . '/accounts', 'GET', array(), '30 days');
     } catch (Exception $e) {
         Sharepress::handleFacebookException($e);
         return array();
     }
     if ($result) {
         $data = $result['data'];
         // we only care about pages...
         $pages = array();
         if ($data) {
             foreach ($data as $d) {
                 if (isset($d['name'])) {
                     $pages[] = $d;
                 }
             }
         }
         // sort by page name, for sanity's sake
         usort($pages, array('SharepressPro', 'sort_by_name'));
         $result = $default + $pages;
         return !$result || !is_array($result) ? array() : $result;
     } else {
         return array();
     }
 }
Ejemplo n.º 2
0
      
      clearTimeout(message_timeout);
      setTimeout(function() {
        msg.val(title.val());
        msg_was = msg.val();
      }, synchronize ? 0 : 1000);
    };
    
    title.bind('keypress blur', function() {
      copy_title_to_message();
      return true;
    });

    var check_for_featured_image = true;
    var check_for_targets = <?php 
echo SharePress::is_business() ? 'false' : 'true';
?>
;

    $('#save-post, #post-preview, input[value="Submit for Review"]').click(function() {
      check_for_targets = check_for_featured_image = false;
      return true;
    });

    $('#publish').not('input[value="Submit for Review"]').click(function() {
      check_for_targets = check_for_featured_image = true;
      return true;
    });

    $('input[name="sharepress_meta\[let_facebook_pick_pic\]"]').change(function() {
      $('#picture_error').hide();