×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me

TOPIC: Module doesn't limit comments

Module doesn't limit comments 14 years 9 months ago #8664

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
Hi
after update to 4 RC1 and 4.0.0alpha3 module doesn't limit comment anymore, it show entirely text. How to fix it?

Module doesn't limit comments 14 years 9 months ago #8665

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
go to components/com_comment/joscomment/comment.class.php and copy the content of the JOSC_ubbcode class and paste it here. I want to see how it looks.

Module doesn't limit comments 14 years 9 months ago #8666

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
class JOSC_ubbcode extends JOSC_support {
 
	var $_comment;
 
	var $_ubbcodeCount=1;
 
	var $_ubbcodeArray=array();
 
	var $_splitTag;
 
	var $_limittextTag;
 
	var $_TO='<';  /* for debug change */
 
	var $_TC='>';  /* for debug change */
 
 
 
	function __construct($value) {
 
		$this->_comment = $value;
 
	}
 
 
 
	function setMaxlength($word, $text, $line) {
 
		$this->_maxlength_word = $word;
 
		$this->_maxlength_line = $line;
 
		$this->_maxlength_text = $text;
 
	}
 
 
 
	function setParagraphHandling($value) {
 
		$this->paragraphHandling = $value;
 
	}
 
 
 
	function parseEmoticons($html) {
 
		foreach ($this->_emoticons as $ubb => $icon) {
 
			$html = str_replace($ubb, "<img src='" . $this->_emoticons_path . "/" . $icon . "' border='0' alt='".$ubb."' title='".$ubb."' class='postemoticon' />", $html);
 
		}
 
		return $html;
 
	}
 
 
 
	function code_unprotect($val) {
 
		$val = str_replace("{ : }", ":", $val);
 
		$val = str_replace("{ ; }", ";", $val);
 
		$val = str_replace("{ [ }", "[", $val);
 
		$val = str_replace("{ ] }", "]", $val);
 
		$val = str_replace(array("\n\r", "\r\n"), "\r", $val);
 
		$val = str_replace("\r", '&#13;', $val);
 
		return JOSC_utils::filter($val, true);
 
	}
 
 
 
	/*
 
	 * checks the validity of an url and prevents XSS attacks
 
	*/
 
	public static  function do_bbcode_url ($action, $attributes, $content, $params, $node_object) {
 
 
 
		if (!isset ($attributes['default'])) {
 
			$url = $content;
 
			$text = htmlspecialchars ($content);
 
		} else {
 
			$url = $attributes['default'];
 
			$text = $content;
 
		}
 
 
 
		/*
 
		 * check if a valide url was entered
 
		 * prevents XSS attacks
 
		 *
 
		*/
 
		if ($action == 'validate') {
 
			return JOSC_ubbcode::validate($url);
 
		}
 
 
 
		/*
 
		 * the module doesn't need a formated link, that is why we only output
 
		 * link: $url [ text ] for it
 
		*/
 
		if($params['support_link']) {
 
			return "<a href='". JOSC_ubbcode::preventXSS($url)."' rel='external nofollow' title='".$text."'>".$text."</a>";
 
		} else {
 
			return "link:" . $url . " [" . $text . "]";
 
		}
 
 
 
	}

Module doesn't limit comments 14 years 9 months ago #8668

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
this is not the whole class.
I'm most interested in function initUbbParsing($text)

Is it the same like here:
dev.compojoom.com/repositories/entry/joc...nt.class.php?rev=350

Module doesn't limit comments 14 years 9 months ago #8669

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
function initUbbParsing($text) {
 
		if (!class_exists('StringParser_BBCode')) {
 
			require_once (JPATH_SITE.DS.'components'.DS.'com_comment'.DS.'classes'.DS.'ubbcode'.DS.'stringparser_bbcode.class.php');
 
		}
 
		$bbcode = new StringParser_BBCode();
 
		$bbcode->addFilter (STRINGPARSER_FILTER_PRE, 'JOSC_ubbcode::convertlinebreaks');
 
 
 
		$bbcode->addParser (array ('block', 'inline', 'link', 'listitem'), 'nl2br');
 
		$bbcode->addParser ('list', 'JOSC_ubbcode::bbcode_stripcontents');
 
 
 
		$bbcode->addCode ('b', 'simple_replace', null, array ('start_tag' => '<b>', 'end_tag' => '</b>'),
 
				'inline', array ('listitem', 'block', 'inline', 'link'), array ());
 
		$bbcode->addCode ('i', 'simple_replace', null, array ('start_tag' => '<i>', 'end_tag' => '</i>'),
 
				'inline', array ('listitem', 'block', 'inline', 'link'), array ());
 
		$bbcode->addCode ('u', 'simple_replace', null, array ('start_tag' => '<u>', 'end_tag' => '</u>'),
 
				'inline', array ('listitem', 'block', 'inline', 'link'), array ());
 
		$bbcode->addCode ('s', 'simple_replace', null, array ('start_tag' => '<s>', 'end_tag' => '</s>'),
 
				'inline', array ('listitem', 'block', 'inline', 'link'), array ());
 
 
 
 
 
		$bbcode->addCode ('url', 'usecontent?', 'JOSC_ubbcode::do_bbcode_url', array ('usecontent_param' => 'default', 'support_link' => $this->_support_link ),
 
				'link', array ('listitem', 'block', 'inline'), array ('link'));
 
 
 
		$bbcode->addCode ('img', 'usecontent', 'JOSC_ubbcode::do_bbcode_img',
 
				array ('usecontent_param' => 'default',
 
						'image_width' => (int) $this->_pictures_maxwidth,
 
						'support_pictures' => $this->_support_pictures,
 
						'support_link' => $this->_support_link
 
				),
 
				'image', array ('listitem', 'block', 'inline', 'link'), array ());
 
		$bbcode->setOccurrenceType ('img', 'image');
 
		$bbcode->setMaxOccurrences ('image', 4);
 
 
 
		$bbcode->addCode ('size', 'callback_replace', 'JOSC_ubbcode::do_bbcode_size', array ('usecontent_param' => 'default'),
 
				'inline', array ('listitem', 'block', 'inline', 'link'), array ());
 
 
 
		$bbcode->addCode ('color', 'callback_replace', 'JOSC_ubbcode::do_bbcode_color', array ('usecontent_param' => 'default'),
 
				'inline', array ('listitem', 'block', 'inline', 'link'), array ());
 
		$bbcode->addCode ('list', 'simple_replace', null, array ('start_tag' => '<ul>', 'end_tag' => '</ul>'),
 
				'list', array ('block', 'listitem'), array ());
 
		$bbcode->addCode ('*', 'simple_replace', null, array ('start_tag' => '<li>', 'end_tag' => '</li>'),
 
				'listitem', array ('list'), array ());
 
		$bbcode->setCodeFlag ('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL);
 
		$bbcode->setCodeFlag ('*', 'paragraphs', true);
 
 
 
		$bbcode->setCodeFlag ('list', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT);
 
		$bbcode->setCodeFlag ('list', 'opentag.before.newline', BBCODE_NEWLINE_DROP);
 
		$bbcode->setCodeFlag ('list', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
 
 
 
		$bbcode->addCode ('quote', 'usecontent?', 'JOSC_ubbcode::do_bbcode_quote', array ('usecontent_param' => 'default'),
 
				'block', array ('block'), array('inline'));
 
		$bbcode->setCodeFlag ('quote', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT);
 
		$bbcode->setCodeFlag ('quote', 'opentag.before.newline', BBCODE_NEWLINE_DROP);
 
		$bbcode->setCodeFlag ('quote', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
 
 
 
		$bbcode->addCode ('code', 'usecontent?', 'JOSC_ubbcode::do_bbcode_code', array ('usecontent_param' => 'default'),
 
				'block', array ('block'), array('inline'));
 
		$bbcode->setCodeFlag ('code', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT);
 
		$bbcode->setCodeFlag ('code', 'opentag.before.newline', BBCODE_NEWLINE_DROP);
 
		$bbcode->setCodeFlag ('code', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
 
 
 
		$bbcode->setRootParagraphHandling (true);
 
 
 
		$maxlength_word = ($this->_maxlength_word!=-1) ? $this->_maxlength_word : 999999;
 
		$maxlength_text = ($this->_maxlength_text!=-1) ? $this->_maxlength_text : 999999;
 
 
 
		$text = JOSC_utils::setMaxLength($text, $maxlength_text);
 
		$text =  $bbcode->parse ($text);
 
		$nobreak = 'pre code blockquote';
 
		$text = JOSC_utils::wrapWord($text,$maxlength_word, ' ', $nobreak);
 
 
 
		return $text;
 
	}

Module doesn't limit comments 14 years 9 months ago #8670

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Just a crazy idea from my side. Can you go to components->joomlacomment->content settings->security ->text overflow. Set some limits there and see if this changes anything in the module.

Module doesn't limit comments 14 years 9 months ago #8671

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
There is 3.000 chars limit yet.
Sorry, but it's the module that I need to limit because it show the entire comments.

Module doesn't limit comments 14 years 9 months ago #8672

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
change this values just for the test.
The module uses the same functions that the comment use. This is why I think there could be some kind of connection.

Module doesn't limit comments 14 years 9 months ago #8673

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
Ok, changed to 2.500. No fix :(

Module doesn't limit comments 14 years 9 months ago #8674

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
man, change it to something like 50, look if you see any change, then revert it back.
I don't believe that all your comments are more than 2500 characters long!

Module doesn't limit comments 14 years 9 months ago #8675

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
changed to 50. Comments are same as before into module.
Maybe it is a legacy problem? this site has legacy enabled.

Module doesn't limit comments 14 years 9 months ago #8677

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
Did you download RC1 pre-release from the forums? That copy had a bug.

Module doesn't limit comments 14 years 9 months ago #8678

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
I don't think, but I'm going to re-download and overwriting files

Module doesn't limit comments 14 years 9 months ago #8684

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
downloaded from download page, overwrite all files (component and admnistration), set to 50 comment limit but no fix, module display entire comments again.
:(

Module doesn't limit comments 14 years 9 months ago #8685

  • Nils Ally
  • Nils Ally's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 299
  • Thank you received: 33
Do you have a link?

Module doesn't limit comments 14 years 9 months ago #8686

  • Nils Ally
  • Nils Ally's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 299
  • Thank you received: 33
I suspect you are using a wrong template.
Remember, only use the template Modern in the new package.
The other templates will follow shortly.

Module doesn't limit comments 14 years 9 months ago #8687

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
I use the default one, should this cause the module issue?
this is the site:
www.mbnews.it/index.php

Module doesn't limit comments 14 years 9 months ago #8688

  • Nils Ally
  • Nils Ally's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 299
  • Thank you received: 33
As suspected... you are using:

components/com_comment/joscomment/templates/default/css/css-age.css

This (at least to me) implies you have a custom template, which does not get deleted under the Uninstall process, and leaves it available with the new installation.

Change your template to the Modern one, that came with the package.

Module doesn't limit comments 14 years 9 months ago #8689

  • ant
  • ant's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 33
  • Thank you received: 0
No, the modern template doesn't fix the module issue

Module doesn't limit comments 14 years 9 months ago #8690

  • Nils Ally
  • Nils Ally's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 299
  • Thank you received: 33
I assume you have tested the standard.css as well as the black.css?
Time to create page: 0.176 seconds