Author Topic: command lines  (Read 8044 times)

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12945
    • View Profile
Re: command lines
« Reply #30 on: April 06, 2011, 03:58:32 PM »
ok.
let me know if you need a preview

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: command lines
« Reply #31 on: April 06, 2011, 09:10:51 PM »
Hey Rejetto, why does this hfs.events script not work?  I'm trying to make a script that generates thumbnails when a user uploads them. On uploading a picture, HFS launches the program, but something wrong happens with the parameters, because the program doesn't do what it's supposed to.  I know that the parameters are right for the program because they work just fine when using them in a shortcut to the program without having HFS launch it.  So obviously, something is wrong that's making HFS not give it the right parameters, but I don't know why.

Code: [Select]
[upload completed]

{.if|    {.or| {.=|%item-ext%|jpg.} | {.=|%item-ext%|png.} .}   |

{.set|parameter1|"{.vfs to disk|%item-url%.}".}
{.set|parameter2|{.chr|47.}D="D:\%user%\thumbnails\".}
{.exec|C:\Program Files\Easy Thumbnails\EzThumbs.exe| {.call|parameter1.} {.call|parameter2.} .}

.}

Parameter 1 could look like  
Code: [Select]
"D:\user\test.jpg"
and Parameter 2 would then look like
Code: [Select]
/D="D:\user\thumbnails\"
Parameter 1 is supposed to tell the program the source file and parameter 2 tells it the output.
I know that the scripting that creates the correct parameters themselves works because I had it input the result into the log with {.add to log.} and it was correct.

http://www.fookes.com/ezthumbs/

Thanks for your endless help  ;D ,
Ray


BTW, not that it's relevant because this part works but to show the thumbnails, I put this in the template.

Code: [Select]
[file=folder=link|private]


<tr class='{.if|{.mod|{.count|row.}|2.}|even|odd.}' >

<td>
<input type='checkbox' class='selector' name='box' value='%item-url%' {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a class="the-item" href="%item-url%" >

<img src="%item-icon%" alt="" />
&nbsp;%item-name%</a>


[color=blue]{.if|    {.or| {.=|%item-ext%|jpg.} | {.=|%item-ext%|png.} .}   |

<div style="float:right;">
<a href="%item-url%" class="thumblink" >
<img src="/.%user%/thumbnails/thumbnail.%item-name%" alt="" />
</a>
</div>

.}[/color]

« Last Edit: April 06, 2011, 09:20:06 PM by raybob95 »

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1876
    • View Profile
Re: command lines
« Reply #32 on: April 07, 2011, 11:43:30 AM »


the syntax of "if" macro will be

{.if | boolean expression |
       {:  text or Set of macro-commands  when booelan TRUE :}
     |
       {:  text or Set of macro-commands  when boolean FALSE :}
/if.}

Quote
[upload completed]

{.if|{.=|%item-ext%|jpg.}{.=|%item-ext%|png.}|
{:
{.set|parameter1|"{.vfs to disk|%item-url%.}".}
{.set|parameter2|{.chr|47.}D="D:\%user%\thumbnails\".}
{.exec|C:\Program Files\Easy Thumbnails\EzThumbs.exe| {.call|parameter1.} {.call|parameter2.} .}
:}
.}

Quote
[file=folder=link|private]


<tr class='{.if|{.mod|{.count|row.}|2.}|even|odd.}' >

<td>
   <input type='checkbox' class='selector' name='box' value='%item-url%'
{.if not|{.get|can delete.}{.get|can access.}{.get|can archive item.}|disabled='disabled'.} />
   {.if not|{.get|can access.}|<img src='/~img_lock'>.}
   <a class="the-item" href="%item-url%" >

<img src="%item-icon%" alt="" />
&nbsp;%item-name%</a>

{.if|{.=|%item-ext%|jpg.}{.=|%item-ext%|png.}|
<div style="float:right;">
<a href="%item-url%" class="thumblink" >
<img src="/.%user%/thumbnails/thumbnail.%item-name%" alt="" />
</a>
</div>
.}

if your script has no error, it must work now ;)

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12945
    • View Profile
Re: command lines
« Reply #33 on: April 07, 2011, 12:14:10 PM »
i can easily see two problems
1. you are using {.exec.} the wrong way.
all the command line must be supplied as a single parameter, you are dividing it in multiple parameters.

2. you didn't surround with {:these markers:} the instructions inside the IF, so they will be executed in any case.

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: command lines
« Reply #34 on: April 07, 2011, 10:23:13 PM »
You're right it should have quotes but that shouldn't stop it from working (and it doesn't because I just tried it)

And what do you mean I'm using it wrong?  I am using {.exec|program|parameters.}
There are 2 parameters I want to run on the program and that's what the two variables are.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1225
  • ....... chut ! shh!
    • View Profile
Re: command lines
« Reply #35 on: April 07, 2011, 11:25:10 PM »
tested with:

Quote
[+upload completed]
{.switch|%item-ext%|,|jpg,jpe,jpeg,png,gif|
{:
{.exec|"C:\Program Files\Easy Thumbnails\EzThumbs.exe" "{.vfs to disk|%item-name%.}" /D="D:\%user%\thumbnails\".}
:}.}

Works fine  ;)
« Last Edit: April 08, 2011, 04:11:52 AM by SilentPliz »

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: command lines
« Reply #36 on: April 08, 2011, 02:01:07 AM »
Hmmmm yeah that works!

Thanks!


Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: command lines
« Reply #37 on: April 17, 2011, 02:15:18 PM »
Just thought I'd share this.  You can have a simple email validation system by using this program:   http://caspian.dotconf.net/menu/Software/SendEmail/

And here's my new account code.  When a user submits the new account form, they are taken to ~submission then immediately to ~Validation.  If they get the Validation code correct from the email then they are sent to ~validation-output and then immediately to ~success-creation.  Here's an example of that part that I put into my template.

Code: [Select]
[submission]

{.if     | {.postvar|user.}                                                                   |   {: {.redirect |/~newaccount?alreadysignedup=yes.}{.break.}  :}        |.}
{:{.if     | {.and| {.=|{.cookie|signedup.}|yes.} | {.!=|{.cookie|deleted.}|yes.}.}             |   {: {.redirect |/~newaccount?alreadysignedup=yes.}{.break.}  :}        |.}:}
{.if     | {.>= | {.count substring|{.postvar|name.}|{.load|User Emails.txt.}.}|1.}           |   {: {.redirect |/~newaccount?credentials=used.}{.break.}     :}        |.}
{.if     | {.>= | {.count substring|{.postvar|email.}|{.load|User Emails.txt.}.}|1.}          |   {: {.redirect |/~newaccount?credentials=used.}{.break.}     :}        |.}
{.if not | {.postvar|name.}                                                                   |   {: {.redirect |/~newaccount?username=none.}{.break.}        :}        |.}
{.if     | {.>= | {.count substring|{|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|.|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring| |{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|?|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|}|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|]|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|[|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|;|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|:|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|"|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|'|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|>|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|<|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|,|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|!|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|@|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|#|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|$|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|%|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|^|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|&|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|*|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|(|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|)|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|-|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|_|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|=|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|+|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|~|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if     | {.>= | {.count substring|`|{.postvar|name.}.}|1.}                                  |   {: {.redirect |/~newaccount?usernamee=invalid.}{.break.}    :}        |.}
{.if not | {.postvar|email.}                                                                  |   {: {.redirect |/~newaccount?emailgiven=no.}{.break.}        :}        |.}
{.if not | {.=  | {.count substring|@|{.postvar|email.}.}|1.}                                 |   {: {.redirect |/~newaccount?emailgiven=no.}{.break.}        :}        |.}
{.if not | {.>= | {.count substring|.|{.postvar|email.}.}|1.}                                 |   {: {.redirect |/~newaccount?emailgiven=no.}{.break.}        :}        |.}
{.if not | {.postvar|password1.}                                                              |   {: {.redirect |/~newaccount?passwordA=none.}{.break.}       :}        |.}
{.if not | {.postvar|password2.}                                                              |   {: {.redirect |/~newaccount?passwordB=none.}{.break.}       :}        |.}
{.if not | {.>= | {.length|{.postvar|password1.} .} | 8 .}                                    |   {: {.redirect |/~newaccount?password=short.}{.break.}       :}        |.}
{.if not | {.=  | {.postvar|password1.}             | {.postvar|password2.} .}                |   {: {.redirect |/~newaccount?passwordmatch=no.}{.break.}     :}        |.}
{.if not | {.=  | {.postvar|agree.}                 | yes.}                                   |   {: {.redirect |/~newaccount?agreement=no.}{.break.}         :}        |.}
{.if not | {.=  | {.postvar|spamcheck.}|{.add |{.postvar|x.}|{.postvar|y.}.}.}                |   {: {.redirect |/~newaccount?wrongmath=yes.}{.break.}        :}        |.}

{.mkdir|D:\{.upper|{.postvar|name.}.}.}
{.mkdir|D:\{.upper|{.postvar|name.}.}\thumbnails.}
{.add folder|real|D:\{.upper|{.postvar|name.}.}|.{.lower|{.postvar|name.}.}.}
{.new account|{.postvar|name.}|password={.postvar|password1.}|enabled=0|member of=can change password|redirect=/.{.lower|{.postvar|name.}.}/.}
{.set item|.{.postvar|name.}|hide=1|access={.postvar|name.}|delete={.postvar|name.}|upload={.postvar|name.}.}
{.copy|C:\Documents and Settings\Admin\Desktop\User Template.tpl|D:\{.upper|{.postvar|name.}.}\hfs.diff.tpl.}
{.copy|D:\user1\thumbnails\hfs.diff.tpl|D:\{.upper|{.postvar|name.}.}\thumbnails\hfs.diff.tpl.}

{.set| Validation-Code  |{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}{.random|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9.}.}

{.set| Email-From       | -f "Internet-Drive.tk Administrator <internetdrivetk@aol.com>"  .}
{.set| Email-To         | -t "{.postvar|name.} <{.postvar|email.}>"                       .}
{.set| Email-Server     | -s smtp.aol.com                                                 .}
{.set| Email-Logon      | -xu username                                             .}
{.set| Email-Password   | -xp password                                                      .}
{.set| Email-Subject    | -u "Validate your account on Internet-Drive.tk"                 .}
{.set| Email-Content    | -m "Your Validation Code is: {.call|Validation-Code.}"          .}

{.exec|Email-{.random|A|B|C|D|E|F.}.exe {.call|Email-From.} {.call|Email-To.} {.call|Email-Server.} {.call|Email-Logon.} {.call|Email-Password.} {.call|Email-Subject.} {.call|Email-Content.} .}

{.save|C:\Documents and Settings\Admin\Desktop\Validation Codes\{.postvar|name.}.txt|{.call|Validation-Code.}.}

{.append |C:\Documents and Settings\Admin\Desktop\User Emails.txt|
{.postvar|name.}
{.postvar|email.}
{.time.}
.}






<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

<title>internet-drive.tk BETA - Submitted New Account Request</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<style type="text/css">
body, th { font-family:tahoma, verdana, arial, helvetica, sans; font-weight:normal; font-size:9pt; }
body { margin:0; background-color:#FFFFF; padding:10px; }
p { margin:0 }
h1 {font-size:38px}
</style>

</head>

<body>

<script type="text/javascript">
var t = setTimeout("alertMsg()",3000);
function alertMsg()
{
window.location = "/~validation?name={.postvar|name.}"
}
</script>

<center>
<div style="padding-top:10%;">

<h1>If your browser does not automatically<br />
redirect you in 3 seconds, please click <a href="~validation?name={.postvar|name.}">here.</a></h1>



</div>
</center>
</body>
</html>


Code: [Select]
[validation]

{.if not|{.urlvar|name.}|{:{.redirect|/.}:}.}
{.if not|{.is file|C:\Documents and Settings\Admin\Desktop\Validation Codes\{.urlvar|name.}.txt.}|{:{.redirect|/.}:}.}  

<html><body>

<center>
<br /><br />

To activate your account, please enter the validation code that was sent to your registered email.

<br /><br />

<div style="border:1px solid; width:320px; ">
<form name="validation" action="/~validation-output" method="post" style="padding-top:16px;" >
<input type="text" size="36" name="code" /><br />
<input type="hidden" size="36" name="name" value="{.urlvar|name.}" /><br />
<input type="submit" name="send" value="Submit" />
</form>
</div>

<br />

{.if|{.=|{.urlvar|code.}|incorrect.}|

<div style="color:red;">
<b>ERROR:</b> That validation code is incorrect!
</div>

.}

</center>

</body></html>


Code: [Select]
[validation-output]

{.if |{.=|{.postvar|name.}|.}|{:{.redirect|/.}{.break.}:}.}

{.if
|
{.=|{.postvar|code.}|{.load|C:\Documents and Settings\Admin\Desktop\Validation Codes\{.postvar|name.}.txt.}.}
|{:
{.redirect|/~success-creation?user={.postvar|name.}.}
:}
.}


{.if
|
{.!=|{.postvar|code.}|{.load|C:\Documents and Settings\Admin\Desktop\Validation Codes\{.postvar|name.}.txt.}.}
|{:
{.redirect|/~validation?code=incorrect&name={.postvar|name.}.}:}
.}


Code: [Select]
[success-creation]

{.if not|{.is file|C:\Documents and Settings\Admin\Desktop\Validation Codes\{.urlvar|user.}.txt.}|{:{.redirect|/.}{.break.}:}.}
{.set account|{.urlvar|user.}|enabled=1.}
{.delete|C:\Documents and Settings\Admin\Desktop\Validation Codes\{.urlvar|user.}.txt.}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <title>Internet-Drive.tk - Made a new account!</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  
<!-- CSS INFORMATION BELOW -->

 <style type="text/css">
  
body, th { font-family:tahoma, verdana, arial, helvetica, sans; font-weight:normal; font-size:9pt; }
body { margin:8; background-color:#F8F8F8;
 padding:10px;
background-image:url("/background.png");
background-repeat:repeat-x;}
p { margin:0 }
.button7 { padding:5px; padding-top:7px; margin:15px; border:2px solid black; background:white; font-size:8pt; font-weight:bold; }
a { text-decoration:none;  background-color:Transparent; color:#000000 }
a:visited { color:#000000; }
a:hover { background-color:#BBF; }
img { border-style:none }
td { font-size:10pt; background:#C4F4C3; border:1px solid #BBF }
td img { vertical-align:top }
th, th a, th a:visited { color:#000000; font-size:14pt; font-weight:bold; padding-bottom:0; }
.button { float:right; padding:5px; padding-top:7px; margin:15px; border:2px solid black; background:white; font-size:8pt; font-weight:bold; }
.button img { vertical-align:text-bottom; }
.flag { font-weight:bold; font-size:8pt; background:white; color:red; text-align:center; border:1px solid red; }
h1 {color:black;font-family:"Comic Sans MS";font-size:38px;}
p {color:black;font-family:"Comic Sans MS";font-size:16px;}
w3css {vertical-align:bottom;text-align:right;}
hr {width:600px; }

</style>
  

</head>
<body>

<center>



<h1>Your account was successfully validated!</h1><br />
<h2>You may now log in.</h1><br /><br />

<a href="~login" class="button7" style="margin-bottom:200px;" > <img src="/~img27" alt="" /> USER LOGON</a>
<br /><br /><br /><br />



{.section|footer.}
« Last Edit: April 17, 2011, 07:18:06 PM by raybob95 »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12945
    • View Profile
Re: command lines
« Reply #38 on: May 24, 2011, 03:51:20 PM »
you didn't use my {.regexp.} suggestion in the end