Archived Comment Thread
Please visit the new AZIndex Website for all the latest on the AZIndex plugin.
I have preserved the old comment thread below in case some people are still linking here, or coming back to find answers to old questions.
For new questions, comments, and feedback about AZIndex, please use the new Feeback page.
Heather B said:
maybe you can supply the sql to run manually in phpmyadmin
English Mike said:
Heather — no need — in the rush to fix the previous problem I screwed up 0.7.2 even worse! Please try 0.7.3 to see if that works any better. It should appear on the WordPress Plugins directory in a few minutes.
Heather B said:
I’m thinking that this plugin and I were just not meant to be, lol….
English Mike said:
Does that mean it’s still not working for you? (v0.7.3?). I would love to know what version of MySQL you are using. I tested this on MySQL: v4.1.22 and 5.0.5.
Here is the SQL call to create the table if you would like to try it in PHPMyAdmin:
CREATE TABLE wp_az_indexes ( name text NOT NULL, idindex int NOT NULL, categories text, tags text, heading text, subheading text, description text, cols tinyint, headingseparator text, itemsperpage smallint, ignorechars text, nlslocale text, nlsequiv text, customcsssingle text, customcssgroup text, customlinks text, customsort text, options set('child-cats', 'include-pages', 'include-pages-exclude-posts', 'multipage', 'multipage-links-above', 'multipage-links-below', 'group-subhead', 'alpha-head', 'alpha-head-page', 'alpha-head-col', 'add-spaces', 'alpha-links', 'alpha-links-unused', 'alpha-links-two-rows', 'ignore-chars', 'non-alpha-end', 'nls', 'nls-equiv', 'nls-locale', 'custom-css', 'custom-css-striping', 'custom-links', 'custom-sort', 'disable-cache'), itemcache mediumblob, linkcache blob, PRIMARY KEY(idindex)) DEFAULT CHARACTER SET utf8;If that doesn’t work, then try taking “DEFAULT CHARACTER SET utf8″ off the end and try again.
Monika said:
Hi thanks for this plugin
testing it was easy and good,
but my mother speech is German,
we have special characters in our language
öäüß ÖÄÜ your plugin doesn’t show Ö it shows only O but this is not correkt and no German people search for O if it would like to read Ö because Austria =Österreich and not Osterreich
I know this special characters are heavy - e-mail clients can’t show them correct most of the time, and so on..
but workaround is Ö =Oe Ä =Ae Ü=Ue is this possible?
thanks
Monika
English Mike said:
Monika, thanks for the information. I used the collation table from here: http://www.collation-charts.org/mysql60/mysql604.utf8_unicode_ci.european.html as a guide to what to do, and it folds the ÖÄÜ characters into the OAU sections in the index. There are separate tables for some languages, but not for German.
I understand your problem, but I’m not sure if I can do anything about it. My plugin does not have much control over how the index is sorted — I just use a function call (strcoll()) provided by the programming language (PHP) because sorting is so different in all the different languages.
I will take another look at German to see if there is anything I can do. Please check back here in a day or two.
Monika said:
thanks .. if not . I’ll found a workaround - a little sentence or so -with a blink in my eyes - and my user understand
I’ll come back
regards
Monika
English Mike said:
Monika, I looked on Wikipedia and it says that there are three different ways to sort german indexes:
1. In dictionaries, the accented characters (ÖÄÜ) and placed next to the unaccented characters (so Österreich would come next to Ostrich).
2. In telephone directories and place name indexes, the accented characters (ÖÄÜ) are expanded (Ö =Oe Ä =Ae Ü=Ue) like you wanted above.
3. In some cases, the accented characters (ÖÄÜ) are placed separately either after the base letters (OAU) or at the end of the alphabet (after Z).
Unfortunately, the sorting used in AZIndex only does number 1, and not 2 or 3. However, I do have an idea which might help you. I will post another comment (or a new blog post) later. You might be able to use a custom sort function to get what you need.
English Mike said:
Monika, I wrote a comment explaining how you can convert the ÖÄÜ characters into Oe Ae and Ue before the index is sorted (option 2, above), but I lost it somehow. I will write a new blog post this weekend to explain how you can do it.
Nonaoco said:
AZINDEX ERROR: Invalid az-index short-code found. A non-zero id parameter must be specified.
Please notify blog/site administration of the problem.
(Message from the AZIndex plugin)
English Mike said:
Nonaoco — if you go to the AZIndex settings page, do you see your index settings or a red error message? If you installed 0.7.2 you may have lost your index settings (my fault). If you haven’t done already, try installing 0.7.3 and recreate your index (you will get a different index id, so you will have to change the id of the index in the page displaying the index.
Charles Hodgson said:
Hi Mike
I am running the latest WordPress on BlueHost (so I assume up to date MySQL too) and just upgraded (twice) to the latest of AZIndex. Whereas before things were working wonderfully, now it appears that it lists all the posts that start with a capital letter then starts again alphabetically with the posts starting with a lowercase letter.
English Mike said:
Charles, yeah, this plugin is getting complicated to regression test correctly. I see the problem. There is a workaround — if you go into the settings and turn on the National Language support option, then the lowercase characters will be sorted correctly again.
I will fix the problem as soon as I can, but you will understand if I take my time making sure I don’t break anything else!
EM
Charles Hodgson said:
Thanks Mike
I tried the workaround but it didn’t seem to make a difference. Do I have to toggle more than just the main tickbox? (there are 2 sub-boxes)
Thanks for what you’ve done and I look forward to when you’ve had time to get a fix together.
Cheers
English Mike said:
Darn it — it definitely works for me, just tried it again. Are you sure your index page isn’t being cached? Try clearing the cache (from the main AZIndex settings page) and maybe your browser cache and, if you are running WPSuperCache, that too.
You should not have to select the national language sub-options.
I’ll work on getting the fix in soon.
Charles Hodgson said:
Well, I hadn’t cleared my browser cache but I did disable WP-Cache and clear the AZIndex cache. …
Instead of clearing my Firefox cache I poped it up in both IE and Chrome, no joy.
Ah well…
I’ll check back here later to see if you want me to do any other diagnostics.
Cheers
English Mike said:
No need (I hope). I just created (yet) another version of AZIndex — 0.7.4 — which should popup on the repository in a few minutes. You might have to turn off the national language support option again, but the plugin should sort the lowercase letters in the correct order again, now. Please let me know what you find.
Charles Hodgson said:
Sorry to be away from the conversation for a few days (busy weekend).
As if by magic things are working perfectly now. But I know it isn’t by magic, it’s by your care and attention.
Thanks!
Andy said:
Hello, I have got one problem. When I want to activate your plugin, this arrow accures:
Fatal error: Cannot redeclare az_add_admin_page() (previously declared in /var/www/anst/projektfolder/htdocs/wp-content/plugins/azindex/az-index-admin.php:73) in /var/www/anst/projektfolder/htdocs/wp-content/plugins/azindex/az-index-admin.php on line 74
English Mike said:
Hey Andy. It looks as though you might have two copies of the AZIndex plugin in your plugin directory somehow. If you can, take a look in your /var/www/anst/projektfolder/htdocs/wp-content/plugins folder and see if you can find any extra copies of az-index-admin.php (and az-index-cache.php and az-index-content.php) and delete them.
The error message you are seeing is because WordPress is trying to load two copies of az-index-admin.php.
I hope that helps.
EM
Artikel alphabetisch sortieren - nach Titel - nach benutzerdefinierten Feldern said:
[...] statischen Seite - und dies alles mit ganz wenigen Klicks. Wunderbar ist das. Das WordPress Plugin A-Z Index kann dies - und vielleicht noch [...]
K said:
Hi EM!
Sorry I can’t help to track the issue with error - everything is fine at my end, but I just want to ask if it is possible to list the site tags with your great plugin? I mean unordered list of tags with alphabetical links?
thanks
English Mike said:
Hi K, glad it’s all working! At the moment there is no way to add tags to the entries. I was working on some template code which would allow you to include things like tags and categories but then I went and deleted it all by mistake
I do plan to add that feature at some point, so keep watching.
The Local Landing said:
Just upgraded to 0.7.4 and all the indexes we had made are gone… Is there any way to get them back? Please help!
English Mike said:
Hi there. I’m sorry, but if your indexes are gone, then I’m afraid there is currently no way to bring them back unless you made a backup of your blog’s database before you upgraded. If you have a backup (which all bloggers should have, by the way!) then I am willing to help you recover the indexes, but without one there is nothing anyone can do, I’m afraid.
Did you upgrade directly to 0.7.4? There was a problem with 0.7.1 and 0.7.2 which caused some people to lose their settings, but I fixed that problem in 0.7.3 and you’re the only person to report the problem after that. Either way, something failed during the upgrade and the settings are lost.
Unfortunately, the experiences of the last week have shown me that the way the plugin upgrades the database between releases is inherently unsafe — if the upgrade process fails for some reason then all settings can be lost. I know it’s of little consolation to you, but I will be working on a safer way to do it, so that settings are not lost if something goes wrong.
The only other thing I can add is that AZIndex is still clearly marked as BETA software and, I’ll afraid, this type of thing can happen from time to time when developers are still adding new features. The best suggestion is to make regular backups of your blog and especially your database so that you can get things back if it all goes wrong.
The Local Landing said:
No worries. I’ve remade most of the indexes already anyway, it’s not so bad. I upgraded to 0.7.3 the other day then 0.7.4 earlier today right before i sent the original message. Not sure when the indexes were lost, but it might have been after the first update. There was an error when I did that one.
We do have a backup but like I said, I’ve got them mostly remade anyway. Interestingly, though, as I remade them the numbering of the indexes started counting from where the old indexes were (in the 40’s) rather than starting from 1. Don’t know if that means anything.
Anyhow, love the plugin. Keep up the good work!
English Mike said:
Well, I’m glad the recovery wasn’t too bad
FYI: The counter for ids of the indexes is stored in the WordPress database options table, so that value wasn’t wiped out when the AZIndex table was. I have no idea why I just didn’t use an auto-incrementing id in the AZIndex table (probably just didn’t think of it at the time). Ah well.
English Mike » Add-on Plugin for German AZIndex Users said:
[...] a German AZIndex user asked if it was possible to convert German index headings containing umlauts to their non-accented [...]
zonebattler said:
Hi Mike, I frequently use french style quotes (»Guillemets«) and I wanted to add the character “»” to the “Ignore these characters when sorting” field. However, this resulted in erraneous sorting for articles beginning wit a number (!) or special characters like “#”. I was able to solve he problem by removing the default single and double quote charactes from the ignore list, leaving only the “double chevron” aka Guillemet character. This works fine for me but I just want to report that adding more characters to the ignore list might screw up index building. It took me an hour to find out why me index was behaving so strangely suddenly…
English Mike said:
Hi, Zone, thanks very much for the feedback and for debugging the problem you were having. I had to add some funky code to handle those curly quotes that WordPress likes to put in everyone’s posts (they are double-byte characters in UTF-8 and were not being processed correctly by the plugin) and I suspect I didn’t quite get that code right first time around.
Now that you have given me a test case to work with, I should be able to fix the problem in an upcoming version. Thanks for the help!
zonebattler said:
Thanks from me for the fast response!
BTW, in case you are looking for my index created by your plugin: it is to be found at
http://www.zonebattler.net/laboratorium/
It works fine now but as I said I have only one double-chevron french quote character in the exclusion list. Would be great indeed if future releases of your plugin could handle more without shaking up the index list…
Keep up the great work,
Ralph
English Mike said:
The index looks good, though I noticed that you haven’t turned on the national language support option in the settings (which is why all the index items beginning with umlauted characters are at the end of the index. Is that deliberate?
I am curious because another German user didn’t like the natural ordering of umlauted characters in the index and I am wondering if you also think that it is wrong.
EM
zonebattler said:
Mike, I tried to activate the national language support feature, however it doen’t seem to make any difference. Of course I’d like to have the umlaut characters sorted in where the respective non-umlaut character is… Do I have to specify a “locale used for sorting index” and if so, what would be the correct name of that parameter for German/Germany?
Thank you for your help,
Ralph
English Mike said:
I don’t know what to tell you. For German, you should not have to do anything more than enable the basic national language option — that’s all I have to do on my test systems (Windows XP and Ubuntu), but unfortunately, people’s results seem to vary depending on the type of server and server host they are using. But at the very least, you should see umlaut characters in the alphabetical headings instead of the funny < ?> symbol.
You could try setting the locale name — though again, it depends on what your server supports. Someone suggested trying the following locales (one at a time)
de_DE, de, ge, de_DE.UTF-8, de_DE.utf8
Finally, if you don’t mind losing the umlauts, you can install the add-on plugin I wrote for another German user which converts the umlaut characters to the equivalent non-umlaut character pairs — here’s the blog post I wrote:
http://englishmike.net/2009/01/24/add-on-plugin-for-german-azindex-users/
Maybe one day I will understand why some people are having more trouble than others, but I guess it’s always going to be an issue with this type of open source software.
EM
zonebattler said:
Mike,
thanks again for your patient support! I tried everything (the locales you specified and some more), but without any differences in result. Even the add-on-plugin doesn’t work in my blog, using it always results in a “Fatal error: Call to undefined function: mb_ereg_replace() in /…/plugins/azindex-german-filter/az-index-german.php on line 51″. However, I wouldn’t like to employ the add-on anyway for aesthetic reasons since it would convert all umlaut vowels to less legible double vowel substitutions…
So it boils down that I have to live with a handful of articles that are listed at the bottom of the index because the titles start with an umlaut. I agree with you that the problem has its origin in my provider’s server configuration. Well, I could rewrite the titles to avoid umlaut vowels in the first place (and in the first position), but I think I will leave it as it is. It’s not that much of a problem even for a perfectionist like me!
Yours,
Ralph
English Mike said:
Hey Ralph — thanks for the feedback — the fact that you got an error with the add-on plugin explains a lot. You do not have the multibyte PHP extension installed on your server, so enabling the national language support on the AZIndex would do nothing because I need that extension for it to work properly. (The good news is that my plugin doesn’t fall over without the extension — that’s good to know
).
I think WordPress gets away with not needing the multibyte extensions to PHP because it never has to manipulate the multibyte characters (like those with the umlauts) — it just stores them and displays them — and the MySQL database does all the sorting required (quite clever really) but when it comes to generating the character headings and links, I need the multibyte extensions to PHP for it to work.
So, if you ever decide you need to use the national language support in AZIndex, you are going to have to find a way to install that multibyte extension to PHP. If you’re using a web hosting service, you would have to talk to them about it.
Anyway, thanks again for trying it out. It’s always nice to know the reason why something may not be working as you thought.
Mike
zonebattler said:
Yes, I know perfectly what you mean: A good explanation for bad behaviour lets us sleep well nevertheless…
Thank you for the very comprehensive explanation! I’m somewhat relieved to hear that the problems I encountered are in the responsibility of my provider rather than in my own.
P.S. Im no native speaker of English (I’m of German origin as you might happen to guess), but I think that the string “Index cache has been clear successfully.” should read “Index cache has been cleared successfully.” Shouldn’t it?
Good night from accross the Atlantic,
Ralph
Andy said:
I searched for doubbled files but didnt find any.
English Mike said:
Andy, the error is happening because your blog is trying to load the function “az_add_admin_page()” in the file “az-index-admin.php” two times. If you only have one copy of the plugin on your blog then there are only two possibilities I can think of:
1) Someone else has created a plugin that uses the same function name (az_add_admin_page)
2) Your blog is trying to load AZIndex plugin twice for some reason.
Since it is extremely unlikely another plugin is using the same function names as AZIndex (this is why all AZIndex functions begin with az_) then I can only think that your blog’s configuration has been messed up somehow and it believes there are two copies when there is only one.
If you haven’t already tried this, try deleting AZIndex from your blog completely (including the azindex directory and all the files in it), and try installing it again. Sorry I can’t be of more help.
Michael said:
Very nice! Any idea or hint for me, to get the more Text (<!–more TEXT –>) into the description of my A-Z page?
English Mike said:
Hi Michael, I am not sure what you are asking for. The “more” tag is usually only supported in posts, not pages. A quick Google did find this post:
http://weblogtoolscollection.com/archives/2007/07/09/the-more-tag-on-a-wordpress-page/
which might be what you are asking for. You can try putting the code the post talks about in your page template and see what happens.
Michael said:
Yes, I mean this more tag. But I don’t know, how I should use this code for my AZIndex Page.
My idea is to tag my smiley album with a special tag (SAI) and great a AZIndex Page with the text from the more tag as description.
Example:
http://www.greensmilies.com/tag/sai/
The long link text, is the content of the more tag.
English Mike said:
Okay. I think you are asking if you can put the text in your “more” links (tags) in the index as the description for the index item. So you would have (for example):
Aliens (the title of post as the heading)
This post contains a list of cute alien emoticons (the more text inside the more tag)
Correct?
Well, if I am correct then you can do it, but you will have to modify your theme template to do it. Look for places in your theme files where it says:
the_content();and replace them with these two lines:
$custom = get_post_custom_values('more', get_the_ID());the_content($custom[0]);Then, instead of putting your ‘more’ text in the post inside the < !- more --> tag, put it in a custom field called ‘more’ for your post.
It works, but you will have to move all your more tags to a custom field for all of your old posts if you want this to work. There is no other way to do it.
Michael said:
Yeah, that looks like what I’m searching for. I allready thougt, that I have to use the custom field and use this new custom field in your plugin as descripton. I will test it, on my test blog.
Thanks!
Roy said:
I’ve just updated this plugin, but anything I try to do with it gives me the following error:
I have de- and reactivated the plugin, un- and reinstalled it, deleted it with the WP 2.7 functionality and reinstalled it, but all to no avail.
(PS I posted this on the WP forums before I figured I might better post it here.)
Roy said:
Addition:
WP 2.7
Operating System : Linux
Server : Apache/2.0.46 (CentOS)
Memory usage : 11.49 MByte
MYSQL Version : 4.1.21-standard-log
SQL Mode : Not set
PHP Version : 4.4.7
PHP Safe Mode : Off
PHP Allow URL fopen : Off
PHP Memory Limit : 128M
PHP Max Upload Size : 50M
PHP Max Post Size : 32M
PHP Max Script Execute Time : 30s
PHP Exif support : Yes ( V1.4 )
PHP IPTC support : Yes
PHP XML support : Yes
I can’t answer question 4 from work (no access to Plesk).
English Mike said:
Roy, sorry you’re having trouble. A few people have had similar problems, and it’s likely because the plugin failed to upgrade the database table because of an SQL error of some kind. Unfortunately your settings are very like to have been erased.
I am still trying to pin down what is gong wrong for some people. There is one thing I would like you to try, if possible. If it works, it should get you up and running:
1) Go to the plugins administration panel in your blog, and click the “Edit” link next to the AZIndex plugin in the list.
2) Locate the line:
$sql .= ” DEFAULT CHARACTER SET $wpdb->charset;”;in the file — I had to page down six times to get to it.
3) Insert two slashes // in front of the line so it now reads:
// $sql .= ” DEFAULT CHARACTER SET $wpdb->charset;”;Be careful not to change anything else.
4) Click the “Update File” button at the bottom of the page and then try activating the plugin again. Hopefully that should get you up and running again (but your settings will not come back).
Please report back to me if this works for you or not. Your feedback will be very useful in helping to nail down what the problem is.
If it doesn’t work, all I can suggest is that you go back to version 0.6.3, which should still work for you. You can find the older versions here. Do not try any of the 0.7.x versions as you will probably encounter the same problem you are having with 0.7.4.
Roy said:
Mike, that does the trick! I’m not all through the process yet, but I can at least add a new index again.
To answer question 4 (you’ve guessed it): no, there isn’t.
WASn’t
English Mike said:
Glad it worked for you — I had to add in that line in 0.7.3 to make the new national language support to work. I knew it was causing problems for some people in 0.7.2 which is why I looked at what WordPress did (because they use the same code for their database tables) and added some extra code they used, but apparently it doesn’t help much. Ah well, at least I know what to look at now — thanks!
Roy said:
Mike, there are more important things to look into, but just in case you’ve got nothing to do some time. If you look at this index you’ll notice international filmtitles. At the top you’ll see some funky things around numbers (no header, misplaced) at the bottom you’ll see titles beginning with À or Î which are not (as I expected) listed under A and I but at the bottom. I’ve played a bit with the national language support, but the only things that change are the headers from ? to A, etc.
No rush, I’m glad that I have the indexes back up. Thanks for you ever quick support.
English Mike said:
Hey Roy,
Some of the problems you are having are because you seem to have the “Group items with the same heading under one main entry” selected. Since you don’t have any subheadings in your index (you probably have that selected as “none”) then the links are not showing up at all!
Deselect the option and let me know what happens.
As for the sorting — yeah, some users on certain systems are not getting the sorting they want from their servers (the plugin depends on the correct locale to be set on the server for sorting (collation) to work). A couple of users are using filtering to get the sorting to work (after a fashion) and I might be able to do something in a future version to work around the sorting problems.
Les extensions (plugins) Wordpress utilisées sur ce blog | Blog gay de MensGo FR said:
[...] AZIndex 0.7.4 » English Mike (url) A highly customizable and user friendly plugin to create one or more alphabetical indexes of selected posts in your Wordpress blog. Mon avis : Crée automatiquement, comme ici, un index des articles et pages du blog, afin notamment d’optimiser le « travail » des moteurs de recherche. Quelques bugs mineurs. Utile. [...]
Jobe said:
Your newest version is working great! Here it is running on SensoryMetrics:
http://sensorymetrics.com/a-to-z-index/
Thank you so much for your efforts and to share this wonderful functionality for WP.
AZIndex said:
[...] you try this plugin and like what you see, email to azindex@englishmike.net or visit AZIndex Plugin Home Page to provide your [...]
The Local Landing said:
Hey Mike,
I’m having some trouble changing the style of the indexes. Here’s an example of one of our bigger indexes:
http://www.thelocallanding.net/businesses/
I can’t seem to change the header from the black background, and I can’t get the bullets out of there either…
Any recommendations on how I can do this? The most I’ve been able to do is change the font sizes in the index, but not much else.
English Mike said:
Hey,
Your theme’s CSS is probably interfering with the index’s look. I am not a CSS expert, and can’t really help much here, but this is what I put in the FAQ a few months ago, and it’s a good place to start:
Essentially you have to figure out where the bullets and the black backgrounds are coming from in the CSS and then either override them for the index (something I have not always been able to do myself) or modify the theme’s CSS (in a way that doesn’t mess up other pages). Be on the look out for !important tags next to some values in the stylesheet. These values cannot be overridden, and you may have to remove them (comment them out) before the bullets/black lines will disappear.
It is a messy subject, and I wish I could be of more help, but CSS is not my strongest suit.
The Local Landing said:
Hey again Mike,
I conquered that CSS problem just now, thank you for your help on that! As I was restyling my indexes and going through them, I started thinking of a couple things that would make this plugin EVEN better, and I thought I’d see what you thought.
1. Would it be possible to make a “General Settings” area where some standards could be set for each index, unless otherwise specified in individual index settings? This way each new index could have, say, the same basic options and CSS as the others, then modified.
2. Would there be a way to set a variable that would tell the indexes to change the number of columns displayed based on a user-defined number of posts displayed on a page? I guess a posts-per-column variable. When set to, say, 25 posts-per-column, then post 26 would automatically start a new column on that page and so on. Then when the posts-per-page limit is reached, a new page is created with one column, etc.
3. Parent/Child Indexes? Right now we’ve got 31 indexes built with your plugin on our site, and it gets a bit confusing when sorting through them some times. Is there a way to add an option for some kind of “Parent Index”, like WordPress has with categories?
Sorry for the long post… Like I’ve said, I love the plugin. We’ve used it for maybe 3 or 4 months now on our site and it’s been a life-saver. I hope these ideas can help in any way.
English Mike said:
Hi — glad you sorted the CSS issues. As for your feedback (thank you):
1. That’s an interesting idea. Without a wholesale change to the structure of the plugin, the best way might be to allow one index to use the settings of another (i.e. everything except the tags and categories). Another possibility that would help reduce the work in maintaining multiple indexes would be to allow users to specify a function/file name for their custom CSS styles, so you only have one copy to change. That’s probably where most of the tweaking of the settings occurs.
2. Hmm — where would you get a “user-defined setting” from — i.e. where would AZIndex have to look to find it?
3. Wow! 31! I think that must be some kind of record! Unfortunately, I don’t think, the way the plugin is organized that implementing parent-child indexes is particularly easy. Perhaps if you could sort indexes by name, it might help? Then if you stick to the right naming convention, you should be able to locate the right index more easily.
Cheers,
EM
Israe said:
Good job so far. You’ve got validation errors when using this plugin. Test it by running one of your pages with an index through http://validator.w3.org/and you will see what I mean. Some big ones: You are embedding a stylesheet in the middle of the body rather than calling it in the head (I fixed this temporarily by commenting out your css output and just copy pasted the css to my template’s stylesheet for now), you have an unnested ending after the commented credits for your name, because you are including it within the index loop, forcing the ending to loop a at the end which causes validation to break. There are others as well, please check the validation tool. Otherwise, nice job on the plugin.
English Mike said:
Thanks for the feedback. I have fixed the “style” tag problem in the next version (coming soon) and I will be moving a couple of other things around too.
As for the stylesheet — that’s a bigger problem. Moving the stylesheet to the header isn’t trivial because the only time the plugin knows an index is going to be on a page is when the shortcode is called, and by then it’s too late to put it there (unless there is a WordPress API I don’t know about?).
I agree the CSS and HTML formatting of the index do need some work, but it will be a while yet before I get around to it. I will probably add a “Use Theme Stylesheet” option which will allow users to add the index CSS to their theme, and I may also allow users to add their own CSS file, so that it can be kept separate from the main theme’s stylesheet. (Not sure how useful that is, but it would reduce the risk of being overwritten when a theme is upgraded.)
Keep the comments coming!
EM
Israel said:
I have a suggestion to fix the style sheet validation issue.
after install, have users put
@import “../../plugins/azindex/azindex.css”;
at the bottom of their theme’s css file.
Then just have your azindex program modify the azindex.css file to include:
@import “azindex1.css”;
@import “azindex2.css”;
@import “azindex3.css”;
etc. for each index created with custom css. Then for each index with a custom css, your program would create a corresponding azindex#.css file where # is the index id, and changes made to the individual index custom css would only update that index’s custom css file which is already included on your main azindex.css file which is included in the theme’s css file which loads it in the header, and therein solves your validation issue with styles being called in the middle of the body. I haven’t tested it out, and it may just be a wacky brainstorm, but I think the idea might have merit. Thoughts?
Israel said:
Or if you’re up for less work, you could just wipe out your entire css routine, and tell users to copy+paste your entire list of azindex styles in their themes css. This would serve as the default for all indexes that aren’t specified as having their own unique css.
For those advanced users that want custom styles for specific indexes, you would have a checkbox on the index setup page which would expand a list of custom css they should copy+paste into their themes’ css. Each custom css would be delineated with the number of the index id such as .azindex2 .head or .azindex5 .head - but I think you get the idea. Your program would then only be responsible for adding that index id to the style tag output if and only if that box was checked. Otherwise it outputs the standard style tag which uses that default css you told the user to copy+paste originally upon install of azindex. Simple?
All these posts to really finally get to what I would love to see: can you program Categories and sub categories (two-three levels max) as options for sorting in addition to Titles and custom? I have to do custom tags each and every time that are practically named the same as the category of the post. There just doesn’t exist any good category/index program for WP that does what yours does in at least parsing the index into columns. So far I am making do with custom tags, but they really seem redundant on my part when if I could just use categories as the primary sort option, my posting life would be less redundant.
English Mike said:
Israel, thanks for your suggestions. Regarding the CSS stylesheet, I really don’t like the idea of forcing users to start hacking with their themes or copying files around on their server — the whole idea behind the plugin was to avoid all that unless you were one of the minority who needs something special.
And I just don’t know how many people are really that interested in strict XHTML compliance. While it is certainly a worth goal, most bloggers just care that their themes and plugins work in all the major browsers. Having said that, people have been asking for an easy way to set their custom CSS styles for all their indexes at once and if I provided a way to have a default theme in the settings, it would be easy enough to embed that theme in the section of the blog page (as well as turning off CSS in the plugin so that users can past the stylesheet into their theme. Not sure when I can do all that, but I’ll add it to the list.
As for tags and categories — I have been resisting doing that because I thought it would mean a major overhaul to the plugin (for example, you have to handle an item that appears in multiple categories, but I got to thinking last night and it might actually not be that hard to do. Now, I could still run into a serious issue, so no promises, but I will look into it.
Cheers,
EM
Piet said:
Hi Mike,
Great plugin, works straight out of the box and also CSS was easy to implement.
One(two) question(s) though:
Is it possible, after having added an index, to add the code to a category.php template?
If yes, what code should I add to the template then, I have been playing around a bit, but my knowledge of PHP is very limited…
Thanks,
Piet
English Mike said:
Piet, I haven’t tried this myself, but you could try adding the following line to the template:
<?php echo do_shortcode('[az-index id="1"]');?>Remember to replace the number “1″ with the id of your index and let me know if that works for you!
Piet said:
Fantastic! That does it
You just made my day, thanks!
Piet
Piet said:
and brilliant how it works with the custom fields!
Thanks again for this great adaptable plugin, it makes my life a lot easier!
Christian said:
Hey, GREAT Plugin!
but since today (maybe because of upgrade to wp 2.7.1?) I get the following error on top of the index:
Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /home/htdocs/web0/html/440er/wp-includes/compat.php on line 105
thanks in advance,
Christian
zonebattler said:
Same here: Upgrading the plugin to v0.7.5 causes the error
“Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /mnt/web7/43/78/517178/htdocs/zonebattler/wp-includes/compat.php on line 105″
on top of the index page:
http://www.zonebattler.net/laboratorium/
To make matters worse, a bug managed to creep in: I explicitly included the french style guillemet character “»” in the ignore list, but that doesn’t work anymore: All headlines starting with that character are now listed in a separate block…
Thanks for fixing both issues soon!
Greetings,
Ralph
Christian said:
I now looked at the code, this is what causes the error:
(in az-index-content.php)
function az_get_ignorechars($index, $is_multibyte) {
$chars = az_is_set($index->options, ‘ignore-chars’) ? htmlspecialchars_decode($index->ignorechars, ENT_QUOTES) : null;
return $chars;^M
}
so i disabled the “ignore specified characters…” option as a quick-fix.
This has really to do with my upgraded wordpress, as I found out, here is the diff for compat.php:
http://core.trac.wordpress.org/changeset?old_path=tags/2.7&old=10539&new_path=tags/2.7.1&new=10539#file2
you can see, that Wordpress now has an own check for the function htmlspecialchars, which leads to the system ignoring your function_exists test in az-index-admin.php.
best regards,
Christian
English Mike said:
Thanks Christian for the heads-up. I hadn’t got around to installing 2.7.1, thinking a minor release would not have any impact on the plugin. Ha!
The error message on the screen is a stupid bug introduced into 2.7.1 — they are checking the variable “$string” instead of “$str” (easy mistake to make in PHP, but their regression testing should have picked it up, since the function will never work for any value passed in).
I’ve uploaded 0.7.6 with a workaround (just use my version of the API call all the time) which should get you and zoneblatter’s “»” characters up and running again.
zonebattler said:
0.7.6 works fine again as you predicted. Thanks a lot! But certainly you should tell the WordPress development team about the PHP bug…
Greetings,
Ralph
English Mike said:
I’m ahead of you there -
- I already submitted a defect report to the WordPress bug database, with a target of 2.7.2.
zonebattler said:
Thanks, Christian,
for finding and sharing a working quick fix! In the long run, however, it would be really nice to see the character ignore list working again. The trouble we ran into was obviously caused by an unhappy coincidence (WP v2.7.1 and the AZindex Plugin v0.7.5 being released simultaneously)…
Cheers,
Ralph
Christian said:
Thanks alot, bug seems to be fixed, even if it is just a workaround.
Don´t forget to remove that once 2.7.2 is released
I Should have seen the “$string” instead of “$str” bug too, I guess i was a bit codeblind
By the way, could you remove those nasty carriage returns (^M s) from az-index-content.php source? makes it a pain to read in vi. All the other files don’t have it.
keep on developing,
Christian
English Mike said:
And I’m supposed to have sympathy for someone who still uses “vi”?
I have no idea why one file should be different from another. I use Eclipse for editing on Windows XP — I would have thought that they were all the same. I’ll see if there’s a setting on Eclipse — there probably is.
I have already fixed my code — I just test for the level of PHP explicitly and bypass the function_exists test so it should work no matter which release the code is running on.
It’s not surprise that things keep breaking on new releases. There’s no official real API for WordPress so you end up digging though the code for stuff to steal — er, use. In any case, when it comes to populating the index, I bypass all the WordPress APIs (except for wpdb) altogether. I guess they’ll almost certainly not mess with the existing database tables since they’ll probably break most of the plugins and some of themes!
Christian said:
Hey, when I am not at home, having my PC-environment, what would be faster than starting putty and using vi to check.
Besides that, if you are used to vi, it’s really fast!
anyway …. I am aware of the old-schoolness of it
Gunther said:
This plugin is very useful but unfortunately it doesn’t work with WordPress 2.3.3, the version I am still using. Since I don’t want to upgrade (at least not now): Is there a way to make it compatible with WP 2.3.3? Of course I am willing to familiarize myself with the code and apply the changes myself (provided I am allowed to modify your plugin).
English Mike said:
Gunther — the code is released under the GNU General Public License, so you are free to do what you like with it under the terms of that license :-).
The main reason AZIndex doesn’t work with WP < 2.5 is because it uses shortcodes. When WordPress runs across an AZIndex shortcode in a post or page it calls the function “az_insert_index” in az-index-content.php to display the index. That function just extracts the id of the index and calls “az_get_index_content($id)” You could try calling that function directly (with the correct index id) from a template file and see if that works.
I have no idea what other functions the plugin uses that were not in WP 2.3.3, so you may have to replace some other code, but it might not be too bad. Some parts of the code are well commented, other parts not so much! I would be interested to hear if you get it to work, but I’m afraid I won’t have time helping you debug any problems you might have. Downloading a copy of the WP 2.7 source code might help if you run into functions not supported in your version.
Good luck
EM
Gunther said:
Mike, thank you very much for your quick respone, your effort and the information. To be honest, I am not familiar with PHP but this will be a good opportunity to get into it. I will look at the code, do my best and let you know about the results.
Thanks again!
Gunther
Thong Tran said:
Hi, under “Index subheadings” I would like to include the “posted date of the post” what code should I enter? pubDATE?
English Mike said:
Hi Thong. It isn’t possible in the current version to add anything like the posted date of the post, like you want.
You will be able to do it in the next version, (0.8.0) coming soon, but you will have to write a little bit of PHP code to do it. You will be able to use the “azindex_item” filter to replace the subheading with the posted date (or anything else you want). It will be a few lines of code, and there will be documentation to help you.
In the longer term, I would like to implement something called “templates” which would allow you to do what you want without any code, but I’m afraid that will not be any time soon.
But if you are able to do a bit of coding, then come back in a few days and give AZIndex 0.8.0 a try.
EM
Roy said:
Mike, my again. I just noticed that version 075 and 076 does no longer make linked titles in the indexes! WP 271, any ideas?
English Mike said:
Roy, I noticed this a while ago. I think you have the “group subheadings” option set in your index when you don’t have any subheadings. Deselect that option and your links should return.
I have actually added some code in the next version to prevent users from selecting that option when there are no subheadings set in the index, because t’s an easy mistake to make and it’s not always obvious why the links all suddenly disappear.
Roy said:
Where would I be without you?
Robin said:
Thanks Mike. Your reply to Roy ended my problem.
English Mike said:
Hi folks! I am closing comments on this page.
Please use the new feedback page on AZIndex Website to post your comments.
See you on the other side