Blog

Advanced Excerpt + PHP 4 problem (solved)

Immediately after the release of version 0.2.1, I was made aware of a huge problem. The plugin fails to work on PHP 4, causing a fatal error.

A quick update has been released that fixes this. The new safe release is now 0.2.2, which should be available from the WordPress plugin repository shortly.

The cause for this problem is the fact that PHP 4 can have mbstring enabled, but not support all its functions. Ironically.

By the way, this would be a good time to urge your host to update PHP. The version 4 releases are all historical now.

January 17, 2009
71 comments

Posted in:
WordPress


Comments

Hi, the Advanced Excerpt plugin was recommended to me for using HMTL in my wordpress posts. It seems to work for many HTML tags except , and tags. Is there any way I can make sure these function in my posts. They are listed under tags_allowed within the plugin’s PHP file. Is tehre somewhere else I need to make an adjustment? I’m using wordpress 3.0.

Thank you!
-C

Reply

Casey
July 2, 2010 at
8:40 pm


Hey Bas: First off great plugin and thank you for releasing it for all of us to use.

I’m having a bit of an issue with how it’s trimming certain tags though. I’m using WordPress 3.0 with the newest version of your script. My webhost runs php 5.2.13. What’s happening is that wordpress now has a feature that makes it so that when you insert a smiley based character (ie, :) or :( etc) it converts it to an actual smiley face via an image. What’s happening is that advanced excerpt is cutting into that img tag even though I have it specified that I am excluding all formatting (I’ve tried excluding just the img tag exclusively as well). What I’m guessing is happening is that your script is running before wordpress has a chance to output the smiley. Is there a way to have your script check if smileys are enabled and then check to make sure that it’s not cutting them off in the end? I’m going to see if there’s a way for wordpress to output them beforehand, but I think that it’s going to be an issue no matter what. If nothing else, this will at least make you aware of the situation.

Thanks again for the great plugin!

Reply

John P. Neumann
July 6, 2010 at
4:58 am


Bas, I am using the plugin ver.3.1 on WP 2.9.2 the plugin works except in category listings where the post has no thumbnail image, I get this in place of the thumbnail:

Warning: strpos() [function.strpos]: Offset not contained in string in /home/content/69/6252669/html/wordpress/wp-content/plugins/advanced-excerpt/advanced-excerpt.php on line 230 [...]

line 229 to 243 in the plugin:

// Adding the ellipsis
if(($pos = strpos($text, '', strlen($text) - 7)) !== false)
{
// Stay inside the last paragraph (if it's in the last 6 characters)
$text = substr_replace($text, $ellipsis, $pos, 0);
}
else
{
// If is an allowed tag,
// wrap the ellipsis for consistency with excerpt markup
if(in_array('_all', $allowed_tags) || in_array('p', $allowed_tags))
$ellipsis = '' . $ellipsis . '';

$text = $text . $ellipsis;
}

I am new to PHP. Is there a fix?
Thank You.
Mayda

Reply

Mayda
August 16, 2010 at
6:48 am


Seems to be a minor bug that occurs when the post contains too little text (less than 7 characters, to be precise). The issue will be resolved in the next version.
For now, you can add some text to the posts to prevent the bug.

Bas
August 17, 2010 at
4:58 am


I have implemented your plugin and it is working great on the sub pages (categories) but, it does not seem to transfer to the homepage. I know this is a theme issue ( at least it seems like it) could you please point me in the right direction to make this work on the homepage as well.

Thanks,
Tg

Reply

Tony
August 22, 2010 at
9:44 pm



Write a reply

Your comment goes here… 




*required