Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter jkester1986

    (@jkester1986)

    By the way, I did some more digging, it looks like a simple change to this line:

    if(!isset($_POST['mdocs-contributors']))  $_POST['mdocs-contributors'] = array();

    in mdocs-upload.php to include set role types in the array (instead of leaving it empty) should work (and something similar in the mdocs-batch-upload file). I manually just entered my two role types in the upload.php file and it’s now working for me :). I look forward to a permanent fix!

    Thread Starter jkester1986

    (@jkester1986)

    And, going off of the above, now that I’m thinking about it…is there a way currently for me to write a script that will just iterate through ALL the files so I can change the contributors array if it’s empty? I see a lot of things like below where it’s all being set, but I’m not sure how to view the settings of ALL files

    array_push($mdocs, array(
    				'id'=>(string)$upload['attachment_id'],
    				'parent'=>(string)$upload['parent_id'],
    				'filename'=>$upload['filename'],
    				'name'=>$_POST['mdocs']['name'][$index],
    				'desc'=>'',
    				'type'=>$mdocs_fle_type,
    				'cat'=>$_POST['mdocs']['cat'][$index],
    				'owner'=>$current_user->user_login,
    				'contributors'=>array(),
    				'size'=>(string)$file['size'],
    				'modified'=>(string)time()+MDOCS_TIME_OFFSET,
    				'version'=>(string)$_POST['mdocs']['version'][$index],
    				'show_social'=>(string)'on',
    				'non_members'=> (string)'on',
    				'file_status'=>(string)'public',
    				'post_status'=> (string)'publish',
    				'post_status_sys'=> (string)'publish',
    				'doc_preview'=>(string)'',
    				'downloads'=>(string)0,
    				'archived'=>array(),
    				'ratings'=>array(),
    				'rating'=>0,
    				'box-view-id' => $boxview_file['id'],
    			));
    Plugin Author bhaldie

    (@bhaldie)

    Yes that looks like it could work.

    To run a script here is a idea:

    $mdocs = get_option('mdocs-list');
    foreach($mdocs as $index => $the_mdoc) {
    	array_push($mdocs[$index]['contributors'] , <the role type>);
    }
    mdocs_save_list($mdocs);

    this is just a quick idea, please test this before running this.

    Thread Starter jkester1986

    (@jkester1986)

    Got it, thanks!

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘user roles’ is closed to new replies.