×

Notice

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

TOPIC: Parsing BB codes and punctuation in JS

Parsing BB codes and punctuation in JS 14 years 5 months ago #10001

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
I noticed with the jomsocial integrations (which came out great, btw!), when I write comments, they appear in my activity stream as raw text - including bb codes. Is there an easy way to make it so that when I quote someone, these codes do not appear? Screenshot attached.



Also notice that the punctuation is displayed with /'s everywhere. I should have tested this with the earlier builds :/

Thanks!

Parsing BB codes and punctuation in JS 14 years 5 months ago #10009

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok Steve,
now you must fall in love with me :D
compojoom.com/downloads/downloads/compoj...comment-v101zip/view
Download it and install it. BBcode is parsed, emoticons are shown, slashes are stripped.
Cheers,
Daniel

Parsing BB codes and punctuation in JS 14 years 5 months ago #10012

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
It almost works perfectly! You're quite an amazing developer, I haven't worked with any nearly as responsive as you. I will be extending my subscription as soon as the current one is up for sure :) in the mean time, can you tell me where I can donate to you? You deserve it for all the work!

Now, the one problem: www.gamersnexus.net/nexus -> if you look at the top activity (test comment), you will see that it appears properly except the bbcode at the end is still showing. It shouldn't be due to length displayed, because other comments show several lines before cutting off. Interesting...

Parsing BB codes and punctuation in JS 14 years 5 months ago #10013

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
compojoom.com/downloads/downloads/compoj...comment-v102zip/view

try this one! Sorry about that bug, I thought that jomsocial is restricting the length of the comments on the wall, but at the end it was me :)

Parsing BB codes and punctuation in JS 14 years 5 months ago #10014

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
Works great! Thanks!! Let me know what paypal account I can send some donation to :)

Parsing BB codes and punctuation in JS 14 years 5 months ago #10015

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
About that donation you can use This email address is being protected from spambots. You need JavaScript enabled to view it., but to be honest I will prefer that you buy a 6month subscription or just spread the word about compojoomComment :)
Cheers,
Daniel

Parsing BB codes and punctuation in JS 14 years 5 months ago #10016

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
I already have a year subscription, I will let me former website clients know about it :))

Parsing BB codes and punctuation in JS 14 years 5 months ago #10017

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
Looks like a new issue on this front: if I like a comment, it appears in JS as 'disliked' instead, and it also links to the wrong page.

When I liked the comment, this appeared: "Lelldorianx disliked CyberGrim\'s comment in GG: The Formula of Hype"

Note the / is still there :/

Also, the link went here: gamersnexus.net/component/content/article/366#josc240

instead of here: gamersnexus.net/features/gg/366-the-formula-of-gaming-hype#josc240

Seems to just be a voting problem. When I "dislike" a comment, it appears the opposite -> in JS it says that I liked it! :P

Parsing BB codes and punctuation in JS 14 years 5 months ago #10019

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
the language file is located in
administrator/languages/en-GB/en-GB.plg_compojoomcomment_jomsocial.ini

And about the disliked - bad english from my side :rolleyes:
Just update the language file and share it with my and I'll add it to the plugin.

About the link problem. Go agian to administrator/components/com_comment/plugin/com_content and change:
if ($appl->scope == 'mod_comments' || $josctask  == 'ajax_search' || $josctask  == 'ajax_insert') {

to
if ($appl->scope == 'mod_comments' || $josctask  == 'ajax_search' || $josctask  == 'ajax_insert'|| $josctask  == 'ajax_voting_yes' || $josctask  == 'ajax_voting_no') {
 

I have to really find another way to make comments. I think on something like this - the link will look like this:
yoursite.com/comments/commentId

and when you click it, it will redirect you to the right article, video or whatever.

Parsing BB codes and punctuation in JS 14 years 5 months ago #10020

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
Yeah, might be easier for HF (human friendly :) ) URLs. I fixed the links, now I just need to fix the like/dislike. I change the language file to this:
JOMSOCIAL_ADDGENERAL_COMMENT={actor} {single}wrote a comment{/single}{multiple}wrote another comment{/multiple}
JOMSOCIAL_ADDJOMSOCIAL_COMMENT_TARGET={actor} {single}commented{/single}{multiple}wrote another comment{/multiple} on {target}'s
JOMSOCIAL_ADDJOMSOCIAL_COMMENT_OWN={actor} {single}commented{/single}{multiple}wrote another comment{/multiple} on his/her
JOMSOCIAL_WALL=wall
JOMSOCIAL_DELETEGENERAL_COMMENT={actor} {single}deleted a comment{/single}{multiple}deleted several comments{/multiple}
JOMSOCIAL_DELETEJOMSOCIAL_COMMENT_TARGET={actor} {single}deleted a comment{/single}{multiple}deleted another comment{/multiple} on {target}'s
JOMSOCIAL_DELETEJOMSOCIAL_COMMENT_OWN={actor} {single}deleted a comment{/single}{multiple}deleted another comment{/multiple} on his/her
JOMSOCIAL_NEGATIVEVOTE_COMMENT={actor} {single}dislikes {target}'s comment{/single}{multiple}dislikes several comments{/multiple}
JOMSOCIAL_NEGATIVEVOTE_COMMENT_GUEST={actor} {single}dislikes {target} comment{/single}{multiple}dislikes several comments{/multiple}
JOMSOCIAL_POSITIVEVOTE_COMMENT={actor} {single}likes {target}'s comment{/single}{multiple}likes several comments{/multiple}
JOMSOCIAL_POSITIVEVOTE_COMMENT_GUEST={actor} {single}likes {target} comment{/single}{multiple}likes several comments{/multiple}
JOMSOCIAL_HERE=here
JOMSOCIAL_IN=in

This has fixed the slashes, however, it still shows like/dislike in opposite places. It seems like the "NEGATIVEVOTE" and "POSITIVEVOTE" are opposite. Where are these defined? I am in en-GB.plg_compojoomcomment_jomsocial.ini under /administrator/language/en-GB/.

en-GB.plg file

Parsing BB codes and punctuation in JS 14 years 5 months ago #10021

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
true, for some reason I have changed the labels.
change the code:
			if ($this->mode == 'no') {
				$cmd = 'com_comment.negativeVote';
				$target = $this->item['userid'];
				$actTitle = JText::_('JOMSOCIAL_POSITIVEVOTE_COMMENT') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				if (!$target) {
					$actTitle = JText::_('JOMSOCIAL_POSITIVEVOTE_COMMENT_GUEST') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				}
 
			} else {
				$cmd = 'com_comment.positiveVote';
				$target = $this->item['userid'];
				$actTitle = JText::_('JOMSOCIAL_NEGATIVEVOTE_COMMENT') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				if (!$target) {
					$actTitle = JText::_('JOMSOCIAL_NEGATIVEVOTE_COMMENT_GUEST') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				}
			}
to
		if ($this->mode == 'no') {
				$cmd = 'com_comment.negativeVote';
				$target = $this->item['userid'];
				$actTitle = JText::_('JOMSOCIAL_NEGATIVEVOTE_COMMENT') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				if (!$target) {
					$actTitle = JText::_('JOMSOCIAL_NEGATIVEVOTE_COMMENT_GUEST') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				}
 
			} else {
				$cmd = 'com_comment.positiveVote';
				$target = $this->item['userid'];
				$actTitle = JText::_('JOMSOCIAL_POSITIVEVOTE_COMMENT') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				if (!$target) {
					$actTitle = JText::_('JOMSOCIAL_POSITIVEVOTE_COMMENT_GUEST') . $in . ' <a href="' . $url . '">' . $title . '</a>';
				}

in plugins/compojoomcomment/jomSocial.php line 140.
This should do the job.

Parsing BB codes and punctuation in JS 14 years 5 months ago #10022

  • Steve Burke
  • Steve Burke's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 38
  • Thank you received: 0
Tested thoroughly and it works flawlessly. Thanks once again!

The enclosed documents are the completed corrections, including comments on the JomSocial.php file ;) Just in case anyone can use it in the future.

CompojoomComment JomSocial Voting & Punctuation Fixes

Parsing BB codes and punctuation in JS 14 years 4 months ago #10024

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Steve,
thank you! I've updated the language file and the new plugin is in the download section.
cheers,
Daniel
  • Page:
  • 1
Time to create page: 0.150 seconds