Mormon_Princess (mormon_princess) wrote in component_help,
Mormon_Princess
mormon_princess
component_help

A Question..

I get this error when I'm trying to add the book/tv/music codes. I have posted the codes to see if anyone can help me. Oh and Thank you kunzite1  for helping me make my first layout pretty! :)

S2 Compiler Output at Wed Mar 9 16:30:35 2005
Error compiling layer:

Compile error: line 133, column 25: Unexpected token found.  Expecting: [TokenPunct] = ;
Got: [TokenIdent] = http
  S2::Node, S2/Node.pm, 139
  S2::NodeExprStmt, S2/NodeExprStmt.pm, 29
  S2::NodeStmt, S2/NodeStmt.pm, 55
  S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 42
  S2::NodeFunction, S2/NodeFunction.pm, 104
  S2::Layer, S2/Layer.pm, 58
  S2::Compiler, S2/Compiler.pm, 27
  
Context
129: 
130: 
131: # set one
132: 
133: $k1Msrc[0]   = "<img src="http://tinypic.com/22ggoz">";
134: 
135: $k1Malt[0]   = "Marron 5";
136: 
137: $k1Mtitle[0] = "Songs About Jane";
 

layerinfo "type" = "theme";
layerinfo "name" = "mormon_princess_component_customizations";

function page_layout(Page p) {
  # Set this to the width that you want both the navbar (if it exists) and the whole journal to be
  # may be percentage (70%) or number of pixels (700px).
  var string k1Swidth = "70%";

  # Start the html document and print the head section which controls the page title, stylesheet information,
  # server supplied head content, and custom header informtion from the print_custom_head function.
  var string title = $p->title();
  """
  <html>
  <head>
    <link rel="stylesheet" href="$p.stylesheet_url" type="text/css"/>
    $p.head_content
    """; $p->print_custom_head(); """
    <title>$title</title>
  </head>
  """;
 
  # Start the body section of the html document which controls the visible parts of the page.
  """<body style="text-align:center;">""";

  # If you want a picture to be at the top of your journal, edit and decomment this section remove the # from the next line.
   """<div align="center"><img src="http://tinypic.com/22ez2a" alt="" title="" /></div>""";

  if($k1Swidth != "") {
    """<table style="border: 0px; margin: auto; padding: 0px; width:$k1Swidth;"><tr><td>""";
  }

  # Print the navigation bar if it is needed. This can be incorporated into any other tutorials which override
  # the page_layout() function, and should be placed immediately after the <body> tag above.
  if (not $*comp_navbar or $*comp_state=="none") {
    """    <div class="header">""";
    print "<span class=\"header-item\"><a href=\""+$p.view_url{"recent"}+"\">$*nav_entries_text</a></span>";
    print "<span class=\"header-item\"><a href=\""+$p.view_url{"friends"}+"\">$*nav_friends_text</a></span>";
    print "<span class=\"header-item\"><a href=\""+$p.view_url{"archive"}+"\">$*nav_calendar_text</a></span>";
    print "<span class=\"header-item\"><a href=\""+$p.view_url{"userinfo"}+"\">$*nav_info_text</a></span>";
    if ($p.journal.website_url != "") {
        print "<span class=\"header-item\"><a href=\"$p.journal.website_url\">$p.journal.website_name</a></span>";
    }
    $p->lay_viewspec_nav();  # prints previous / next links including arrow images
    """ 
    </div>
    """;
  }

  # Print a spacer at the top of the page above the components and main area.
  """<div><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></div>""";

  # Start the table which lays out the components and main area in side-by-side layout
  """
  <table cellspacing="0" cellpadding="0" valign="top">
    <tr valign="top" width="100%">
      <td width="3">
        <img src="$*PALIMGROOT/component/clear.gif" width="3" height="1" alt="" border="0" />
      </td>
  """;
 
  # If the components are supposed to be on the left side of the page, then print them, followed by a column
  # with a spacer which is to seperate the components and the main area.
  if ($*comp_state == "left") {
    print_my_components($p);
    """
    <td width="3">
      <img src="$*PALIMGROOT/component/clear.gif" width="3" height="1" alt="" border="0" />
    </td>
    """;
  }

  # Print the main area of the page.
  print_my_entries($p, $title);

  # If the components are supposed to be on the right side of the page, then first print a column with a spacer
  # and then print the components after the spacer.
  if ($*comp_state == "right") {
    """
    <td width="3">
      <img src="$*PALIMGROOT/component/clear.gif" width="3" height="1" alt="" border="0" />
    </td>
    """;
    print_my_components($p);
  }

  # Finish off the table for the body
  """
      <td width="3">
        <img src="$*PALIMGROOT/component/clear.gif" width="3" height="1" alt="" border="0" />
      </td>
    </tr>
  </table>
  """;

  if($k1Swidth != "") {
    """</td></tr></table>""";
  }

  # End the body section and end the html document
  """
  </body>
  </html>
  """;
}

function print_free_text(Page p) {

var string k1Mheader = "XXXXXX";   # title of component

var string k1Mheight = "XXXpx";   # height of component

var Color  k1Mborder = "#000000"; # bordercolor for images

 

var Color    k1Mbg;

var string[] k1Msrc;

var string[] k1Malt;

var string[] k1Mtitle;

var string[] k1Melse;

var string[] k1Murl;

 

 

# set one

$k1Msrc[0]   = "<img src="http://tinypic.com/22ggoz">";

$k1Malt[0]   = "Marron 5";

$k1Mtitle[0] = "Songs About Jane";

$k1Melse[0]  = "OPTIONAL ITALICISED SUBTITLE";

$k1Murl[0]   = "OPTIONAL URL";

 

# set two

$k1Msrc[1]   = "IMAGE SRC";

$k1Malt[1]   = "ALTERNATE TEXT FOR PICTURE";

$k1Mtitle[1] = "ENBOLDENED TITLE";

$k1Melse[1]  = "OPTIONAL ITALICISED SUBTITLE";

$k1Murl[1]   = "OPTIONAL URL";

 

$k1Msrc[2]   = "IMAGE SRC";

$k1Malt[2]   = "ALTERNATE TEXT FOR PICTURE";

$k1Mtitle[2] = "ENBOLDENED TITLE";

$k1Melse[2]  = "OPTIONAL ITALICISED SUBTITLE";

$k1Murl[2]   = "OPTIONAL URL";

 

 

 

 

# copy sets as necessary

# make sure that the index numbers (bolded numbers) are the same in each group

# this program will step thru them in numerical order

 

# comment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

print_comp_header($k1Mheader);

 

# decomment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

# print $comp_header_open; print $k1Mheader; print $comp_header_close;

"""

<div id="Layer1" style="position:relative; width:100%; height:$k1Mheight; z-index:1; overflow: auto; overflow-x: hidden;">

<table width="100%" cellpadding="3" cellspacing="0">

""";

 

foreach var int i (0 .. (size($k1Msrc) - 1)){

  $k1Mbg = ($i % 2 == 0) ? $*comp_bgcolor  :  $*header_bgcolor;

  """

  <tr style="background-color:$k1Mbg;">

  <td style="text-align:center;">""";

if($k1Murl[$i] != "") { """<a href="$k1Murl[$i]">"""; }

  """<img src="$k1Msrc[$i]" border="0" style="border: 1px solid $k1Mborder" alt="$k1Malt[$i]" title="$k1Malt[$i]" />""";

if($k1Murl[$i] != "") { """</a>"""; }

  """</td>

  <td style="text-align:left; text-size:1;" ><B>$k1Mtitle[$i]</B>""";

if($k1Melse[$i] != "") {"""<br><nbsp><I>$k1Melse[$i]</I>""";}

"""</td>

  </tr>

  """;

}

 

"""

</table>

</div>

""";

# comment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

print_comp_footer();


# decomment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

# print $comp_footer;

}

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 10 comments