Downloadmanager

Creating and modifying plugins.
Sela81
Regular
Posts: 5
Joined: Wed May 26, 2010 11:36 pm

Downloadmanager

Post by Sela81 »

Hallo zusammen,
ich habe auf meinem Rechner das Serendipity Weblog installiert und teste einige plugins aus bevor ich das Weblog auf den richtigen Server installieren möchte. Bin begeistert von diesem Weblog. Leider habe ich gerade ein kleines Problem. Ich habe den Downloadmanager installiert und er funktionier bei mir nicht. Ich selber habe leider keine Ahnung von programmieren.

Der Folgende Fehler erscheint bei mir im Bereich des Downloadmanagers.

Warning: is_dir() expects parameter 1 to be string, resource given in C:\xampp\htdocs\serendipity\plugins\serendipity_event_downloadmanager\serendipity_event_downloadmanager.php on line 1791

Die Zeile 1791 habe ich mir in der php Datei angeschaut und kann aber damit nichts anfangen.

Folgende Pfade habe ich bei der Installations des Plugins eingegeben.

Permalink
/Serendipity/index.php?/downloads.html

Pfad zu "incoming"
C:/xampp/htdocs/Serendipity/hochladen/incoming

Pfad zu "download" Verzeichnis
C:/xampp/htdocs/Serendipity/hochladen/files

HTTP-path to plugin
/Serendipity/plugins/serendipity_event_downloadmanager/

Würde mich über eure Hilfe freuen.
Gruß
Sela
onli
Regular
Posts: 2828
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Downloadmanager

Post by onli »

Hi
is_dir will tatsächlich einen String als Pfad zum möglichen Ordner und das Plugin gibt eine Ressource - ein naheliegender Fehler. Mir ist nur nicht klar, warum die Warnung bei mir nicht angezeigt wird...

Teste doch bitte mal aus, ob alles funktioniert wie gewünscht, wenn du Zeile 1791 ersetzt mit:

Code: Select all

if( is_dir( $path ) ) closedir( $handle );
Gruß
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

onli wrote:Mir ist nur nicht klar, warum die Warnung bei mir nicht angezeigt wird...
Oder warum bei mir nicht mal die Ordner erstellt wurden....
Ich finde auf die Schnelle noch nicht mal ein mkdir im plugin....
(Der Wechsel von $handle auf $path funktioniert übrigens)

Ian
onli
Regular
Posts: 2828
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Downloadmanager

Post by onli »

Stimmt, die Ordner müssen selbst angelegt werden (das Plugin hat aber auch schon ein paar Jährchen auf dem Buckel).
(Der Wechsel von $handle auf $path funktioniert übrigens)
Super. Das werde ich dann bald hochladen.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

Dann könntest du die Ordnerstruktur sicher auch gleich auf templates_c/dlmanager/incoming und templates_c/dlmanager/files korrigieren, was bestimmt besser ist als sie im S9y root liegen zu haben, und das fehlende mkdir a la

Code: Select all

        if (!is_dir('templates_c/' . $directory)) {
            mkdir('templates_c/' . $directory, 0777); 
        } 
einfügen.
Denn was nützt einem das plugin, wenn man selber Ordner erstellen muss, ohne das man davon weiß?! War das schon immer so?

Gruß
Ian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Downloadmanager

Post by yellowled »

Timbalu wrote:War das schon immer so?
Vermutlich ja. Es gibt bestimmte Plugins, die -- gelinde gesagt -- steinalt sind und (soweit ich weiss) auch nicht mehr aktiv gepflegt werden. Ich rate z.B. normalerweise davon ab, den Download-Manager überhaupt zu verwenden -- das Ding produziert u.A. höllischen HTML-Code, der nur mit viel Mühe überhaupt anständig zu gestalten ist.

So, und jetzt sind wir mal höflich und hören auf, die Leser dieses (englischsprachigen) Forum dadurch zu verwirren, dass wir hier in einer Sprache, die die meisten von ihnen nicht verstehen, diskutieren. Dafür ist das deutsche Forum da, auch wenn dieses thematisch passender erscheint. :)

(Sorry for the disturbance, folks. Yes, this thread is in German. We'll try to stop this in the future.)

YL
onli
Regular
Posts: 2828
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Downloadmanager

Post by onli »

Ok, dann englisch^^

Timbalu, the plugin has 2000 lines of code. As far as i've seen it's not totally awful, but I won't make any unnecessary changes ;)

PS: But I'd test a patch.
Last edited by onli on Sat Aug 07, 2010 5:15 pm, edited 1 time in total.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

onli wrote:...., but I won't make any unnecessary changes
Well, for a 'newbie', like Sela called her/him-self, at least the mkdir sounds like a necessity...!
Just to make sure, the 'totally awful' is a Yellowledi.... ;-)

Regards,
Ian
onli
Regular
Posts: 2828
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Downloadmanager

Post by onli »

True, i didn't want to call the change itself unnecessary. I just am concerned i'd break the plugin altogether - especially because i've some other things on my todo-list then to dig into this very big plugin. But you noticed my ps? ;)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

Yes... afterwards ;-)
I sent you a PM with some files.
Ian
Sela81
Regular
Posts: 5
Joined: Wed May 26, 2010 11:36 pm

Re: Downloadmanager

Post by Sela81 »

onli wrote:Hi
is_dir will tatsächlich einen String als Pfad zum möglichen Ordner und das Plugin gibt eine Ressource - ein naheliegender Fehler. Mir ist nur nicht klar, warum die Warnung bei mir nicht angezeigt wird...

Teste doch bitte mal aus, ob alles funktioniert wie gewünscht, wenn du Zeile 1791 ersetzt mit:

Code: Select all

if( is_dir( $path ) ) closedir( $handle );
Gruß
Hello alltogether, the replacement of the line 1791 with:

if( is_dir( $path ) ) closedir( $handle );

works very good

Many thanks for your help!!
Regards
Sela
Sela
Sela81
Regular
Posts: 5
Joined: Wed May 26, 2010 11:36 pm

Re: Downloadmanager

Post by Sela81 »

Now, I'm able to upload files with the downloadmanager,
but if I try to dowload the file from the Weblog, it is not woking.
I made a screenshot of the page where I uploaded the data. There is no possibilty to download the Agenda pdf-file. With the right mouse klick I can save the path but I can not download the file.

These are my new settings:

Permalink
/Serendipity/index.php?/downloads.html

Pfad zu "incoming"
C:/xampp/htdocs/Serendipity/templates_c/dlmanager/incoming

Pfad zu "download" Verzeichnis
C:/xampp/htdocs/Serendipity/templates_c/dlmanager/files

HTTP-path to plugin
/Serendipity/plugins/serendipity_event_downloadmanager/

Many thanks again !!
best regards
Attachments
download.pdf
(37.68 KiB) Downloaded 336 times
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

HI Sela

We were making progress knitting a new version which is on its way to be uploaded. We

- changed upload folder to 'serendipity/uploads/dlmanager/incoming' (effects new installations only!)
- changed download folder to 'serendipity/templates_c/.dlmanager/files' (effects new installations only!)
- added misssing mkdir of directories using the recursive mkdir function added with PHP 5.0.0
- corrected is_dir($handle) bug and warning
- added the ability to have a very own plugin stylesheet with some very minor values to start with
- changed the frontend tpls to support these changes

If you can wait, wait. If not, try to add after

Code: Select all

    function ADMIN_showDownloads() {
        global $serendipity;

        [..... some code ......]

        if (!$absdownloadspath || strlen($absdownloadspath) < 1) {
            $absdownloadspath = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . 'dlmanager/files';
        }
at around line 1441

Code: Select all

        if (!is_dir($absincomingpath)) {
            mkdir($absincomingpath, 0777, true);
        }
        if (!is_dir($absdownloadspath)) {
            mkdir($absdownloadspath, 0777, true);
        }
so this should work. If it isn't working, this might be a matter of the pdf file. Try something else first.

Ian
Sela81
Regular
Posts: 5
Joined: Wed May 26, 2010 11:36 pm

Re: Downloadmanager

Post by Sela81 »

Hello Timbalo,

Many thanks for you fast answer. I tried to copy the code you sent me in the php file. Unfortunately it didn't work.
When do you think the new downloadmanager plugin will be online?
Regards
Sela
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Downloadmanager

Post by Timbalu »

Its updated already (Version 0.22)!

Ian

PS.
Sela81 wrote:Now, I'm able to upload files with the downloadmanager,
but if I try to dowload the file from the Weblog, it is not woking.
I made a screenshot of the page where I uploaded the data. There is no possibilty to download the Agenda pdf-file. With the right mouse klick I can save the path but I can not download the file.
I should really start to read before I post... ;-)
Why do you want to download in an area where you just uploaded. The download is meant to be in frontend only, which should be per default underneath
/yourblog/index.php?serendipity[subpage]=downloadmanager or /yourblog/downloads.html
Last edited by Timbalu on Mon Aug 09, 2010 4:15 pm, edited 1 time in total.
Post Reply