Forum Made Simple 0.9.3

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
alby

Re: Forum Made Simple 0.9.3

Post by alby »

Sonya wrote: One question: is there any reason for not having XML installation file? So that the last version of the module can not be installed from Module Manager?
Too many changes in DB from 0.9.2
I preferred a solution where the user have more control

However I have not report for DB ALTER problem, next release coming with xml installation

Alby
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm

Re: Forum Made Simple 0.9.3

Post by mcDavid »

I've made some changes tot the function "AlbyBBParser()".

one is for better looking quotes, using the html-tag.

The other is for smiley-support using the smileys-module ( http://dev.cmsmadesimple.org/projects/smileys )

I also changed the last line, In my oppinion a forum post should be a paragraph, not a div.

Maybe it's nice to add this to the next version of Forum Made Simlpe :)

Code: Select all

	function AlbyBBParser( $text )
	{
		$bb = array(
			'/</','/>/',
			'/\[color=(.*?)\](.*?)\[\/color\]/ism', #color
			'/\[center\](.*?)\[\/center\]/ism', #center
			'/\[quote\](.*?)\[\/quote\]/ism', #blockquote 1
			'/\[quote="(.*?)\"](.*?)\[\/quote\]/ism', #blockquote 2
			'/\[img\](http:\/\/)(.*?)\[\/img\]/ism', #img
			'/\[url\](.*?)\[\/url\]/ism', #link 1
			'/\[url=(http:\/\/)(.*?)\](.*?)\[\/url\]/ism', #link 2
			'/\[b\](.*?)\[\/b\]/ism', #bold
			'/\[i\](.*?)\[\/i\]/ism', #italics
			'/\[u\](.*?)\[\/u\]/ism', #underline
			'/\[sup\](.*?)\[\/sup\]/ism', #superscript
			'/\[sub\](.*?)\[\/sub\]/ism', #supscript
			'/\r\n/', #new line
//			'/[\s]{2}/i' #space
		);
		$html = array(
			'<','>',
			'<span style="color:\1;">\2</span>', #color
			'<div class="forum_center">\1</div>', #center
//quote layout changed 			
			'<blockquote><span>Quote</span><br /><div class="forum_quote">\1 </div></blockquote>', #blockquote 1
			'<blockquote><span>Quote from: \1</span><br /><div class="forum_quote">\2 </div></blockquote>', #blockquote 2
			'<a href="" onmouseover="SMR_setLink(this);" rel="nofollow external" target="_blank"><img src="http://\2" alt="forum image" onload="SMR_resize(this);" /></a>', #img
			#'<img src="http://\2" alt="forum image" />', #img
			'<a href="\1" rel="nofollow">\1</a>', #link 1
			'<a href="http://\2" rel="nofollow">\3</a>', #link 2
			'<b>\1</b>', #bold
			'<i>\1</i>', #italics
			'<u>\1</u>', #underline
			'<sup>\1</sup>', #superscript
			'<sub>\1</sub>', #subscript
			' <br />', #new line
			//'  ' #space
		);
		$text = preg_replace($bb, $html, $text);

// Smiley support using smiley module		
		$smileys = $this->GetModuleInstance("Smileys");
		if ($smileys!=false) {
		  $text = $smileys->ReplaceSmileys($text);
		} 

		return '<p>'.$text.'</p>';
	}
I've also made a function to displays a list of (clickable) smileys, but this required some changes in the smileys module too. I'll get back to that.
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm

Re: Forum Made Simple 0.9.3

Post by mcDavid »

Made some changes and now I don't need the changes in the smileys module anymore.

I added this function to forum.module.php:

Code: Select all

	function InsertSmileyList($theme='default')
	{
		$i=0;
		$output='<div class="smileytable">';
		$smileys = $this->GetModuleInstance("Smileys");
		if ($smileys!=false) {
			$list = $smileys->GetSmileyList($theme, true);
			foreach ($list as $smiley=>$url)
			{
				$i++;
				$jsparam = str_replace("'","\'", $smiley); // escape ' for proper JS call
				$smiley  = htmlentities($smiley); // escape " for proper HTML
				$output .= '<div style="float:left;cursor:pointer" onclick="addSmiley(\''.$jsparam.'\') ">';
				$output .= $url;
				$output .= "<br /> $smiley </div>";
				if ($i == 10)
				{
					$output .= "<button onclick=\"this.nextSibling.style.display='block';this.style.display='none';return false;\">".$this->lang('more')."...</button><span style='display:none'>";
				}
			}
		if ($i >= 10) {$output.= '</span>';}
		$output .= '<br style="clear:both;" /></div>';
		
		return $output;
		} 
		else {return;}
	}
I also added a javascript function to the bbcode_toolbar.php (basically a stripped down version of the storeCaret() function)

Code: Select all

function addSmiley(smiley)
{
smiley = ' ' + smiley + ' ';
	if (isMozilla)
	{
		oField=document.forms['{$_FormId}'].elements['{$_TextareaId}'];
		objectValue=oField.value;
		deb=oField.selectionStart;
		fin=oField.selectionEnd;

		objectValueDeb=objectValue.substring(0,oField.selectionStart);
		objectValueFin=objectValue.substring(oField.selectionEnd,oField.textLength);
		oField.value=objectValueDeb + smiley + objectValueFin;
		oField.selectionStart=strlen(objectValueDeb);
		oField.selectionEnd=strlen(objectValueDeb  + selec_start );
		oField.focus();
		oField.setSelectionRange(objectValueDeb.length + selec_start.length + 2,objectValueDeb.length + selec_end.length + 2);
	}
	else
	{
		oField=document.forms['{$_FormId}'].elements['{$_TextareaId}'];
		oField.focus(oField.caretPos);
			oField.focus(oField.value.length);
			oField.caretPos=document.selection.createRange().duplicate();

			var bidon = "%~%";
			var orig=oField.value;
			oField.caretPos.text=bidon;
			var i=oField.value.search(bidon);
			oField.value=orig.substr(0,i) + smiley + orig.substr(i, oField.value.length);
			var r=0;
			for(n=0; n<i; n++) {if(regexp.test(oField.value.substr(n,2)) == true){r++;}};
			pos = i + 2 + selec.length - r;
			var r=oField.createTextRange();
			r.moveStart('character',pos);
			r.collapse();
			r.select();
	}
}
I think this javascript can be shorter but it works. Maybe it should be included in the insertSmileyList() function instead of the BBCode-toolbar, to make it independent (and the bbcode-toolbar less bloated for people that don't want smileys). Or maybe the whole smiley-thing should be part of the bbcode-toolbar...
aibreanstudio
New Member
New Member
Posts: 4
Joined: Thu Aug 13, 2009 5:57 pm

Re: Forum Made Simple 0.9.3

Post by aibreanstudio »

BUG

It took me forever to figure out why my client was having issues creating a topic with Forum Made Simple. It turns out the forum is visible EXCEPT for the "New Topic" link when using Internet Explorer. Anyone have this issue or could direct me how to fix it so I don't have to install something else?

I am using the latest release. If I make a new topic (through a different browser) the new topic created is visible in IE, but not the icon to make a new topic.
Peciura

Re: Forum Made Simple 0.9.3

Post by Peciura »

steph60
Forum Members
Forum Members
Posts: 46
Joined: Fri Nov 02, 2007 1:45 pm

Re: Forum Made Simple 0.9.3

Post by steph60 »

Hi Alby

I have a problem with the TreeManager module, when i would install, i have this error :
Error create: cms_module_tree_transaction
So i can't install FMS 0.9.3 on my CMSMS 1.6.6
Do you know where is the problem ?
Thanks

Steph
alby

Re: Forum Made Simple 0.9.3

Post by alby »

steph60 wrote: Error create: cms_module_tree_transaction
Check if you have already that sql table with a sql tools

Alby
steph60
Forum Members
Forum Members
Posts: 46
Joined: Fri Nov 02, 2007 1:45 pm

Re: Forum Made Simple 0.9.3

Post by steph60 »

I have this table but empty

I must delete this table ?
Last edited by steph60 on Fri Nov 13, 2009 9:13 am, edited 1 time in total.
dave21p
New Member
New Member
Posts: 6
Joined: Mon May 11, 2009 3:04 pm

Re: Forum Made Simple 0.9.3

Post by dave21p »

Any thoughts on an update via xml?  Still on 0.9.2 and itching for an upgrade version ;-)
Happy New Year by the way.
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm

Re: Forum Made Simple 0.9.3

Post by mcDavid »

How are things going with the Forum module?

I guess everybody is busy working on CMSMS 2.0 ( ;D ), but still I'm really looking forward to have some improvements in the forum module!

Some users of my forum discovered quite a big bug (0.9.3): If you open a topic from the "new messages" page, all buttons (like: new reply, edit, quote, etc.) are malfunctioning.
I'll try to find a solution to this, without messing up half the module like I usually do  :-[


-edit-
I made some changes to the regular expressions, to make it easyer to post an URL:

Code: Select all

//snap
			'/\[url\](http:\/\/|https:\/\/|ftp:\/\/|mailto:)(.*?)\[\/url\]/ism', #link 1
			'/\[url\](.*?)\[\/url\]/ism', #link 1 -> add HTTP		
			'/\[url=(http:\/\/|https:\/\/|ftp:\/\/|mailto:)(.*?)\](.*?)\[\/url\]/ism', #link 2
			'/\[url=(.*?)\](.*?)\[\/url\]/ism', #link 2 -> add HTTP
			'/\s(http:\/\/|https:\/\/|ftp:\/\/|mailto:)([^\s]+)/', #link 3
//snap
			'<a href="\1\2" rel="nofollow" target="_blank">\2</a>', #link 1
			'<a href="http://\1" rel="nofollow" target="_blank">\1</a>', #link 1 -> add HTTP
			'<a href="\1\2" rel="nofollow" target="_blank">\3</a>', #link 2
			'<a href="http://\1" rel="nofollow" target="_blank">\2</a>', #link 2 -> add HTTP
			'<a href="\1\2" rel="nofollow" target="_blank">\2</a>', #link 3
Last edited by mcDavid on Thu Jan 21, 2010 2:06 am, edited 1 time in total.
Locked

Return to “Modules/Add-Ons”