We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Word Limit Plus

Development and Programming

dookie's avatar
dookie
19 posts
18 years ago
dookie's avatar dookie

Can anyone tell me why I am getting this error at the top of any page that I use the word_limit_plus plugin.

Notice: Undefined offset: 22 in plugins/pi.word_limit_plus.php on line 70

It actually seems as though it is doing what I want it to do, with the exception of this random error. From my untrained eyes it looks like it is pointing out an error in the actual php plugin. That wouldn’t be my error would it.

Here is the code that I am using as of now.

{exp:word_limit_plus if_exceeds="25" stop_after="22" } 
         {summary}
  {/exp:word_limit_plus}

Thanks for the help. And yes I am new to this.

Derik

Mod Edit:This is a plugin, not an extension. Added code tags

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
18 years ago
Lisa Wess's avatar Lisa Wess

Hey dookie, I deleted your second post, no need to cross-post, you can just bump.

That said if you are having problems and no response here, I’d suggest contacting the plugin’s author directly. =)

       
siffring's avatar
siffring
147 posts
17 years ago
siffring's avatar siffring

For what it’s worth, I’m having the same problem. Funny thing is, the error only appears in IE (not Firefox).

Anyone find an answer?

       
siffring's avatar
siffring
147 posts
17 years ago
siffring's avatar siffring

I was able to get rid of the warning message by changing from this:

{exp:word_limit_plus if_exceeds="20" stop_after="19" ...

to this:

{exp:word_limit_plus if_exceeds="20" stop_after="18" ...
       
Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
16 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)

It’s happening to me, too. It seems to be triggered by text being a certain length - perhaps between the two values. It also may be triggered by the presence of HTML tags…?

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

I realise I’m posting to a long-dead thread here, but I think this may be down to a bug in the word_limit_plus plugin.

A (admittedly rather quick) look at the code makes me think that this (around line 70):

for ($i = 0; $i < $stop_after + 1; $i++) 
{
  $str .= $word[$i]." ";
}

Should be changed to this:

for ($i = 0; $i < $stop_after; $i++) 
{
  $str .= $word[$i]." ";
}

It solved the problem for me, certainly.

Cheers, Stephen

       
Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
16 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)

That fixed the issue for me, too - apparently without any disadvantages. Thanks!

As an aside, notice that the “error” is actually a Notice, not an Error or even a Warning - i.e. not a critical issue. It seems to only be displayed to logged-in super-admins, too.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
As an aside, notice that the “error” is actually a Notice, not an Error or even a Warning - i.e. not a critical issue. It seems to only be displayed to logged-in super-admins, too.

You’re right of course. Still annoyed the hell out of me though 😉

Stephen

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.