rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Foggy on December 07, 2007, 08:07:52 AM

Title: %number% in [folder]
Post by: Foggy on December 07, 2007, 08:07:52 AM
I was thinking that if we had a way to get the number of items in a folder(not the current folder but subfolder's of the current folder) we should be able to make use of the new macros(or create one) to get multipage file systems quite easily.

I've got plenty of time on my hands currently and I'm thinking of having a go at creating a template based on a forum I visit and I've got the perfect idea of how to use this.
Title: Re: %number% in [folder]
Post by: bacter on December 07, 2007, 12:01:51 PM
That is something very close related to the folder-tree-generation problem.

I wonder if rejetto could open the most powerfull macro of hfs that was there already before macros were named: %list% !

list is now hidden and could be understood as (I use here %..% instead of {{section|..}} to read it easier) :

{{list | %encoded-folder% | %folder | %file% | %link% }}

If %list% could be opened in such a manner, and if we could add two parameters: recursive and filter we would greatly enhance the possibilities:
we  could create a foldertree and the filelist in one step:

{{list | 'root'| %foldertree% | | | 'recursive'}}
{{list | %encoded-folder% | %folder | %file% | %link% }}
in this example %foldertree% would only add the item-url% and name to an array in javascript.

or we could do what foggy wants:

{{list | %encoded-folder% | %recfolder% | %file% | %link% }}
....
[recfolder]
{{list | %Item-url% | %foldercountitems% | %filecountitems% | %linkcountitems% }}
or:
{{list | %Item-url% | | %filecountitems% |||'filesfilter'}}
in this example also it is supposed to use arrays for the filelist iith a counterelement in the case of folders (perhaps in place of size).










Title: Re: %number% in [folder]
Post by: rejetto on December 07, 2007, 08:29:34 PM
I was thinking that if we had a way to get the number of items in a folder(not the current folder but subfolder's of the current folder) we should be able to make use of the new macros(or create one) to get multipage file systems quite easily.

to know the number of files in every subfolder we must scan the whole tree every time.
even with virtual folder, a file listed there may not exist on disk anymore.
but, anyway, with real folders for sure.

i don't understand how subfolders are related to "multipage".
Title: Re: %number% in [folder]
Post by: Foggy on December 08, 2007, 12:51:18 AM
i don't understand how subfolders are related to "multipage".

if you can get the number of items in the subfolder you could easily divide that by 10,20,25,etc to get the number of pages and then create links with offset.
Title: Re: %number% in [folder]
Post by: rejetto on December 08, 2007, 02:39:55 AM
why should i want to have the pages of a subfolder?
Title: Re: %number% in [folder]
Post by: Foggy on December 08, 2007, 03:41:15 AM
so you can choose which page of the folder to goto from the list instead of going into the folder first.
Title: Re: %number% in [folder]
Post by: rejetto on December 08, 2007, 03:55:06 AM
and how do i know the number of the right page before i even enter?
Title: Re: %number% in [folder]
Post by: Foggy on December 08, 2007, 04:06:35 AM
You don't but if you are searching for something specific you use ?search=
Title: Re: %number% in [folder]
Post by: Foggy on December 08, 2007, 04:26:07 AM
I get the feeling that what I'm trying to say isn't being fully understood so Ill try and explain it a bit better.

What I ask is that we be able to use %number% in the list on folders to list the amount of items like it does once you are inside the folder.

If we can get the amount of items, it would then be easy to write some javascript or other code that will use offset to create links to pages.

eg.

name:Folder123 Items:66 page:1 2 3

name:Folder456 Items:7 page:1

etc

I hope that makes a bit more sense because it could be useful.
Title: Re: %number% in [folder]
Post by: rejetto on December 08, 2007, 04:41:22 AM
i use the pages when i have an idea of the content (then i'm already in), and try to figure it out the right page.
i would not enjoy such links.

what you explained in your last post is exactly what i imagined at start, but it had no sense in my mind.