rejetto forum

How to Make Top 10 Download?

Guest · 22 · 11402

0 Members and 1 Guest are viewing this topic.

taha

  • Guest
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?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
i'm sorry but this is not available at the moment in HFS


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
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 ;)
« Last Edit: March 11, 2009, 11:52:56 PM by mars »


Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
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


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
Heres an old post about top downloads that should be helpful.

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

Be sure to check the whole thread, theres more code at the end.
« Last Edit: March 12, 2009, 05:14:03 AM by r][m »


taha

  • Guest
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...


Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
this command of mars shows the top 10 files not folders


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
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.


Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
it works for me in this way and i realize its the same as rejetto just mentioned



Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
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
« Last Edit: March 13, 2009, 04:47:16 PM by mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
quite sure.
what's in your opinion the "limit" function?
it is not "listing.free"
it's inside fromfolder.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
it works for me in this way and i realize its the same as rejetto just mentioned

works for you? double check ;)


Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
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


Offline AYEHAN

  • Occasional poster
  • *
    • Posts: 92
    • View Profile
see this ...

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


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
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