Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Pionect

    (@pionect)

    I made a change in class.phimind.php on line 78.
    To change the capability ‘edit_plugins’ to ‘eeplus’

    And in my plugin i’ve added:

    register_activation_hook( __FILE__, array("pnct_excelExport", "add_permissions") );
    
    class pnct_excelExport{
    
        function add_permissions(){
            global $wp_roles;
            $wp_roles->add_cap("administrator", "eeplus");
            $wp_roles->add_cap("editor", "eeplus");
        }
    
    }
    new pnct_excelExport();

    It would be easy if you changed line 78 like this:

    $capability = apply_filters('phimind_excel_export_capability', 'edit_plugins');
    add_submenu_page( ... , $capability,  ... );

    Or you could set it fixed to something like ‘eeplus’, like I did.
    In that case it would be nice if you’d include the first piece of code with ‘add_permissions’.
    And then add a filter so others are able to change the affected roles.

    Thread Starter Pionect

    (@pionect)

    It’s not a good practice to make changes in a framework but I simply removed the troublemakers from bootstrap’s CSS.
    I guess the bootstrap doesn’t necessarily has to get updated ever.

    I’ve removed this two pieces:

    body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}
    a{color:#08c;text-decoration:none}
    a:hover,a:focus{color:#005580;text-decoration:underline}

    and

    ul,ol{padding:0;margin:0 0 10px 25px}

    I didn’t try to dictate you, my apologies if it looked like that.
    Consider this my feature request.
    To me it seemed helpful for the community to be able to set defaults.

    Two solutions are: custom hooks in your plugin or a settingspage for your plugin.

    For others looking for a solution, here is mine:
    add the following code to your theme’s functions.php

    add_action('admin_enqueue_scripts', array($this, 'private_usc_script') );
    
    function private_usc_script($hook) {
      if( 'post-new.php' != $hook ){
        return;
      }
    
      wp_enqueue_script( 'privatecontent', get_template_directory_uri() . '/js/privatecontent.js' );
    }

    create a new file in your theme’s js folder called ‘privatecontent.js’

    jQuery(document).ready(function($){
       $('#User_specific_content input[name*=logged]:first').prop('checked',true);
    });

    I’m not satisfied with this answer.

    Allmost all posts on my site should be private by default except for a few that should be public.
    This piece of code would make all posts the same, even after the editor changed the U_S_C settings.
    Isn’t it possible to set defaults for the metaboxes on ‘new posts/pages’ so they can be overwritten by editors?

    @sterdog: I’ve changed my query to fit different database prefixes. I hope this will fix your issue.

    case "categories":
    global $wpdb;
    $query = "SELECT GROUP_CONCAT(t.name) as categories
    FROM ".$wpdb->prefix."term_relationships tr
    INNER JOIN ".$wpdb->prefix."term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
    INNER JOIN ".$wpdb->prefix."terms t ON t.term_id = tt.term_id
    WHERE object_id = $post->ID ";
    $field_value = $wpdb->get_var( $query );
    break;

    I’ve just build the feature to export the categories (not the filter).
    There are only two additions to be made in /controllers/class.phimind_excel_export_plus.php

    First on line 50 add
    $this->array_wp_custom_columns["categories"] = "Categories";

    The second addition on line 318

    case "categories":
    $query = 'SELECT GROUP_CONCAT(t.name) as categories
    FROM wp_term_relationships tr
    INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
    INNER JOIN wp_terms t ON t.term_id = tt.term_id
    WHERE object_id = '.$post->ID;
    global $wpdb;
    $field_value = $wpdb->get_var( $query );
    break;

    @yuri, could you insert this into the plugin?

    Thread Starter Pionect

    (@pionect)

    Secondly the style of the page ‘Excel Export +’ isn’t correct.
    The page has a white background but not if you scroll down.
    The white background is comming from bootstrap.

    If the admin menu is not as long as the browser window, the bottom turns to white instead of being black.

Viewing 7 replies - 1 through 7 (of 7 total)