On Sat, Sep 13, 2008 at 8:52 AM, Andreas Rindler mediawiki@jenandi.com wrote:
Hi everyone, we use the Social Profile extension (www.mediawiki.org/wiki/Extension:SocialProfile). Regular Mediawiki behaviour is to make a hyperlink red when there is no article yet. As SP hijacks the regular User:somename article and replaces it with the social profile page, the link to the user's page always appears in red, even when the user has completed their profile.
Where can I change the CSS to fix this? In Monobook, main.css contains the element a.new with red color. How do I change the skin to not add class="new" to "a href" if the link is to a User:somename article?
You could use CSS for this, but it would be better not to generate the class at all. You would most likely want to hook into the LinkEnd hook (if using 1.14) with some function like this:
function myLinkFixer( $skin, $target, $options, &$text, &$attribs, &$ret ) { if( $target->getNamespace() == NS_USER && isset( $attribs['class'] ) ) { $classes = explode( ' ', $attribs['class'] ); $key = array_search( 'new', $classes ); if( $key !== false ) { unset( $classes[$key] ); $attribs['class'] = implode( ' ', $classes ); } } }
Untested, may not work. If you're using an earlier version, this hook won't be available. It might be simplest to just hack the file in this case, and make a note to use the hook when you upgrade.