1
javier
Mydownloads submit, remove the http:// ? i tried all.
  • 2004/3/23 15:10

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Hi,
i already removed all the http:// values in the fileurl from mydownloads module,
but every time i add a new file, it keep adding the http:// in the file url,
them i have to modify the file to remove that and ready.

I want remove these http:// because my files are in internal locations in my server.
ie: files/file.zip
and the submit always add the http://
ie: http://files/file.zip

the other question is,

currently i have my files in Xoopsurl/modules/mydownloads/files/file.zip

i want modify to

Xoopsurl/files/file.zip

i made these modifications some years ago in my old 1.3.x site,but now in XOOPS 2.0.6 i can´t

thanks in advance for your reply
grettings.

2
T-Tech
Re: Mydownloads submit, remove the http:// ? i tried all.
  • 2004/3/23 16:35

  • T-Tech

  • Just popping in

  • Posts: 62

  • Since: 2004/3/3 1


Why can't you just type in for example
{XOOPS_URL}/files/file.zip?
or
yoursite.com/files/file.zip?

Im not sure I understand why you need to remove the http:// part, I get that they are located on your server which is kool, but linking them via http:// shouldn't be an issue.

As far as having your files folder within the main directory, yoursite.com/files/file.zip that shouldn't be a problem either. Although moving the files will resault in having to re-add them all or at the least edit each download entry.

Could you explain more of the issue your having using the http:// method?

3
ajaxbr
Re: Mydownloads submit, remove the http:// ? i tried all.
  • 2004/3/23 18:48

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Hi there, javier.

I'm playing a bit with MyDownloads these days and I might have a solution for your problem.

In /modules/mydownloads/submit.php and /modules/mydownloads/admin/index.php you'll find that XOOPS uses the "formatURL()" function to treat the url (but not the "homepage") field of a submited download. This function, which resides in /include/functions.php, trims extra spaces and adds "http://" to its target strings (only when it doesn't start with "ftp://", "https://", etc).

So you'd have two choices to solve your problem.

1) You'll solve this pretty neatly by editing both submit.php and admin/index.php, replacing
$url $myts->makeTboxData4Save(formatURL($url));
with
$url $myts->makeTboxData4Save($url);
for submit.php and doing it twice in /admin/index.php, where you should replace
$homepage $myts->makeTboxData4Save(formatURL($HTTP_POST_VARS["homepage"]));
WITH
$homepage $myts->makeTboxData4Save($HTTP_POST_VARS["homepage"]);


AND

$url $myts->makeTboxData4Save(formatURL($HTTP_POST_VARS["url"]));

WITH
$url $myts->makeTboxData4Save($HTTP_POST_VARS["url"]);


This obviously makes it much easier to have invalid urls of a kind, namely those with extra spaces, and also makes these fields more versatile, which can be good (mailto: and relative links) or bad (some sort of exploit?).

2) The other way to solve this would be by editing the formatURL() code in functions.php, but that would probably break things beyond our wildest dreams.

4
jusui
Re: Mydownloads submit, remove the http:// ? i tried all.
  • 2004/3/23 20:29

  • jusui

  • Just popping in

  • Posts: 17

  • Since: 2003/9/29


I fixed this once by hard coding the path to my file folder into all the files I found that contained the code for that field (submit.php and a couple others I can't remember right now). This way when I went to add a download, it would already be filled with http://www.site.com/modules/mydownloads/files/etc and I would just have to type the filename.

I did ask in the group permission my downloads thread for an option to be added in the config to set a default path relative to the XOOPS root or the module's root, so we will just have to see if he can do it for us :)

5
javier
Re: Mydownloads submit, remove the http:// ? i tried all.
  • 2004/3/23 22:04

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


Quote:
Why can't you just type in for example
{XOOPS_URL}/files/file.zip?
or
yoursite.com/files/file.zip?


Because the site i have currently in proyect will have a large volume of upload/downloads
Xoops has not a integrated upload file script yet (except mydownloads rc1)
them i will use a external upload script,the user after fill the XOOPS submit form with the file details is redirected to these upload script.
and i modified mydownloads module to allow enlarge screenshots. (i already made this with XOOPS 1.3.x some years ago in my old site)

them in each user submited file,i have to fill 3 spaces in manual way every time,
the url file (with the internal location)
the small picture (internal location)
the big picture (internal location)

if i have to fill all the complete path every time,is too much work.
in my way i only have to add the folder and the filename.
ie: files/file.zip
files/small_image.jpg
files/big_image.jpg

the rest is added automaticly.

--------


Thanks ajaxbr :) you solve my problem :)
i only modified the admin files because the users will not add file urls.

-----

jusui:

is very similar to the way i using :)

in 2.0.6 is not neccesary add all the site url, if you put your files inside the mydownloads module,
if your file is in the root of the downloads module, you put only file.zip and will work fine too.
if you put your file inside a folder inside download root, will work too
tex/file.zip

the only problem is if your want change the relative path to the XOOPS root for example.

in my old site i was modified the path relative for my files, but im 2.0.6 is diferent or i not remember fine how i made that before :)

grettings, sorry for my poor english

Login

Who's Online

380 user(s) are online (234 user(s) are browsing Support Forums)


Members: 0


Guests: 380


more...

Donat-O-Meter

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

Latest GitHub Commits