[square] components on both sides

Mar 09, 2005 11:39

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



















""";
var string k1Ssq_nav_bar_close = """





""";
var string k1Sro_nav_bar_open = """








""";
var string k1Sro_nav_bar_close = """








""";

# 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();
"""

""";
$p->print_head();
$p->print_stylesheets();
"""
$title

""";

# Start the body section of the html document which controls the visible parts of the page.
"""""";

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

if($k1Sheader_url != "") {
"""

""";
}

if($k1Swidth != "") {
"""""";
}

# 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 tag above.

if (not $*comp_navbar or $*comp_state=="none") {
if ($k1Sroundnavbar) {
print $k1Sro_nav_bar_open;
} else {
print $k1Ssq_nav_bar_open;
}
"""
""";
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 """ $view_text{$v}""";
}

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

# print """ memories""";
# print """yahoo!""";

if ($p.journal.website_url != "") {
print """ $p.journal.website_name""";
}
$p->lay_viewspec_nav(); # prints previous / next links including arrow images

"""

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

""";
}

# Start the table which lays out the components and main area in side-by-side layout
"""



""";

# 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") {
"""

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

"""

""";
}
}

"""



""";
print_my_entries($p, $title);
"""



""";

# 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") {
"""

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

"""

""";
}
}

# Finish off the table for the body
"""



""";

if($k1Swidth != "") {
"""""";
}

# End the body section and end the html document

"""

""";
}

user: kunzite1, admin: deprecated

Previous post Next post
Up