[theme] - [gradient strip] - [add a header/fix view links]

Oct 18, 2005 21:06

in response to bittersweet_art's s2styles post.

function Page::print_custom_head() {
# if recent/archive/friends/info/5th link/6th link/website, need 7th color
var Color gradient_7 = $*head_bgcolor->average($*page_bgcolor);
"""

""";
}

function Page::lay_print_header() {
var string k1Hheader_url = ""; # optional header url
var string k1Hheader_alt = ""; # optional header alt
var int k1Hheader_width = 0; # optional header width
var int k1Hheader_height = 0; # optional header height

if($k1Hheader_url != "") {
# if we've got dimensions set up above, let's put 'em together
var string k1Hheader_dims = "";
if($k1Hheader_width) {
$k1Hheader_dims = $k1Hheader_dims + " width=\"$k1Hheader_width\"";
}
if($k1Hheader_height) {
$k1Hheader_dims = $k1Hheader_dims + " height=\"$k1Hheader_height\"";
}
# print header image

"""



""";
}

var string block_size;
if ($*head_size == "small") {
$block_size = "50px";
} elseif ($*head_size == "medium") {
$block_size = "75px";
} else {
$block_size = "100px";
}

var string title = $.global_title;
var string subtitle = $.global_subtitle;
var string view_title = $this->view_title() != "" ? $this->view_title() : " ";

var string{} view_url = { # make hash of urls
"recent" => get_url($.journal, "recent"),
"friends" => get_url($.journal, "friends"),
"archive" => get_url($.journal, "archive"),
"userinfo" => get_url($.journal, "userinfo"),
"tags" => get_url($.journal, "recent") + "tag",
"userpics" => "$*SITEROOT/allpics.bml?user=$.journal.username",
"memories" => "$*SITEROOT/tools/memories.bml?user=$.journal.username",
"todo" => "$*SITEROOT/todo/?user=$.journal.username",
"update" => "$*SITEROOT/update.bml",
"website" => $.journal.website_url,
"scrapbook" => "http://pics.livejournal.com/$.journal.username/",
};

var string{} view_text = { # make hash of texts
"recent" => lang_viewname("recent"),
"friends" => lang_viewname("friends"),
"archive" => lang_viewname("archive"),
"userinfo" => lang_viewname("userinfo"),
"tags" => lang_viewname("tags"),
"userpics" => "User Pictures",
"memories" => "Memories",
"todo" => "To-Do List",
"update" => "Update Journal",
"website" => $.journal.website_name != "" ? $.journal.website_name : $*text_website_default_name,
"scrapbook" => "ScrapBook",
};

# copy views order
var string[] views_order = $.views_order;

# add fifth block link
$views_order[size($views_order)] = $*fifth_block_link;

# add sixth block link, if != fifth block link
$views_order[size($views_order)] = $*sixth_block_link != $*fifth_block_link ? $*sixth_block_link : "";

# add website block link, if != fifth block link and != sixth block link
$views_order[size($views_order)] = ($*fifth_block_link != "website") and ($*sixth_block_link != "website") and $view_url{"website"} != "" ? "website" : "";

# create var for block id number
var int id_num = 1;

# open header

"""

""";
# are we showing the title?
if ($*show_title == true) {
# if we are, show title
"""

$title""";
# do we have a subtitle?
if($subtitle != "") {
# if we do, show it
"""
$subtitle""";
}
# close title

"""""";
}

# open view links table
"""

""";
# iterate thru each one
# increment block id number
foreach var string v ($views_order) {
if($view_url{$v} != "") {
"""

""";
$id_num++;
}
}
# close view links table
"""

""";

# close header

"""

""";
}

class page, layout gradient strip, function lay_print_header, function print_custom_head

Previous post Next post
Up