baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from TheOneRing on 1/9 2004, 06:05 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Re: <include src=> -- Christoph

    Your reply:

    Name: EMail: WWW:
    Subject:
    Text:
    Timezone:

    Post a new message


 All messages from this thread: To the list 
    Message from TheOneRing on 1/8 2004, 06:30 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    <include src=>


      I call the template "size" below in another template "input" but it doesn't calculate length or write anything to the database. It works fine if I use the hyperlink to the file "size". Is there something wrong with my <include>?


      Template "size" below:

      <loop code=perl Title==*&Chapter_number==* db=/TheOneRing/Story_archives/Story>
      $sums{$Title}+=length($Story)/1000;
      </loop>
      <perl>
      foreach $Title(%sums)
      {
      my($Title_str) = $Title;

      $Title_str =~ s/ /\\ /gs;

      mod "Title==$Title_str", ["Size",$sums{$Title}], "/TheOneRing/Story_archives/Archive";

      }

      </perl>

      ***************
      Template "input" calls "size" with the following:

      <include src=/TheOneRing/Story_archives/size>

      The above <include> does not write to the database but selecting on "size" via a hyperlink does.

     Post a reply

    Message from Christoph Bergmann on 1/8 2004, 17:49 +01:00
    EMail: info@baseportal.de

    Re: <include src=>


      Mmh, your posted code looks Ok to me. Do you have a link where I can see and test it?

      Btw: You can avoid replacing all spaces for the "mod" command when you give it the parameters in a different format:

      Instead of

      my($Title_str) = $Title;

      $Title_str =~ s/ /\\ /gs;

      mod "Title==$Title_str", ["Size",$sums{$Title}], "/TheOneRing/Story_archives/Archive";

      you could write:

      mod ["Title", "==", $Title], ["Size",$sums{$Title}], "/TheOneRing/Story_archives/Archive";

      ;-)

     Post a reply


    Message from TheOneRing on 1/9 2004, 23:01 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Re: <include src=> I think I've solved it???


      I moved the include to the end of the template. It was located just after the database "put" calls and I think that the database was not completely updated first. So far it is working...
     Post a reply
     
 Messages from 2850 to 3000: To the input form 
<< Newest messages | < Newer messages | To the input form | Older messages > | Oldest messages >>


Back to the homepage

© baseportal.com. All rights reserved. Terms of use



baseportal.com