1 edb Jan 04, 2007 02:35
3 edb Jan 04, 2007 22:09
Add the same word with the upper case version. So like "Word" and "word". That was the change made in 0.2 - to be able to add upper and lower cases - because the renderer itself, as you noticed, only matches the exact case situation.
BTW I should point out some things this plugin doesn't do, just to be up front about it. For autolinks it does not know how to make b2evolution.net become http://b2evolution.net/, meaning you have to enter properly formed URLs. For autolinks and acronyms I have no idea what will happen if you try to add it's using an apostrophe as your title tag. I used URLs in the title tag and they worked, so maybe an apostrophe will also work, but I don't know for sure.
Oh and I'm glad you like it!
4 cipher0 Jan 05, 2007 01:36
Oh, ok.
I have to add a lower case and an upper case version and depending on whether I type the lower case or the upper case will determine which link is applied. (Unless the link is the same for both words.)
Thanks for clearing that up.
By the way, you can't put apostrophies in title tags. I tried.
Now if I could only figure out how to get subdomains (sub.domain.com) to work properly.
5 edb Jan 05, 2007 01:58
cipher0 wrote:
Oh, ok.
I have to add a lower case and an upper case version and depending on whether I type the lower case or the upper case will determine which link is applied. (Unless the link is the same for both words.)
Thanks for clearing that up.
By the way, you can't put apostrophies in title tags. I tried.
Yeah - you got it. So you might add google and Google and probably link them to the same site. I'm halfway thinking it'd be cool to have it know that keyword google also means keyword Google, or the other way around, but I'm not sure that'll always be what is needed.
Good news on apostrophes!
When I find some time I need to see what happens with keywords that have spaces in them. I think it'll freak out, and if so I need to make it check that the user isn't trying to add a keyword with a space. The actual renderer looks for non alpha-numeric characters around words in your post so it won't break into the word 'specialist' if you happen to have 'cialis' as a keyword. Anyway that's why it'll freak out so I should put in a filter to make sure there's nothing unusual in the keyword list.
EDIT: BAD news on apostrophes. I read it wrong the first time. :(
6 cslepage Jan 06, 2007 05:02
When I attempted to use "T/C" as a keyword, and apply an acronym to it, the following error appeared in my error log:
Fri Jan 5 22:47:02 2007] [error] PHP Warning: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Unknown modifier 'C' in /home/comlist/public_html/plugins/acrolink_plugin/_acrolink.plugin.php on line 342
The solution quite simply appears to be to take "T/C" off the list. Normal keywords, without slashes or parentheses, work just fine.
Thank you for the plugin!
7 ttlblog Jan 08, 2007 10:18
Oh dear, I seem to be the first with an installation problem. The plugin uploaded okay but when I went to install it the following appeared.
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE latin1_general_cs NOT NULL default '', linkurl varch(Errno=1064)
Your query:
CREATE TABLE IF NOT EXISTS evo_plugin_acrolink_19_Keywords (
keyword varchar(50) COLLATE latin1_general_cs NOT NULL default '',
linkurl varchar(255) NOT NULL default '',
titletag varchar(80) NOT NULL default '',
PRIMARY KEY (keyword)
)
Can anyone please point me in the right direction.
Thanks
John
** Forgot to add MySql is version 4.0.25 (Patched) if that helps.
8 edb Jan 08, 2007 14:57
I don't know if it's a version thing or not, but I think it's because of the "latin1_general_cs" part. I did that to make the thing be case-insensitive, and tested it on the only place I could (my web host), but was kinda worried that it might not be the best way to do it.
So anyway open up the _acrolink.plugin.php file and find this bit around line 48:
"CREATE TABLE IF NOT EXISTS ".$this->get_sql_table('Keywords')." (
keyword varchar(50) COLLATE latin1_general_cs NOT NULL default '',
linkurl varchar(255) NOT NULL default '',
Now remove the latin1_general_cs bit:
"CREATE TABLE IF NOT EXISTS ".$this->get_sql_table('Keywords')." (
keyword varchar(50) COLLATE NOT NULL default '',
linkurl varchar(255) NOT NULL default '',
The thing is you'll lose the ability to add both 'Google' and 'google' as keywords because the table will become case-insensitive again. If - IF - that fixes it let me know, and click the "watch this topic" link at the bottom of the page so you'll get notified by email if I ever figure out a better way to make it be case-insensitive. If it doesn't let me know that as well and I'll see what I can guess at ... er ... figure out next.
9 ttlblog Jan 08, 2007 15:14
Unfortunately, that didn't work - just gave me a similar error.
I have reverted back to including the latin1 reference.
MySQL error!
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE NOT NULL default '', linkurl varchar(255) NOT NULL d(Errno=1064)
Your query:
CREATE TABLE IF NOT EXISTS evo_plugin_acrolink_19_Keywords (
keyword varchar(50) COLLATE NOT NULL default '',
linkurl varchar(255) NOT NULL default '',
titletag varchar(80) NOT NULL default '',
PRIMARY KEY (keyword)
)
any other ideas?
John
10 edb Jan 08, 2007 15:24
Yes. Oh wait a minute - I just now noticed the COLLATE part. maybe getting rid of collate along with the latin1_general_cs part? In other words, make that particular varchar line look like the others.
If that doesn't work I was thinking MAYBE your version of mysql doesn't like a varchar(255) so you might consider setting it to varchar(180) or something. A quick google of the issue tells me this is not the answer, but maybe the collate thing (in addition to telling it how to collate) is the problem.
I'm hoping the removal of "collate latin1_general_cs" will help you. That would mean you are, effectively, using version 0.1 of the plugin.
pls keep me informed as I'd like to be able to make this happen.
11 ttlblog Jan 08, 2007 16:26
Yes that works - but is case-sensitive.
12 edb Jan 08, 2007 16:31
Okay - so we know what caused the error. Please - do the "watch this topic" thing so I'll have a way to let you know when I think I have a fix for it.
13 ttlblog Jan 08, 2007 16:49
Thanks for that - great plugin by the way - well useful.
If you do update the version I do have a niggle as well.
I would like to use TTL for Taking the Lead site (no problem)
TTL Blog for the blog on the site
TTL Shop for the shop on the site
TTL Forum for the forum on the site.
Always picks out the TTL and ignores the rest - could be useful if words in "" or [] could be used in links - or better still if plugin recognised 2 or 3 word phrases.
As I said, only a niggle not desperate or life-threatening.
I can manage with TTLBlog, TTLShop etc..
I will watch this space for the other - thanks John
14 laygnuk Jan 10, 2007 23:20
I've tried the the suggestion posted above and still get this :
MySQL error!
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE NOT NULL default '', linkurl varchar(180) NOT NULL (Errno=1064)
Your query:
CREATE TABLE IF NOT EXISTS evo_plugin_acrolink_25_Keywords (
keyword varchar(50) COLLATE NOT NULL default '',
linkurl varchar(180) NOT NULL default '',
titletag varchar(80) NOT NULL default '',
PRIMARY KEY (keyword)
)
I have the possibility to switch from MYSQL4 to the version 5
is this going to help me install this plugin ? (i never had any problem till now when installing b2 plugins..
i'm already watching this topic and really curious to "see" what this plugin is about :) anyway thanks for helping !
blog version 1.91
host : apache
provider: infomaniak.ch
15 edb Jan 10, 2007 23:44
You missed my correction to my possible correction! EdB wrote:
Yes. Oh wait a minute - I just now noticed the COLLATE part. maybe getting rid of collate along with the latin1_general_cs part? In other words, make that particular varchar line look like the others.
Get rid of the "COLLATE" part and your plugin will be functional, but will not allow 'Google' and 'google' as keywords.
BTW I'm working on it right now. I found a bug in the plugin updater though that effectively stops updating this plugin from happening. I'm not sure if I should kill this plugin and start with a new name (same function), or provide text instructions for how to manually alter your database to 'upgrade' and retain your keyword list. To me if I do the first then every user will have to re-enter their keyword list. If I do the second then users who are okay with manually editing their database won't lose what they've got, and everyone else will have to uninstall the plugin then reinstall the next version, and therefore lose their keyword list in the process.
Probably gonna go with the "here's an update that won't work" method because that way some users won't lose the keyword list they've already put together.
Anyway I'm hoping for a good package by tomorrow.
16 yabba Jan 11, 2007 02:12
Off the top of my head (haven't checked the exact order events fire)
in BeforeInstall() grab the current contents of the tables if it/they exist in the db, then drop the tables
Put your new db stuff in GetDbLayout() (or whatever it's called) so that new installs still work and your tables get rebuilt
In AfterInstall() put any data back in the new tables
¥
*edit*
don't forget to pour a double before backing up everything including your car before trying this at home ;)
17 laygnuk Jan 11, 2007 16:01
Oh i see now..ok install is done, now..do we have to call the plugin by code ? or something ?
i just can't see it, i've added the blog where i want to see it..but i just can't "see" the plugin anywhere..
edit : i'v added few keywords, still can't see them..
i'm testing this at vajra.be
Firefox 2 here..
18 edb Jan 11, 2007 16:24
I guess this means you installed the plugin, found the plugin settings where you told it what blog(s) you wanted, and found the extra tab on your tools tab where you get to add new keywords. Then added keywords. I'm hoping those keywords then showed up in the list when you hit the Tools::AcroLink tab again?
A post that existed prior to the installation won't use this renderer, so you would have to edit the post and check the box for this renderer. Does that help? I hope so, else version 89 million is going to have to happen :(
To ¥åßßå: Thanks mate, but I can't really follow where you're going. I've tried and will try again, but it's a lot of work-around to a bug in the plugins system IMHO. Look it's taken me forever to figure out how to put in an "edit" link next to each keyword, so ... what can I say? Anyway the next release is happening very soon. It will (okay SHOULD) get rid of this annoying bug, allow you to use case-insensitive keywords, give clickable links for editing and deleting keywords, and - as a payback for the crap that is v0.3 - split permissions for adding and editing/deleting into 2 different admin selections.
To anyone using this plugin: STOP adding keywords!!! The next release, and all future improvements, will require either completly re-writing your keyword list or working through phpmyadmin to tweak your installation's plugin database. Sorry, but I'm just not up to the task of understanding what ¥åßßå is saying.
(v0.3 was a mistake. it worked in my test installation, but it does stuff I did not see b2evolution doing so I should have known better and coded according to what the official package does.)
19 laygnuk Jan 11, 2007 16:33
Thanks a lot, i could have hit this understanding by myself, sorry for distracting you, and again thanks for your quick help on this ! :)
20 yabba Jan 11, 2007 16:54
Hey EdB, I had a play and something like this should work, even if it is a workaround ;)
function PluginVersionChanged()
{
global $DB;
$sql = 'select * from '.$this->get_sql_table('Keywords');
$this->temp_results = $DB->get_results( $sql,array( 'halt_on_error' => false) );// get the old data
$sql = 'drop table '.$this->get_sql_table('Keywords');
$DB->query( $sql );
$sql = $this->GetDbLayout();
$DB->query( $sql[0] );//create the new table
if( !empty( $this->temp_results ) )
{
foreach( $this->temp_results as $old_row )
{
$sql = 'insert old data into new table format';// obviously change this to suit
$DB->query( $sql );
}
}
return true;
}
¥
21 edb Jan 11, 2007 17:33
Cool. Will give it a go. Currently getting myself all buggered up trying to do everything the hard way. Gotta stay focused on stealing what other plugins do ... ;)
22 yabba Jan 11, 2007 17:51
Get your priorities right, *hands drink*, now you can stay focused ;)
¥
23 edb Jan 12, 2007 01:40
Thanks man. I'm really close. v0.4 works, but I really want to add a clean upgrade method. The bit I'm stuck on, for the moment, is that I want it to do the "temp table drop table rebuild table" ONLY if the version is 0.3. I THINK that will cover all cases where someone might have to fight with the upgrade process to get it to work, so it's worth doing it - if I can.
24 blueyed Jan 12, 2007 02:34
PluginVersionChanged gets "old_version" in $params, which you can use to check this.
See http://doc.b2evolution.net/v-1-8/plugins/Plugin.html#methodPluginVersionChanged
25 edb Jan 12, 2007 08:35
Thanks! I got busy reading an online comic from beginning to current, and will now come back to this project.
26 edb Jan 12, 2007 12:21
Okay! v0.4 is available from the same link as before - see the first post in this thread or just grab it [url=http://wonderwinds.com/media/blogs/hackblog/acrolink_plugin.zip]here[/url]
In this release I'm pretty sure I fixed the problem some people had with it not being able to install by adding an ID and making that the primary field. You won't notice that when you make keywords, but you will notice that now you have an edit and delete icon link next to each keyword. If you've got permission to edit and delete keywords eh?
Oh that's another change: you can decide who can add keywords, and decide who can edit or delete keywords. It's not one setting anymore is what I mean.
Anyway if it's got bugs lemme know and I'll do what I can.
27 laygnuk Jan 17, 2007 11:04
It works just great now ! instalation run smoothly !
thanks for the update !
28 cslepage Feb 21, 2007 12:50
Is it possible to have the key word be a phrase? As in
Marvel Comics
as opposed to
Marvel
?
29 edb Feb 21, 2007 13:09
Yes, AFAIK it is very possible. The thing is if you also have "Comics" it'll match that first and therefore never match "Marvel Comics". It sorts your keywords by length and matches the shortest keys first is the thing. I'm gonna hafta install this on an un-butchered blog so's I can make sure of what I'm saying eh?
OffTopic: My next door neighbor when I was growing up was the guy who created the "Iron Man" character. That's my claim to fame in this world :roll:
30 cslepage Feb 21, 2007 13:51
Iron Man (Anthony Edward Stark) is a fictional comic book superhero in the Marvel Comics universe. He was created by Stan Lee, Larry Lieber, Don Heck and Jack Kirby in Tales of Suspense #39 (March 1963).
Do you remember the name of that neighbor?
31 edb Feb 21, 2007 20:25
Heck yes! Is that enough of a clue? Every now and then we would see his name on the credits for those cheap saturday morning cartoons where all they did was took a cartoon panel, spoke the words, and sometimes shook the panel a little to indicate action. Maybe it's still normal, but back then cartoonists did like contract work - drawing new issues of comics that weren't their own creations. So when they put his panels on teevee they put his name up there. He was a pretty damned good artist too, not to diss cartooning, but I think you know what I mean. He did a portrait of one of my father's dogs that people regularly mistook for a photograph.
32 dub27 Mar 02, 2007 23:50
Hi EdB,
Nice Plugin!
However, install went clean, i.e.
- installed
- activated plugin
- made choices of all and admin screening
- added keywords
- they showed with edit/delete links
but when I go to write a post or edit an old post, the checkbox is not active. it is selected but not active.
Any ideas?
Thanks in advance... I have read a lot of your tips/hacks here and they have been great!
D
33 dub27 Mar 02, 2007 23:50
should add, v1.9.2 b2e
and v5 of your plugin
34 edb Mar 03, 2007 00:53
What do you mean by "selected but not active"? It should show up as a regular checkbox that is checked, and uncheckable if you want. It should not show up 'grayed out' or anything funky like that.
Hey did you select 'All' or 'ALL' to get all blogs? Never mind - it seems to know both situations means the same thing.
Did you tell it to be a lazy renderer? When I do that I get an unchecked checkbox that I can't check. It works though, meaning it does it's thing even when it looks unchecked. Selecting 'stealth' makes the checkbox disappear but I got this feeling it'll work that way too.
Oh yeah that's a good question: does it work even though it's selected but not active?
35 tensh Apr 11, 2007 13:16
I can't download your plugin... anybody have any idea where I can get it?
Once again you've provided us with an extremely useful addition to our blogs, but...
I tested a word in upper case and lower case and the only one that worked was the lower case version.
I added the word to the keyword list using lower case letters, if that helps.
Anyway, I just thought I'd let you know so you could check for bugs and such.
I set up a test blog so you can see what I'm talking about.
http://jpeorg.100webspace.net/blogs4/testblog.php