rejetto forum

Software => HTML & templates => HFS ~ HTTP File Server => RAWR-Designs => Topic started by: rejetto on November 26, 2007, 12:14:33 PM

Title: update check
Post by: rejetto on November 26, 2007, 12:14:33 PM
Check if this Thunderchicken of Glory is the latest build!

does this appear to every visitor?
it has sense to show only to the admin, whom is usually connected through 127.0.0.1 or localhost, and is thus recognizable. (even using macros instead of jscript)
Title: Re: update check
Post by: TSG on November 26, 2007, 12:24:38 PM
It is hidden to all external users and has been since 2.9.0.

Think it can be done with a macro?
Title: Re: update check
Post by: rejetto on November 26, 2007, 12:36:13 PM
can you tell me what's the code supposed to hide that part?

Think it can be done with a macro?

sure, something like {{if| {{=|%ip%|127.0.0.1}} | <div> }}
Title: Re: update check
Post by: TSG on November 26, 2007, 12:39:35 PM
//Show template update module.   
if(Ip.match("127.0.0.|10.1.1.|10.0.0.|192.168.")) gEBI("Upd").style.display='block';

This is in the pageLoad function, Ip = %ip%, gEBI... its complicated...

hmm i will try this macro idea...
Title: Re: update check
Post by: rejetto on November 26, 2007, 01:04:19 PM
pros
macros: more compatible
javascript: cpu load distributed
Title: Re: update check
Post by: Mars on November 26, 2007, 06:41:21 PM
something like

Quote
Ip.match("127.0.0.|10.1.1.|10.0.0.|192.168.")) gEBI("Upd").style.display='block';

replace it with

Quote
{{ if {{ = | {{left | %ip% | 8 }} | 127.0.0. }} | {{ section | What you must see}} }}
{{ if {{ = | {{leftstr | %ip% | 7 }} | 10.0.0. }} | {{ section | What you must see}} }}
{{ if {{ = | {{leftstr | %ip% | 7 }} | 10.1.1. }} | {{ section | What you must see}} }}
{{ if {{ = | {{leftstr | %ip% | 8 }} | 192.168. }} | {{ section | What you must see}} }}

[What you must see]
<div>
.....
</div>

implementation

{{leftstr|Text|length}}
{{midstr|Text|offset|length}}
{{rightstr|Text|length}}

if necessary I can create code to rejetto

In the long run hfs is going to become a real language of programming as a replacement of javascript
The return in the good old BASIC of the interpreted and simple language.

I LIKE ;D ;D
Title: Re: update check
Post by: TSG on November 26, 2007, 06:50:19 PM
I agree mars, everything that doesn't require user input like this update check div which will only show to internal users will be done with macro's :) but javascript is always going to be needed for dynamic page content.

That version you made seems unnecessarily complicated, i don't quite understand it yet, can you post a working version?
Title: Re: update check
Post by: rejetto on November 29, 2007, 05:18:47 AM
Code: [Select]
{{ if {{ = | {{left | %ip% | 8 }} | 127.0.0. }} | {{ section | What you must see}} }}
{{ if {{ = | {{leftstr | %ip% | 7 }} | 10.0.0. }} | {{ section | What you must see}} }}
{{ if {{ = | {{leftstr | %ip% | 7 }} | 10.1.1. }} | {{ section | What you must see}} }}
{{ if {{ = | {{leftstr | %ip% | 8 }} | 192.168. }} | {{ section | What you must see}} }}

things are better thanks to macros {{match}} and {{match address}}

Quote
{{leftstr|Text|length}}
{{midstr|Text|offset|length}}
{{rightstr|Text|length}}

you won't miss any of them thanks to {{cut}} ;)

Quote
In the long run hfs is going to become a real language of programming as a replacement of javascript
The return in the good old BASIC of the interpreted and simple language.

i was thinking of trying to make a macro {{while}} to see if it could be considered a real (unhandy) programming language, but it's just mindfu#king ;D

the thing i like most in all this is: it's making it much more powerful without any performance decay.
Title: Re: update check
Post by: rejetto on November 29, 2007, 12:17:32 PM
i meant: all those i cited, are already DONE, and are documented on the wiki
Title: Re: update check
Post by: rejetto on November 29, 2007, 02:49:28 PM
by their name i don't understand what they are meant to do

if it takes hours to make them you'd better first describe their meaning
Title: Re: update check
Post by: rejetto on December 02, 2007, 05:00:38 AM
i noticed that users of the old version of TOG were pointed to a wrong url on rejetto.com

they are now redirected automatically to the new website
Title: Re: update check
Post by: TSG on December 02, 2007, 12:09:44 PM
ehmm ye i left the old update directory on rejetto.com for the old template the new template uses the new website.
Title: Re: update check
Post by: TSG on December 11, 2007, 11:21:59 AM
Just a message to the 1000+ ToG users that have already downloaded the template, the update check was pointing to a .htm directory at www.rawr-designs.com, I am going to put up a redirect to the correct download.php. The archive now has this fixed. I thank you for your patience if the link was always failing on you, i know that is frustrating :)

Oh and mars/rejetto, i use this...

{{if|{{is substring|127.0.0.|%ip%}}|{{$update-mod}}}}
{{if|{{is substring|10.0.0.|%ip%}}|{{$update-mod}}}}
{{if|{{is substring|10.1.1.|%ip%}}|{{$update-mod}}}}
{{if|{{is substring|192.168|%ip%}}|{{$update-mod}}}}

works for me :)