1
nmshah
module to display downloads in different formats
  • 2009/11/24 4:22

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Greetings,
I am looking for a module that allows upload of files in different formats.

What I mean is that the Admin has the option to upload the same file in two different format .doc and .pdf and display the same for download. Some thing like the same XOOPS download package that is available in zip and tar.

So the admin has Writes the Title and then uploads the file in doc and pdf which is then displayed in on the website(see the image)
Resized Image

2
Mamba
Re: module to display downloads in different formats
  • 2009/11/24 8:29

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


This could be something for you:

http://docs.schuetzengau-freising.de/modules/xdocman/

The link to CVS is here, but since it's very old, I am not sure if this works with the current version of XOOPS.

Actually, if somebody could make it work with XOOPS 2.4.1 and on PHP5, we could use it here on XOOPS for our Documentation.

Anybody willing to test it and if needed, make it work?

3
nmshah
Re: module to display downloads in different formats
  • 2009/11/24 12:37

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Thanks Mamba, but the link to cvs was not working, so I searched for it and could download it from here
http://www.xoops.pr.gov.br/modules/repository/viewcat.php?cid=19

The module installed without any errors, using XOOPS 2.4.1 and php 5.2

But when I try to upload any doc, I get the following error

Quote:
"Feedback.doc is an invalid file for uploading"


Feedback.doc is the file I am trying to upload. Tried uploading files in other format but still similar error

Xoops debug shows

Quote:
Warning: include_once(/modules/news/class/class.newsstory.php) [function.include-once]: failed to open stream: No such file or directory in file /modules/xdocman/admin/index.php line 40
Warning: include_once() [function.include]: Failed opening '/modules/news/class/class.newsstory.php' for inclusion (include_path='.;/xampp/php/pear/') in file /modules/xdocman/admin/index.php line 40
Notice: Constant _DM_UPLOAD_DOC already defined in file /modules/xdocman/language/english/modinfo.php line 19
Notice: Constant _DM_UPLOAD_STYLE already defined in file /modules/xdocman/language/english/modinfo.php line 20
Notice: Undefined offset: 1 in file /modules/xdocman/admin/admin_func.php line 94


In the frontend when I try to access the xdocman, I get the following error

Quote:
Fatal error: Call to a member function assign() on a non-object in C:\xampp\htdocs\iso\modules\xdocman\man_func.php on line 53


Xoops debug
Quote:
None All Errors (1) Queries (8) Blocks (0) Extra (2) Timers(3)
Errors
Notice: Undefined index: root_path in file /modules/xdocman/index.php line 39

4
nmshah
Re: module to display downloads in different formats
  • 2009/11/24 13:01

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


I found another module onhttp://www.bluemooninc.biz/~xoops2/modules/mydownloads/viewcat.php?cid=3
called FcabixShare

Installed fine but I am not sure how to use it. There seems to be no option available to upload files. Can someone guide me on how to use it

5
Mamba
Re: module to display downloads in different formats
  • 2009/11/24 13:11

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Quote:
But when I try to upload any doc, I get the following error

I've asked the module author to take a look at that, and he promised to do so. Hopefully, we'll have soon a working copy.

In the meantime, if somebody else can make it work, please let us know.

6
nmshah
Re: module to display downloads in different formats
  • 2009/11/29 5:41

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


thanks mamba

any news on this...

7
Burning
Re: module to display downloads in different formats
  • 2009/11/29 5:49

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi

Have you checked permissions ? You do that on public side (checkboxes, two "popups" to open).

It works fine with XOOPS 2.3... I haven't test it with latest XOOPS version.

8
nmshah
Re: module to display downloads in different formats
  • 2009/11/29 9:54

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


@ Burning

Are you talking about FcabixShare or xdocman?

Xdocman on XOOPS 2.4.1 gives a white screen with

Quote:
Fatal error: Call to a member function assign() on a non-object in C:\xampp\htdocs\swayams\modules\xdocman\man_func.php on line 53


Lines 53 to 65 in C:\xampp\htdocs\swayams\modules\xdocman\man_func.php

Quote:

$xoopsTpl->assign ('doctypes', $docTypes); // provide the document info list to smarty

$docList = array ();
$langList = array ();
$textList = array ();

$textList['ohits'] = _XDM_SP_ONLINEHITS;
$textList['downloads'] = _XDM_SP_DLHITS;

GetDocumentList ($docList, $lang);
GetDocumentLanguages ($docList, $langList);
GetDocumentInfo ($docList/*, $lang*/);
CreateProgressInfoImage ($docList);


Xoops debug info

Quote:
None All Errors (1) Queries (8) Blocks (0) Extra (2) Timers(3)
Errors
Notice: Undefined index: root_path in file /modules/xdocman/index.php line 39
Queries
0.000250 - SET NAMES 'utf8'
0.000174 - SET SQL_BIG_SELECTS = 1
0.001373 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.000668 - SELECT sess_data, sess_ip FROM session WHERE sess_id = '7b0832aed3b5e95123c2222ea5e8cc9a'
0.000413 - SELECT * FROM users WHERE uid = '1'
0.000697 - SELECT * FROM modules WHERE dirname = 'xdocman'
0.000932 - SELECT * FROM config WHERE (conf_modid = '22') ORDER BY conf_order ASC
0.000383 - SELECT * FROM modules WHERE dirname = 'protector'
Total: 8
Blocks
Total: 0
Extra
Included files: 53 files
Memory usage: 3196976 bytes
Timers
XOOPS took 1.035 seconds to load.
XOOPS Boot took 0.428 seconds to load.
Module init took 0.607 seconds to load.


Line 39 of /modules/xdocman/index.php
Quote:
include ($xoopsConfig['root_path']."header.php");


On XOOPS 2.3.1 the public side (frontend) is getting displayed correctly but there is no options for any permission that you mentioned in your post and the upload in admin side is still showing the error

Quote:
Feedback.doc is an invalid file for uploading

9
nmshah
Re: module to display downloads in different formats
  • 2009/11/29 10:32

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


it seems the code

$xoopsConfig['root_path'] is not longer being supported in XOOPS 2.4.1 and hence Xdocman is not displaying in the public side.

On changing

line 40 on Xdocman/download.php
line 39 on Xdocman/manual.php
line 39 on Xdocman/index.php

from
Quote:
include ($xoopsConfig['root_path']."header.php");


to
Quote:
include (XOOPS_ROOT_PATH."/header.php");


line 112 on Xdocman/manual.php
line 103 on Xdocman/index.php

from
Quote:
include ($xoopsConfig['root_path']."footer.php");


to
Quote:
include (XOOPS_ROOT_PATH."/footer.php");


amd line 100 on Xdocman/index.php

from
Quote:
$xoopsTpl->assign ('modroot', $xoopsConfig['root_path'] . "modules/xdocman/");

to
Quote:
$xoopsTpl->assign ('modroot', XOOPS_ROOT_PATH."/modules/xdocman/");


The module is now available on the frontend i.e the public side is displaying. But still I am not able to upload files.

Error on admin side after making above changes are:

Quote:
Warning: include_once(/modules/news/class/class.newsstory.php) [function.include-once]: failed to open stream: No such file or directory in file /modules/xdocman/admin/index.php line 40
Warning: include_once() [function.include]: Failed opening '/modules/news/class/class.newsstory.php' for inclusion (include_path='.;/xampp/php/pear/') in file /modules/xdocman/admin/index.php line 40

10
nmshah
Re: module to display downloads in different formats
  • 2009/11/29 11:08

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


If the news module is in the module folder then there is no error message.

Still not able to upload files

The Upload function is on xdocman/admin/admin_func.php around lines 36 to 63

Quote:
/***** XDM_UploadDocFile () **********************************/

function XDM_UploadDocFile ($langpreselect) {
global $xoopsModuleConfig;
global $MAX_FILE_SIZE;
global $doc_file;
global $poll_submit;
global $op;
global $xoops_upload_file;
global $HTTP_POST_FILES;

$dirname = '';
$is_online = FALSE;

if (!empty ($HTTP_POST_FILES['doc_file']['name'])) {
$destfilename = $HTTP_POST_FILES['doc_file']["name"];
$srcfilename = $HTTP_POST_FILES['doc_file']["tmp_name"];

if (XDM_ParseFilename ($destfilename, $dirname, $is_online)) {
XDM_Uploading ($srcfilename, $destfilename, $langpreselect, $dirname, $is_online);
}
else {
echo "$destfilename is an invalid file for uploading<br />\n";
}
}

XDM_UploadDocFileForm ($langpreselect);
}

Login

Who's Online

132 user(s) are online (62 user(s) are browsing Support Forums)


Members: 0


Guests: 132


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits