March 9th, 2005

Hi again - (Link) problems

On my journal, I have the vertical and horizontal scrollbars for each entry. Under the entry is the (Link) link, which when clicked, was to take me to my entry at full-size. Instead, it takes me to the entry page with scroll-bars still intact.

I hope I'm being clear enough with this, but I'm still pretty new at the coding thing. If you could help me, I'd be most obliged. Thank you so much.

I've searched carefully...

I found and implemented the info/code for the link list scroll bar and was looking to do the same with the page summary component... scoured the tutorials, searched component_help, even read 'The Document' (mostly), and came up empty handed.

I'm thinking it's going to be related to
function Page::print_linklist()
, but i'm just guessing-

Any thoughts?

Oh, code is here: http://www.livejournal.com/customize/advanced/layersource.bml?id=3743347&fmt=html
Test page: http://www.livejournal.com/users/ntwrth_memberin/?s2id=5884043

'Preciate any assistance!
  • Current Mood
    curious curious
minifesto

[square] components on both sides

grab step one of s&c, then use the following:
#####################################
# [SQUARE] COMPONENTS ON BOTH SIDES #
#              (v2.0)               #
#  WITH ROUNDED OR SQUARE NAVBAR    #
#       AND OPTIONAL HEADER         #
#      kunzite1, xtomxfallsx        #
#      component-help/589908        #
# overrides page_layout(Page p)     #
#####################################

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 (80%) or number of pixels (800px).
  var string k1Swidth         = "80%";    # width of component layout (including entries and components)
  var string k1Sheader_url    = "";       # optional header image url
  var string k1Sheader_alt    = "";       # optional header image alt text
  var string k1Sheader_align  = "center"; # header alignment
  var string k1Salign         = "center"; # layout alignment

  var bool   k1Sroundnavbar   = true;     # set to false for square navbar corners

  # Calculate the corner_color for the new rounded navigation bar
  var Color  k1Sheader        = $*header_bgcolor;
  var Color  k1SheaderMinus5  = $k1Sheader->darker(50);
  var Color  k1SheaderPlus3   = $k1Sheader->lighter(30);
  var string k1Scorner_color  = "/p0"+$k1SheaderPlus3->substr(1,6)+"1"+$k1SheaderMinus5->substr(1,6)+"2"+$k1Sheader->substr(1,6);
  var string k1Smargin        = $k1Salign == "center" ? " margin: auto;" : "";

  # Create the corners of the navbar, both square and rounded

  var string k1Ssq_nav_bar_open  = """<table cellspacing="0" cellpadding="0" border="0"><tr><td class="dkLine" colspan="7"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="dkLine" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="ltLine" colspan="5"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="dkLine" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="dkLine" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="ltLine" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="medLine" colspan="4"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="dkLine" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="dkLine" rowspan="3" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="ltLine" rowspan="3" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="medLine" rowspan="3" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="tabBg" rowspan="1" colspan="2"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="medLine" rowspan="3" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="dkLine" rowspan="3" colspan="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="tabBg" colspan="2"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="tabBg" colspan="2"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td></tr><tr><td class="dkLine" width="1" rowspan="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="ltLine" width="1" rowspan="2"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="medLine" width="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td><td class="tabBg" width="100%"><div class="compFont" style="position:relative; top:-3px; left:2px;">""";
  var string k1Ssq_nav_bar_close = """</div></td><td class="tabBg" width="3" ><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td><td class="medLine" width="1" rowspan="2"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="dkLine" width="1" rowspan="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="medLine" colspan="4"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="dkLine" colspan="5"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td></tr></table>""";
  var string k1Sro_nav_bar_open  = """<table width="100%" 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><td><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td valign="top" rowspan="3" colspan="3" width="5"><img src="$*PALIMGROOT/component/curve-top-left.gif$k1Scorner_color" width="5" height="5" alt="" border="0" /></td><td class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td valign="top" rowspan="3" colspan="3" width="5"><img src="$*PALIMGROOT/component/curve-top-right.gif$k1Scorner_color" width="5" height="5" alt="" border="0" /></td></tr><tr><td class="ltLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="tabBg"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td></tr><tr><td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="ltLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="tabBg" width="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td><td class="tabBg" width="100%">""";
  var string k1Sro_nav_bar_close = """</td><td class="tabBg" width="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td><td class="ltLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td><td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td valign="top" rowspan="3" colspan="3" width="5"><img src="$*PALIMGROOT/component/curve-bottom-left.gif$k1Scorner_color" width="5" height="5" alt="" border="0" /></td><td class="tabBg"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td><td valign="top" rowspan="3" colspan="3" width="5"><img src="$*PALIMGROOT/component/curve-bottom-right.gif$k1Scorner_color" width="5" height="5" alt="" border="0" /></td></tr><tr><td class="ltLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr></table></td><td width="3"><img src="$*PALIMGROOT/component/clear.gif" width="3" height="1" alt="" border="0"></td></tr></table>""";

  # set the width of the side td to zero if the navbar is square

  var int    k1Sspacing          = 3;
  var int    k1Sside_spacing     = ($k1Sroundnavbar) ? $k1Sspacing : 0;
  var int    k1Sinner_spacing    = $k1Sspacing;

  # 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>
  """;
  $p->print_head();
  $p->print_stylesheets();
  """
    <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;">""";

  # print the navigation strip if the remote viewer sees it
  $p->print_control_strip();

  if($k1Sheader_url != "") {
    """<div align="$k1Sheader_align"><img src="$k1Sheader_url" alt="$k1Sheader_alt" title="$k1Sheader_alt" /></div>""";
  }

  if($k1Swidth != "") {
    """<table align="$k1Salign" border="0" cellpadding="0" cellspacing="0" style="border: 0px;$k1Smargin 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") {
    if ($k1Sroundnavbar) {
      print $k1Sro_nav_bar_open;
    } else {
      print $k1Ssq_nav_bar_open;
    }
    """    <div class="header">""";
    var string[] views_order = ["recent", "friends", "archive", "userinfo"]; # view order
                                                                             # "recent"   = recent   view
                                                                             # "friends"  = friends  view
                                                                             # "archive"  = calendar view
                                                                             # "userinfo" = userinfo link
    var string{} view_text   = { # build text hash
                                "recent"   => $*nav_entries_text,
                                "friends"  => $p.journal_type != "C" ? $*nav_friends_text : $*text_view_friends_comm,
                                "archive"  => $*nav_calendar_text,
                                "userinfo" => $*nav_info_text
                               };
    var string   base_url    = $p.journal->base_url(); # get base url

    var string{} view_url    = { # build url hash
                                "recent"   => get_url($p.journal, "recent"),
                                "friends"  => get_url($p.journal, "friends"),
                                "archive"  => get_url($p.journal, "archive"),
                                "userinfo" => get_url($p.journal, "userinfo")
                               };
    foreach var string v ($views_order) {
      print """<span class="header-item"><a href="$view_url{$v}" class="headerLinks">$view_text{$v}</a></span>""";
    }

    # to add your own links you can use these as a template

    #  print """<span class="header-item"><a href="$*SITEROOT/tools/memories.bml?user=$p.journal.username" class="headerLinks">memories</a></span>""";
    #  print """<span class="header-item"><a href="http://www.yahoo.com/" class="headerLinks">yahoo!</a></span>""";

    if ($p.journal.website_url != "") {
        print """<span class="header-item"><a href="$p.journal.website_url" class="headerLinks">$p.journal.website_name</a></span>""";
    }
    $p->lay_viewspec_nav();  # prints previous / next links including arrow images

    """	
    </div>
    """;
    if ($k1Sroundnavbar) {
      print $k1Sro_nav_bar_close;
    } else {
      print $k1Ssq_nav_bar_close;
    }
  }

  if ($k1Sroundnavbar) {
    # 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="$k1Sside_spacing">
        <img src="$*PALIMGROOT/component/clear.gif" width="$k1Sside_spacing" height="1" alt="" border="0" />
      </td>
  """;

# Left component column
# If comp_state is set to "left" it will print the standard components
# If comp_state is set to "right" it will print the custom components
# If comp_state is set to something other than "left" or "right" it won't print any components

# Don't screw with this unless you know what you are doing
if($*comp_state == "left") {
  print_my_components($p);
} else {
  if($*comp_state != "none") {
"""
<td border="0" cellpadding="0" cellspacing="0">
<table  width="183" border="0" cellpadding="0" cellspacing="0">
""";

# This starts the playing field for left side custom components

print_comp_header("left side header 1");
"""
left side text 1
""";
print_comp_footer();

print_comp_header("left side header 2");
"""
left side text 2
""";
print_comp_footer();

# This ends the playing field for left side custom components

"""
</td>
</tr>
</table>
</td>
""";
  }
}

"""
  <td width="$k1Sinner_spacing" valign="top">
   <img src="$*PALIMGROOT/component/clear.gif" width="$k1Sinner_spacing" height="1" alt="" border="0">
  </td>
""";
   print_my_entries($p, $title);
"""
  <td width="$k1Sinner_spacing" valign="top">
   <img src="$*PALIMGROOT/component/clear.gif" width="$k1Sinner_spacing" height="1" alt="" border="0">
  </td>
""";

# Right component column
# If comp_state is set to "right" it will print the standard components
# If comp_state is set to "left" it will print the custom components
# If comp_state is set to something other than "left" or "right" it won't print any components

# Don't screw with this unless you know what you are doing
if($*comp_state == "right") {
  print_my_components($p);
} else {
  if($*comp_state != "none") {
"""
<td border="0" cellpadding="0" cellspacing="0">
<table  width="183" border="0" cellpadding="0" cellspacing="0">
""";

# This starts the playing field for right side custom components

print_comp_header("right side header 1");
"""
right side text 1
""";
print_comp_footer();

print_comp_header("right side header 2");
"""
right side text 2
""";
print_comp_footer();

# This ends the playing field for right side custom components

"""
</td>
</tr>
</table>
</td>
""";
  }
}

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

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

  # End the body section and end the html document

  """
  </body>
  </html>
  """;
}
_me 4/16/2006

How to customize the calendar page layout?

See my calendar page. It only displays two months on a row before dropping to the next row, which puts a LOT of empty space on my screen (or any screen with a large resolution). So I want as many months to fit on the page as possible.

There's a fix. Instead of using table cells to wrap each month, I want to wrap them each in a fixed-width DIV floated to the left, so they only wrap to the next line according to the width of the user's window. An example of this effect is at crash.neotope.com/calendar.htm. Go there and shrink the window as you see fit and watch the boxes wrap to the next line as necessary.

I want my calendar page to do this, but I can't find any tutorial on how to edit the layout of the YearPage, if that's even what I need to do, so I don't know exactly what variables to use. PrintMonth? I'm not entirely sure...

I also don't know if I need to post this to a Component community or a general S2 community. Any help is appreciated!
Believe In Love

Stupid Question Warning

I can't seem to find any mention of adding a button/link under the component boxes in the tutorials.

Am I not looking in the right part of the tutorials? Or using the wrong term? Could someone please shove me in the right direction?

Thanks.

~edit~
I was hoping for this ~>

I'm out luck, right? Only took me all day and way too much caffeine to figure that out. * sigh *

Thank you, ninjamonkeyspy, for the cool code and for not setting me on fire. I'm sorry I didn't/couldn't make myself clearer.
  • Current Mood
    weird weird
Six-eyed Blind Monsters

(no subject)

A week ago I was using the delete entry code without any problems. I changed something in my code and started getting this error when I'd try to use it to delete an entry:

One or more errors occurred processing your request. Please go back, correct the necessary information, and submit your data again.

   * Invalid form submission. Please refresh and try again.


I reworked the code of my journal (I was having other problems.) and completely re-entered the delete code, but I am still getting the same error. I've tried checking it against the code for LJ's edit entry page and it looks to me like it's okay, but I just don't know enough about forms to know if I'm missing something or not.

Does anyone know what's going on and how I can fix it?

My S2 Codes
yuffie - spaces

(no subject)

This is probbaly an other dumb question. if so i apologize in advance. But is there any way to make the page summary only display on recent page? when it displays on friends view it stretches the whole layout out.
[Loki] Suited

(no subject)

I tried to do square components. Everything worked out fine except that my title bar goes completely across the page instead of the size I had set it to before. The piece of code that changes the width is still in there, so I'm baffled, but then again I'm talking out of my ass. Can someone look at my code and show me where I fucked up?
  • Current Mood
    confused confused
[Starlee] My star sent from heaven

(no subject)

How do I get the days of the week for be bigger then the rest of my date? I want it like anesthezea

I have no idea how to do it, I'm really new to this so if some one could just comment with the code on exactly how to do it that would be great. :)

Thank you. <3
Diamonds

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";
 

Collapse )

Mandy

(no subject)

I know this has been asked before so i'm sorry. But i can't find where i last seen it.

Whats the code for defining the corner color? And where exactly do you place it?

(no subject)

The tutorials used to have the link to get a header and now it's gone. I've looked in the memories and that code is not working for me. Can someone send me the link... please?