-
Website
http://HuddledMasses.org/ -
Original page
http://HuddledMasses.org/wordpress-plugin-acronym-replacer/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Clint Ecker
1 comment · 5 points
-
avenzke
1 comment · 1 points
-
Euri
1 comment · 4 points
-
Stuart
1 comment · 1 points
-
Luciano Evaristo Guerche
1 comment · 1 points
-
-
Popular Threads
I am still developing my Wordpress, and it isn't live yet but am currently testing offline.
It appears that all instances of an abbr/acronym are being replaced even when they are within the 'title' attribute of a link.
Is this a bug?
However, I can see how it could be a problem, so I'll try to see if I can tweak the regular expression to make it avoid those. It's kind-of tricky, honestly, because it involves checking a LOT of extra text to be able to tell for SURE if we were in an attribute or not ... which means the plugin will be a bit slower ...
I also had fun creating css buttons...
Would a character infront of any that you don't want to be processed be any use? Or would this still slow the script down?
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/sastian/public_html/blog/wp-content/plugins/acronym.php on line 36
*David*: That's a good point ... the regex was a fairly conservative one, I have rewritten it to be less-so. The reason for it being conservative is that I had real problems with acronym tags showing up on the extensions and protocols in URL's [;)] so I added those two cases as exceptions in the new regex.
*NOTE*: I've left a couple of other versions of the regex in there, including one which is the same as the new one, but case sensitive!
*elfin*: I've also added an extra replacement call, which allows you to undo the acronym if it was surrounded by dollar signs (of course it removes the dollar signs). Here's an example: $AOL$ won't be wrapped in acronym tags, replaced, but $AOL will be, and so will AOL$ ) Of course, you can change the character, but watch out for that, I can imagine it causing problems [:p]
yes I am using version 2.4 with the relevant lines uncommentated.
so a little further testing revelaed the following strange result:
ok that didna??t work, how about an AOL XHTML CSS ?
$XHTML$ CSS $CSS$
CSS
(if these don't show properly here check my website)
enclosing with $ don't appear to affect things, have I missed something ? and yes I doubled checked that the line was uncommented.
The parentheses in the deffinition of an acronym cause problems with the regular expression that removes them. I've removed them from the deffinitions I listed by default, and added a note to that effect at the top.
Looks like it is fixed now!
thanks for the time and effort
For example:
a??AOLa?? => a??America Onlinea?? ,
a??APIa?? => a??Application Programming Interfacea?? ,
a??CDa?? => a??Compact Diska?? ,
Oh, I should add that simply adding a space before the first letter (as done here) solves the problem, but who's gonna remember to do that?
I actually put in an optimization while I was at it, to avoid redefining the acronym list every time the plugin is invoked. Can't believe I didn't think of that before [blush] so it's upped a version point.
I have No links defined
I get the following two errors:
Warning: Cannot modify header information - headers already sent by (output started at /home/rawlinso/public_html/blog/wp-content/plugins/acronyms.php:149) in /home/rawlinso/public_html/blog/wp-admin/link-manager.php on line 563
Warning: Cannot modify header information - headers already sent by (output started at /home/rawlinso/public_html/blog/wp-content/plugins/acronyms.php:149) in /home/rawlinso/public_html/blog/wp-admin/link-manager.php on line 564
I quickly clicked through the rest of the WP admin screens and didn't get the error to occur anywhere else. If I deactive the acronym plugin the errors go away.
<a href="http://hugophonic.com/arc/2004/08/15/ramblings-de-hugo/31/#comment-20" title="hugophonic.com comment">Comment on my site
with this code in it.
MySQLIt will show the acronym info for the MySQL and hide the title info in the href tag. I don't know if this is the way you want it to behave or not.
Also, any way that I could easily add support for "." characters, for including acronym info country domain names for example. I don't know REGEX. Thanks.
If you make a link with NOTHING in it but an acronym, then yes, the acronym's title is going to hide the link's title, because it's inner-most, and most browsers are smart enough to figure that it's most important.
* Personally, I think the title attribute on links is practically always unnecessary: it should be clear from the context (and from the URL, which appears in my status-bar) what the link is for, so a title is just redundant information which your reader's will most likely not see.
* Aside from my personal feelings about the link's title tag, I'm also against the practice of one word links, in general, unless that one word is the name of a product, person or company. If that's the case, then having the link's title hidden by the acronyms title is almost certainly not a problem [;)]
All of that to say that basically, that _is_ the way I want it to behave [:P]. See, for example, the link to the W3C in my article above: the W3C acronym title shows over "W3C" but not over the whole link...
As far as country codes in URL's ... yes, you can do that, just delete the "." from the first regex on line 132,
preg_replace("|([^.That will work, but it will have the side effect of also making most of your file extensions into acronyms as well (like somepage.html or some image.gif).Lastly ... I should probably figure out how to make the acronym plugin take effect when you *write* the article, instead of when it's rendered, that would reduce the ammount of work drastically, without any major side-effects, I think.
Parse error: parse error, unexpected T_STRING in /home/blah/public_html/wp-content/plugins/acronyms-plugin.php on line 33
I literally just copied it direct from your source file to my host. Didn't change or modify anything :(
But as soon as I activate it, it brings that error up on my blog.
I think the error you are having is very common with the current downloading mechanism on the blogs today. You probably have a whitespace before the
<?phpor after the?>at the beginning and end of the pho file. Check it and remove any whitespaces before or after. Great Plugins Joel!There's no white space before the <?php
And there's no white space after the ?>
I asked someone on #wordpress if they could send me their plugin - and it worked fine. So it has to be a problem with me copying it from the source page.
The other thing that occurred to me, is that maybe I wasn't using Unix line breaks in BBEdit, but I checked and I was.
I'm also using the Unicode character encoding.
Still - neither of these things can be causing the problem. Can they?
Joel, can you please post the plugin compressed in a zip file or something so that I can test it?
http://www.forbiddenbyte.co.uk/archives/2004/08...
However, the plugin is working fine, sort of - but I now get this error when either posting or deleting an entry:
Warning: Cannot modify header information - headers already sent by (output started at /home/dave/public_html/wp-content/plugins/acronym.php:1) in /home/dave/public_html/wp-admin/post.php on line 474
Not to sure what is wrong with that :(
I'm working on a modification to the 'view source' file I'm using to let people download plugins easily.
Warning: Cannot modify header information - headers already sent by (output started at /home/nailet/public_html/wp-content/plugins/text-replace.php:94) in /home/nailet/public_html/wp-admin/post.php on line 340
If I disable acronyms, my post page works just fine.
I also notice that my acronyms breaks my links when I use acronyms in the title. I copied the php code directly from the page here and pasted it into Dreamweaver and saved as acronyms.php. The acronyms work, but unfortunately, it causes the error in my post screen and template edit screen and it breaks in HTML title tags :(.
If there's a fix out there, I would surely like to use it, but for now I have to keep it deactivated.
Warning: Cannot add header information - headers already sent by (output started at w:\www\lostdays.info\wp-content\plugins\acronyms.php:150) in w:\www\lostdays.info\wp-admin\index.php on line 13
One day it was raining, but using <acronym title="Hypertext PreProcessor">PHP</acronym> is great so I had a great day.rather than just having the letters PHP right in the middle there. The problem is that now that I've installed the acronym plugin, all of those old posts that have acronyms in them with acronym tags around them are now double-tagged! In other words, WordPress is outputting
One day it was raining, but using <acronym title="Hypertext PreProcessor"><acronym title="Hypertext PreProcessor">PHP</acronym></acronym> is great so I had a great day.which is a slight nuisance, though it doesn't invalidate my page any and looks identical in visual browsers.
I'm not a PHP expert, but I feel comfortable enough hacking the plugin to fix this for my own site, but was wondering if there was an easier way, perhaps through a more sophisticated regex I could use? If there's a one-two-button-your-shoe fix to this, I'd really appreciate being let in on the secret.
In either case, great plugin, and thanks for writing it. :)
$text = preg_replace("|<acronym[^>]*><acronym title="$description">$acronym</acronym></acronym>|imsU",
"<acronym title="$description">$acronym</acronym>" , $text);
That should do it [:)] , but I haven't really tested it ...
<acronym></acronym>-Tags, even if it's inside a word. Check out my blog, you'll find plenty of examples over there. Maybe you know a quick fix for that, or can point me into the right direction to fix it.Thanks ...
I'll try to come up with a better solution later today, but in the meantime I've marked the acronym plugin 2.7 and you can download it at the link above.
Feel free to grab 2.8 from the link above.
I have installed WP 1.3 on a test system this afternoon and your acronym plugin causes many error messages in connection with posting comments and blog entries. I know that WP 1.3 is in development but do you think you will find time to make your great plugin WP 1.3 compatible?
So, yes, and ... wait, error messages?
$acronym_acronym = array(
"missiology" => "missiology is the area of practical theology which studies the mission of the Church including evangelism, apologetics and work of the Christian in their cultural setting",
Should this still work? It doesn't seem to...am I doing something wrong?
Warning: Cannot modify header information - headers already sent by (output started at /home/uruloki/public_html/wp-content/plugins/acronyms.php:158) in /home/uruloki/public_html/wp-admin/post.php on line 146The line in post.php where it seizes up is different (between 340 and 146 usually). I am using WP 1.2 with Acronym Replacer 2.8, and was wondering if there was anything else I have to do to install the plugin (I simply used the plugin manager in the CMS).
Thanks for the plugin and the help!
t0mmy
@add_filter('the_excerpt_rss', 'acronyms', 18);@
After doing so, I get the following massage when I try to login.
Parse error: parse error, unexpected T_LNUMBER in /customers/rjohnsen.dk/rjohnsen.dk/httpd.www/wp-content/plugins/acronyms.php on line 57
And yes I don't know much about this, so please - spell it out for me.
Thanks - if you decide to di so ...
As an explanation, yet another FYI: I, too, somehow stumbled into the trailing spaces issue: a single whitespace had crept into the last line in wp-acronyms.php, just after the closing "?>" tag. Most interestingly, not only was the acronym feature not working, but it broke the WP login page: the base login page came up fine, but after entering my user/pass, I got back a completely blank page -- and still wasn't logged in.
I still don't know how or exactly when this extra space crept in :/
Oh, you probably already know this, I don't see it mentioned anywhere, but it seems to work fine on WP v1.5.
Hi to all.
I try to use this plugin in my language Bulgarian.
But the problem is if I put Acronym (for exaple PEPE) in cyrilic nothing happend. In English works good
Some Help?
The problem was in the white space on each line. Apparently they are a different type of white space then a regular push of the space bar. So I put the code into BBedit lite and set it to display hidden characters and spaces. Then I selected one of the wrong space (it was displayed as a solid dot, not a hollow dot) and did a find replace, replacing the trouble makers with regular dots. Now it seams to be working great.
Also, I should note that I am using a Mac OS box running Tiger.
Warning: Cannot modify header information - headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 10
Warning: Cannot modify header information - headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 12
Warning: Cannot modify header information - headers already sent by (output started at /home/account/public_html/wp-content/plugins/acronyms.php:141) in /home/account/public_html/wp-admin/admin.php on line 13
i'm not php-savvy so it might be a simple fix. i just don't know what it is. commenting out those lines in the admin.php file didn't do me any good LOL. any chance for some help?
Otherwise, it's a great plugin.
Thanks!
By the way Jeannie:
Check for spaces, newlines or any characters before the , and remove them. That should work.
Frankly, would getting a direct link to the plugin file be too much to ask for? That encoding bug would vanish.
It's convienient to make me use some abbrev without explain what it is.
But I have a problem now,that this plug-in seem not to work on Chinese(Big5).
For Example,
"(Chinese)"=>"12345",
"FF"=>"(Chinese)",
the latter works,but former doesn't.
I guess it's because the plug-in can't catch Chinese characters correctly,which consists of two bytes.
Can you help me fix this problem?
Anyway, @$file@ is the parameter that you need to pass to the script, like to view the source.php script, you need a link to "source.php?file=source.php":http://www.huddledmasses.org/wp-content/plugins/source.php?file=source.php or else you should just get the "sorry, that file doesn't exist" error.
Anyway, I think I fixed my copy of "View Source":":http://www.huddledmasses.org/wp-content/plugins/source.php?file=source.php, so you can use that link I just posted to view it, and even download it.