rejetto forum
May 24, 2012, 11:41:56 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Default file mask to ~setting  (Read 2551 times)
0 Members and 1 Guest are viewing this topic.
Zean
Guest


Email
« on: December 04, 2007, 12:04:03 AM »

Is there a way to change the default file mask for the server root "/" to something listed in the server's HTML template?

For example, If I created a new section called "[index]" and enter the html for my homepage and type ~index this page views as I'd like. However, If I make the default file mask for the root "~index" It's looking for an actual which it wont find so the root and all the folders are shown.

The reason I'm trying to do this is so I can use the server templates functions such as %timestamp%, %connections% where as I can't using an actual file.
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #1 on: December 04, 2007, 01:37:22 AM »

for now you can
1. put the content of [index] at the top of the template (the main section, with no name)
2. select all folders
3. diff template, put the original content of the main section

it should work
Logged
bacter
Operator
Insane poster
*****
Offline Offline

Spain Spain

Posts: 679


View Profile
« Reply #2 on: December 04, 2007, 09:04:54 AM »

Another approach could be: create two main sections, as follows.

Name the first one (for example) 'PageFiles' and copy there the content of your actual main body.

Create a second one 'PageHome' where you put the body of your home page.

Then in the original main section delete the content of body and put this:

{{if | {{=|%folder%|/|}} | {{section|PageHome}}  | {{section|PageFiles}} }}


So in PageHome you have all global hfs vars accessible (ip, speed-out,  user,conections...). Only add in your homepage a link (access to fileserver) to the mainfolder of your fileserver (something like '/root/' , not '/') ! You cant then let the users browse from '/' root, but you can put there more than one link to access: root for generic files, music for a tree with mp3, templates for a thread with templates and so on.
Logged

your computer has no brain - use your own !
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #3 on: December 04, 2007, 12:17:08 PM »

that's great bacter! Cheesy
Logged
Zean
Guest


Email
« Reply #4 on: December 04, 2007, 05:09:45 PM »

Thanks, works just how I like now.  Cheesy
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #5 on: December 04, 2007, 05:32:30 PM »

By looking at this post, I wondered if it was possible to add the equivalent of
{{=|%folder%|/|}}
Quote
if name = '=' then
  trueIf(sameText(par(0), par(1)));


{{equal|%folder%|/|}}
Quote
if name = 'equal' then
  trueIf(sameText(par(0), par(1)));

{{=|'{{=|#|&}}'|''}}   The syntax is obviously of use to nothing but is correct and to decipher it is another story 

{{equal|'{{equal|#|&}}'|''}} is a little easier to follow

{{if|{{=|'{{=|#|&}}'|''}}|You win|You lose}} or {{if|{{equal|'{{equal|#|&}}'|''}}|You win|You lose}}
Logged
rejetto forum
« Reply #5 on: December 04, 2007, 05:32:30 PM »

Do you like this software? Consider even $2
 Logged
bacter
Operator
Insane poster
*****
Offline Offline

Spain Spain

Posts: 679


View Profile
« Reply #6 on: December 04, 2007, 05:39:35 PM »

Thanks to you, Rejetto, because your macros allow to reduce the need of diff templates!

They are really usefull !

Only ... if we could find a way of evolution of RTL (Rejetto-Template-Language). Because the actual syntax - without trying to offend - is as useful as ugly. Now, a template is html (with optional java etc.) and embeded rtl, but complex macros are really difficult tu read.

RTL could progress to reverse: {rtl}{/rtl}  for macro text with simpler sintax, allowing {code}{/code} where resides standard browser language(html expressions), a section-name could directly be invoked (like named gosub). Mars says with enthusiasm... we will have something like old Basic. Also perhaps we do not need 'GOTO 2210' and no 'POKE's, rtl could be at least as readable as Basic. Without double braces, and without the first pipe character after macroname, we could already gain a lot. 

So templates would no longer be html with rejetto extensions, but a rtl-document that's used to create html.


Logged

your computer has no brain - use your own !
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #7 on: December 04, 2007, 05:53:17 PM »

RTL
Quote
RTL (Rejetto-Template-Language).
It is the slow evolution or the migration towards the php Grin Grin
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #8 on: December 04, 2007, 06:58:43 PM »

hehe, slow down guys Smiley
there's no point in creating a "full" new language.
even before CGI support i could add php support, but it's better to wait.
to have equal as alias for = it's ok, from next build.
to avoid the first separator | and have a space instead is apparently possible, BUT what if the first parameter need to be a blank space?
Logged
bacter
Operator
Insane poster
*****
Offline Offline

Spain Spain

Posts: 679


View Profile
« Reply #9 on: December 04, 2007, 09:44:21 PM »

If first parameter is blank space: {quote  } or &nbsp.

... or: allowing inside macros a new sintax for {{ section | somesection}} like $somesection (or for Basic-preference somesection$ ), there could be some prefefined 'sepecial section' like $space (-> space$) ..

from:
{{if | {{=|%folder%|/|}} | {{section | PageHome}}  | {{ ifnot %user% | {{section|PageLogin}} | {{section|PageFiles }}}}}}

to:
{{if  {{equal %folder%|/|}} | $PageHome  | {{ ifnot %user% | $PageForceToLogin | $PageFiles }} }}

or inside rtl:
{rtl}
{$GetLangFromCookie}
{if {notequal %folder%|/|} | $BuildFoldertree }
...
{if {equal %folder%|/|} | $PageHome  | {ifnot %user% | $PageForceToLogin | $PageFiles }}
...
{/rtl}
Logged

your computer has no brain - use your own !
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #10 on: December 04, 2007, 10:12:42 PM »

If first parameter is blank space: {quote  } or &nbsp.
"quote  " doesn't seem a good solution, and   would not work in many cases, like {{=}}

Quote
... or: allowing inside macros a new sintax for {{ section | somesection}} like $somesection

it's complex. i would try avoid introducing new special characters.
if %symbols% weren't there already, i would have used macros for all of them so that % was a normal char.
anyway, a possible solution is {{$name}} as alias for {{section|name}}.
if you like it i will introduce it in next build.
« Last Edit: December 04, 2007, 10:22:16 PM by rejetto » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #11 on: December 04, 2007, 10:31:51 PM »

i worked out to get this working
{{ %folder% = / }}

with this one, i think we don't need the alias {{equal}} anymore Wink
Posted on: 05 December 2007, 05:22:42
just as for {{$section}} i could make {{?urlvar}} to have a shorter form in case this macro is very used. it's an idea.
anyway, characters like $ = and ? are few, and we should think twice before assigning them to a macro.
Logged
bacter
Operator
Insane poster
*****
Offline Offline

Spain Spain

Posts: 679


View Profile
« Reply #12 on: December 05, 2007, 01:13:03 AM »

I think we could even still use %somesection% !
The confusion created would not be any greater than the difference between defined and intrinsic functions y most languages.

As there is no way to assign variables, the logigal conditional operations 'if' or 'if not' (what sould be 'ifnot' to simplyfy parsing) could turn to if = and if #

Also to avoid problems with a future 'if >' (if greater)  (example: {{ if > %secuential%| dosomething}} ) perhaps Mars idea to use words instead of signs (equal, notequal, greater, less..) would be better.

In any case, you are right, we should think twice about changes and new creations, and polish definitions before implementing, to have more consistent syntax and avoid some strange orders like in substring and cut. First parameter (as in most languages) the object to work with, then how -> substring "thestring", form where, towhere, like it's in repeat: repeat what, howmanytimes.

urlvar will be used a lot less than sections, and there is think it contributes to see where the value comes from, because there are no intrinsic values for %sort% etc. , and perhaps nobody includes a section with that name.
Logged

your computer has no brain - use your own !
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11829


View Profile
« Reply #13 on: December 05, 2007, 02:26:10 AM »

As there is no way to assign variables, the logigal conditional operations 'if' or 'if not' (what sould be 'ifnot' to simplyfy parsing) could turn to if = and if #

yes, the if is a very frequent macro... but maybe it is already handy the way it is?

Quote
In any case, you are right, we should think twice about changes and new creations, and polish definitions before implementing, to have more consistent syntax and avoid some strange orders like in substring and cut. First parameter (as in most languages) the object to work with, then how -> substring "thestring", form where, towhere, like it's in repeat: repeat what, howmanytimes.

i often decide the order thinking on how big the parameters will be. E.g. substring, the first two parameters may be very much littler than the third. if a short parameter is after a long one, reading may be harder.
« Last Edit: December 05, 2007, 02:27:41 AM by rejetto » Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #14 on: December 05, 2007, 04:30:31 PM »

Analyse de tout ça en cours avant de me pronocer

un oeil la dessus

http://www.laboiteaprog.com/article-35-1-delphi_modele_html
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page March 28, 2012, 01:34:10 AM
anything