Skip to Content
It is currently July 15th, 2018, 8:30 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: October 20th, 2008, 8:59 pm 
Offline
Experienced User
Experienced User

Joined: October 12th, 2008, 2:10 pm
Posts: 283
I've done a search and there is no more "How To Dress Up Lyrics" (or whatever it was called) code for basically having a <br> tag for each line of a lyric. My example is (PHP):

<p align="left"><font color="midnightblue" size="1"><b><? echo $song["lyrics"]; ?></b></font>

I was also hoping for a pulldown type menu similar to festerhead's + sign if possible. Thanks!


Top
 Profile  
Reply with quote  
PostPosted: October 20th, 2008, 11:26 pm 
Offline
Senior User
Senior User

Joined: March 11th, 2003, 4:51 am
Posts: 235
Location: Buffalo, NY
I suggest using BBcode for this. Bbcode is the mark up tags you use in forums like this one.

What you do is choose a set of appriopriate and add them to your lyrics (and comment section as well). You then have the php, asp, or .Net code parse the field looking for those code fragments and replace teh bbcode with the appropriate html attribute or style sheen entry.

This is how all forum software write their pages. If you need assistance, browse through the code for your favorate forum, and note the conversion lines.


Top
 Profile  
Reply with quote  
PostPosted: October 21st, 2008, 8:13 am 
Offline
Experienced User
Experienced User

Joined: October 12th, 2008, 2:10 pm
Posts: 283
Thanks for the info. When I find a lyric, I look at the source code and copy. It has the line breaks in there already, so it works just as good.


Top
 Profile  
Reply with quote  
PostPosted: October 22nd, 2008, 6:54 am 
Offline
Junior User
Junior User

Joined: October 4th, 2008, 12:35 pm
Posts: 39
Location: Kaufbeuren, Germany
I guess you are talking about samPHPweb?

I use the function Text2Html from common/form.php for that:
Code:
function Text2Html($txt)
{
 return str_replace("\n","\n<br>",$txt);
}


and in songinfo.php something like
Code:
<? if(!empty($song["lyrics"])){?>   

… <? echo Text2Html($song["lyrics"]); ?> …

<?}?>


Hope that helps.

_________________
Moonbase: The Problem Solver
I will not give any support for unlicensed or pirated software.


Top
 Profile  
Reply with quote  
PostPosted: October 22nd, 2008, 11:41 am 
Offline
Experienced User
Experienced User

Joined: October 12th, 2008, 2:10 pm
Posts: 283
Thanks moon...I will try that when I get home tonight.

The way I stated (look at the source code) is very tedious.


Top
 Profile  
Reply with quote  
PostPosted: October 22nd, 2008, 9:18 pm 
Offline
Alumni
Alumni

Joined: March 11th, 2003, 1:34 pm
Posts: 9959
Location: Maui, HI
A PHP built-in function for new lines to breaks is nl2br.
http://us3.php.net/nl2br

_________________
- Steve Kunitzer
- SVS (Spacial Volunteer Support) / Forum Administrator

Image
Image


Top
 Profile  
Reply with quote  
PostPosted: October 23rd, 2008, 9:43 am 
Offline
Junior User
Junior User

Joined: October 4th, 2008, 12:35 pm
Posts: 39
Location: Kaufbeuren, Germany
I stand optimized :-) [Thanks for the hint, Steve!]

_________________
Moonbase: The Problem Solver
I will not give any support for unlicensed or pirated software.


Top
 Profile  
Reply with quote  
PostPosted: October 23rd, 2008, 10:29 am 
Offline
Experienced User
Experienced User

Joined: October 12th, 2008, 2:10 pm
Posts: 283
Thanks Steve! That was exactly what I was looking for.


Top
 Profile  
Reply with quote  
PostPosted: October 23rd, 2008, 2:42 pm 
Offline
Experienced User
Experienced User

Joined: October 12th, 2008, 2:10 pm
Posts: 283
I'm a little lost. I don't know where to pt this code in the following:

<? echo $mainsong["lyrics"]; ?>


Top
 Profile  
Reply with quote  
PostPosted: October 23rd, 2008, 3:57 pm 
Offline
Alumni
Alumni

Joined: March 11th, 2003, 1:34 pm
Posts: 9959
Location: Maui, HI
Try:
Code:
<? echo nl2br( $mainsong["lyrics"] ); ?>


The XHTML capability (on by default) is nice.

_________________
- Steve Kunitzer
- SVS (Spacial Volunteer Support) / Forum Administrator

Image
Image


Top
 Profile  
Reply with quote  
PostPosted: October 23rd, 2008, 4:39 pm 
Offline
Experienced User
Experienced User

Joined: October 12th, 2008, 2:10 pm
Posts: 283
Thank you festerhead...100% working


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group