rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: taha on March 11, 2009, 02:28:16 AM

Title: How to Make Top 10 Download?
Post by: taha on March 11, 2009, 02:28:16 AM
This Question in the list but i cannot find where the forum is located. i have search using search but did not have result. how to make list of top 10 download?
Title: Re: How to Make Top 10 Download?
Post by: rejetto on March 11, 2009, 12:49:02 PM
i'm sorry but this is not available at the moment in HFS
Title: Re: How to Make Top 10 Download? the solution
Post by: Mars on March 11, 2009, 11:49:02 PM
Then defy rejetto, one do not know any more his classics ;D

http://127.0.0.1/a/?sort=d&reverse&recursive&folders-filter=\&limit=10

With French, nothing is impossible, we have no oil, but we have ideas ;)
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 12, 2009, 03:57:19 AM
very nice, but is there a way to put the result in a small news box like the one in right hand showing speed downloads and hits .. etc
Title: Re: How to Make Top 10 Download?
Post by: r][m on March 12, 2009, 05:10:03 AM
Heres an old post about top downloads that should be helpful.

http://www.rejetto.com/forum/index.php?topic=4064.msg1020597#msg1020597 (http://www.rejetto.com/forum/index.php?topic=4064.msg1020597#msg1020597)

Be sure to check the whole thread, theres more code at the end.
Title: Re: How to Make Top 10 Download?
Post by: taha on March 12, 2009, 05:21:24 AM
i mean that how to put top 10 download o my file not my folder.. and i want to make it in new table. how to explain eks...
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 12, 2009, 07:04:24 AM
this command of mars shows the top 10 files not folders
Title: Re: How to Make Top 10 Download?
Post by: rejetto on March 12, 2009, 06:29:08 PM
http://127.0.0.1/a/?sort=d&reverse&recursive&folders-filter=\&limit=10
With French, nothing is impossible, we have no oil, but we have ideas ;)

very nice idea mars.
sadly it does not work. :(
as far as i remember, the current (and only) "limit" function applies beore the sorting.
so the result won't be the top 10 downloads, but just the first 10 files in the list (sorted by downloads).
the other version of limit is in the to-do list.

as an additional comment: when this method will work in the future, it will be very heavy for the system, so it should be called once per day, and the result copy&pasted in the place we want to show.
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 12, 2009, 07:59:49 PM
it works for me in this way and i realize its the same as rejetto just mentioned

Title: Re: How to Make Top 10 Download?
Post by: Mars on March 12, 2009, 09:44:20 PM
Quote
sadly it does not work.
as far as i remember, the current (and only) "limit" function applies beore the sorting.

are you really sure??

Quote
function Tmainfrm.getFolderPage(folder:Tfile; conn:ThttpConn; otpl:Tobject):string;
.....
  // build %list% based on dir[]
  numberFolders:=0; numberFiles:=0; numberLinks:=0;
  totalBytes:=0;
  oneAccessible:=FALSE;
  fast:=TfastStringAppend.Create();
0)  listing:=TfileListing.create();
  hasher:=Thasher.create();
  hasher.loadFrom(folder.resource);
  try
1)   listing.fromFolder( folder, conn, recur );   
    if not recur or (otpl <> filelistTpl) then
2)      listing.sort(conn, diffTpl['sort by']);       
   for i:=0 to length(listing.dir)-1 do
      begin
      application.ProcessMessages();
      if conn.state = HCS_DISCONNECTED then exit;
      data.lastActivityTime:=now();
      handleItem(listing.dir)
      end;
    list:=fast.reset();
  finally
3)    listing.free;
    fast.free;
    hasher.free;
    end;


 ;) ;D
Title: Re: How to Make Top 10 Download?
Post by: rejetto on March 13, 2009, 11:05:19 AM
quite sure.
what's in your opinion the "limit" function?
it is not "listing.free"
it's inside fromfolder.
Title: Re: How to Make Top 10 Download?
Post by: rejetto on March 13, 2009, 11:06:58 AM
it works for me in this way and i realize its the same as rejetto just mentioned

works for you? double check ;)
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 13, 2009, 05:37:20 PM
i said the same as u mentioned about it

and also posted the image too

it didnt work for whole site it just shows the file on root and i have only one so it shows it , but folder with many files have no result
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 13, 2009, 05:40:36 PM
see this ...

i am not sure who is right
rejetto or mars :/
Title: Re: How to Make Top 10 Download?
Post by: Mars on March 13, 2009, 06:46:34 PM
actually rejetto is right, but if you have the possibility to use the french version with the mode page made by me, what you will is possible by sorting and selecting the numbers of files by page with the french default template, you have to remove or rename the section [special:strings] to the english  version of this template
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 14, 2009, 12:32:57 PM
ah alright, i wonder if with some new build we can add the top10 box like PhpNuke or other templates :)
Title: Re: How to Make Top 10 Download?
Post by: Mars on March 15, 2009, 12:12:56 AM
ah alright, i wonder if with some new build we can add the top10 box like PhpNuke or other templates :)

use the attached template
Title: Re: How to Make Top 10 Download?
Post by: maverick on March 15, 2009, 06:14:40 AM
use the attached template

You use <a href="{.get|url|sort=d|folders-filter=\|recursive.}"></a>
I use <a href="%encoded-folder%?sort=d"></a>  (old school)  :)
Same output results...

It displays all file contents by recursive hits.  Not a top 10 list only.
Title: Re: How to Make Top 10 Download?
Post by: taha on March 15, 2009, 08:28:25 AM
see this ...

i am not sure who is right
rejetto or mars :/

i like your templates.. can i have you templates coding??? please... im a noob. did not know how to make it on my own.
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 15, 2009, 05:10:16 PM
sure will give it a try :)
Title: Re: How to Make Top 10 Download?
Post by: AYEHAN on March 15, 2009, 05:45:18 PM
i am using Rawr 0.0.7

check it in template section
Title: Re: How to Make Top 10 Download?
Post by: rejetto on March 16, 2009, 02:01:44 PM
I use <a href="%encoded-folder%?sort=d"></a>  (old school)  :)
Same output results...

it works while you have no other parameters.
in case, they are lost with your method.