?

Log in

No account? Create an account

Previous Entry | Next Entry

magically disappearing skiplinks

  • Nov. 16th, 2007 at 12:54 AM
I recently started using Expressive (thefulcrum's Mixit code, here) and no problems except the skiplinks on my friends page have suddenly disappeared.

The only thing I added to the code today was this:
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://wild-hunt.org/visual/layout/user_suit.png",
                         "community"     => "http://wild-hunt.org/visual/layout/user_group.png",
                         "syndicated"    => "http://wild-hunt.org/visual/layout/user_rss.png",
                         "news"          => "http://wild-hunt.org/visual/layoutuser_news.png",
                         "identity"      => "http://wild-hunt.org/visual/layout/user_openid.png",
                         "sponcomm"      => "http://wild-hunt.org/visual/layout/user_sponsored.png",
                        };

# 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"    => "14",
                           "community"   => "14",
                           "syndicated"  => "14",
                           "news"        => "14",
                           "identity"    => "14",
                           "sponcomm"    => "14",
                          };

# 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"   => "14",
                            "community"  => "14",
                            "syndicated" => "14",
                            "news"       => "14",
                            "identity"   => "14",
                            "sponcomm"   => "14",
                           };

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 !important;
}
""";

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

}
...and I don't think that's the problem.


My layer should be viewable here [#9609957]. It's probably something simple but I've been staring at this for hours, eek, halp. D:

Thanks!

Comments

( 4 comments — Leave a comment )
av8rmike
Nov. 16th, 2007 01:29 pm (UTC)
No, it's not the print_custom_head function. You're overriding FriendsPage::print_body() completely and not printing the skiplinks there.
moveablehistory
Nov. 16th, 2007 01:33 pm (UTC)
Ack. It's weird, because it printed the skiplinks fine after I included that code. But I can just copy the code from the base Expressive and it should work, right?
av8rmike
Nov. 16th, 2007 01:54 pm (UTC)
There is no separate handler in the Expressive code for FriendsPage::print_body, because FriendsPage is really just an extension of RecentPage. So the layout code takes advantage of this inheritance by using one function (RecentPage::print_body) to print both pages.

Confusing explanations aside, I'd recommend a slight modification of the instructions I gave here (which I see you already found):
  • delete your current FriendsPage function
  • copy in the existing RecentPage::print_body function
  • add in the var string killfile_list = ... line defining your kill list
  • somewhere near the top
  • add the if( not $killfile_list ... section
  • to conditionally print entries
It won't have any effect on your own RecentPage (unless, of course, you put yourself on your own kill list ;) ).
moveablehistory
Nov. 16th, 2007 03:56 pm (UTC)
That worked - thank you so much for helping me out. :))
( 4 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars