View Full Version : Is there a way to not give breaks in news?
big123
11-19-2005, 08:00 PM
Firstly, THANK YOU very much for this script. I have looked everywhere for this exact script and I am surely glad I found you :D
I just wanted to know if there was any way not to give "<br>" s in the post text where my news is displayed? I know the news is getting fetched by the forum posts and it is automatic when you post, but it looks funny where my news is displayed with the <br> s that are caused when posting in the forum.
So my question is, if someone makes a post in my forum and it has all kinds of breaks in it, is there a way to not inlude these breaks where my news is displayed from the posts. I hope this makes sense.
Much appreciated if you can help me out :)
Patrick
11-19-2005, 11:39 PM
I am not exactly sure what your situation is (if you posted a URL it would sure help in visualizing it ;)).
Most people want the format of the post to be preserved ;). Currently the script is capable of correcting for XML purposes (converting <br> -> <br />) so it would be easy to strip out breaks in a similar manner by modifying some code.
However, could you please provide some more insight into WHY you need this? If you do not want to post the URL publicly you can PM me the URL.
big123
11-20-2005, 12:44 AM
Thanks for responding :) You can look at where I have displayed my news from posts from my forum at www.sportscapperisland.com at the bottom of the page. The last news article has a break. By the time you read this I might have fixed it myself, but probably not.
Thanks if you have a way. Of course I could just not have any breaks in my posts but that would look dumb too. So I guess it stinks either way :( .
Maybe I am being a little too picky lol.
big123
11-20-2005, 01:12 AM
Also, is there a way to set the Character Limit in the post text to put "...read on" after the last word rather than right in the middle of the word? I think Vbulletin does this for post titles on forum home. If you set the Char limit to 250 say, it would only go to the last full word up to 250.
Thanks. :)
Patrick
11-20-2005, 12:43 PM
I still do not see what you are referring to with the line breaks problem.
As for the character limit, I have planned on upgrading its functionality for quite some time. I am going to try to get a release out soon with new functionality including better character limit feature.
I will try to post an update to the feature here as soon as I get it working.
Thank you.
Patrick
11-20-2005, 01:25 PM
Ok, I have update the character limit logic to recognize word boundaries. Just upload the attached file into /forum-news/classes/ folder (to replace the old display.php).
(Right Click >> Save As... to download).
big123
11-21-2005, 04:18 PM
Thanks alot for the display.php upgrade file :) It works like a charm.
Referring to the line breaks. It's not really a line break problem, just something I wanted to know if you had some way to do away with the breaks that are in forum post when displaying the news text. When I display the news text from the forum, it shows it exactly how it is in the post, breaks and all. When I am using character limits to display the news and not the whole article, it displays a little funny
In the Forum, I would post an article like normal
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
When displaying this news on a different page with Char limit it will come up some times like this
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah...read more
I just wanted to know if there was a way to display the news all in one paragraph even though there is breaks in the forum posts.
In the Forum say I post :
Blah
Blah
Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
What I am trying to achieve is to displayed the news from this post like this :
blah blah blah blah blah blah blah blah blah blah blah blah blah.....read more
Breaks in the forum like normal, but all in one paragraph in displaying the news from the forum with character limit.
Hope you undertsand, if there is something that can be done, it would be much appreciated :)
Patrick
11-21-2005, 05:30 PM
Oh, I see.
Well, this is obviously NOT a popular request and as such I can't incorporate it as a major feature.
However, you can modify the script yourself to have it work. You are using vBulletin 3.x, which by default doesn't even have <br> in its posts (instead, it has new lines which are converted upon display).
Thus, it is easiest just to stop the conversion ;) :
Open /forum-news/classes/sources/Forum/vBulletin_3.php in a text editor and find the following (on line 160):
$text = nl2br($text);
and simply remove that line. It is that line that converts the new lines (\n) to html breaks (<br>).
big123
11-21-2005, 06:02 PM
THANKS A TON :) It did exactly what I wanted. Also, the display.php file was an awesome upgrade too. It is so much cleaner now!!
This the best forum script out there, I have used alot of them and this one takes the cake by far.
GREAT JOB!!! and Thank You very much for everything!!!
Powered by vBulletin™ Version 4.0.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.