XML reader modul for save downloads

XML reader modul for save downloads

by Peter Sereinigg -
Number of replies: 8

This is a save download xml-reader modul, you can use with the resource-modul to pop up a complete directory to select files for download.
Ressource - Modul only allows one file per entry.

By using the file.php from moodle only persons are allowed to use this link, who are able to use the course.

The version is still 0.001 Breites Grinsen but works fine. Changes you have to do, are described in the readme.txt and the files ...

Some changes should come soon: select directories, more comfortable view (now filename, size and date is shown as one string, without formats)

  • Change the nessesary values
  • Change the start.htm and end htm for your view

Peter

Average of ratings: -
In reply to Peter Sereinigg

Re: XML reader modul for save downloads

by Peter Sereinigg -

Have a look at the view to can get (sorry for the german view!)

Attachment MWSnap241_2004-03-24_12_58_31.jpg
In reply to Peter Sereinigg

Re: XML reader modul for save downloads

by W Page -

Hello!

I am having a problem installing this script.

Just wanted to ask the following,

My Moodle install looks like the following,
/moodle
/moodledata

The web site address appears as
http://MyWebSite.com/moodle/

This is what I did in an attempt to follow the instructions in the "ReadMe" file,

SCRIPT CHANGES,

In "xmlreader.php"

 /* MOODLE FILE.PHP ANFANG
 */

    require_once("moodle/config.php");
    require_once("moodle/files/mimetypes.php");
    $pfad="
http://MyWebSite.com/moodle/file.php/";
    $lifetime = 86400;
    if (isset($file)) $pathinfo = $file;
    else $pathinfo = get_slash_arguments("xmlreader.php");
    if (!$pathinfo) error("No file parameters!");
    $pathinfo = urldecode($pathinfo);
    if (! $args = parse_slash_arguments($pathinfo)) error("No valid arguments supplied");

In "reader.xml"

- <ps>
- <!-- Reader for moodle (c) 2004
ps@sereinigg.at</font>  -->
- <!-- you MUST CHANGE ROOT to Moodledata:  /home/YOUR-Domain/moodledata/   -->
- <!-- you MUST Change pfad with your data-directory  -->
- <!-- you may modify title  -->
- <!-- you may modify start.htm and end.htm  -->
- <!-- use it from ressource with
http://your-mmodle-domain/xmlreader.php/reader.xml  -->
  <basis>/homepages/22/x12345678/htdocs/moodledata/</basis>
- <verzeichnis>
  <pfad>homepages//22/x12345678/htdocs/moodledata/</pfad>
  <titel>STORAGE TESTER</titel>
  <kopfzeile>start.html</kopfzeile>
- <fusszeile>
- <!--  you may modify this  -->
  end.html
  </fusszeile>
  </verzeichnis>
  </ps>

SCRIPT PLACEMENT

/moodle/xmlreader.php

/moodledata/reader.xml
moodledata/start.html
moodledata/end.html

If I try to call the page using http://MyWebSite.com/moodle/xmlreader.php/reader.xml I get a 404 error.

What did I do wrong??

WP1

In reply to W Page

Re: XML reader modul for save downloads

by Peter Sereinigg -

Please update, maybe this solves your problem.

Change in this file $pfad="http://ps.powerlearning.at/moodle/file.php/"; to your path

We have the same structure!

Peter

In reply to Peter Sereinigg

Re: XML reader modul for save downloads

by W Page -

Hi Peter!

I made the changes you suggested but when I click on the link I still get a 404 error.

// Ausgabe
{
$this->strBaseDir = trim($this->strBaseDir);
$this->strPfad = trim($this->strPfad);
$this->strExtension = trim($this->strExtension);
$this->strKopfzeile = trim($this->strKopfzeile);
$this->strFusszeile = trim($this->strFusszeile);

$pfad="http://MyWebSite.com/moodle/file.php/";

if (!($fp = @fopen($this->strBaseDir . $this->strKopfzeile, "r"))) die("Kann Kopfzeile nicht öffnen!");
while ($data = fread($fp, 4096)) echo $data;
fclose($fp);

Are the scripts in the proper location?

/moodle/xmlreader.php

/moodledata/reader.xml
/moodledata/start.html
/moodledata/end.html

Thanks again in advance for your help.

WP1
In reply to W Page

Re: XML reader modul for save downloads

by Peter Sereinigg -

I see....

xmlreader.php => moodle homedirectory

xmlreader.xml =>moodledata

you link at this with:

http://YOUR-Moodledomain/xmlreader.php/reader.xml

http://ps.powerlearning.at/xmlreader.php/gmt-tfb1.xml (thats (one of my link, you can not use it without loggin in Breites Grinsen) I have several of the xmlreader.xml with differnt names

Now xmlreader.php creates a new link (internal) to the moodledata and uses the parameters in reader.xml to locate the directory in moodledata

Please check: is xmlreader.PHP in the root

Peter

In reply to Peter Sereinigg

Re: XML reader modul for save downloads

by W Page -
Hi Peter!

The files in the ZIP are,
reader.xml
xmlreader.php
start.html
end.html
readme.txt

There is no "xmlreader.xml".

My site address is based on the following,
http://MyWebSite.com/moodle/
Just for my own clarity, which address should I call the script by,
http://MyWebSite.com
/moodle/xmlreader.php/reader.xml
OR
http://MyWebSite.com/xmlreader.php/reader.xml

WP1
In reply to W Page

Re: XML reader modul for save downloads

by Peter Sereinigg -

Hi

first you are right, "xmlreader.xml" is named "reader.xml" in the zip (my fault)

In my case i start moddle with

  • http://ps.powerlearning.at/moodle/
    home/ps.powerlearning.at/www/moodle is the physical path
    • xmlreader.php is located in the directory
      http://ps.powerlearning.at/
      (Mention: my moodle starts one level under my root)
      In this file

      • If you have a standard moodle installation, you should not change this:
        Line 5: require_once("moodle/config.php");
        Line 6: require_once("moodle/files/mimetypes.php");

      • But you have to change
        Line 99: $pfad="http://ps.powerlearning.at/moodle/file.php/";
        to the path where your file.php is located ...

  • The link using the reader is (in my case)

    • http://ps.powerlearning.at/xmlreader.php/gmt-tfb1.xml
      • gmt-tfb1.xml is the same file as reader.xml with a different path inside is located at moodledata, in the directory where you find the course numbers 1...n
      • Line 9:   /home/YOUR-Domain/moodledata/
        in my case: /home/ps.powerlearning.at/moodledata
      • Line 13: in my case: publicdata/gmt/im/
        starting in moodledata and then (some) directories down
      • Line 16: Your Title for the downloads
        This text is shown in the popup window of the reader
      • Line 19: start.html
        a simple page for your header
      • Line 22: end.html
        a simple page for your footer

If this not works, please send me xmlreader.php and your reader.xml + the two html-files direct to my e-mail, we will find the problem.
Maybe we can find (with your help then) a easer to read description for installation, my english is ...schüchtern

We use this version on serveral servers with no problems

The zip included has two differnt directories to show in which directory you should copy which file

Peter

In reply to Peter Sereinigg

Re: XML reader modul for save downloads

by W Page -
Hi Peter!

Sending you something via e-mail. smile

I wonder if 1and1 (my webhost) is showing its tail bone again with this script. sad

WP1