rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zhenhai

Pages: 1
1
中文 - Chinese / Add a simple DNS service for intranet
« on: May 17, 2009, 02:58:28 AM »
[mydns]
{{if|{{?name}}|{{\
{{append|weburl.txt|  <a target='bank' href="{{?weburl}}" title="{{?memo}}">{{?name}}</a>./append}}/}}/if}}
<form name=frm>
<p>本模块功能相当于为内部网络系统提供了一个简易的DNS地址解析服务/this module is A simple DNS service
<p>请输入你要推荐的网站(或自己的)链接地址/Input your web link
<p>内网最好是IP防止域名解析失败,网站说明要简洁明了,不夸大其词。
<p>如果允许https方式访问请在备注中说明
<p>网站名称/web name:<input name=name size=40 value="">
<p>网站链接/web link:<input name=weburl size=60 value="http://">
<p>该网站的简单说明和备注/memo:
<p><TEXTAREA name=memo ROWS="6" COLS="40"></TEXTAREA>
<p><input type=submit value="添加网站链接/Add a web link" >
</form>
<script>document.frm.name.focus();</script>
<br>{{load|weburl.txt}}

2
HTML & templates / Re: how to limit the chat.txt size?
« on: April 27, 2009, 12:51:02 AM »
thank you. in fact this chat.tpl can be use as a public BBS board.
 

3
HTML & templates / Re: how to limit the chat.txt size?
« on: April 26, 2009, 12:31:16 AM »
thank you!
the [chat] section is come from chat.tpl in "hfs-last-beta-src" .
cut | A | B | C
    cut C from position A, for B characters. The difference with macro substring is that here you specify where to cut by numeric positions. Example: with A=2 and B=3 and C=abcdef you will get bcd because it is from character 2 and for a length of 3.
    If you don't specify A, it defaults to 1. If you don't specify B, it defaults to the length of C.
    If A is negative, then you are counting backward from the end of C. If B is negative, then you are considering the length of C minus the amount of B.

4
HTML & templates / Re: how to limit the chat.txt size?
« on: April 22, 2009, 12:50:50 AM »
Hello everyone, this question has been soveled as follow:

[chat]
{{if|{{?text}}|{{\
{{save|chat.txt|({{time}}){{?name1}}{{if|{{?name2}}|对{{?name2}}/if}}留言:\n{{?text}}\n{{load|chat.txt}}/save}}/}}/if}}
{{if|{{{.length|{{load|chat.txt}}.}>1500}}|{{\{{save|chat.txt|{.cut||1000|{{load|chat.txt}}.}/save}}/}}/if}}
<form name=frm>
<input name=name1 size=10 value="{{?name1}}">对<input name=name2 size=10 value="{{?name2}}">留言:
<p><TEXTAREA name=text ROWS="3" COLS="40"></TEXTAREA>
<p><input type=submit value="提交留言" >
</form>
<script>document.frm.text.focus();</script>
<br><TEXTAREA ROWS="30" COLS="40">{{load|chat.txt}}</TEXTAREA>


the code is added at main, before  (<form><div id='footer'>) :
<td valign=top><br><a target='bank' href="/~chat">到留言板提交留言</a>
<br><TEXTAREA ROWS="25" COLS="20">{{load|chat.txt}}</TEXTAREA>
</table>


as a resume: I found my question is at the code:
|{.cut||1000|{{load|chat.txt}}.}
after the  command .cut ,there three parameters, the first is a number [Start], the second is a number [END], the third is a string, the code means: cut (keep) the characters from start to end in the string.
the related help document at this forum didnt say detail in why two || found.
thank you.

5
HTML & templates / how to limit the chat.txt size?
« on: April 18, 2009, 05:59:42 AM »
a white board code as that,  ihave a question: how to limit the chat.txt filesize?

 
[chat]
{{if|{{?text}}|{{\
{{save|chat.txt|({{time}}){{?name1}}{{if|{{?name2}}|对{{?name2}}/if}}留言:\n{{?text}}\n{{load|chat.txt}}/save}}/}}/if}}

<form name=frm>
<input name=name1 size=10 value="{{?name1}}">对<input name=name2 size=10

value="{{?name2}}">留言:
<p><TEXTAREA name=text ROWS="3" COLS="40"></TEXTAREA>
<p><input type=submit value="提交留言" >
</form>
<script>document.frm.text.focus();</script>
<br><TEXTAREA ROWS="30" COLS="40">{{load|chat.txt}}</TEXTAREA>

6
Programmers corner / logout suggestion
« on: April 15, 2009, 10:07:10 AM »
another question is Why hfs.tpl donnt have a section [login]?
to quit a user accout , I adviced to use a public section [login]

in my hfs.tpl ,I add the section [logout](of course I cannot quit in true!),such as:

<div class="menu">
    <ul>
    <li class='last'><a href="#"><span style='position:relative; top:5px;'><img src="/~img27">{.!user.}:{.if | %user%|%user%|@anonmous/if.}</span><!--[if IE 7]><!--></a><!--<![endif]-->
       <!--[if lte IE 6]><table><tr><td><![endif]-->
       <ul>
{.if not| %user%          | <li><a href="~login"><img src="/~img27"> Login</a></li> .}
{.if    | %user%          | <li><a href="~logout"><img src="/~img27"> Logout</a></li> .}
{.if| {.get|can upload.}  | <li><a href="~upload"><img src="/~img32"> Upload</a></li> .}
       <li class="last"><a href="{.get|url|tpl=list|folders-filter=\|recursive.}">Files of List</a></li>
       </ul>
       <!--[if lte IE 6]></td></tr></table></a><![endif]-->
    </li>
    </ul>
    </div>

[logout]
{.add to log|.}
<br />A Bug has not be solved, please back to<a href="/"><b>Home</b></a>

7
Programmers corner / logout suggestion
« on: April 15, 2009, 09:55:25 AM »
Advice on ~Login and ~logout
I study the source text: newuserpassDlg.pss, I found how to solve the HFS Logout/quit question. I mean since the HFS has a select properties on Anonmous, why we add a choice when userBox.text = '' ? when a blank user try to login, we can log HFS with a hidden default user: @anonmous (of course the "@" is still kept in characters check list!), it means to logout/quit your user account.

The source text said:

procedure TnewuserpassFrm.okBtnClick(Sender: TObject);
var
  error: string;
begin
userBox.text:=trim(userBox.text);
pwdBox.text:=trim(pwdBox.text);
error:='';
if (userBox.text > '') and not validUsername(userBox.Text)
or (pwdBox.text > '') and not validUsername(pwdBox.text) then
  error:='The characters below are not allowed'#13'/\:?*"<>|;&&@'
else if (pwdBox.text > '') and (userBox.text = '') then
  error:='User is mandatory'
else if pwdBox.text <> pwd2Box.text then
  error:='The two passwords you entered don''t match';

//add by zhenhai
if (userBox.text = '') then
userBox.text ="@anonmous";
error = ''
//


if error = '' then ModalResult:=mrOk
else msgDlg(error, MB_ICONERROR);
end;


Pages: 1