PDA

View Full Version : Portal Software - A Better News Module Fix for vBadvanced CMPS 2.2.1


voteforbird
10-29-2006, 10:00 PM
vBadvanced (http://www.vbadvanced.com/) has released CMPS (http://www.vbadvanced.com/products.php?do=productinfo&p=4) 2.2.1 with a substandard fix to the News module bug that has plagued many vBulletin forums for months.

Volconvo.com (http://www.volconvo.com/) and developer Sillysoft (http://www.volconvo.com/cmps.php?page=newsmodulefix#sillysoft) are offering a free and better fix.


BACKGROUND

In version 2.2.0, the problem occurred when when the maximum characters variable was set at such a number that it precluded the display of closing BBCode tags. (thumb: news_verybad.png)

Version 2.2.1 "resolved" the issue by ending quoted material prematurely, effectively ignoring the actual maximum character value. (thumb: news_bad.png)

Volconvo.com (http://www.volconvo.com/) and developer Sillysoft (http://www.volconvo.com/cmps.php?page=newsmodulefix#sillysoft) have partnered to offer the following better fix for vBadvanced CMPS that respects your personal settings. (thumb: news_good.png)


INSTALLATION


Find this line in [forumdirectory]/modules/news.php: $news['message'] = substr($news['message'], 0, strrpos(substr($news['message'], 0, $mod_options['portal_news_maxchars']), ' ')); Replace with the following code:// START BUG FIX
// Provided by Volconvo.com and Sillysoft
// http://www.volconvo.com/cmps.php?page=newsmodulefix
// Original code:
// $news['message'] = substr($news['message'], 0, strrpos(substr($news['message'], 0, $mod_options['portal_news_maxchars']), ' '));

$rawdata = $news['pagetext'];
$newspart1 = substr($rawdata,0,$mod_options['portal_news_maxchars']);
$newsposition = strrpos($newspart1,' ');
$newspart1 = substr($newspart1,0,$newsposition);

$rawdata = $rawdata .'.';
$newspart2 = substr($rawdata,$newsposition,-1);

preg_match_all('#(\[(.*?)\])?.*?(\[\/(.*?)\])?#',$newspart2,$newspart2tags);
$numtags = count($newspart2tags[0]);
$tags = '';

for($i = 0; $i < $numtags; $i++)
{

$tags .= $newspart2tags[1][$i] . $newspart2tags[3][$i];

}

$shownews = $newspart1 .'...';
$news['message'] = $bbcode_parser->do_parse($shownews, $mod_options['portal_news_enablehtml'], $news['allowsmilie'], $mod_options['portal_news_enablevbcode'], $mod_options['portal_news_enablevbimage']);

// END BUG FIX

Click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=130384).

CHANGE LOG

11/6/06: Update to better handle images as provided here (https://vborg.vbsupport.ru/showpost.php?p=1111869&postcount=22).

CREDITS

This fix was developed by Sillysoft in partnership with Volconvo (http://www.volconvo.com).

You may contact Sillysoft at liquidchaoss (at) yahoo.com or via AIM at "Sillysoft".
The Volconvo administrator may be contacted here (http://www.volconvo.com/forums/sendmessage.php).

kall
10-30-2006, 05:26 PM
Just a note, vBACMPS is, and has always been, free.

voteforbird
10-30-2006, 05:29 PM
Right. I never said it wasn't… I didn't mean to imply that it wasn't by saying this was free, as well.

magnus
10-30-2006, 06:13 PM
I'm curious as to why you would have people modify the powered_by_vbulletin phrase when the fix in question affects vBadvanced. Such an edit would be displayed and viewable on all vBulletin powered pages.

As a side note, for those installing this -- I would recommend adding a rel="nofollow" tag to the links within the branding text, to prevent search engine crawling of those links.

eg.
+ the <a href="http://www.volconvo.com" rel="nofollow">Volconvo</a><a href="http://www.volconvo.com/cmps.php?page=newsmodulefix" rel="nofollow"> news module fix</a>

voteforbird
10-30-2006, 06:38 PM
I'm curious as to why you would have people modify the powered_by_vbulletin phrase when the fix in question affects vBadvanced. Such an edit would be displayed and viewable on all vBulletin powered pages.I didn't know there was a better place to add it. In my powered_by_vbulletin phrase, there's a vBadvanced notice there, as well. Is that one not global?

Why are you being so rude?

magnus
10-30-2006, 06:44 PM
I didn't know there was a better place to add it. In my powered_by_vbulletin phrase, there's a vBadvanced notice there, as well. Is that one not global?
vBadvanced in no way modifies the powered_by_vbulletin phrase. It utilizes it's own independant phrase, powered_by_vbadvanced_cmps, which is displayed on all pages generated by vBadvanced. If you have to modify any phrase, this would be the one.

Why are you being so rude?
I wasn't aware I was being rude. Would you care to elaborate?

cheesegrits
10-30-2006, 07:06 PM
There shouldn't be any updating of powered phrases, period. Asking for a "powered by" credit for one patch to one module in CMPS is ridiculous. That's like "third spear bearer on left" asking for equal credits with the lead actors in a movie.

Just my $0.02, your mileage may vary, one persons opinion, etc etc.

-- hugh

voteforbird
10-30-2006, 07:09 PM
I wasn't aware I was being rude. Would you care to elaborate?Your "I'm curious" comment and suggestion to add nofollow attributes insinuates that you think I'm trying to improve my search engine rankings. This is not the case.

There shouldn't be any updating of powered phrases, period. Asking for a "powered by" credit for one patch to one module in CMPS is ridiculous. That's like "third spear bearer on left" asking for equal credits with the lead actors in a movie.

Just my $0.02, your mileage may vary, one persons opinion, etc etc.

-- hughPoint taken. The instructions have been modified accordingly and the link is no longer required.

cheesegrits
10-30-2006, 07:15 PM
Point taken. The instructions have been modified accordingly and the link is no longer required.

You have regained my respect.

Thanks for the fix. I'll use it now. :)

-- hugh

magnus
10-30-2006, 07:27 PM
Your "I'm curious" comment and suggestion to add nofollow attributes insinuates that you think I'm trying to improve my search engine rankings. This is not the case.
My post was made to be informative and factual. Which it was. I didn't interject my opinion on the subject.

But since you opened the door:

As for the nofollow tags -- they should've been added to begin with as a common courtesy. What your actual intentions were is irrelevant. Adding such links is unethical and I simply provided the needed code to correct this 'oversight'. Nevermind the fact that the entire branding addition is completely unwarranted and obtrusive.

I'm also baffled how cheesegrits' post was met with enthusiasm while mine was met with tooth and nail.

bitHacker
10-30-2006, 07:45 PM
six month ago, i cam across an error, which made my page not validated due to
news module cutting HTML tags - http://www.vbadvanced.com/forum/showthread.php?p=91456#post91456

your solution fixed that problem too !!!!!!

one more thing...

add this:
$news['message'] .= ' '. construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']);
before
// END BUG FIX
to get a "[Read More]" link at the end of the post ;)

THANK YOU !!!! :D :D :D :D :D :D :D

p.s.
if only i could *click INSTALL* a million times :cool:

voteforbird
10-30-2006, 07:47 PM
Glad it helped! :)

Mine already does have a [READ MORE] link. Can anyone else confirm? Perhaps somehow I left this out of the fix instructions.

Paul M
10-30-2006, 09:03 PM
Please attach the modification as a (text) file.

You can keep it in the first post if you wish, but all modifications must be supplied in a downloadable form.

Thanks.

voteforbird
10-30-2006, 09:09 PM
Sorry about that. Done!

lolo?
10-31-2006, 03:20 AM
great works fine thanks for this fix

Mecho
10-31-2006, 08:47 AM
Hi .. do u think that u can add some code for resize Images ( not attach images ) in news M... ?

sorry if i ask in wrong section but i saw that u work on it thats why....

Tnx alot

voteforbird
10-31-2006, 01:33 PM
Sorry, that's not me, but you may be able to find your solution here: https://vborg.vbsupport.ru/showthread.php?t=127266

Mecho
10-31-2006, 02:40 PM
Tnx mate but this topic that u said i think is not for Vbadvanced . isnt it ?

i need resize image for vbadvanced . i was looking for it everywhere and i request it more that 5times in vbadvanced forum too . but ....

it will be great if some coder can make this mode for news moudle for vbadvanced coz it doest exist . Tnx alot . regards

Bad Bunny
10-31-2006, 03:26 PM
Just to clarify...does this fix work with vbadvanced 2.2.1 or 2.2.0, or both?

voteforbird
10-31-2006, 04:34 PM
Mecho,
It should work with vBadvanced with slight alteration. Please save that discussion for another thread, though.

Bad Bunny,
The line in 2.2.0 is slightly different. You can find it shortly under this:// Strip characters and add "read more"The fix will still work—in fact, it was originally created for version 2.2.0. I just assumed you all would have upgraded ;)

ComputerVitals
11-01-2006, 02:36 AM
Thanks for the added fix.

CBrown
11-06-2006, 03:55 PM
This works well, but one issue.

Fix this line:


$shownews = $newspart1 .'...' .$tags;

and replace with:

$shownews = $newspart1 .'...';


Otherwise a post with lots of images prints all the image tags in a row and stretches out the theme.....

voteforbird
11-06-2006, 04:41 PM
Thanks! Updated.

jellybeanz
11-08-2006, 12:23 PM
Hmm after applying the latest changes my news no longer parses bbcode.

voteforbird
11-08-2006, 01:38 PM
I don't believe that problem has occurred for me or anyone else. Can I get some confirmation on that?

jellybeanz
11-09-2006, 04:11 PM
Here are my before and after pics.

Tulsa
11-09-2006, 11:42 PM
I'll second that issue.

Inferno Dragon
12-22-2006, 03:33 AM
hey thanks for the hack, I was about to install it but the installation instructions in the .txt file is totally a mess check it out please!

Inferno Dragon
12-22-2006, 03:35 AM
Ok I installed it and I am having the same issue like jellybeanz i-e it's not parsing bbcode within news :\