rejetto forum

New template in the works.

TSG · 39 · 15159

0 Members and 1 Guest are viewing this topic.

Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Just thought I'd post about the new template I'm working on.

It's a hybrid between ToG and Terayon with a completely new CSS and HTML code set. This one follows the colour scheme of our homepage and will be avaliable in a few other colour sets too, will just be a simple change of the CSS sheet.

It is nowhere near completion, but you can take a look. :o
« Last Edit: May 13, 2010, 05:59:39 AM by TSG »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Alright i need help with some macro's here... rejetto, mars... time to use brains.

I am trying to make a check for an archive button on our new template.

{{if|{{get|%item-archive%}}|{{$archive-on}}|{{$archive-off}} /if}}

[item-archive]
true

[archive-on]
<div class="quickBtn1" onmouseover="onBtn(this)" onmouseout="offBtn(this)"><a href="%item-url%~folder.tar?recursive" title="Download the content of this folder as a .tar Archive"><img src="/template/images/Download.gif" alt="DL" align="middle"></a></div>

[archive-off]
<div class="quickBtn1 disabled" onmouseover="onBtn(this)" onmouseout="offBtn(this)"><img src="/template/images/Download.gif" alt="DL" align="middle"></div>

what am i doing wrong...
« Last Edit: December 09, 2007, 01:56:55 PM by That_Stevens_Guy »


Offline rejetto

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

Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
It works! But its backwards :P...

{{if|{{$%item-archive%}}|{{$archive-off}}|{{$archive-on}}/if}}

that does it correctly. even tho the logic appears to be reversed...
« Last Edit: December 10, 2007, 04:31:16 AM by That_Stevens_Guy »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Ok, i am trying use macro's throughout this template. Since i've heard that it is a faster system :)

I have compiled a list, if you don't already know, of the symbols/ sections that don't function as macro's as i've found them thus far.

%folder%
%host%
%number-files%
%number-folders%
%number%
%total-size%

{{$archive}} does not hide for disabled like %archive%
{{$upload-link}} does not hide for disabled like %upload-link%
{{$up}} does not hide for disabled like %up%
{{$login-link}} does not hide for disabled like %login-link%
{{$loggedin}} does not hide for disabled like %loggedin%

%uptime%
%timestamp%
%connections%
%speed-in%
%speed-out%
%total-in%
%total-out%
%total-downloads%
%total-uploads%
%total-hits%
%ip%

%build%
%version%

%user%

%list%

%item-url%
%item-name%

%item-size%
%item-dl-count%
%item-modified%
%sequential%
%item-comment%
%parent-folder%

{{$loggedin}} does not hide for not logged in like %login-link%

or am i doing it wrong >_> it is either {{symbol}} or {{$symbol}} {{type|symbolname}} none seem to work...

I think i get it, without %% those sections are shown as a constant, and without defined type the symbols wont show.... but whats type for say...
%list%
« Last Edit: December 10, 2007, 11:51:26 AM by That_Stevens_Guy »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
TO TSG

download rejetto template attached

desactivate 'archivable' to root  and activate some sub-folder being archivable

and see what append  at the place of filesize

-----------------------------------------------------

pour rejetto

activer 'archivable' sur la racine implique que la même option pour les sous-dossiers est activée par défaut, il faudrait envisager les deux cas 'full archivable' and 'recursive archivable'

'full archivable'  : all subdirs are archivable by 'herited'
'recursive archivable' : only sub-folders wich are 'archivable' activated are achivable in folder.tar

tu comprends la différence??  un peu à la manière des droits sur les dossiers


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I took a look at the default template, it still shows the old symbols as %symbol% so i guess i'll just leave them :D


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
It is the last one template by defaut which I used, I was only interested in the case

Quote
{{if|{{get|%item-archive%}}|{{$archive-on}}|{{$archive-off}} /if}}

[item-archive]
true

[archive-on]
<div class="quickBtn1" onmouseover="onBtn(this)" onmouseout="offBtn(this)"><a href="%item-url%~folder.tar?recursive" title="Download the content of this folder as a .tar Archive"><img src="/template/images/Download.gif" alt="DL" align="middle"></a></div>

[archive-off]
<div class="quickBtn1 disabled" onmouseover="onBtn(this)" onmouseout="offBtn(this)"><img src="/template/images/Download.gif" alt="DL" align="middle"></div>

On the other hand if the couple [mysection] and {{section|mysection}} works, he goes away differently for sections previous to the macro as [login-link] and [loggedin]

{{if not| %user% |{{section|login-link}} }}...{{if| %user% | {{section|login-link}} }}
 same result than  %login-link% ...%loggedin%

you can change %list% to {{section|list}}, it is a special usage to hfs, as for %user%

At the moment your action is limited to the former(ancient) call of section

[sym-section]   %sym-section%  ----> [mysection]   {{section|mysection}}

I think that %symbol% has to keep(guard) his structure of origin not to be confused with the macro, certain manners are in connection with data appropriate for the functioning of hfs and would require a radical modification of the code.


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Yes i have included something like this and many more. All i need is the ability to say, if this or this or this... somehow, then i can create my filelist with just [file] ... then, i would like the ability to find the indexOf within the header or any string, i posted in the macro one.

 All good. is substring ;)
« Last Edit: December 11, 2007, 12:42:34 PM by That_Stevens_Guy »


Offline Unknown8063

  • Occasional poster
  • *
    • Posts: 96
    • View Profile
Yes i have included something like this and many more. All i need is the ability to say, if this or this or this... somehow, then i can create my filelist with just [file] ... then, i would like the ability to find the indexOf within the header or any string, i posted in the macro one.

 All good. is substring ;)

Check out Rejetto's switch macro: http://www.rejetto.com/wiki/index.php?title=HFS:_Template_macros


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
Ye i managed to get it working with that, thanks anyway  :D

I now have all my 'files' coming out of one section with macros :) makes it very easy to edit now.

Here is what i had to do.

Code: [Select]
[file]
<tr>
<td class="iconCol">
{{switch|%item-ext%|,|jpg|{{$thumbs}}|png|{{$thumbs}}|bmp|{{$thumbs}}|<div style="background:url('/~img_file') center center no-repeat"></div>}}
</td>
<td class="fileCol%protected%" {{if|%protected%|{{$row-js-p}}|{{$row-js}}/if}}>
<span class="fileInfo">
<a href="%item-url%" {{$target}}>%item-name%</a><br/>
%comment%
<span><b>Size:</b> %item-size%</span>
<span><b>Hits:</b> %item-dl-count%</span>
<span class="age"><b>Age:</b> %item-modified%</span>
</span>
</td>
<td class="quickCol">{{switch|%item-ext%|,|jpg|{{$preview-btn}}|png|{{$preview-btn}}|bmp|{{$preview-btn}}|mp3|{{$preview-btn}}|swf|{{$preview-btn}}|divx|{{$preview-btn}}|avi|{{$preview-btn}}|<div class="disabled hide"></div>}}
<noscript><div class="disabled"></div></noscript>
<div class="quickBtn1" {{$btn-js}}><a href="%item-url%" {{$target}} title="Download this file."><img src="/template/images/Download.gif" alt="DL"></a></div>
</td>
</tr>

[thumbs]
<div style="background:url('/template/images/Default-Thumb.gif') center center no-repeat">
<noscript><div style="background:url('previews_and_thumbnails/thumb-%item-name%.jpg') center center no-repeat"></div></noscript>
<img class="hide" src="previews_and_thumbnails/thumb-%item-name%.jpg" onerror="imgError(%sequential%,this)" align="middle"/>
</div>
[preview-btn]
<div {{$btn-js}} id="s%sequential%" class="hide" {{if|{{%item-ext%=mp3}}|name="mp3File"}}><a href="javascript:void(0)"  onclick="initPreviewBox('Box-'+(%sequential%+1),'%item-ext%',this.name)" name="{{if|{{%item-ext%=mp3}}|http://%host%%encoded-folder%}}%item-url%" title="Launch preview box."><img src="/template/images/Preview.gif" alt="P" align="middle"/></a></div><span id="Box-%sequential%"></span>
[target]
{{switch|%item-ext%|,
|gif|target="_blank"
|pdf|target="_blank"
|htm|target="_blank"
|html|target="_blank"
|txt|target="_blank"
|css|target="_blank"
|jpg|target="_blank"
|png|target="_blank"
|}}
« Last Edit: December 11, 2007, 05:21:27 PM by That_Stevens_Guy »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
this is better {{switch|%item-ext%|,|jpg,png,bmp|{{$thumbs}}|<div ....... }}

in such case you can also use
{{if| {{match|jpg;png;bmp|%item-ext%}} | {{$thumbs}} | <div .... }}

Quote
{{$archive}} does not hide for disabled like %archive%

indeed, that's what it's meant to do.
it's not like %archive%.
%archive% is sometimes empty.
{{$archive}} is always the section.
if you want to put a condition, you can use {{if}} like the default tpl does
« Last Edit: December 12, 2007, 01:12:28 PM by rejetto »


Offline TSG

  • Moderator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
I was wondering if i could stack up some parameters :) I will try these now.

I found the 'can archive' after some time ;)

EDIT: Cool it works, and the code is much less redundant. Am i right to say that switch is the faster method?
« Last Edit: December 12, 2007, 02:14:36 PM by That_Stevens_Guy »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Ok, i am trying use macro's throughout this template. Since i've heard that it is a faster system :)

you won't get a faster template using macros in place of symbols.
the full story is rather complex, but the point is that HFS is slowed down by the making of symbols table. macros are calculated upon request, while symbols must be pre-calculated and eventually applied. symbols are calculated even if you don't use them.

some symbols will be deprecated, then discarded, over time.
« Last Edit: December 12, 2007, 04:58:46 PM by rejetto »


Offline Giant Eagle

  • Moderator
  • Tireless poster
  • *****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
Are macro's faster or slower than php execution times? I mean, if you place alot of macro's in a template, would that significally reduce the speed on slower computers? (E.g. my 500mhz server).. Or is it barely noticeable

Minimizing or even remove the use of jacascript really sounds good