Guest Posted September 12, 2003 Share Posted September 12, 2003 Here is what I did in regards to the line break issue. The issue that I had was in regards to how product_info.php displayed the description of the item. I would not display any of the line breaks. The suggestions that I have received were install the WYSIWYG contribution but I have made to many mods to the store so that will not work and its to time consuming to install. Here is the solution that I came up with. I created a function that converts n to a <BR> tag. <?php function nl2p($text) { $text = ereg_replace("n", "<br>", $text); return $text; } ?> and inserted that at about line 115 just above this call ($product_info_values['products_description' I then added nlp2 just before it so the desc now looks like this <?php echo nl2p ($product_info_values['products_description']); ?> Works like a charm and I thought that I'd pass it along. --Gary Link to comment Share on other sites More sharing options...
burt Posted September 12, 2003 Share Posted September 12, 2003 Good work. Take a look at www.php.net/nl2br (which is basically an inbuilt php function that does exactly what your function does). hth Link to comment Share on other sites More sharing options...
Guest Posted September 13, 2003 Share Posted September 13, 2003 If it was so easy then how come no one else posted it? And why when I asked for help regarding this everyone directed me to install a wysiwyg contrib? Link to comment Share on other sites More sharing options...
burt Posted September 13, 2003 Share Posted September 13, 2003 Maybe your question was not understood the first time you asked. Maybe the person who answered knows little. Maybe maybe maybe. Does it matter ? Link to comment Share on other sites More sharing options...
wizardsandwars Posted September 13, 2003 Share Posted September 13, 2003 maybe, lol. I also think this is a great little tip. Extremly usefull. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Guest Posted January 9, 2004 Share Posted January 9, 2004 Hi, Great Tip, works a treat. Dereck Link to comment Share on other sites More sharing options...
sesam Posted February 6, 2004 Share Posted February 6, 2004 Could anyone post an screenshot? :unsure: Link to comment Share on other sites More sharing options...
Cerberus Posted February 9, 2004 Share Posted February 9, 2004 Why not use the built in PHP function nl2br ? :huh: Just use: <?php echo nl2br ($product_info_values['products_description']); ?> No need for new functions then ;) p.s. Burt - only read your post after I posted this - you've already mentioned it I see - sorry. Link to comment Share on other sites More sharing options...
Woody_CRF Posted March 5, 2004 Share Posted March 5, 2004 Where exactly do you put that code? Sorry n00b question... Just another Squirrel trying to get a nut :D Link to comment Share on other sites More sharing options...
Woody_CRF Posted March 5, 2004 Share Posted March 5, 2004 Never mind... I found it.. duh! Just another Squirrel trying to get a nut :D Link to comment Share on other sites More sharing options...
Guest Posted April 3, 2004 Share Posted April 3, 2004 I could not find $product_info_values but only $product_info in the product_info.php am i missing something here? Link to comment Share on other sites More sharing options...
♥ecartz Posted April 4, 2004 Share Posted April 4, 2004 I could not find $product_info_values but only $product_info in the product_info.phpDifferent versions use different names for the variables. In particular, the array $product_info_values was renamed $product_info Hth, Matt Always back up before making changes. Link to comment Share on other sites More sharing options...
Marlene Posted August 2, 2004 Share Posted August 2, 2004 You can use the html tag <P> right in your description when you are typing the description into the admin tool?? The tag will not show up in your description. If it does put the closing tag on it.</P>. I think that accomplishes the same goal??? Maybe I read something wrong. Link to comment Share on other sites More sharing options...
mrsC2003 Posted August 8, 2004 Share Posted August 8, 2004 Hum, I just use keytext with HTML built in the lines with the stuff you hate to type. Good old HTML.....what ever happen to it? :unsure: I live in my own little world. But it's OK. They know me here. Link to comment Share on other sites More sharing options...
Naughtica Posted September 10, 2004 Share Posted September 10, 2004 The HTML tag works great..... good idea! Link to comment Share on other sites More sharing options...
rizk Posted June 8, 2006 Share Posted June 8, 2006 I was having the same problem, until I replaced </br> with <br>. Tested in firefox and IE5, seems to work fine. :rolleyes: :o Link to comment Share on other sites More sharing options...
Guest Posted August 10, 2006 Share Posted August 10, 2006 I was having the same problem, until I replaced </br> with <br>. Tested in firefox and IE5, seems to work fine. The correct usage is actually <br /> if you want to be xhtml compliant Link to comment Share on other sites More sharing options...
shaytaan Posted August 10, 2006 Share Posted August 10, 2006 I use Easypopulate for inserting products, and I copy product desc. from a text file which has lines and paragraphs. Will this code make a <b/>? ?,???`???,?? God must love stupid people, he made so many ??,???`???,? Link to comment Share on other sites More sharing options...
snuggtopz Posted October 11, 2011 Share Posted October 11, 2011 <p> works for me Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.