Welcome to LegendCS – Free and Open Source gaming forum.

MyDownloads plugin - Manage Previews fix
#1
When uploading a file inside the Mydownloads polugin you might forgot to upload a preview image of the resource you uploaded.

The plugin gives you an option to fix this directly by clicking on Manage previews button , however you might get 500 HTTP ERROR or something like this.

To fix this keep in mind that we need to work with mydownloads.php that can be found the root of your board ( NOT the one in the inc/plugins )

In mydownloads.php 

Find :

Code:
if($mybb->get_input('legacy', INPUT_INT) == 1)

Replace with :

Code:
if($mybb->get_input('legacy', MyBB::INPUT_INT) == 1)

Before:

Code:
mydownloads_json_error($lang->mydownloads_preview_empty, $preview_file, $mybb->get_input('legacy', INPUT_INT));

After:

Code:
mydownloads_json_error($lang->mydownloads_preview_empty, $preview_file, $mybb->get_input('legacy', MyBB::INPUT_INT));

Other Occurrences:
  1. Replace:

Code:
mydownloads_json_error($lang->mydownloads_invalid_extension, $preview_file, $mybb->get_input('legacy', INPUT_INT));

With:

Code:
mydownloads_json_error($lang->mydownloads_invalid_extension, $preview_file, $mybb->get_input('legacy', MyBB::INPUT_INT));
  1. Replace:

Code:
mydownloads_json_error($lang->mydownloads_upload_problem_pr_already_exists, $preview_file, $mybb->get_input('legacy', INPUT_INT));

With:

Code:
mydownloads_json_error($lang->mydownloads_upload_problem_pr_already_exists, $preview_file, $mybb->get_input('legacy', MyBB::INPUT_INT));
  1. Replace:

Code:
mydownloads_json_error($lang->mydownloads_upload_problem_previewfile.$preview_file['error'], $preview_file, $mybb->get_input('legacy', INPUT_INT));

With:

Code:
mydownloads_json_error($lang->mydownloads_upload_problem_previewfile.$preview_file['error'], $preview_file, $mybb->get_input('legacy', MyBB::INPUT_INT));
  1. Replace:

Code:
mydownloads_json_error($lang->sprintf($lang->mydownloads_max_width, $maxsize[0]), $preview_file, $mybb->get_input('legacy', INPUT_INT));

With:

Code:
mydownloads_json_error($lang->sprintf($lang->mydownloads_max_width, $maxsize[0]), $preview_file, $mybb->get_input('legacy', MyBB::INPUT_INT));
  1. Replace:

Code:
mydownloads_json_error($lang->sprintf($lang->mydownloads_max_height, $maxsize[1]), $preview_file, $mybb->get_input('legacy', INPUT_INT));

With:

Code:
mydownloads_json_error($lang->sprintf($lang->mydownloads_max_height, $maxsize[1]), $preview_file, $mybb

Find :

Code:
$filename = "preview_".$mybb->user['uid']."_".TIME_NOW."_".md5(uniqid(rand(), true)).".".get_extension($preview);

Replace with :

Code:
$filename = "preview_".$mybb->user['uid']."_".TIME_NOW."_".md5(uniqid(rand(), true)).".".get_extension($preview);

find :

Code:
// Legacy?
        if($mybb->get_input('legacy', INPUT_INT) == 1)
            redirect($mybb->settings['bburl']."/mydownloads.php?action=managepreviews&did=".$did, $lang->mydownloads_preview_submitted);

Replace with : 

Code:
// Legacy?
if($mybb->get_input('legacy', MyBB::INPUT_INT) == 1) {
    redirect($mybb->settings['bburl']."/mydownloads.php?action=managepreviews&did=".$did, $lang->mydownloads_preview_submitted);
}

This should fix the manage previews problem.


Related Threads…
Thread Author Replies Views Last Post
  MyDownloads plugin - Unable to upload any files Berserk 0 152 09-30-2024, 06:35 PM
Last Post: Berserk

Forum Jump:


Recently Browsing 1 Guest(s)