rejetto forum

Software => HTML & templates => HFS ~ HTTP File Server => RAWR-Designs => Topic started by: Roessi on January 23, 2010, 12:38:06 PM

Title: New Module System for Rawr-Template
Post by: Roessi on January 23, 2010, 12:38:06 PM
This is the 3rd update of the template :)
everything works fine at the moment :)
currently there is one extra module:


If You dont have the Rawr template you can get the complete template form here:

http://www.multiupload.com/S95YPN466I










Edit : 13.02.10 :

k now everything seems to work :) so i attache a zip file with everything u need to replace in the rawr template :)

just extract it in the hfs folder and replace everything :)





I modified the way of how the template works with the modules :)
because they were just "static" html in the template and i created some modules and wanted them to be included and this was always a waste of time.

Now It works this way:
in the template folder there is an subfolder "modules" .  
in this folder , every module has his own subfolder with at least two text files in it
1: modcontent.txt
2:title.txt

the template simply builds the html for the modules based on a list with the names of the modules and loads the content from modcontent.txt and the title from title.txt

the positiv sideffects when u include this in your rawrtemplate are :

you can simply change the order of the modules :) just by positioning the name in the list :)
you can simply create a new module to be loaded :) just create an folder with the name of the module and a mod_ prefix
and put the content of the module inside the modcontent.txt and the title in title.txt in the folder.

to turn an module off u can either remove it from the list or prefix it with an off:- .

if an module is thought to only be displayed locally ( like the updates module ) just put an local:- before the module name in the list .

if anyone wants to use it :) feel free to do so :)

Instructions:
1: First of all put the modules folder found in the rar arcive into /template/rawr_default
2. U will need these function in the [special:begin] section in order this to work :



Code: [Select]
{.set|#doforlist|{:{.trim|
{.set|#seperator|{.switch|{.length|$3.}||0|;|$3.}.}
{.set|#list|$1{.^#seperator.}.}
{.set|#entries|{.count substring|{.^#seperator.}|{.^#list.}.}.}
{.while|#list|{:{.trim|
{.set|#curitem|{.substring||{.^#seperator.}|{.^#list.}.}.}
{.cut|var=#list|from={.add|2|{.length|var=#curitem.}.}|size=.}
.}{.dequote|{.replace|%cur%|{.^#curitem.}|$2.}.}:}.}
.}:}.}

{.set|loadmodule|{:

{.set|modhtml|{:
< d i v class="module">
< d i v class="modHeading">
< s p a n >
< a h r e f="javascript:pinModule('{.^curmod.}');" id="{.^curmod.}_Link" title="{.!lv_hideTitle.}">< i m g
class="hide" src="/template/{.!theme.}/images/hide.gif" align="top" alt=""/>
< n o script>< i m g src="/template/rawr_default/images/spacer.gif" width="8" align="top"

alt=""/ > < / n o script>
< / a >
< / s p a n >
{.load|/template/rawr_default/modules/mod_{.^curmod.}/title.txt.}
< / d i v >
< d i v class="modContent" id="{.^curmod.}">
{.load|/template/rawr_default/modules/mod_{.^curmod.}/modcontent.txt.}
< / d i v >
< / d i v >"
:}.}
{.set|part1|{.substring||:-|$1|include=0.}.}
{.set|part2|{.substring|:-||$1|include=0.}.}


{.switch|{.^part1.}|,|
local|{: {.if|{.match|127.*;10.*;192.168.*|%ip%.}|{.set|curmod|{.^part2.}.}{.^modhtml.}.} :}|
off||
{:{.set|curmod|{.^part1.}.}{.^modhtml.}:}
.}
:}.}


just copy this and paste it directly after the [special:begin]

3. now u have to replace the template code in the template with the new code. in the rawr template juste delete
everything from line 183 to line 299 and replace it with the following code:
Code: [Select]
{.if|{.!modules.}|
<td width="175" valign="top" id="moduleCol">
<span id="specialBox"></span>
{.^#doforlist|{.!modules.}|{:{.^loadmodule|%cur%.}:}.}
</td>
.}
4. the last step write the list with the modules u want to be loaded , this gies directly under the [special:strings] section: f.e.
Code: [Select]
modules=local-updates;off-foldertasks;statistics;shoutboxnote: if you put the shoutbox or sth. else at the first position it will be displayed as the first module ;)

hope anyone will find it usefull and everythings working correctly ( for me it does ) im open for every idea to improve this :)
roessi


could be that i find sth to improve and modify the post

P.S u have to remove the spaces in the html code ... i werent allowed to post html code in a code box
P.P.s i attached the modified template ... the only thing i still need to do to work perfectly is modifying the javascript to set the cookie for the state of the modules
Title: Re: New Module System for Rawr-Template
Post by: Dragon_Hunter on January 23, 2010, 03:38:14 PM
Hey !

I have followed the steps that you have posted, but i don't get it too work.
maybe you can check it out and tell me what is wrong.

http://hfs-server.no-ip.org:7780/
Title: Re: New Module System for Rawr-Template
Post by: Roessi on January 23, 2010, 04:39:51 PM
updated it heres the finished modified template ... just use the template file and copy the template folder in the hfs folder :)

edited : the rawr_main.js to load the state for the modules to
Code: [Select]
var cookiecounter = 0;
while ( cookiecounter <= modulenumber ) {
if(getCookie(modules[cookiecounter])=="pinned") hideShow("mod_" + modules[cookiecounter]);
cookiecounter++;
}
now the only things which didnt work solved :) the boxes stay closed when you close them and the sites being refreshed :)

template is attached
Title: Re: New Module System for Rawr-Template
Post by: Dragon_Hunter on January 23, 2010, 04:46:36 PM
I can not download the files
Title: Re: New Module System for Rawr-Template
Post by: Dragon_Hunter on January 23, 2010, 04:48:46 PM
Now I could download the files.. Thx
Title: Re: New Module System for Rawr-Template
Post by: Dragon_Hunter on January 23, 2010, 04:57:45 PM
How do I make a folder that I get admin?
Title: Re: New Module System for Rawr-Template
Post by: Roessi on January 24, 2010, 01:50:42 PM
heres an example module ^^ which allows users to change password and username ;)
but its only in english and german ^^

just extract the zip archiv as explained into the /template/rawr_default/modules/
folder

and in the template file simply add roessi
somewhere into the list of the active modules;)
under the permanet settings in the specials:strings section (l: 48)

Title: Re: New Module System for Rawr-Template
Post by: rejetto on January 25, 2010, 02:46:08 PM
wouldn't it be better if you were able to detect the modules yourself?
i will make a {.command.} to get the list of files in a folder. ok?
Title: Re: New Module System for Rawr-Template
Post by: Roessi on January 25, 2010, 02:55:51 PM
would be perfect ;) i thought about using the exec and a .bat to get the list but didnt found its nice solution :) a {.command.} would be really nice
Title: Re: New Module System for Rawr-Template
Post by: rejetto on January 25, 2010, 03:06:38 PM
i don't know if you can handle newlines the right way, but you can in the while play with this
{.exec|cmd /c dir /b|out=#list.}
Title: Re: New Module System for Rawr-Template
Post by: rejetto on January 25, 2010, 03:19:22 PM
i can already tell you how it may be used for your case
{.dir|{.filepath|{.get|tpl file.}.}modules .}
Title: Re: New Module System for Rawr-Template
Post by: Roessi on January 25, 2010, 03:29:55 PM
would be really great :)
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 10, 2010, 05:02:55 PM
Hello, I've downloded the template and the module to change the user password. I've installed the files and I've changed the template to add the mod_roessi at line 48. Nothing happens!
I mean that I don't see the possibility to change the user password.
Can you help me? I also see that some messages on the mod-roessi are only in german: is it right?
I attach the template for you evaluation.
Thank you in advance for your reply.
Title: Re: New Module System for Rawr-Template
Post by: mudputty on February 11, 2010, 01:24:12 AM
I love this idea of using modules!
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 11, 2010, 01:13:03 PM
Hi Roessi, I've tested the template.zip and it works properly. It is possible to do the same with RAWR-template? Can you please post the template?
Thank U.
Title: Re: New Module System for Rawr-Template
Post by: Roessi on February 11, 2010, 03:20:32 PM
@gio attached your zip file. changed the parts that were only in german ^^ sry....
but err i dunno why the module doesnt show up for you O.o for me its beeing displayed at the bottom O.o

but atm im trying on a new module to change password create folder rename and so on....
you could try again the template and see if it loads the module O.o if not attach the macros.log pls :)
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 11, 2010, 03:46:13 PM
It's still not working...I don't know why. Moreover, I see only the directory window, but not the statistics, sutbox, etc.
I attach the log and a snapshot.
Thanks
Title: Re: New Module System for Rawr-Template
Post by: Roessi on February 11, 2010, 04:06:00 PM
omg stupid xD
... sry i think its my fault

exctract the attached zip into the template folder :)
so its
template/functions/...
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 11, 2010, 05:18:02 PM
Wow, now it's working!
Just a remark: the connection is extremely slow respect to the standard template configuration. Do you know why?
Thank you.
Title: Re: New Module System for Rawr-Template
Post by: Roessi on February 11, 2010, 05:22:41 PM
err maybe you still havew the debug on ?
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 11, 2010, 05:34:26 PM
if you mean the macro.log enabled, no.
Title: Re: New Module System for Rawr-Template
Post by: Roessi on February 11, 2010, 05:39:30 PM
umm
for me it makes no noticeable difference using the standard or the modified template
Title: Finally Modules for Rawr Template Load Automatically
Post by: Roessi on February 12, 2010, 10:19:56 AM
Finally i got it :) and the modules will be loaded automatically :)

to get restricitons work theres now another txt file inside a module : restrictions.txt .
this is the file u can change in existing modules to change the behaviour od the module . :

u can use :

local
      -> the module is only displayed if the ip matches a local ip.
off
     -> the module isnt displayed at all.
loggedin
     -> the module is only displayed to logged in users.
!loggedin
     -> the module is only displayed to not logged in users ( could be used for a registration module )
keyallow
    -> the module is only displayed if a user or a group the user is member off has a key in the notes section with mofulefoldername = 1 (f.e.   mod_foldertasks=1 )

plugin
   -> the module is loaded anyway but not into a table only the modcontent.txt content is going to be loaded ( if u just want to use the module for executing macros or sth.)


i currently did not thought about a nice solution to sort the modules so for the moment u have to name the module folders like
a_mod_foldertasks if u want the foldertask module to be displayed first :)

attached :
everything u need to use it if u use the rawr templatet :) if not first download the rawr template and replace everything with the content of the archive ;)
just extract it to the hfs root folder :)



..............


everyone is free to use it :)

but now since everythings loading automatically and hfs has even mor macros to handle  i have to say that i notice a lil speed slow down :) EDIT: " xD forgot to turn macros.log off :P now no slow down noticeable for me ^^"but just take a look at it :)
if you find mistakes or things which could be improved :) pls post

roessi



edit : attachment is on first post ->
Title: Re: Finally Modules for Rawr Template Load Automatically
Post by: rejetto on February 12, 2010, 10:47:49 AM
did you mean to attach a file?
Title: Re: Finally Modules for Rawr Template Load Automatically
Post by: SilentPliz on February 12, 2010, 10:54:35 AM
Haha! I tried to find with my mouse a hidden link in the message.

I thought it was a joke !

 ;D ;)
Title: Re: Finally Modules for Rawr Template Load Automatically
Post by: Roessi on February 12, 2010, 12:15:06 PM
xD
wth why always do such things happen to me :P
now files attached


Edit:

Quote
you had better attach it to the first post  :P
done  :P
Title: Re: Finally Modules for Rawr Template Load Automatically
Post by: rejetto on February 12, 2010, 12:29:13 PM
you had better attach it to the first post :P
Title: Re: New Module System for Rawr-Template
Post by: Roessi on February 17, 2010, 11:24:37 PM
new version :P

lil fix so you can use %modulename% in modules which will be replaced by the name of the module / modulefolder


attached at first post
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 18, 2010, 09:12:02 AM
@rejetto. Please, can you delete my attachment "macro.log" posted on reply #16, 11th of February?
Thank you
Title: Re: New Module System for Rawr-Template
Post by: rejetto on February 18, 2010, 06:37:22 PM
@gio
fatto. ma sappi che potevi farlo autonomamente. :)
Title: Re: New Module System for Rawr-Template
Post by: Gio on February 19, 2010, 08:25:13 AM
@rejetto. Scusami, pensavo fosse autorizzato solo l'amministratore.
Grazie.
Title: Re: New Module System for Rawr-Template
Post by: Roessi on February 19, 2010, 11:42:59 AM
Another Update :)
Changed the ids of the filecolums so a deletefunction can easily be created with a module.

attached at first post