Tables in BBCode! Updated!

Dragonfly issues as they relate to modules discussed here
Reply to topicReply to topic
Go to page  Previous  1, 2, 3  Next 

  
22 Oct '09 Thu Oct 22, 2009 15:43    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

- rosbif

Incidentally there's a reference to images/pdf_icon.gif which I don't seem to have. Should I have that from somewhere?


Addressing this just one first:

It's just an image that appears on the actual web page after the link as a piece of ether flotsam! One that you'd like to represent an Adobe pdf. It's a matter of finding one that you like and believe that you can use. I used one that's 27x28px, but again it is up to you. You don't need one at all, I put it there just so I could show visitors that it was a PDF.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
22 Oct '09 Thu Oct 22, 2009 15:53    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

- rosbif

Also, I think I mentioned this before somewhere but can't remember where, pressing any BBCode button always puts the code at the bottom of the text, rather than around the highlighted text for example...


Ah, ... how to say? Use a browser? One that understands CSS?

Firefox, Opera and I think all the others but that incompatible-with-everything-including-versions-of-itself Internet Explorer doesn't. (Don't get me wrong, I fully understand Microsoft's strategy of "if it works then break it", but I'm never going to agree with it.)I understand

Could the BBCode be written to handle it? I don't know, it is really beyond me, and I doubted you'd find someone with the skill to do it who'd want to do it, if you see what I mean? But BBCode in it's various interatiosn is very widespread in it's use. So if I were wed to making IE work, I'd probably start by looking to see how it works in latest phpBB or similar, first. 'cos if it's the same there, then your chances are probably slim to none.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
22 Oct '09 Thu Oct 22, 2009 16:34    
rosbif
BetaTester  BetaTester
  •  

Post Re: Tables in BBCode! Done!

Fair enough - the placement of the code is odd as it works on some modules but not others - for example the submit news page on the DF news module it works as expected!

Incidentally, I thought I'd mentioned another problem but it appears not: My URL with image, List Item and URL with pdf are no longer working. I'm not aware of having changed anything but when clicking any of those three buttons I get an error on the page (IE reports it as Webpage error details:


User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SV1; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Thu, 22 Oct 2009 16:23:19 UTC


Message: Object expected
Line: 1290
Char: 1
Code: 0
URI: www.chantillyexpat.com...o=new.html


More helpfully Firefox reports it as

Error: BBCimg is not defined
Source File: www.chantillyexpat.com...o=new.html
Line: 1


Any thoughts?



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
22 Oct '09 Thu Oct 22, 2009 21:06    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

You had mentioned it. I just hadn't figured it out from the previous request. But from the newer info, I have - indirectly - discovered the problem. What I don't understand is how it ever worked, but still ...

Apply the following 2 edits to includes/javascript/bbcode.js.

Before line containing:

PHP:
function BBCdir(form, field, dirc) { document.forms[form].elements[field].dir=(dirc); }


insert:

PHP:
function BBCli(form, field) { BBCwrite(form, field, '', "[*]", true); }



Before line:

PHP:
function BBCwrite(form, field, start, end, force) {


insert:

PHP:



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
22 Oct '09 Thu Oct 22, 2009 21:37    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

- rosbif

Fair enough - the placement of the code is odd as it works on some modules but not others - for example the submit news page on the DF news module it works as expected!


Good observation!!!!

I can find only 1 difference between News and Pro_News in this area. But it is reported as affecting cross-browser compatibility ...

Can you test this for me please?

In functions.php search for:

PHP:
				'T_INTRO' => '<textarea cols="72" rows="15" name="intro">'.$edit['intro'].'</textarea>',


and replace with:

PHP:
				'T_INTRO' => '<textarea wrap="virtual" cols="72" rows="15" name="intro">'.$edit['intro'].'</textarea>',


and:

PHP:
				'T_STORY' => '<textarea cols="72" rows="15" name="addtext">'.$edit['content'].'</textarea>',


to:

PHP:
				'T_STORY' => '<textarea wrap="virtual" cols="72" rows="15" name="addtext">'.$edit['content'].'</textarea>',


and if it works, you'll want to repeat in admin_functions.php.

And let me know?

TIA!



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 07:23    
rosbif
BetaTester  BetaTester
  •  

Post Re: Tables in BBCode! Done!

- layingback

You had mentioned it. I just hadn't figured it out from the previous request. But from the newer info, I have - indirectly - discovered the problem. What I don't understand is how it ever worked, but still ...


You're right - don't know how it worked before but works a treat now!

Adding the 'wrap="virtual"' works in Firefox but in IE8 it just highlights the whole text and then puts the opening code pair at the end still... I know what you're going to say now!



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 07:48    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

- rosbif

You're right - don't know how it worked before but works a treat now!

All I can think of is that you had been to my site in same session and browser had cached the javascript?

- rosbif

Adding the 'wrap="virtual"' works in Firefox but in IE8 it just highlights the whole text and then puts the opening code pair at the end still... I know what you're going to say now!

That goes without saying, for a host of very good reasons, but if it works in Submit News, then it ought to work here ... What about IE6 or 7? ANd does it work in IE8 on Submit News?



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 08:19    
rosbif
BetaTester  BetaTester
  •  

Post Re: Tables in BBCode! Done!

- layingback

- rosbif

You're right - don't know how it worked before but works a treat now!

All I can think of is that you had been to my site in same session and browser had cached the javascript?

Ah it could well have been. Fixed now though!

- rosbif

Adding the 'wrap="virtual"' works in Firefox but in IE8 it just highlights the whole text and then puts the opening code pair at the end still... I know what you're going to say now!

That goes without saying, for a host of very good reasons, but if it works in Submit News, then it ought to work here ... What about IE6 or 7? ANd does it work in IE8 on Submit News?


I don't have the old IE available anywhere - so can't test. However, it works as it should on Submit News with IE8.



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 08:45    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

OK, can I ask you for 1 more test - using IE8?

Edit same lines as before, including the warp="virtual" part, but also AFTER the name="..." stuff but BEFORE the > please try inserting:

PHP:
 onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"



(As we already know IE does not pass any number of things to its javascript like other browsers do, eg: BASEREF. I also found out that it doesn't pass event info, while building the new fcs template yesterday. So perhaps this falls into the same camp?)



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 09:00    
rosbif
BetaTester  BetaTester
  •  

Post Re: Tables in BBCode! Done!

That has done the trick - all seems to be working a treat now! Thank you.

Looks like you've recovered after your upheaval - I'll have to start pestering you for a hack for Pro News on a different thread when I get a chance!

Thanks again



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 09:09    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Done!

Great news! I have 1 client who will be very happy!

Thanks for the nagging. Wink



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Oct '09 Fri Oct 23, 2009 10:36    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Updated!

FYI, it works in IE 5.5, although much of the CSS displays very poorly. So it seems reasonable to presume that it will also work in IE6 and IE7. I will test at some point, but have to reboot systems, etc., to do so.

I'll have to start pestering you for a hack for Pro News on a different thread when I get a chance!

What's going on? It's been a couple of hours already and no new pestering? :-O



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
23 Jun '11 Thu Jun 23, 2011 14:03    
rosbif
BetaTester  BetaTester
  •  

Post Re: Tables in BBCode! Updated!

I've followed your formatting here and added strikethrough too. Only thing I can't get right is the mouseover colour - I have an image s1 which has the dark background and s with a light background but it is only s which displays...

Anyhoo, I added these:

Insert in includes/nbbcode.php starting at line 190ish, just after the underline code

PHP:
	var s_help = "'. $bbcode_common['strikethrough'][0].' '.$bbcode_common['strikethrough'][1].'";



Also at line 212ish (after the underline code again)

PHP:
		<img alt="'.$bbcode_common['strikethrough'][0].'" class="bbcbutton" onmouseover="helpline(\''.$form.'\',\''.$field.'\',\'s\')" onclick="BBCcode(\''.$form.'\',\''.$field.'\',this,\'s\')" src="'.$bbbttns_path.'s.gif" />



and around 493 (after underline again - see the pattern here?)

PHP:
		# [i] and [/i] for italicizing text.
$patterns[] = '#\[i\](.*?)\[/i\]#si';
$replacements[] = '<span style="font-style: italic">\\1</span>';



and for completeness, Insert in language/english/bbcode.php starting around line 82 (guess where)

PHP:
	'strikethrough' => array('Strikethrough:','[s]strikethrough[/s]'),



I've added two images to themes\{your_theme}\images\bbcode\.





rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
6 Jul '11 Wed Jul 06, 2011 15:27    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Updated!

Hmm ... I found it worked better with the code for strikethrough in your 3rd insert Laughing

[ underline and italic are reversed in the code at this point Wink ]

But my reDesign1/2 icons did flip to green backgrounds.

Below are my attempts at a reDesign3 style ones:

  • s1.gif
  • s1.gif
  • s.gif
  • s.gif


layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
6 Jul '11 Wed Jul 06, 2011 21:39    
layingback
Site Admin  
  •  

Post Re: Tables in BBCode! Updated!

And to update BBCode FAQ in file language/english/Forums/lang_bbcode.php change line 52 to:

PHP:
$faq[] = array("How to create bold, italic, underlined and strike-through text", "BBCode includes tags to allow you to quickly change the basic style of your text. This is achieved in the following ways: <ul><li>To make a piece of text bold enclose it in <b>[b][/b]</b>, eg. <br /><br /><b>[b]</b>Hello<b>[/b]</b><br /><br />will become <b>Hello</b></li><li>For underlining use <b>[u][/u]</b>, for example:<br /><br /><b>[u]</b>Good Morning<b>[/u]</b><br /><br />becomes <u>Good Morning</u></li><li>To italicise text use <b>[i][/i]</b>, eg.<br /><br />This is <b>[i]</b>Great!<b>[/i]</b><br /><br />would give This is <i>Great!</i></li><li>To strike-through text use <b>[s][/s]</b>, eg.<br /><br />Turn <b>[s]</b>left<b>[/s]</b> right<br /><br />would give Turn <s>left</s> right</li></ul>");



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
Link  QR 
Share this Printer Friendly Page  facebook   google+   linkedin   twitthis  
Show more ...
Go to page  Previous  1, 2, 3  Next


Go to page  Previous  1, 2, 3  Next