Lyriki:Community Portal

From Lyriki
Jump to navigation Jump to search

This is a sugestion to the admins of this site:

I'd like to make a suggestion for a third way to enter music lyrics. You can create a simple extension to mediawiki that will handle all of the line breaks.

For example this is a sample script I wrote. If you to save it as lyrics.php under the Extensions folder

# lyrics extension by bailey
$wgExtensionFunctions[] = "lyrics";

function lyrics() {
   global $wgParser;
   $wgParser->setHook( "lyrics", "parse" );
# The callback function for converting the input text to HTML output
function parse( $input, $argv ) {
   return preg_replace("[\r\n|\n]", "<br />", $input);

and then add the following to the end of your LocalSetting.php


You would then be able to type in all of your lyrics with just one tag

It's four in the morning, the end of December
I'm writing you now just to see if you're better
New York is cold, but I like where I'm living
There's music on Clinton Street all through the evening.

and the breaks would be automatically added. Of course with this technique you couldn't add wikilinks to the middle of songs but I think the trade off is worth it compared to having to sit there and add either a space at the begining or a br tag at the end.

Thanks for the above suggestion

Just a quick thank you to whoever made that suggestion, I believe it was Bailey :)... I read again and it has Bailey's name in the script, I'm so smurt. x.X;;;

Nanenj 15:48, 22 December 2005 (PST)

Ban User

An anonymous user with the IP Address added some silent spam to the site. I deleted it, but have a look in the history pages and you'll see it. -268299