rejetto forum

ToG and folder creation

rich2323 · 11 · 11774

0 Members and 1 Guest are viewing this topic.

Offline rich2323

  • Occasional poster
  • *
    • Posts: 5
    • View Profile
Hello again,

I was reading in another post about creating folders, and i was able to get the HFS "default" templete to create folders. I have tried adding the same code to the ToG 4.0.1 template and the folders will not create. Here is the code that the other post mentions:

Quote
Code:

<form method='get'>
   {.if|{.get|can upload.}|
      Folder name: <input  type='text' name='fldname' maxlength="25" size="25" >
      <input  type='submit' name='createfolder' value='Create Folder' >
    /if.}
</form>



and add this code to generate the folder
Code:

[special:begin]
{.if|{.and| {.get|can upload.} | {.urlvar|createfolder.} .}|{:
   {.mkdir|%folder-resource%\{.urlvar|fldname.}.}
:}/if.}

Do you have any suggestions on how I can get the folder creation to work with ToG?

Thanks,

Rich


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile

Offline rich2323

  • Occasional poster
  • *
    • Posts: 5
    • View Profile
I am running beta version 2.3 build 223.

Thanks,

Rich


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
you can try menu - debug - macros log
it will generate a file macros.log near your hfs.exe
you can publish it here after you test the creation again


Offline rich2323

  • Occasional poster
  • *
    • Posts: 5
    • View Profile
User error. I was putting the code in the wrong spot. I figured it out. Still trying to get the hang of html and such. Thanks for your speedy response.

Rich


Offline Kremlin

  • Tireless poster
  • ****
    • Posts: 137
    • View Profile
This is my current admin panel i'm using on the RAWR template (black theme) which you can apply to the ToG as well, use it if you like it (i will place the code with the correct section where it should be placed, simply add, do not substitute the code already existent in the sections):

In the template file:

Code: [Select]
[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 upload.} | {.urlvar|renamefile.} .}|{:
{.rename|%folder-resource%\{.urlvar|oldname.}|%folder-resource%\{.urlvar|newname.}.}
:}/if.}

Code: [Select]
[files]
<!--[if lte IE 6]>
<style type="text/css">
.create {
padding-right:0px;
padding-left:0px;
}
.delete {
padding-right:0px;
padding-left:2px;
}
.rename {
padding-right:0px;
padding-left:1px;
}
</style>
<noscript><style type="text/css">#mainInner{width:100%}</style></noscript>
<![endif]-->
{.if|{.get|can upload.}|
<div class="space">
<table cellspacing="1" cellpadding="0" border="0" width="100%">
<tr>
<td colspan="3" class="adminheading">
<center>{.!lv_admin.}</center>
</td>
</tr>
<tr>
<td colspan="3">
<center>
<form method='get'>
<input class="formCreate" type='text'   name='fldname' maxlength="50" size="25" value="{.!lv_foldercreate.}" onclick="if(this.value=='{.!lv_foldercreate.}')this.value=''"/>
<input class="create"     type='submit' name='createfolder' value='Create Folder'>
<input class="delete"     type='submit' name='deletefolder' value='Delete File/Folder'>
<input class="formOld"    type='text'   name='oldname' maxlength="50" size="25" value="{.!lv_oldname.}" onclick="if(this.value=='{.!lv_oldname.}')this.value=''"/>
<input class="formNew"    type='text'   name='newname' maxlength="50" size="25" value="{.!lv_newname.}" onclick="if(this.value=='{.!lv_newname.}')this.value=''"/>
<input class="rename"     type='submit' name='renamefile' value='Rename File'><br/>
</form>
</center>
</td>
</tr>
</table>
</div>
/if.}

In the main.css:

Code: [Select]
.delete {
padding-right:8px;
padding-left:8px;
margin-top:16px;
margin-bottom:16px;
margin-bottom:16px;
border:1px solid #393939;
background:url('../images/button-bg.jpg') repeat-x;
font-weight:bold;
color:#b0b0b0;
font-size: 11px;
}
.create {
padding-right:8px;
padding-left:8px;
margin-right:2px;
margin-top:16px;
margin-bottom:16px;
border:1px solid #393939;
background:url('../images/button-bg.jpg') repeat-x;
font-weight:bold;
color:#b0b0b0;
font-size: 11px;
}
.rename {
padding-right:8px;
padding-left:8px;
margin-top:16px;
margin-bottom:16px;
border:1px solid #393939;
background:url('../images/button-bg.jpg') repeat-x;
font-weight:bold;
color:#b0b0b0;
font-size: 11px;
}
.formCreate {
padding-left:2px;
padding-right:2px;
margin-right:2px;
margin-top:16px;
margin-bottom:16px;
background:#0A0F11;
border:1px solid #393939;
color:#636363;
font-size: 11px;
}
.formOld {
padding-left:2px;
padding-right:2px;
margin-left:18px;
margin-right:2px;
margin-top:16px;
margin-bottom:16px;
background:#0A0F11;
border:1px solid #393939;
color:#636363;
font-size: 11px;
}
.formNew {
padding-left:2px;
padding-right:2px;
margin-right:2px;
margin-top:16px;
margin-bottom:16px;
background:#0A0F11;
border:1px solid #393939;
color:#636363;
font-size: 11px;
}
#content table table .adminheading {
background:url('../images/button-bg.jpg') repeat-x #000;
height:30px;
line-height:30px;
color:#c0c0c0;
}
.adminheading span {
float:right;
padding-right:8px;
padding-top:1px;
padding-bottom:1px;
margin-bottom:5px;
}
.space, .contSpace {margin-bottom:10px}
.contSpace {margin-top:0}

Should be firefox and ie6 compatible. In order for it to show you will need to create an account with upload rights to the folder which you wish the Admin Panel to appear (remeber rights are inherited so you will only need to apply them to the top folder, not the tree root).

PS. add lv_admin=Admin Panel, lv_oldname=Old name.., lv_newname=New name.., lv_foldercreate=Enter folder/file name.. to languages txt file.

This should be how it shows:
« Last Edit: February 25, 2009, 07:33:25 PM by Kremlin »


Offline Ranger

  • Tireless poster
  • ****
    • Posts: 115
    • View Profile
I added the code you provided to the RAWR Template (also using black). However the admin panel is on the bottom and the lv_** appears. I created a languages.txt file to the root of HFS install folder. Is that correct?


Offline Kremlin

  • Tireless poster
  • ****
    • Posts: 137
    • View Profile
The placement of the code in the [files] section is crutial, it needs to be right in between the [files] and the code already below it that comes in the original ToG template. Refering to the language (lv_..) there are several *.txt files that come with the RAWR, ToG and Terayon templates, each one designed to adapt the templates to diferent languages (what they do is substitute the "lv_.." tags in the template for those in these language txt files). What you need to do is add these additional lv's that i refered to the txt file already existent that should be located in a path similar to ../template/rawr_default/languages/*.txt being the *="to the language you are using, which is by default en for english"


Offline Ranger

  • Tireless poster
  • ****
    • Posts: 115
    • View Profile
Ah ok I found the language file, I didn't look in the default folder. I added the lv_* under the File List section as well as just at the end. The button names are fine, however the text boxes where you type the folder name still says lv_foldercreate, lv_oldname/lv_newname.

Also I originally the File section to the end vs the beginning, putting it at the beginning put up top now, thanks!


Offline Kremlin

  • Tireless poster
  • ****
    • Posts: 137
    • View Profile
Code: [Select]
<input class="formCreate" type='text'   name='fldname' maxlength="50" size="25" value="Enter folder/file name.." onclick="if(this.value=='Enter folder/file name..')this.value=''"/>
<input class="create"     type='submit' name='createfolder' value='Create Folder'>
<input class="delete"     type='submit' name='deletefolder' value='Delete File/Folder'>
<input class="formOld"    type='text'   name='oldname' maxlength="50" size="25" value="Old name.." onclick="if(this.value=='Old name..')this.value=''"/>
<input class="formNew"    type='text'   name='newname' maxlength="50" size="25" value="New name.." onclick="if(this.value=='New name..')this.value=''"/>
<input class="rename"     type='submit' name='renamefile' value='Rename File'><br/>

Just use this instead if you're having difficulty in adding the lv's tags in the language txt file, I just did it the other way because that's the method the original template was using.


Offline Ranger

  • Tireless poster
  • ****
    • Posts: 115
    • View Profile
Ok I just changed it by renaming the code going in the template

Code: [Select]
<input class="formCreate" type='text'   name='fldname'
maxlength="50" size="25" value="{.!Enter Folder Name.}"
onclick="if(this.value=='{.!lv_foldercreate.}')this.value=''"/>
<input class="create"     type='submit'
name='createfolder' value='Create Folder'>
<input class="delete"     type='submit'
name='deletefolder' value='Delete Folder'>
<input class="formOld"    type='text'   name='oldname'
maxlength="50" size="25" value="{.!Old File/Folder Name.}"
onclick="if(this.value=='{.!lv_oldname.}')this.value=''"/>
<input class="formNew"    type='text'   name='newname'
maxlength="50" size="25" value="{.!New File/Folder Name.}"
onclick="if(this.value=='{.!lv_newname.}')this.value=''"/>
<input class="rename"     type='submit'
name='renamefile' value='Rename File'><br/>

All I did was remove the LV_ and put in what I wanted it to show. I may just blank it entirely since you have to delete the text it puts in there. Also how hard would it be to take out the delete file and/or have this not work for a anonymous users. I have a couple folder publicly accessible that user can upload/download to, but no other permisison. With this Admin Panel they can also delete folders/files which I'd rather not allow.