Auto tagging of article announcements was not working correctly always

This commit is contained in:
Grischa Brockhaus 2011-12-14 02:13:01 +01:00
parent c066659da0
commit 87467e8a63
3 changed files with 7 additions and 3 deletions

View file

@ -11,6 +11,10 @@ TODO:
* Twitter announcements/credentials etc. per author instead of
only per central blog
1.41 (brockhaus)
--------------------------
* Auto tagging of article announcements was not working correctly always
1.40 (brockhaus)
--------------------------
* PHP 5 required (garvin)

View file

@ -1,4 +1,4 @@
<?php
// Actual version of both plugins
@define('PLUGIN_TWITTER_VERSION', '1.40');
@define('PLUGIN_TWITTER_VERSION', '1.41');

View file

@ -1341,11 +1341,11 @@ a.twitter_update_time {
$tags = explode(',',$taglist);
foreach ($tags as $tag) {
$tag = trim($tag);
$tag = str_replace(" ","",$tag); // make tags more twitter alike
$tag = str_replace(" ","_",$tag); // make tags more twitter alike
$test = str_replace('#title#',$title,$announce_format_notags);
$len = strlen($title);
if (strlen($test) < 140) { // still capacity
$title = preg_replace('@(' . $tag . ')@i',"#$1",$title);
$title = preg_replace('@(^|\s)(' . $tag . ')@i'," #$2",$title);
if (strlen($title) == $len) $tagsnotused[] = $tag;
}
else {