1
Fastian
A little Help with - PDdownloads
  • 2005/8/12 21:05

  • Fastian

  • Not too shy to talk

  • Posts: 156

  • Since: 2005/6/6 0


Hi,

I m using PDdownloads v 1.0 and so far its working without any problem.

Just a little thing I want to change. That is when downloading any file it opens a new window (have seen this only with PD).
How can i disable this so that the download starts in the same window just like any other download module.
I m not a Programmer
BUT
I m a Good Learner

2
Fastian
Re: A little Help with - PDdownloads
  • 2005/8/13 2:47

  • Fastian

  • Not too shy to talk

  • Posts: 156

  • Since: 2005/6/6 0


One more Issue

I changed the default
"_MD_PDD_NUMBYTES", "%s bytes" with "KB" in language file so now it shows "File Size: 840 KB"

But there is one problem.
It works fine as long as I keep file size upto 999.
So it shows "File Size: 999 KB"

But when I increse it like when I add a file with Size "1500" it Gives "File Size: 1.5 KB"
It should be "1.5 MB" or "1500 KB"

What should i do to solve this ???
I m not a Programmer
BUT
I m a Good Learner

3
krobi
Re: A little Help with - PDdownloads
  • 2005/8/13 16:47

  • krobi

  • Quite a regular

  • Posts: 290

  • Since: 2003/12/21


hey

the first "problem" is quiet simple

edit the following templates:

PDdownloads_download.html and PDdownloads_singlefile.html

in this templates you will find a line like this
Quote:
<a href="visit.php?cid=<{$down.cid}>&lid=<{$down.id}>" target="_blank">


simple remove the target="_blank" or change it so target="_self".

and then you have to make some small changed in the visit.php

at the begin of the file look for this
Quote:
include 'header.php';


after that line put in this line
Quote:
include XOOPS_ROOT_PATH . '/header.php';


and at the end of the file
befor this line
Quote:
?>


but this in it
Quote:
include XOOPS_ROOT_PATH . '/footer.php';


after that the visit.php at the two points will look like this:
at the begin of the file:
Quote:
include 'header.php';
include XOOPS_ROOT_PATH . '/header.php';


and at the end
Quote:
include XOOPS_ROOT_PATH . '/footer.php';
?>


so thats all, done forget to update the module because of the changes you made in the templates.

regarding the second problem, hm normally the module will change the size to kb/mb automatically for the user-side. but you have to put in bytes when you submit a download - its because the module will calculate the kb/mb/gb size from the bytes size.

so there is no need to change this.
Developer of PD-Modules like PD-Downloads and PD-Links.
Webmaster of Power-Dreams.com

4
Fastian
Re: A little Help with - PDdownloads
  • 2005/8/14 10:06

  • Fastian

  • Not too shy to talk

  • Posts: 156

  • Since: 2005/6/6 0


Thanks Krobi

I didn’t know that it’s just a small little change.

Its working now but I think this can be further improved. What I want to say is when click on download button, the next thing you see is where to save the file. Instead of getting the new page in the same window.
So basically I don’t want to show "Download in Progress" and especially Direct link to the file from
“If your download does not start, Click here!"

I hope this will again be a small change. If it’s quite complicated or can not be done. I can live without this. But if it can be achieved that will be Great.

And about second thing,
I thought changing bytes to KB will save the time coz I have everything in KBs. But never mind, its working perfectly now. Although I need to have a calculator to convert the size.

Thank you for looking into the thread and for your quick reply.
I m not a Programmer
BUT
I m a Good Learner

5
Fastian
Re: A little Help with - PDdownloads
  • 2005/8/15 20:24

  • Fastian

  • Not too shy to talk

  • Posts: 156

  • Since: 2005/6/6 0


What i am asking, i have seen this on few sites running Mydownloads.
But i really dont know how much change will it cause.

Even if this is not possible with PDdownloads, Atleast some one could tell me so that i stop asking it again.
I m not a Programmer
BUT
I m a Good Learner

6
Fastian
Re: A little Help with - PDdownloads
  • 2005/8/16 18:36

  • Fastian

  • Not too shy to talk

  • Posts: 156

  • Since: 2005/6/6 0


I think only Krobi would have a better answer.
I m not a Programmer
BUT
I m a Good Learner

7
krobi
Re: A little Help with - PDdownloads
  • 2005/8/16 20:13

  • krobi

  • Quite a regular

  • Posts: 290

  • Since: 2003/12/21


hehe yes sorry for not answering your question but we had no time for this we have to work on pd-downloads 1.2

in the mean time you had could look your self into some files, especially in the visit.php this is the file you have to modify.

as you have written you are willing to learn
i cant give you a detailed manual how to do this because i'am tired but you will find all the things you have to change in this part

Quote:
if (!empty($xoopsUser))
{
echo "
<h4><img src='" . XOOPS_URL . "/modules/PDdownloads/images/icon/downloads.gif' align='middle' alt='' /> " . _MD_PDD_DOWNINPROGRESS . "</h4>\n
<div>" . _MD_PDD_DOWNSTARTINSEC1 . "</div><br />\n
<div>" . _MD_PDD_DOWNNOTSTART . "\n
<a href='$url' target='_blank'>" . _MD_PDD_CLICKHERE . "</a>.\n
</div>\n";
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
echo "<meta http-equiv=\"refresh\" content=\"0;url=$url\">\r\n";
}
else
{
echo "
<h4><img src='" . XOOPS_URL . "/modules/PDdownloads/images/icon/downloads.gif' align='middle' alt='' /> " . _MD_PDD_DOWNINPROGRESS . "</h4>\n
<div>" . _MD_PDD_DOWNSTARTINSEC . "</div><br />\n
<div>" . _MD_PDD_DOWNNOTSTART . "\n
<a href='$url' target='_blank'>" . _MD_PDD_CLICKHERE . "</a>.\n
</div>\n";
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
echo "<meta http-equiv=\"refresh\" content=\"3;url=$url\">\r\n";
}


so try a little bit with disabling some things - especially echo things.
Developer of PD-Modules like PD-Downloads and PD-Links.
Webmaster of Power-Dreams.com

8
Fastian
Re: A little Help with - PDdownloads
  • 2005/8/17 18:50

  • Fastian

  • Not too shy to talk

  • Posts: 156

  • Since: 2005/6/6 0


Thanks krobi for the guideline.
Quote:
as you have written you are willing to learn


Yes I do. That’s completely an other story that I usually take hours to do the things that need just few minutes

Anyway, with your help, I manage to hide the actual path not exactly the way i thought but it will work for now.

Now i have one more question.

I m adding a small screensavers collection and few webs just allowed me to link to there html pages. DO as i download URL i have to add (www.screensavers.com/nature1.htm)
By doing this The other webpage opens up in the same window leaving my web completely. (You need to use Back button to come to web again)

Can this be open in another window ?? Or inside the web( As Center Block)
I m not a Programmer
BUT
I m a Good Learner

Login

Who's Online

264 user(s) are online (175 user(s) are browsing Support Forums)


Members: 0


Guests: 264


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