OK guys, I managed to get something to work.
Don't be too hard on me, I'm a newbie in coding!
I replaced this part:
Code: Select all
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h1>" & song.Title & "</h1>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strSongTitle & strArtistName & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub
with this:
Code: Select all
Dim origYear, albumYear
If song.Year>0 Then
albumYear= " (" & song.Year & ") "
Else
albumYear= ""
End If
If song.OriginalYear>0 Then
origYear= " (" & song.OriginalYear & ")"
Else
origYear= albumYear
End If
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
strSongTitle="<a target=""_New"" href="""& FndTitle(song.Title) &""">"& strSongTitle &"</a>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strArtistName="<a target=""_New"" href="""& FndArtist(song.ArtistName) &""">"& strArtistName &"</a>"
strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
strAlbumName="<a target=""_New"" href="""& FndAlbum(song.AlbumName) &""">"& strAlbumName &"</a>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub
Function FndArtist(cString)
FndArtist="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=1&sql="&cString&"&btnG"
End Function
Function FndAlbum(cString)
FndAlbum="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=2&sql="&cString&"&btnG"
End Function
Function FndTitle(cString)
FndTitle="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=3&sql="&cString&"&btnG"
End Function
I also modified the lyrics_panel.css file to:
Code: Select all
body{font:8pt Verdana, Arial, sans serif;margin:0;padding:17px 14px;background:#bed7f4 url('lyrics_panel_bg.gif') no-repeat}
plaintext{font:8pt Verdana, Arial, sans serif;margin:0;padding:15px 5px}
h1{margin:5px;clear:both;font-size:150%;font-style:italic;color:#222}
h2{margin:5px;clear:both;font-size:130%;font-weight:normal;color:#222;padding:0 0 12px 0}
h3{margin:5px;clear:both;font-size:180%;font-weight:bolder;color:#222}
Like I said, this seems to be working for me but I'm not 100% happy.
Could somebody help me with the following questions?
1. How can I concatenate the functions FndArtist, FndAlbum and FndTitle into one? They're practically identical!
2. Is there a way to prevent the links from being underlined? Just nitpicking aesthetics...
3. This code opens a IE window even though I have Firefox installed and configured as my default internet browser. Can I make these links open in Firefox (or is there even a way to show that content within the lyrics panel?)
Thanks!
OK guys, I managed to get something to work.
Don't be too hard on me, I'm a newbie in coding! :o
I replaced this part:
[code] strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h1>" & song.Title & "</h1>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strSongTitle & strArtistName & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub [/code]
with this:
[code] Dim origYear, albumYear
If song.Year>0 Then
albumYear= " (" & song.Year & ") "
Else
albumYear= ""
End If
If song.OriginalYear>0 Then
origYear= " (" & song.OriginalYear & ")"
Else
origYear= albumYear
End If
strHeaderBegin = "<html><head><link href=""lyrics_panel.css"" rel=""stylesheet"" type=""text/css""></head><body><div id=""bg"">"
strSongTitle = "<h3>" & song.Title & origYear & "</h3>"
strSongTitle="<a target=""_New"" href="""& FndTitle(song.Title) &""">"& strSongTitle &"</a>"
strArtistName = "<h2>" & song.ArtistName & "</h2>"
strArtistName="<a target=""_New"" href="""& FndArtist(song.ArtistName) &""">"& strArtistName &"</a>"
strAlbumName = "<h1>" & song.AlbumName & albumYear & "</h1>"
strAlbumName="<a target=""_New"" href="""& FndAlbum(song.AlbumName) &""">"& strAlbumName &"</a>"
strHeaderEnd = "<plaintext>"
strCompleteLyrics = strHeaderBegin & strAlbumName & strArtistName & strSongTitle & strHeaderEnd & strLyrics
Set tmpFile = sdb.tools.filesystem.CreateTextFile (strPath, true)
tmpFile.WriteLine strCompleteLyrics
End Sub
Function FndArtist(cString)
FndArtist="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=1&sql="&cString&"&btnG"
End Function
Function FndAlbum(cString)
FndAlbum="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=2&sql="&cString&"&btnG"
End Function
Function FndTitle(cString)
FndTitle="http://allmusic.com/cg/amg.dll?P=amg&x=34&y=10&opt1=3&sql="&cString&"&btnG"
End Function [/code]
I also modified the lyrics_panel.css file to:
[code]body{font:8pt Verdana, Arial, sans serif;margin:0;padding:17px 14px;background:#bed7f4 url('lyrics_panel_bg.gif') no-repeat}
plaintext{font:8pt Verdana, Arial, sans serif;margin:0;padding:15px 5px}
h1{margin:5px;clear:both;font-size:150%;font-style:italic;color:#222}
h2{margin:5px;clear:both;font-size:130%;font-weight:normal;color:#222;padding:0 0 12px 0}
h3{margin:5px;clear:both;font-size:180%;font-weight:bolder;color:#222}[/code]
Like I said, this seems to be working for me but I'm not 100% happy.
Could somebody help me with the following questions?
1. How can I concatenate the functions FndArtist, FndAlbum and FndTitle into one? They're practically identical!
2. Is there a way to prevent the links from being underlined? Just nitpicking aesthetics...
3. This code opens a IE window even though I have Firefox installed and configured as my default internet browser. Can I make these links open in Firefox (or is there even a way to show that content within the lyrics panel?)
Thanks!