EllisLab text mark
Advanced Search
1 of 3
1
   
Extension: MD Character Count - display and limit the number of characters allowed for fields
Posted: 14 November 2008 01:22 PM
Joined: 2006-03-26
1664 posts

For my current project, I needed a more robust character count that was was out there, so I started by looking at what Andrew Weaver had done with his, and came up with this offering.

MD Character Count will show character counts below textareas, text inputs, and MD Markitup fields in the CP. You can set character counts to “soft” (which is the default) which is more of a suggestion, or “hard” which will limit the field to that many characters and no more. You can also customize the message underneath each field.

You can download it from the MD Character Count page at Masuga Design.

 
Posted: 14 November 2008 02:20 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Ryan,

Will post here as well as your site to say this is an excellent little extension well done and thanks for sharing it!!

Just one thing though I couldn’t seem to get this to work unless I enabled the jQuery For Control Panel extension. I thought from reading the documentation that it should work without it but couldn’t seem to get it to work like that. Works great though with the other extension on so thanks.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 14 November 2008 02:22 PM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2004-10-10
267 posts

This is really great. Just a feature request: it would be great if there was an option to count words instead of characters. I know I could use the word counter. smile

 Signature 

Twitter: @RobQuigley

 
Posted: 14 November 2008 02:32 PM   [ # 3 ]   [ Rating: 0 ]
Joined: 2006-03-26
1664 posts

@Mark: I would suggest always turning on the CP jQuery extension. If other extensions are written to look for this, it will help avoid conflicts.

This extension should definitely work without having to install CP jQuery, but it might not depending on whether you have other extensions installed that are also calling jQuery. If those others are older and not set up to look for other extensions also calling jQuery (like this one), sometimes jQuery can be loaded more than once in the head which can cause some extensions to fail. I’ve seen some of Leevi’s extensions fail because of this too (LG Data Matrix, in my testing). That’s the sort of the thing the CP jQuery extension was intended to help address.

@Rob: Word count would be nice, sure. And so would being able to ignore HTML. I’m not married to the jQuery plugin I’m using - it seemed lightweight, but I did have to modify it to allow for soft counts. If there is a better character/word counting jQuery extension out there, point me to it and maybe I can beef this up with some extra settings.

 
Posted: 14 November 2008 02:55 PM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Ryan,

Ah right. Could possibly be another extension then although to tell the truth I don’t think any of the other extensions I have on the site use jQuery. Could be wrong on that though.

Anyway will just go with using the jQuery extension as that is much neater anyway.

Again thanks for a fantastic extension, really nice this one!! wink

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 18 January 2009 02:37 PM   [ # 5 ]   [ Rating: 0 ]
Joined: 2007-08-14
98 posts

I know your specs state that the plugin is MSM aware,

however when I change from site to site I get an error in my page above all HTML :

NoticeUndefined index2 in /www/htdocs/cebuco/http/system/extensions/ext.md_character_count.php on line 110 

Where index 2 is the index of the site.

I used both the custom path for jquery, and when I encountered the problem the CP jquery extention. But that made no difference.

Any idea what can cause this? Thank you.

 
Posted: 18 January 2009 02:51 PM   [ # 6 ]   [ Rating: 0 ]
Joined: 2006-03-26
1664 posts

Let’s make sure we’re on the same page. What version/build of EE are you using, and are you using PHP 4 or 5?

 
Posted: 18 January 2009 03:06 PM   [ # 7 ]   [ Rating: 0 ]
Joined: 2007-08-14
98 posts

I am using EE 1.6.6 and
PHP Version 5.2.6-5
Version 1.0.4 of your extention

 
Posted: 28 January 2009 10:16 AM   [ # 8 ]   [ Rating: 0 ]
Joined: 2006-03-26
1664 posts

I’m setting up an MSM installation locally to test this and MD Live Search. Seems a few of my add-ons are having issues with their MSM abilities. Arrrgh.

 
Posted: 03 March 2009 02:49 PM   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2006-09-06
513 posts

Here’s a jQuery word count plugin I found. I need it for a SAEF, but might have something useful for the extension.

 Signature 

Kyle Summer | smartpill design | New Haven, CT |  twitter

 
Posted: 03 March 2009 02:52 PM   [ # 10 ]   [ Rating: 0 ]
Joined: 2006-03-26
1664 posts

Cool. I think it would be a good thing to specify whether you want words or characters counted on each field. The other nice thing would be to ignore HTML tags.

 
Posted: 17 March 2009 08:13 PM   [ # 11 ]   [ Rating: 0 ]
Joined: 2008-11-04
57 posts

Ryan, any progress with the MSM undefined index errors? I am seeing the same errors when switching between sites:

Notice: Undefined index: 1 in /[path]/extensions/ext.md_character_count.php on line 96

 
Posted: 18 March 2009 01:10 AM   [ # 12 ]   [ Rating: 0 ]
Joined: 2006-03-26
1664 posts

I haven’t fixed that. I think the only thing you need to do is go into the MDCC settings for that site and hit “Submit” once and that error should go away.

I would get on this, but I think the above will solve the issue for each site for now, and I have a certain EE-related site I’m trying to get launched as soon as possible. It’s on my to-do list, though.

 
Posted: 23 April 2009 04:35 PM   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-02
307 posts

I’m seeing notices as well and If it would help I’ve attached a dump from xdebug of the notices I’m seeing.

File Attachments
notices.html  (File Size: 11KB - Downloads: 367)
 Signature 
 
Posted: 23 April 2009 04:57 PM   [ # 14 ]   [ Rating: 0 ]
Joined: 2006-03-26
1664 posts

I’m almost 100% positive this has to do with the settings not getting set by default - hence having to hit “Submit” to get the settings in there. With a launch of devot:ee coming very soon I just don’t have time to get on this immediately. It’s still on my to-get-to list.

Thanks for posting the notices.

 
Posted: 23 April 2009 05:06 PM   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-02
307 posts

That fixed it for me Ryan. Thanks a lot.

 Signature 
 
1 of 3
1