Firstly, THANK YOU very much for this script. I have looked everywhere for this exact script and I am surely glad I found you
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.
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.
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 .
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.
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.
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).
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
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):
Code:
$text = nl2br($text);
and simply remove that line. It is that line that converts the new lines (\n) to html breaks (<br>).