Downloadmanager

Creating and modifying plugins.
onli
Regular
Posts: 3040
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Downloadmanager

Post by onli »

Give it a try or wait untill onli has time to push it up again.
What I just did. But it normally takes a day until the mirrors are updated. The actual version is 0.22.1.
But the missing fallback really shouldn't be harmful.
Sela81
Regular
Posts: 5
Joined: Wed May 26, 2010 11:36 pm

Re: Downloadmanager

Post by Sela81 »

Why do you want to download in an area where you just uploaded.
I want to use the Webblog for a project at the university.
I want to upload files there and other user in the project should be able to download the files from the weblog. For sharing files I want to use the downloadmanager plugin.

regards
Sela
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

Hi Sela

But why do you want them to have access to the backend?
They can still download your uploaded files in the frontend. Put a link to this in the navigation of your templates via config, or use the html nugget to have it in the sidebar.

If they have rights to use the backend to upload files too, I can see what you mean, but for such a purpose, as a 'backend ftp manager', the plugin isn't written, I think.

BUT

Change the part at lines 1674 to 1709 to this

Code: Select all

                        $sql = "SELECT * FROM {$serendipity['dbPrefix']}dma_downloadmanager_files WHERE catid = ".$id." ORDER BY timestamp DESC";
                        $files = serendipity_db_query($sql);
                        $OUTPUT .= "<br /><div align=\"center\">\n";
                        if (is_array($files)) {

                            $OUTPUT .= "\n\n\n<table bgcolor=\"#ffffff\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n";
                            $OUTPUT .= "    <tr style=\"background-color:#EDEDED\">\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\" width=\"30\"> </td>\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\" width=\"30\"> </td>\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\" width=\"25\"> </td>\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\"> ".$this->get_config('filename_field')." </td>\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\" width=\"50\"> ".$this->get_config('dls_field')." </td>\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\" width=\"100\"> ".$this->get_config('filesize_field')." </td>\n";
                            $OUTPUT .= "        <td style=\"font-weight:bolder;\" width=\"160\"> ".$this->get_config('filedate_field')." </td>\n";
                            $OUTPUT .= "    </tr>\n";
                            foreach($files as $file) {
                                if ($thiscolor == $color2) {$thiscolor = $color1;} else {$thiscolor = $color2;}

                                $mime = $this->getMime($file['realfilename']);
                                $exticon = "<img src=\"".$mime['ICON']."\" border=0 width=\"".$this->get_config('iconwidth')."\" height=\"".$this->get_config('iconheight')."\" alt=\"".$mime['TYPE']."\" title=\"".$mime['TYPE']."\" />";

                                $filesize = $this->calcFilesize($file['filesize']);

                                $OUTPUT .= "    <tr style=\"background-color:".$thiscolor."\">\n";
                                $OUTPUT .= "        <td width=\"30\" align=\"center\"><a href=\"./serendipity_admin.php?serendipity[adminModule]=event_display&serendipity[adminAction]=downloadmanager&thiscat=".$_GET['thiscat']."&delfile=".$file['id']."\"><img src=\"".$this->get_config('httppath')."img/del.gif\" border=\"0\" width=\"20\" height=\"20\" alt=\"".PLUGIN_DOWNLOADMANAGER_DEL_FILE."\" title=\"".PLUGIN_DOWNLOADMANAGER_DEL_FILE."\" /></a></td>\n";
                                $OUTPUT .= "        <td width=\"30\" align=\"center\"><a href=\"".$serendipity['baseURL'] . ($serendipity['rewrite'] == "none" ? $serendipity['indexFile'] . "?/" : "") . "plugin/dlfile_" . $file['id']."\"><img src=\"".$this->get_config('httppath')."img/download.png\" border=\"0\" width=\"20\" height=\"20\" alt=\"".PLUGIN_DOWNLOADMANAGER_DOWNLOAD_FILE."\" title=\"".PLUGIN_DOWNLOADMANAGER_DOWNLOAD_FILE."\" /></a></td>\n";
                                $OUTPUT .= "        <td width=\"25\" align=\"center\">".$exticon."</td>\n";
                                $OUTPUT .= "        <td> <a href=\"./serendipity_admin.php?serendipity[adminModule]=event_display&serendipity[adminAction]=downloadmanager&thiscat=".$_GET['thiscat']."&editfile=".$file['id']."\">".$file['realfilename']."</a> </td>\n";
                                $OUTPUT .= "        <td width=\"50\"> ".$file['dlcount']." </td>\n";
                                $OUTPUT .= "        <td width=\"100\"> ".$filesize." </td>\n";
                                $OUTPUT .= "        <td width=\"160\"> ".date($dateformat, $file['timestamp'])." </td>\n";
                                $OUTPUT .= "    </tr>\n";

                            }
                            $OUTPUT .= "</table><br /><br />\n";
                        }
I added the two second OUTPUT td lines to have a download button and link in the backend. I tested it once and it worked, but I'm not sure about other consequences.

have fun,
Ian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

Hi Sela, Onli

I am sorry, but I couldn't resist and did some work with the downloadmanager. :wink:

According to Selas single wish, I changed and added:

Code: Select all

	- added root level file appearance in backend (mooved files to root didnt show up)
                The frontend did/does not show root level files, which isn't really a bug, 
                while it is a feature (by now) ;-)
	- changed dlm file work behaviour to support root level files too (please report, 
                if you experience some unusual behaviour)
	- added download file button to backend
	- changed 'dlmanager/incoming' folder to '.dlmanager/incoming', (effects new 
                installations only!)
                so it does not appear when the plugin presents the media gallery values 
                (if have, erase uploads/'dlmanager' folder yourself, next time you upload 
                the new one will be created)
	- fixed download of files with spaces in filename to have replaced spaces (_)
	- added the missing style_dlmanager_frontend.css to CVS
	- added style_dlmanager_backend.css to support future dlm backend templates
	- added dlm_functions.js to support future dlm backend javascript - using 
                foldable div containers by now
	- added some missing closing divs - hopefully all of them at the right place
You can use this as an upstream release to plugins. The zip contains the files changed from version 0.22.1 to 0.23 only.

Regards
Ian

edit:
had to erase file here, please wait until uploaded to spartacus

edit 2:
0.23 will be available soon via spartacus, but there are still missing 2 files (style_dlmanager_frontend.css and dlm_functions.js). Please wait downloading, until we have investigated why this happend.
http://php-blog.cvs.sourceforge.net/vie ... admanager/

edit 3:
Version 0.23.1 now is available via spartacus, including the missing files, which was a purpose of CVS.
Post Reply