rejetto forum
May 25, 2012, 03:17:35 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: PROBLEM : Load Modules Automatically  (Read 688 times)
0 Members and 1 Guest are viewing this topic.
Roessi
Tireless poster
****
Offline Offline

Posts: 107


314780875
View Profile Email
« on: February 03, 2010, 11:06:46 AM »

Smiley since rejetto implemented the dir cmd ... i should be able to load all the modules automatically ... so i gave it a try and wrote a script to do this ... :

function to load the modules :
Code:

{.if|{.!modules.}|{:
< t d width="175" valign="top" id="moduleCol" >
< s p a n  id="specialBox" >< /s p a n >

{.for each|#module|{.dir|template/rawr_default/modules/.}|{:

{.if not| {.pos |false|{.for each|#restr|none|{.load|template/rawr_default/modules/{.^#module.}/restrictions.txt.}|{:
{.^checkrestriction|{.^#restr.}|{.^#module.}.}
:}.}.}|{:
{.^modhtml|{.^#module.}.}
:}.}



:}.}
< / t d >
:}.}

checkrestrictions functions:
Code:
{.set|checkrestrictions|{:

{.switch|$1|,|
local|{: {.if|{.match|127.*;10.*;192.168.*|%ip%.}|true|false .} :}|
ggk|{:{.if|{.{.^ggk|$2=true.}.}|true|false.}:}|
lgd|{:{.if|%user%|true|false.}:}|
off|{:false:}|
none|{:false:}|true

.}

:}.}

modhtml function :

Code:
{.set|modhtml|{:
< d i v class="module" >
< d i v class="modHeading" >
< s p a n  >
< a h r e f ="javascript:pinModule('$1');" id="$1_Link" title="{.!lv_hideTitle.}" >< i mg
class="hide" src="/template/{.!theme.}/images/hide.gif" align="top" alt=""/ >
< n o s c r i p t >< i mg src="/template/rawr_default/images/spacer.gif" width="8" align="top" alt=""/ >< /n o s c r i p t >
< / a >
< / s p a n >
{.load|/template/rawr_default/modules/$1/title.txt.}
< / d i v >
< d i v class="modContent" id="$1" >
{.load|/template/rawr_default/modules/$1/modcontent.txt.}
< / d i v >
< / d i v >
:}.}



... and the problem is ... all modules are displayed ... but the checkrestriction function returns neither false nor true ...
and the bigger problem :

none of the macros in the modules beign loaded are executed ...  and i dunno why ^^

would be great if anyone could take a look at the code and tell if he could spot the problem ^^

thx in advance
Logged

rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #1 on: February 08, 2010, 08:31:59 AM »

menu > debug > enable macros.log

it's not easy to read, but there should be the answer to your problem.
if you cannot find, then consider posting the file here.
Logged
Roessi
Tireless poster
****
Offline Offline

Posts: 107


314780875
View Profile Email
« Reply #2 on: February 08, 2010, 09:45:32 AM »

um it seems that the for each command just doesnt execute the macros when it loads it from a file ...
tried it with a few other simpler examples and they all just didnt got executet ... dont know why .
Logged

rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #3 on: February 08, 2010, 01:54:06 PM »

paste the piece of log where is the problem
Logged
Roessi
Tireless poster
****
Offline Offline

Posts: 107


314780875
View Profile Email
« Reply #4 on: February 11, 2010, 09:25:18 AM »

umm i dont know at which point its the problem ... it just seems at some point all the macros are treated just as plain text : - /
at line 520 theres the first process of the for each function Smiley but i dont find anything : - /

attached :

template

macros.log

* RAWR-Template-0.1.2 + load auto.tpl (24.63 KB - downloaded 36 times.)
* macros.log (67.12 KB - downloaded 50 times.)
Logged

rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #5 on: February 11, 2010, 10:23:28 AM »

around line 520, it is is still evaluating the "if".
at line 555 you can see the "for" taken for execution.
at line 566 its unrolling. [1]
i hope this will help you reading the log.
maybe i should make it clearer, like using
"INPUT>" and
"OUTPUT<"
instead of ">" and "<"


[1] at the moment "for"s are unrolled, but i think i will change this. it will be execution step-by-step, like for the "while".
Logged
rejetto forum
« Reply #5 on: February 11, 2010, 10:23:28 AM »

Do you like this software? Consider even $2
 Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 16, 2012, 09:17:21 PM