Forum Replies Created

Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter peterbra

    (@peterbra)

    Please delete this – this was my fault as I’ve placed some admin JS which was causing problems ! All is OK with the plugin ??

    peterbra

    (@peterbra)

    Well bro – if you are good with PHP – check in mysql and see how it’s storing data and try to manipulate it (I don’t have time to play with it now), and then find you own fix for that – I never worked with that plugin as I think that it’s always best to use native WP stuff and just manually modify them through functions ( you know what you did so it’s easy to update in some point of time if needed + relying on plugin can be fuzzy e.g. plugin author stops updating it and after 5-6 WP updates it breaks so does the whole site).

    Good luck with that bro !

    peterbra

    (@peterbra)

    You should see what kind of post is that and just exclude it from mysql query (so it’s never processed). It should be easy fix, but of-course, with every plugin update – you will have to add that post-type as an exclusion ??

    If it’s creating it’s own db tables – it’s going to be slightly more complicated, but definitely doable.

    OK, I needed this fast so I just did quick’n’dirty hack so it won’t include attachments in SCPO Here is solution (I hope author will include in next update so we don’t have to do it every time):
    In plugin directory edit file simple-custom-post-order.php
    locate line 148 (it should be inside refresh function) and current line is like this:

    $results = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future') ORDER BY menu_order ASC" );

    Now EXCLUDE attachment page from being queried and replace that line with this line:

    $results = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = '".$object."' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future') AND post_type != 'attachment' ORDER BY menu_order ASC" );

    NOTE: only thing changed here is AND post_type != 'attachment'

    Everything should work OK now.

    I second this issue – on vanilla WP install with SCPO plugin you CAN’T order the gallery images properly. I am pretty much sure that it’s because plugin doesn’t have an option to exclude media type attachment from sorting – I will try to find solution later today….

    Place this code in your functions:

    add_action('print_media_templates', function(){
    
      // define your backbone template;
      // the "tmpl-" prefix is required,
      // and your input field should have a data-setting attribute
      // matching the shortcode name
      ?>
      <script type="text/html" id="tmpl-my-custom-gallery-setting">
        <label class="setting">
          <span><?php _e('My setting'); ?></span>
          <select data-setting="my_custom_attr">
            <option value="foo"> Foo </option>
            <option value="bar"> Bar </option>
            <option value="default_val"> Default Value </option>
          </select>
        </label>
      </script>
    
      <script>
    
        jQuery(document).ready(function(){
    
          // add your shortcode attribute and its default value to the
          // gallery settings list; $.extend should work as well...
          _.extend(wp.media.gallery.defaults, {
            my_custom_attr: 'default_val'
          });
    
          // merge default gallery settings template with yours
          wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend({
            template: function(view){
              return wp.media.template('gallery-settings')(view)
                   + wp.media.template('my-custom-gallery-setting')(view);
            }
          });
    
        });
    
      </script>
      <?php
    
    });

    Thread Starter peterbra

    (@peterbra)

    Ok, for all of you searching for a solution here it goes:

    function wwiz_mce_inits($initArray){
        $initArray['height'] = '600px';
        $initArray['theme_advanced_font_sizes'] = '10px,12px,13px,14px,15px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px';
        $initArray['font_size_style_values'] = '10px,12px,13px,14px,15px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px';
        return $initArray;
    }
    add_filter('tiny_mce_before_init', 'wwiz_mce_inits');

    Thread Starter peterbra

    (@peterbra)

    Hi Ipstenu and thanks for your time helping me out, but my users are mostly elderly people or people with no computer experience what-so-ever, and I really have to make this system easy to use.

    I did more than 100 WP sites – never did the MU – this is my first one so I know that there are a lot of plugins and I can use roles and stuff – I know all that, but this is the road i have to go – my custom backend on main site, and I am almost done ??

    I am kind of baffled that there is no work-around to solve ajax cross-domain media-uploader issue.

    Once again thanks for your time and effort – I appreciate it ??

    Thread Starter peterbra

    (@peterbra)

    Well, I wouldn’t be bothering my self to do something if I don’t have to, right ??

    The goal is that all admins will go to one page on my main domain and manage their respective sites from there. They won’t have that many options as they have in WP – only basics one like: write page/post and delete/edit, create category and upload media to the post, change profile info and that’s about it.

    Anyway – I couldn’t find the right solution for this, so I’ll just write my own media uploader…

    Thread Starter peterbra

    (@peterbra)

    Well – I’m not sure what’s best to do as I’m new to WP MU – can you point me in right direction now ? What should I do to make this uploader work with setup I have… How do I alter cross-domain policy ?

    Thread Starter peterbra

    (@peterbra)

    Well, that’s the thing I’m confused with – all users (and user is blog admin as I have only one user per blog and that user is blog admin), so all admins are also logging via https://www.MainDomain.com/login and all cookies are set there.

    I know all cookies are good because after login on main site I can go to subdomain.MainDomain.com/wp-admin and I am logged-in as admin, and from there I can use wp normally ( wp uploader as well ?? )

    Only issue I have is with media uploader on main blog (MainDomain.com/members is location) -> how to “explain” to that ajax call that user is admin and that he is logged in and that all is OK as it seems to me that ajax can’t figure out that user is legit – hence it’s denying access ??

    Thread Starter peterbra

    (@peterbra)

    OK, I see your point ?? Do you have any ideas why ajax isn’t authenticating requests ?

    My wild guess is that it’s ajax/same domain policy issue ? I am doing switch_to_blog() call and that part is ok (like post/page are updating etc…), but since that call is coming from https://www.MainDomain.com/members and is trying to upload to blog.MainDomain.com I guess that in that part the conflict occurs (for ajax https://www.MainDomain.com and blog.MainDomain.com are completely different domains) – am I right ?

    Thread Starter peterbra

    (@peterbra)

    They are editing their own pages/posts (mine setup is only one username/admin per blog).It’s subdomain setup, so I guess it may be some kind of domain policy issue when they have to upload from “main domain” members page ? I am not sure if switch_to_blog($userblog_id) is working properly when ajax calls are running ? And i’m not that good in Ajax ??

    Thread Starter peterbra

    (@peterbra)

    ..Forgot to mention when I go to the site dashboard for that blog and click Add media button – admin-ajax.php response is :
    {“wp-auth-check”:true,”wp-refresh-post-lock”:{“new_lock”:”1386087028:4″},”server_time”:1386087028}

    So obviously even if I am logged in as blog admin on main site – I am not getting authenticated as blog admin when ajax request is run on MainDomain.com ? Is there a work-around ?

    I am having issues with WP MU … It keeps telling me “An error occurred in the upload. Please try again later.”… on a upload media pop-up (once a file is uploaded and supposed to be saved)

    Setup is: All sub-blog admins are going to https://www.MainDomain.com/members page and on that page I’ve managed to put wp_editor…. I am loading all admin scripts on that page and I am using switch_to_blog($userblog_id); but error still shows… no errors thrown in server log… any ideas ?

Viewing 15 replies - 1 through 15 (of 32 total)