rejetto forum

New Module System for Rawr-Template

Roessi · 32 · 12582

0 Members and 1 Guest are viewing this topic.

Offline Roessi

  • Tireless poster
  • ****
    • Posts: 107
    • View Profile
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
« Last Edit: February 19, 2010, 11:46:09 AM by Roessi »


Offline Dragon_Hunter

  • Occasional poster
  • *
    • Posts: 52
    • View Profile
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/


Offline Roessi

  • Tireless poster
  • ****
    • Posts: 107
    • View Profile
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
« Last Edit: February 12, 2010, 02:38:40 PM by TSG »



Offline Dragon_Hunter

  • Occasional poster
  • *
    • Posts: 52
    • View Profile

Offline Dragon_Hunter

  • Occasional poster
  • *
    • Posts: 52
    • View Profile

Offline Roessi

  • Tireless poster
  • ****
    • Posts: 107
    • View Profile
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)



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
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?


Offline Roessi

  • Tireless poster
  • ****
    • Posts: 107
    • View Profile
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
« Last Edit: January 25, 2010, 03:00:18 PM by Roessi »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
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.}


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i can already tell you how it may be used for your case
{.dir|{.filepath|{.get|tpl file.}.}modules .}



Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
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.
« Last Edit: February 12, 2010, 02:37:44 PM by TSG »


Offline mudputty

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
    • Tridell Utah

Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
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.