WordPress.org

Ready to get started?Download WordPress

Forums

Downloads Manager
Unable to edit existing Downloads (2 posts)

  1. leeflea
    Member
    Posted 2 years ago #

    Hi if anyone can help. I really enjoy this download manager and have lots of files set up,but there is a bug that i can't edit some of the added downloads or even delete using the Download manger dashboard. Any one found a fix? Also when i click on the mp3 download to save it save it as an html soucre and not mp3.
    Thanx Please help!!!

    http://wordpress.org/extend/plugins/downloads-manager/

  2. sherwin_flight
    Member
    Posted 2 years ago #

    Hi,

    I had the same problem and figured out a solution that worked for me. In my case I had an apostrophe (') in the description of some of my files. Those files wouldn't let me edit them. It turns out this was due to a bug in the code. I found a couple small fixes that corrected the problem for me.

    These files can be edited through your normal html editor, or through WordPress bu editing the source of the plugin.

    The file you need to edit is dm-main.php

    Around page 215 you'll see:

    echo "    <td class=\"alternate\"><a href=\"#edit\" onClick=\"EditDownload('".$row['id']."', '".$row['name']."', '".$row['catname']."', '".$row['icon']."', '".$row['description']."', '".$row['permissions']."', '".$row['link']."', '".date('d/m/Y', $row['date'])."', '".$row['clicks']."');\" class=\"edit\">".__('Edit', 'downloads-manager')."</a></td>\n";
          echo "  </tr>\n";

    You'll need to replace it with:

    echo "    <td class=\"alternate\"><a href=\"#edit\" onClick=\"EditDownload('".$row['id']."', '".addslashes($row['name'])."', '".addslashes($row['catname'])."', '".$row['icon']."', '".addslashes($row['description'])."', '".$row['permissions']."', '".$row['link']."', '".date('d/m/Y', $row['date'])."', '".$row['clicks']."');\" class=\"edit\">".__('Edit', 'downloads-manager')."</a></td>\n";
          echo "  </tr>\n";

    All I did was put addslashes() around $row['name'], $row['catname'], and $row['description']. So now if one of those fields contains an apostrophe it will not cause this error.

    I am not able to edit those files without a problem!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic