Syntax error with icon replacement?
I'm sure this is just a syntax error, but....when I add the code for the custom user/comm icons, the compiler gives me an error. Both the code and the error behind the cut.
layerinfo "type" = "theme";
layerinfo "name" = "Rounded Custom";
layerinfo "source_viewable" = 1;
function Page::print_custom_head() {
# create an order of account types
var string[] types_order = ["personal", "community", "syndicated", "news", "identity", "sponcomm"];
# original URLs used by livejournal
var string{} old_urls = {
"personal" => "http://stat.livejournal.com/img/userinfo.gif",
"community" => "http://stat.livejournal.com/img/community.gif",
"syndicated" => "http://stat.livejournal.com/img/syndicated.gif",
"news" => "http://stat.livejournal.com/img/newsinfo.gif",
"identity" => "http://stat.livejournal.com/img/openid-profile.gif",
"sponcomm" => "http://stat.livejournal.com/img/sponcomm.gif",
};
# original widths used by livejournal
var string{} old_widths = {
"personal" => "17",
"community" => "16",
"syndicated" => "16",
"news" => "16",
"identity" => "16",
"sponcomm" => "16",
};
# original heights used by livejournal
var string{} old_heights = {
"personal" => "17",
"community" => "16",
"syndicated" => "16",
"news" => "16",
"identity" => "16",
"sponcomm" => "16",
};
# new URLs to your images
# if you don't have an image for a specific type, leave it blank to use the original
var string{} new_urls = {
"personal" => "http://pics.livejournal.com/abigeiru/pic/0007bayf",
"community" => "http://pics.livejournal.com/abigeiru/pic/0007axee",
"syndicated" => "http://pics.livejournal.com/kunzite1/pic/000x6cww.gif",
"news" => "http://pics.livejournal.com/kunzite1/pic/000x5pdc.gif",
"identity" => "http://pics.livejournal.com/kunzite1/pic/0026r895.gif",
"sponcomm" => "http://pics.livejournal.com/kunzite1/pic/002asx0e.gif",
};
# new widths for your images
# if you don't have an image for a specific type, leave it blank to use the original
var string{} new_widths = {
"personal" => "15",
"community" => "15",
"syndicated" => "15",
"news" => "17",
"identity" => "16",
"sponcomm" => "16",
};
# new heights for your images
# if you don't have an image for a specific type, leave it blank to use the original
var string{} new_heights = {
"personal" => "15",
"community" => "10",
"syndicated" => "18",
"news" => "16",
"identity" => "16",
"sponcomm" => "16",
};
var string ie_url = $new_urls{"personal"};
var string ie_width = $new_widths{"personal"};
var string ie_height = $new_heights{"personal"};
"""
<style type="text/css">
.ljuser img {
width: 0;
height: 0;
background-repeat: no-repeat;
/* so that IE users will still see an image */
background-image: url($ie_url);
padding: ${ie_height}px ${ie_width}px 0 0;
}
""";
foreach var string type ($types_order) {
var string old_url = $old_urls{$type};
var string new_url = $new_urls{$type} != "" ? $new_urls{$type} : $old_url;
var string new_width = $new_widths{$type} != "" ? $new_widths{$type} : $old_widths{$type};
var string new_height = $new_heights{$type} != "" ? $new_heights{$type} : $old_heights{$type};
"""
.ljuser img[src="$old_url"] {
background-image: url($new_url);
padding: ${new_height}px ${new_width}px 0 0;
}
""";
}
"""
</style>
""";
}
"""
<style media="screen" type="text/css">
/* Tighter lists */
ul.tagList {padding-left: 0; margin-left: 0; list-style: none; line-height: normal;}
li.tagItem {padding-left: 15px; list-style: none; line-height: normal;}
S2 Compiler Output at Wed Feb 14 02:22:51 2007
Error compiling layer:
Compile error: line 106, column 1: Unknown token encountered while parsing layer: [TokenPunct] = }
S2::Layer, S2/Layer.pm, 67
S2::Compiler, S2/Compiler.pm, 27
Context
102: </style>
103: """;
104:
105: }
106: }
107:
108: """
109:
110:
