rejetto forum

How to use a macro ??

Guest · 21 · 7056

0 Members and 1 Guest are viewing this topic.

HFS-Lover

  • Guest
hello guys , i m just stuck with even scripts and macro


recenlty i requested

How to delete data permanently instead of sending them into recylce bin  
rejetto.com/forum/index.php?topic=7471.0

then rejetto added it in Testing build #246

+ {.delete|bin=XXX.}

but now i dont know how to use it ??


where to add this ?? , how to add this ?? , how to use it ?? , any steps ?? ,

what to do with it ??

plz tell me there is lots of possibilities in HFS , but i dont understand with these things

Thanks alot


Offline kaler

  • Occasional poster
  • *
    • Posts: 94
    • View Profile
lol...

this marco you need, when you want to delet a file permenantly and not to copy t into the bin...
where you must add it:

you must add it whn you want to delet a file, the you write down the macro {.delet|filename|bin=XXX.}
then your file is delete forever...



Offline KooolaNL

  • Occasional poster
  • *
    • Posts: 20
  • EY
    • View Profile
    • wat
hey kaler can u pm me on how u made a shoutbox plz



Greetz from Netherlands (i live 5mins from germany :P)


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
Hi HFS-lover,

first of all you need to use a template. Install a template you like in your HFS, eg. RAWR template. The template is a text file that contains all the code to manage HFS web interface. Is in text format, you can modify the macros there if you understand the code behind.

If you don't want to modify the template you can use HFS events. Create a text file, name it hfs.events and put it into HFS root directory.

Every time HFS will run a specified macro, it will check in that file for a related action.

Here's an example:

[+file deleted]
{.delete|crap.txt.}

So each time HFS deletes a file, after that ([+file deleted]), it invokes macro {.delete.} which deletes the file named crap.txt in the root directory of HFS.

For complete list of events, see HFS wiki.


HFS-lover

  • Guest
Thanks guys , after all i got some idea

i m using default template , now can you paste or upload the working default template with this delete working macro ?

or just tell me the code where to edit what to edit , paste here small piece of code where i have to modify the code

thanks


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
"default template" is included in HFS.exe so you can't edit it. Neither you can use HFS events. You have to install a template.

Whit this:

http://www.rejetto.com/forum/index.php?action=dlattach;topic=7273.0;attach=4329

i know how to do it  ;D



HFS-lover

  • Guest
okay guys i got the template live 3 full and with that modification of delete ,


now please can u tell me where to edit the code for this macro ,

i know xhtml , css , little C Functions , some of php and XML 

but i m very confused with this

i tried to change the code in NewLive3-FULL.tpl file from line 95 to 101 , see below
 
Code: [Select]

{.delete|bin=0%|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}
{.if|{.and| {.get|can delete.} | {.urlvar|createroot.} .}|{:
{.{.add folder.}|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}
{.if|{.and| {.get|can delete.} | {.urlvar|deleteroot.} .}|{:
{.delete|bin=0%|folder-resource%\{.urlvar|fldname.}.}


i guess i m hitting  at right place ??? , but may be syntax is wrong or i m completely wrong


 just show me the right way to do it , please paste the working code

Thanks alot , i m still learning how to do this


Offline kaler

  • Occasional poster
  • *
    • Posts: 94
    • View Profile
okay moment...

here is my code:

[special:begin]
{.if|{.and| {.get|can upload.} | {.urlvar|createfolder.} .}|{:
{.mkdir|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}
{.if|{.and| {.get|can upload.} | {.urlvar|deletefolder.} .}|{:
{.delete|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}
{.if|{.and| {.get|can delete.} | {.urlvar|createroot.} .}|{:
{.{.add folder.}|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}
{.if|{.and| {.get|can delete.} | {.urlvar|deleteroot.} .}|{:
{.delete|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}
{.if|{.and| {.get|can upload.} | {.urlvar|renamefile.} .}|{:
{.rename|%folder-resource%\{.urlvar|oldname.}|%folder-resource%\{.urlvar|newname.}.}
:}/if.}


and in the main Page:


<table>
<tr>
<td>
<b>Creating folders:</b>
{.if|{.get|can delete.}
      |<form method='get'>
      <input class="toolsinput" type='text' alt="File/Folder Name" name='fldname' maxlength="100"
      size="23" value="{.!File/Folder Name.}" onclick="if(this.value=='{.!File/Folder Name.}')            this.value=''"/><input class="toolsbutton" type='submit' name='createfolder' value='OK' ></form>.}
</td>
<td>
<b>Delete Folder:</b>

{.if|{.get|can delete.}|
      <form method='get'>
      <input class="toolsinput" type='text' alt="Type File/Folder Name" name='fldname' maxlength="100"       size="23" value="{.!File/Folder Name.}" onclick="if(this.value=='{.!File/Folder Name.}')               this.value=''"/><input class="toolsbutton" type='submit' name='deletefolder' value='OK' ></form>.}
</td>
<td>
<b>Rename File:</b>
{.if|{.get|can delete.}|
      <form method='get'>
      <input class="toolsinput" type='text' name='oldname' maxlength="50" size="18" value="Old Name.."       onclick="if(this.value=='Old Name..')this.value=''"/>
      <input class="toolsinput" type='text' name='newname' maxlength="50" size="18" value="New Name.."       onclick="if(this.value=='New Name..')this.value=''"/>
      <input type='submit' name='renamefile' value='ok' class="toolsbutton">
</form>
.}
</td>
</tr>
</table>

the table you don't need, but you know this

I hope that works to you too ???


HFS-lover

  • Guest
is that works with deleting the file or folder permanently not to the recycle bin ??




Offline kaler

  • Occasional poster
  • *
    • Posts: 94
    • View Profile
with my method it will be delet into the bin....


HFS-lover

  • Guest
this option is already there , i want to delete permanently guys :)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
{.if|{.and| {.get|can delete.} | {.urlvar|deleteroot.} .}|{:
{.delete|%folder-resource%\{.urlvar|fldname.}|bin=0.}
this option is already there , i want to delete permanently guys

read the what's new of beta version  :-\


HFS-lover

  • Guest
i understand where to add this bin=0 , but it still fails to delete file permanently


can anyone provide me the working template or code , where it works for you ??

thanks alot , now i m bit frustrated with this now  >:(



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
sorry for the late reply, i will try to repay with a complete answer. ;)

i think there is a sort of confusion around this.
it is not clear WHEN you want to delete.
There are at least 2 very different moments:

- when HFS deletes files by the standard "delete" feature, the one you find in the default template, with "delete" permissions set

- when the template or any script deletes a file through the {.delete.} macro

In this latter case you must only find where the {.delete.} macro is, and add the bin=0 before the closing .}

Instead, there's no way to change the first case at the moment.
But I can easily see how this may interest users, and have in mind more than a solution. One is tricky, the other is easy*.

I would go for the tricky way, and IF the non-techie users will actually use it, then i'll introduce the simpler way. I may introduce it even from next release.

Indeed, i would like to simplify the installation of scripts, so to get both power and easiness with the same tool. But this will take some time.

[+file deleted]
{.delete|crap.txt.}

nice try Caco ;) but as the event name says, the file is already deleted, and trying to deleting again won't help. (Just guessing, i didn't test)


* The easy one is based on having an options, in the menu, that simply changes this behaviour from "recycling" to permanent. Very simple, but you can't do nothing more than this.
The tricky one is based on having an event [file deleting] so that you can act on it before the deletion is performed internally. At this time you can decide to permanently delete it, or move it to a drive, or compress it! This solution is powerful but suitable only to techies.