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.

292 thoughts on “Archived Comment Thread

  1. Jon Peltier

    I set up an index, it tells me the index was successfully created, but the index page shows only

    [az-index]

    in the Edit Page screen of the WordPress dashboard, and when previewing the page, all that appears is

    ERROR: No index for this page was found.
    (Message from the AZIndex plugin)

  2. English Mike Post author

    Hi Jon, sorry you’re having trouble. I just double-checked to make sure the published version of the plugin works for me, and it does (phew!):

    http://englishmike.net/azindex-test-page/

    The plugin keeps track of the index page it creates from the pageid that WordPress assigns it. The error your seeing should only happen if the id of the page containing the index doesn’t match any of the index definitions you created.

    Anyway, first I would try starting over. Delete the index you created and try again. Don’t change any of the options at first except for entering a title for your index page, and see if that works. If that does works then it’s possible that the combination of the options you chose caused a bug. Let me know what you find.

    But if you’re still having a problem with any index configuration that probably means that your WordPress setup is different from mine.

    What version of WordPress are you using? And what version of PHP is your WordPress installation using? I have only tested the plugin with WP 2.5 and WP 2.5.1, both of which were using PHP 5. If your installation is using PHP 4.3 and I accidentally slipped in a 5.0 only API (I am fairly new to PHP) then that could be causing the problem.

    Mike

  3. Jon Peltier

    Hi Mike -

    I am using WP 2.5.1, PHP 5.1.6.

    I’ve tried deleting the index page and rebuilding it, including attempting different settings and combinations. The post is created, it just doesn’t contain any information.

  4. English Mike Post author

    Hey Jon, well this is a bit of a head-scratcher since it’s a pretty basic function that’s not working for you. If the plugin wasn’t installed correctly you would be having much worse issues, and you seem to have all the up to date software installed (assuming PHP 5.1 didn’t change anything, which I think is a safe assumption).

    I haven’t heard of anyone else having the same problem yet (there have been about 35 downloads so far, but no other feedback), but it is early days (my first day of my first foray into open source software!). So I would like to investigate further, if you are willing to bear with me (I appreciate you willingness to try out the plugin).

    I don’t have solutions tonight, but I will do some more digging tomorrow to see why the plugin can’t match the created page’s id with the index you created. The logic is very simple — I call id = wp_insert_post(…); and immediately insert the returned id into the database the very next line. If the page create failed then you would see no new page, and if the database insert failed then you would not see a new index in the table. But you see them both. Very strange.

    Unless the post’s ID has been modified in some way (you don’t happen to have any weird plugins installed that might do something like that — do you?), then I am still missing something in my code (which is perfectly possible). I do make the assumption that the id of a post is immutable once it has been created — perhaps I am wrong in that case?

    Anyway, enough rambling. I will investigate further tomorrow.

    Cheers,

    Mike

  5. English Mike Post author

    By the way, I forgot to say this earlier — you should only see [az-index] when you edit the index page — the index is built on the fly when a user accesses it. (or should be anyway!). You can add text in front of [az-index] or after it too (as in the example on this site). But you certainly should not be seeing that error message when you preview the page.

  6. Jon Peltier

    Mike -

    Makes sense about seeing the [az-index] in the Edit Post screen.

    Another hint: When I create an index, I see the message saying “Index added successfully”, but it also says “No index pages found”. Even when I navigate away and return to the screen. Shouldn’t this update when the index is added?

  7. Jon Peltier

    Installed plugins:

    Adsense-Deluxe 0.8
    Akismet 2.1.5
    AZIndex 0.1
    BackUpWordPress 0.4.5
    CommentMailer 0.1.3
    FeedBurner FeedSmith 2.3.1
    Google XML Sitemaps 3.1.0.1
    iG:Syntax Hiliter 3.5
    Post-Plugin Library 2.5.0.6
    Recent Comments 2.5.0.1
    Recent Posts 2.5.0
    Similar Posts 2.5.0
    Text Link Ads 3.1.0
    Ultimate Google Analytics 1.6.0
    WordPress.com Stats 1.2.1
    Wordpress Automatic Upgrade 1.1
    WordPress Database Backup 2.1.5
    wp-cache 2.1.2

  8. Fred

    Hi. Looks like a plug that would fit nicely on my blog. One question though, is it possible to implement the index on an existing page – ie my Arcives page? Having the index beneath the archive list would look really cool.

    Cheers from Stockholm, Sweden.

  9. English Mike Post author

    Hi Jon (and Fred) – thanks for the info. I was thinking about the way the plugin links indexes to posts using post-ids, and have come to the conclusion it might be a bit flaky. I am going to make a change to the way I do that — essentially by changing [az-index] to something like [az-index id=3] where the id is the id of the index you created, so the plugin no long relies on the id of a post staying the same.

    That will actually help Fred’s situation since you will be able to plug an index into any page (i.e. the Archives page) or even a post, if you wanted to. That sounds like a better solution.

    I can’t guarantee it will fix your problem, Jon, but it should. I’ll try to have a new version of the plugin available today.

    Cheers,

    Mike

  10. English Mike Post author

    Fred — to clarify — you can’t plug the index into another page at the moment, but the next version will allow you to do that.

  11. Jon Peltier

    Mike – This open source stuff is neat. A little discussion, followed by a little improvement, etc. Always getting a little better, almost painlessly.

  12. English Mike Post author

    I agree, Jon. And thanks for persevering with me. I know from personal experience how easy it is to just drop something if you can’t get it to work first time :-)

    Anyway, I just uploaded version 0.2 of the plugin, which I am pretty sure will fix your problem. My guess is that one of your other installed plugins was doing something I hadn’t anticipated (which was my problem, not theirs), and the more I thought about it, the worse I realized my assumption was.

    Anyway, the cool thing is that as a result of fixing the problem, Fred now gets to put the index anywhere he wants, so it’s a win-win all round (until you find the next show-stopper bug, anyway!).

  13. Fred

    Sounds great Mike! I actually giggled at the ‘next show-stopper bug’ remark, how sad or
    cool is that? Anyway – looking forward to the new feature!

  14. Mike F.

    Mike,

    Very cool idea for a plugin. The plugin demo on your site looks like exactly what I need.

    Unfortunately, I’m having the same problem as Jon. When I create an index, I receive the message that the index was successfully created, but immediately below that, I still see the message “No indexes found”. It does create the blog page, with [az-index id=1], but when I publish and navigate to that page, I see the message “ERROR. No indexes found for that id”…or something close to that.

    I’m using PHP 5.2.6, MySQL 4.1.1, and WordPress 2.5.1. I do have quite an assortment of plugins, so I might experiment with disabling some of them. Some of the plugins that Jon and I have in common are wp-cache, google xml sitemaps, and wp-stats.

    One question: does your plugin create a new table? If so, what is this table called? I don’t see a new table in my database, but I could definitely be overlooking it.

    Anyway, thanks again. I’ll do some investigating and let you know what I find.

    Thanks,
    Mike

  15. Mike F.

    By the way, I just downloaded the plugin this morning, so presumably it is after you put in the fix that you thought could possibly help Jon.

    Thanks,
    Mike

  16. Mike F.

    So, sorry to inundate you with so many messages, but I looked through the code, and if I’m reading it right, it seems that a table should be created with a name of something like wp_az_index. Is that right? If so, I don’t see that table, and I’m wondering if the code just doesn’t return an error when attempting to create an index in that nonexistent table. I might try to manually create the table to see if it works. Anyway, just wanted to give an update.

  17. Jon Peltier

    Unfortunately the new version has the same problem. Here’s the precise error message in the index page:

    ERROR: No index with the id of 1 was found.
    (Message from the AZIndex plugin)

    Mike F’s last post about the missing table makes sense. I wonder why it isn’t created for all users….

  18. English Mike Post author

    Hey Mike/Jon, that’s very strange — the demo page on this site is a live demo using the plugin, so it’s tough to know why it’s not working on your web sites when I can’t reproduce the problem.

    Yes, the plugin creates a table called “wp_az_indexes” and INSERTS an entry for each index you create. But if the table wasn’t being created, you wouldn’t see the indexes you create being added to the index table on the AZIndex admin page — which I assume you are seeing, right?

    If that’s true, then the problem would seem to lie with loading the database table when the short-code (az-index) (in square brackets) is encountered. That code is in az-index-admin.php:

    function set_vars_from_table($id) {
      az_trace('fn:set_vars_from_table');
      global $wpdb;
      $indexes = $wpdb->get_results("SELECT * FROM ".AZ_TABLE." WHERE pageid = $id");
      if (count($indexes) != 0) {
      ...

    The function returns the count of indexes in the table, which in your case must be zero for some reason. So it looks like this is the query that’s failing, but not always, which is very strange. ( ‘pageid’ is really the id of the index, I just didn’t want to rename the field in v0.2 and break users who didn’t uninstall the plugin between versions). The query is very basic SQL so I wouldn’t think that an older version of SQL is the issue either.

    If you wouldn’t mind, I’ve uploaded a debug version of az-index-admin.php which will dump out a couple of debug lines on your screen (in yellow):

    http://svn.wp-plugins.org/azindex/branches/debug/az-index-admin.php

    If you wouldn’t mind installing this on your system (in plugins/azindex) and let me know what it says.

    In the meantime I’ll keep looking. It doesn’t seem to be a plugin interaction issue, since I removed that likelihood with the fix that failed, so it’s probably a bug or incompatibility in my code somewhere.

    Thanks again for the continuing feedback.

    Mike

  19. English Mike Post author

    Oh, I should just double check. Can you create and edit indexes in the admin panel ok? You know, creating a index, saving it, then clicking on “Edit” again and all the options you set show up ok?

    If that’s all working then the database table is ok — it’s just this query in the comment above that’s failing for some reason.

  20. Jon Peltier

    In the Manage AZIndexes page I see this after adding an index:

    Index added successfully.
    No index pages found.

    I cannot edit an existing index because none are found.

    Here is the text of the index page:

    fn:set_vars_from_table; query index id = 1
    fn:set_vars_from_table; rc = Array; index count found: = 0
    fn:set_vars_from_table; rc = Array; index count found:a = 0
    query = SELECT * FROM wp_az_indexes WHERE pageid = 1
    fn:set_vars_from_table; rc = Array; index count found:b = 0

    ERROR: No index with the id of 1 was found.
    (Message from the AZIndex plugin)

    It seems that the table “wp_az_indexes” was not created: I can’t see it using phpMyAdmin, but all the other tables are present.

  21. English Mike Post author

    Thanks, Jon, that clears it up. No database table. Weird.

    I’m using the API: maybe_create_table(AZ_TABLE, $sql); on activating the plugin, and it doesn’t seem to be working. I guess the function is saying “maybe not!”

    (I should also do something about that misleading “index created” message you got. The plugin should notify the user if the database table doesn’t get created).

    I will look into why the table isn’t getting created and check back a bit later.

    Thanks again for the help.

    Mike

  22. English Mike Post author

    Hey Jon, I think we’re down to two possibilities -

    a) the plugin’s activation hook isn’t getting called.
    b) the database create table is failing

    I have updated the debug version of the code with a couple of extra trace statements:

    http://svn.wp-plugins.org/azindex/branches/debug/az-index-admin.php

    The output won’t appear on the screen so it has to be written to a file on your server. The file is called ‘az-trace’ but I’m not sure where PHP will put it — on my system it’s put in the WordPress root directory.

    I also replaced the maybe_create_table function (though it looks perfectly ok to me) with a direct $wpdb->query(CREATE) call, just to see what happens.

    Reactivate the plugin and go to the AZIndexes page. That should put enough stuff into the az-trace file to see what’s happening.

    The trace output should look something like:

    fn:az_plugin_activate : start

    CREATE TABLE wp_az_indexes ( name text NOT NULL, pageid int NOT NULL, categories text, tags text, heading text, subheading text, description text, columns tinyint, headingseparator text, itemsperpage smallint, customcsssingle text, customcssgroup text, options set('add-spaces', 'group-subhead', 'alpha-links', 'alpha-links-unused', 'alpha-links-two-rows', 'multipage', 'multipage-links-above', 'multipage-links-below', 'custom-css'), PRIMARY KEY(pageid));

    0
    fn:az_plugin_activate : end

    If you can’t see all that in the az-trace file, then WordPress isn’t calling my activation routine for some reason.

    I’m dumping out the SQL statement to see if that’s the issue. You can try cutting and pasting it and running it in PHPMyAdmin to see if that creates the table for you. At least then you’ll be able to play with the plugin!

  23. Jon Peltier

    I swapped files again. Here are the results:

    1. I can’t find the az-trace file. I looked in the WordPress root, the directory above that, all the directories between WordPress and the azindex subdirectory under the plugins directory.

    2. I received the same output trace as before in the index page.

    I presume everything starting with CREATE and ending with the semicolon constitutes the SQL statement that adds the table? I’ll see if adding the table manually is good enough.

  24. Jon Peltier

    Hmmm, ran the SQL, but got an error:

    #1064 – 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 ‘columns tinyint, headingseparator text, itemsperpage smallint, customcsssingle t’ at line 1

    I’m a SQL copy-paste expert, but not too good at generating my own SQL or debugging. The MySQL version is 4.1.20-log, FWIW.

  25. English Mike Post author

    Thanks, Jon. Well, it looks as though I’m going to have to install MySQL 4.1 :-)

    I’ll get back to you when I’ve checked it out.

  26. English Mike Post author

    Ugh — I finally figured it out… By process of elimination (and I eliminated just about everything else in the query first!) it turns out that MySQL 4.1 doesn’t like me using “columns” as a field name. Obviously not an issue for 5.0, but 4.1 squeals loudly when you use it. (I’m guessing it’s a reserved word in 4.1 and that 5.0 relaxed the restriction on it.)

    Ah well, thanks again to Mike F. and especially Jon for your feedback while I chased bugs down the wrong rabbit holes. I will rename the columns field and upload a new version of the plugin for you all to try out. I will also add some more error checking to the code in the near future so that problems like this are less painful for me and the user to figure out.

  27. Jon Peltier

    Mike -

    Thanks for your diligence in figuring this out. I was starting to feel like a PITA, but I know I appreciate it when users of my lame little apps follow up with debugging details.

  28. Jon Peltier

    I was installing another plugin and noticed the link to a new version of AZIndex. Click.

    I created a new index, it appeared in the list, and when I previewed the page it gave me a list of all of my posts.

    Excellent! And thanks for keeping on it.

  29. Mike F.

    I concur: thanks again Mike! I never would have guessed that it was a reserved word issue.

    I’ll try installing again now.

  30. English Mike Post author

    One word…. phew!
    :-)

    Thanks for the confirmation that you’re up and running, Jon. You need not have worried about being a pain. I’ve been a software developer and tester for over 20 years, so I can usually tell pretty quickly who the awkward customers are , and you are definitely not one of them.

    Thanks again,

    Mike

  31. Lionel Chollet

    Hi,
    thanks for the plugin!

    What would be nice: a way to add the easy index-ordering capabilities of AZ-Index to regular archive pages (i.e.: complete with any data that one may want to display in an archive page… post’s picture, metadata and so on), and a way to add natural order in numbers used in custom fields.

    I’d like to order my archive pages according to a custom field value that’s the article’s product reference number, and it would be great that “24283″ came after “3768″.

    I couldn’t manage to order my archive the way i’d like to, even after reading http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query (admittedly, I’m so a n00b).

  32. English Mike Post author

    Hi Lionel. I get what you’re saying about custom queries, I struggled with the query_posts() for a while before deciding to use a direct MySQL query instead. There were a couple of bugs in query_posts() that I could not work around easily. So don’t feel bad about not figuring it out!

    Anyway, in regards to your questions. First, I figured out how to include an index in a template file (which is what I think you need). You can’t just add the [az-index id="1"] short code because it doesn’t get passed to the AZIndex plugin if it’s not in a post or page. What you can do is add something like this to the template (below the main post loop):

    <?php
       query_posts('pagename=index-page');
       while (have_posts()) : the_post();
          the_content();
       endwhile;
    ?>

    where ‘index-page’ is a page containing the [az-index] shortcode. I tested this and it seems to work ok.

    Now, regarding your “natural ordering” request. It’s an interesting idea, though not exactly in the spirit of alphabetical indexing :-). So I’m not sure really sure it’s a good fit for this plugin (though I won’t rule it out yet!).

    However, there are a couple of things you could try yourself:

    1. Add leading zeros to make the product reference numbers all the same length (I’m sure you’ve considered this one already).
    2. The sort comparison function (az_compare) is in the plugin file az-index-content.php. (the file is in wp-content/plugins/azindex in your WordPress installation). You are welcome to replace it with one that meets your needs. For example:

      function az_compare($in1, $in2) {
         $result = intval($in1['head']) - intval($in2['head']);
         return $result;
      }

      This function compares two integer values in the Heading fields (a custom field you define or the excerpt) and will sort the index into the natural order you’re looking for. If the only thing you’re sorting on is the reference codes, then add those codes to a custom field (or excerpt) and use that field as the heading for the index. You can still define sub-headings and descriptions and they will be displayed but they won’t be used in this simple sort. This should work for you, but you do have to remember that upgrading to a new level of the plugin will overwrite any changes you make and you will have to add it back, so it’s not ideal.
    3. I will add your request to the list, but at the moment I really have to figure out how to cache indexes so the plugin can be used safely with large indexes, and there are a few other issues I have to resolve.

      If you have any questions about anything I’ve said here, feel free to ask.

      Mike

  33. English Mike Post author

    Lionel, since I wrote the comment above yesterday, I realized that there is a nice way to integrate what you want into the AZIndex plugin. Similar to my second suggestion of replacing the comparison function with one that you need, I see no reason why an “advanced” option (i.e. one requiring a little programming) could not be to specify your own compare function (i.e. a replacement for az_compare() in the plugin) that you add to, say, functions.php in your theme directory. That way anyone can quickly tailor the sort to their own satisfaction.

    Now, I haven’t played with that idea yet, so I’m not 100% sure that it’s as easy as that, but I will put it on the list of things to do, so when I finally get to version 1.0 (hopefully later this month) check back and see if you have what you need.

    Mike

  34. Nick

    …oops submitted one comment to the wrong blog and another to a different one. Must have taken my stupid pills this morning.

  35. Lionel Chollet

    Hello Mike,

    thanks for the replies, I’ll test your ideas tomorrow, er, today already, but later on!

    Best regards,
    -Lionel

  36. Danny

    Mike,

    Sweet plugin. There are many applications for this and it turns wp that much more into a flexible cms. Cheers.
    Just wanted to say great plugin. I would love to see caches and the ability to sort pages!

    Cheers
    danny

  37. Danny

    actually, id have a question. do you have any easy way to set alternate class’ on the li so you can zebra-stripe the lists?

    i guess you’d have to go into a-zcontent.php right now to do this?

  38. English Mike Post author

    Hey Danny, glad you like the plugin. Thanks very much for the feedback. I do intend to add caching and page support (if that’s what you mean?) in the near future. I had a self-inflicted catastrophe with my new laptop last week which set me back somewhat, but should know in a couple of hours if they fixed it under warranty, so hopefully I will begin to update the plugin again soon.

    As for zebra-striping. That’s a very good idea. You are correct in that it’s not something you can add using the custom CSS. I honestly hadn’t considered the idea as something suitable for an index, but I’ll add it to the todo list and take a look. Curiously enough, I recently hacked WordPress to allow the same thing for sidebars — if you notice the sidebar on this blog is “striped” and it’s not hard-coded in the HTML — if I insert another widget into the sidebar, the alternating colors for the widgets still work. It was a bit of a hack, but I might write a post on how to do it at some point.

  39. Graeme

    Hi there, this is a fantastic plugin. It works superbly with just the default settings and title, but when I add any sort of category or tag I get the following error. Would love to try and work out why.

    Fatal error: Call to undefined function: htmlspecialchars_decode() in
    ……../wp-content/plugins/azindex/az-index-admin.php on line 899

  40. Graeme

    actually in relation to the error in the post above. The AZ Index plugin works beautifully with all the category or tag controls when running a development locahost wordpress site, I have the above problems when trying to implement on the live site. Therefore something must be blocked or not copying over maybe due to read / write permissions ??

  41. English Mike Post author

    Hi Graeme,

    Thanks for your feedback. It looks as though htmlspecialchars_decode() is a PHP 5-only API (a fact I missed when I added it to the plugin). That means your live production site is probably still using a version of PHP 4.x and the plugin fails. From looking at the comments attached to the API in the PHP manual, it looks as though it might be possible to substitute the offending API for another function which would work.

    Now I have my laptop back from the repair shop, I’ll take a look at removing that dependency on PHP 5, but I should warn you that, as I said in the release notes, there might be others. Keep an eye open for a new beta release later this week.

    Mike

  42. English Mike Post author

    By the way, depending on who you are using as your web host, you might be able to upgrade your server to PHP5 from the server’s control panel. That’s what I did on the server running this blog. Mind you, that would be a drastic step to take to fix this one problem you’re having, so you should be think carefully before you do it since other aspects of your server might break. However, if you’re just running WordPress 2.5.x and nothing else, then it should be reasonably safe to do it.

    Mike

  43. Graeme

    Hi Mike,

    Just to let you know, I’ve downloaded the latest beta release and this has resolved the problem. It’s perfect!! This is a brilliant plugin and thanks so much for taking the time to resolve the issue. This now enable me to index various posts into specific groupings or either category or tags.

    Great Job!

  44. English Mike Post author

    Thanks for the feedback, Graeme, and I’m glad it’s working for you. Feel free to let me know if you run across any other problems. Thanks to your testing, it looks as though my plugin supports PHP4 as well as PHP5.

    Mike

  45. English Mike Post author

    Danny, FYI, while the CSS isn’t obvious (those darned “floats” are a real pain!), I figured out a way to do striping of the index entries with a small modification to the plugin code. So look out for it as a new feature in the next version of the plugin.

    Mike

  46. MovieGalaxy.org

    Hello

    I really like this plugin and I was wondering if I could add it to the Sidebar (Widget) to show all my post in alphabetical order. If it’s possible, can you please guide me? It would be nice if you email me, I have included my email in the Comment Form.

    Thanks

  47. English Mike Post author

    I just replied to the question about putting an index into the sidebar. It turns out that you can indeed do it, it just takes a little bit of theme tweaking to do it. I will add a post to my blog explaining how in the next day or two.

  48. MovieGalaxy.org

    Thanks very much, I have received your email and replied to it. I got it working thanks to you, It’s Perfect and it doesn’t seem to get the load high in my server(but it’s been optimized). Thanks.

  49. Crystal

    After installation, I get the following error message when trying to activate: Plugin could not be activated because it triggered a fatal error.

  50. English Mike Post author

    Hi Crystal, I just went to your site and it looks as though you are using WordPress v2.2.2. If that is the site you’re trying to run the AZIndex plugin on, then I’m afraid that it won’t work. You need to be running WordPress v2.5 or v2.5.1. Are you testing it on truthhate.com?

    If you are running it on WordPress v2.5.x then I’m not sure I can help without more information. Do you know what versions of PHP and MySQL you are using? And if possible, could you try disabling the other plugins you are running to see if that helps (I know that might be difficult if you are using it with a live blog). Sorry to be so vague, but so far you’re the only one who’s reported this problem so without more info I’m a bit stuck.

    Mike

  51. Lionel Chollet

    Always count on me for weird requests: ;-)

    I’d like to *sort* by the heading — so far, nothing unusual — but to *display* the subheading first — ahem, er, yes…

    The heading is a custom field (a reference number), the subheading is the title.

    By the way, the numeric_compare function is working great; thanks a lot, Mike!

    Additionally, how do you customize the pagination links to make them look like, say, “Page Navigation” links? http://www.stuff.yellowswordfish.com/paged-navigation.

    As for caching, maybe such a plugin as Plugin Output Cache — http://wordpress.org/extend/plugins/plugin-output-cache/ — might help.

  52. English Mike Post author

    Lionel — congratulations on being the first ever person to have a post held up in moderation on this blog :-) (I think it was the two links that did it — I’ll up the number so that it doesn’t happen again!)

    Now, as for your weirdness — I mean, weird requests:

    1) Why don’t you make the post titles the headings and the reference numbers the subheadings then modify your sort function to sort on the ‘subhead’ field instead of the ‘head’? I think that should give you what you’re looking for. The only caveat is that the grouping option will probably not work, but I suspect that you do not use that.

    2) I’m not quite sure exactly what you want — the boxes around the individual links or the “Page 1 of 5″ bit. You can almost do the first one if you add a CSS style for “.azpagelinks a” but the problem is that there is no way to style page numbers and arrows that are not links. As for the second, well, it’s a nice idea, but I’m not sure if I want to add yet another option at this point (!), because I am sure that not everyone will want it.

    I have updated the page link code in the next version so that it will display “<<” and “>>” if you have more than a certain number of pages. (You will be able to modify that number by changing the value of AZ_MAXPAGELINKS in the az-index-admin.php file.) I will add a bit of HTML code to wrap all the items in the links (page and alpha) so that people can better modify the appearance to suit their needs.

    Thanks for the tip about caching — I already have caching finished, but there is always room for improvement. I currently cache the data from the index not the HTML of the index pages which has its advantages when it comes to rebuilding the cache quicky, but there is no reason why I couldn’t add another layer of caching by cache the HTML as well. I will bear it in mind as a later upgrade.

    So, apart from the “Page 1 of n” thing, I think you can do everything (or will be able to in v0.5) you’re asking for.

    Does that help?

    Mike

  53. dirk husemann

    just updated to 0.5.1, when deleting pages i’m now getting the following:

    Fatal error: Call to a member function acquire() on a non-object in /var/www/xyzzyxyzzy.net/wp-content/plugins/azindex/az-index-cache.php on line 446

    any clue?

  54. dirk husemann

    turns out that the global variable name “mutex” seems to be used by another plugin/part of wordpress. just renaming it to “az_mutex” solved the problem.

  55. kalcha

    Hello Mike,

    U r a genius man… Thanks for this great Plug-in. I have been searching for this kind of tool since long and am really thrilled that AZindex is extremely easy to work with.

    I have a Blog that deals with some Indian celebrities. I wanted to have an easy navigation to the huge number of celebrities pages in a list. Thanks to your plug-in, my problem is solved. Now I can have indexes of everything…

    I know it is too much of an ask, but I saw an interesting feature at the CELEBS page of http://popsugar.com (POPSUGAR) I liked it very much. They used the indexing of the celebs along with a thumbnail for every item (celeb). I use OPTIONS theme by http://justintadlock.com. It has a nice Thumbnail generation script… and I plan to use it extensively. I was just wondering, whether I could some how display a thumbnail for every celeb along with the title via custom fields or something else?

    This was just an over the top request… I know that… But as I am a complete novice in technical things, I just thought to ask you… Thanks for your time and effort on this plug-in.

  56. Lionel Chollet

    Hello Mike,

    your neat additions, technical responses, and dedication to your users certainly help! Thanks! Yet I have other questions ;-)

    How would I place a post image before the heading text?

    How would I place the tags and other custom field metadata after the subheading text?
    I tried to insert “php the_tags” in the plugin source code, but while inserting plain text strings worked OK, putting php code in there triggered an error.

    Actually, I want to order archives by the reference numbers of the products/works, not by date, as “ultimate recency” is not the most important point for this sort of catalogue (recent additions to the catalogue are featured/presented in news announcement on the home page anyway).

    I’d like to have the same presentation for the articles than that I set up for my unwanted-regular-WordPress-by-date archive, only ordered by reference number… Ahem.

    Perhaps, a “before/after” thingy could be implemented for the elements of your plugin, like the one in Scott Reilly’s c2c_get_custom — http://coffee2code.com/wp-plugins/get-custom-field-values/

    Also, is there an easy and monetary way to thank you for your work? I don’t see a Paypal button or anything on your site.

  57. English Mike Post author

    Hi Dirk, thank you very much for the bug report (and solution!). I can’t believe I left off the “az_” prefix from a global variable after I’ve been so careful to use it everywhere else (even the CSS styles have “az” prefixes!!).

    Ah well, it gave me the excuse to add a couple of other fixes and update the code to version v0.5.2.

    Thanks again.

    Mike

  58. English Mike Post author

    Hey Lionel. I only have time for a brief comment at the moment — and it might be the end of the week before I can get full answers to you since I don’t have the time at the moment to test anything out.

    1) Images — I managed to embed images (well image links) in excerpts, which I then used display as the Description field in the index. I know this is getting kind of kludgy, but you could try making the Heading your excerpt, the Title your subhead, and your cat. no. the description, sort on the ‘desc’ field (as discussed before) and then fiddle with the custom CSS to get it to come out the way you want it (if it’s even possible).

    2) Tag — yeah things like “the_tags()” wouldn’t work anyway since I don’t use a regular post loop (for performance reasons mostly). You would have to use something like “echo get_tags($postid)” for it to work (Note: I don’t think that’s the name of a real function). I think the question is — how do I include post metadata in the index? I don’t have an answer for you at the moment (other than “you can’t at the moment”).

    3) Before/after is an interesting idea. I will have to think about it.

    4) Now the paypal link is the best idea of the lot :-) Thanks for the prompting — I do have a paypal account, I just haven’t gotten around to setting up the link. Look for it again in few days.

    Sorry I can’t be more help just at the moment. Life is kind of getting in the way.

    Mike

  59. English Mike Post author

    Oh, just one other thing, Lionel. If you haven’t done so already, take a look at the output source code for an index page with links on it and you will find the css styles I added for the links — I believe they are “azlink” for the page numbers and alphalinks — “azlinknav” for the navigation links, and “azdisabled” for the disabled page numbers/alphalinks/navlinks.

    I will add these to the User Guide when I finally get to the CSS section (which could be a while off yet!)

  60. kalcha

    Hello Mike,

    I am really sorry for my last comment containing some links. But I hope you understand that they were not at all related to me in anyway. Slightly sad that you deleted my comment… but extremely happy that you answered Lionel almost on the same topic. i will try your suggestion on Images and let you know the status… Have a nice evening…

  61. kalcha

    Hi Mike,

    I implemented the excerpt idea… and it worked like a charm. I used a plug-in to produce excerpt for pages and added a URL for the thumbnail. And used the title for the title and excerpt for the subheading. If I use thumbnail for the title, it is causing the alphabetical listing to go weird… But working fine with the thumbnail (excerpt) as subheading. The title and the thumbnail are showing in the same row. So, is there anyway to make the THUMBNAIL come directly below the TITLE? It would be nice if it does and in any case this thumbnail listing would greatly enhance the AZindex plug-in.

  62. English Mike Post author

    Hey kalcha — sorry about your previous comment — for some reason it got held up in moderation, and since yours is only the second that happened to, I don’t think to look for them all the time. I’m a little busy at the moment, but if you will bear with me I should be able to take spend some time on your questions later this week (probably not before Friday).

    In the meantime, to move your thumbnail below the title, try turning on the “custom CSS” option and modifying the “.azindex .subhead” style by adding “clear:left; float:left;” (as in the grouped items CSS below it).

    e.g. change:

    .azindex .subhead {clear:left; float:left;}

    to

    .azindex .subhead {clear:left; float:left;}

    That should put it below the heading, and you can use padding-left to move it to the right a bit if you want.

    There are some other tricks I showed Lionel in the comments above about creating your own sort routine to sort on the ‘subhead’ field if you want to put the photo first — but that involves creating your own sort function which may be a little tricky for you. I may get the chance to look at it in a few days.

    Mike

  63. kalcha

    Hi Mike,

    Thanks a lot for the suggestion. It worked perfectly. I think your plug-in deserves first place in any competition for its usefulness. And your tutorials are very tightly written. Kudos for your efforts… Will give some feedback in the future…

  64. paul

    just thought idd rop by and say what a great plugin was looking for soemthing like this for a while and just found it tonight was easily setup and had no problems kepp up it up

  65. Jeff

    I really like this plugin much better than wp-snap, but is it not possible in AZindex to ignore leading articles like “a, an, the”? That options exists in wp-snap but I prefer the way azindex handles other things, yet creating custom fields for titles without the leading articles is a pain. Still trying to decide whether to stick with wp-snap or move to azindex. Any way to ignore those letters w/o resorting to custom fields?

  66. English Mike Post author

    Jeff, thanks for the feedback. I understand your reluctance to use custom fields, and option to ignore certain words at the front of a title is certainly something I will consider adding to the plugin. I’m not sure when I’ll be able to get around to it — the summer vacation is arriving fast — but I can certainly look at doing a stop-gap measure, perhaps allowing users to add their own filtering function which would allow users to modify titles any way they want before they are sorted. Try checking back here in a few days.

  67. English Mike Post author

    kalcha, it turns out that there is a way to display images to the left of the titles. This is how I did it:

    1) Set the headings to “Title”.
    2) Set subheadings to “none”.
    3) Set description to “Excerpt”.
    4) Add your thumbnail links (using the usual HTML) to the excerpts of your post.
    5) Turn on the option “Use customized stylesheets for the index”
    6) Edit the “ungrouped” style sheet as follows:

    .azindex .head {float:right;text-align:left; width:75%}
    .azindex .subhead { }
    .azindex .desc { float:left;}

    You will have to play with the “width” style so that there is enough space for the thumbnail alongside the title. If the “width” is too large, the thumbnail will appear below the title, if it’s too small, there will be a big gap between the thumbnail and the title, but it should not take you long to find the correct value. Note: it would be best if your thumbnails were all the same size.

  68. English Mike Post author

    Jeff — I just updated AZIndex to v0.5.3, with a new feature that will allow you to alter the headings in the index as you requested. I will probably provide a nicer way to remove words from the front of headings in a later version, once I have more time to do it properly, but using the new filter should work just as well for in the meantime. Take a look at the latest blog post to see what you need to do (and I even wrote the filter code for you!).

    Mike

  69. Lionel Chollet

    Hello Mike,

    I put the Paypal button to use: it works!

    Now if I could just find a plugin to automatically sort posts by the criterium I want, without using extra CSS, and displaying all the metadata…

    Nevertheless, your plugin is fantastic, and your work and kindness deserved compensation!

    Cheers!

  70. English Mike Post author

    Thanks, Lionel — that was very generous of you, as are your compliments. I have some ideas for making the plugin more flexible regarding the order in which the elements are displayed and those other things you are yearning for, but as I mentioned, it’s going to be another month or so before I can get to them. Of course, I’m beginning to wonder how much functionality I can squeeze into the plugin without making it too complicated for the, er, less demanding users to use :-). And there’s all that documentation left to write….

  71. Alex

    I love the concept, been looking for something like this for some time. However it doesn’t appear to work with the 2.6 release. I get the following error constantly when trying to add/update entries.

    Warning: unserialize() expects parameter 1 to be string, array given in /home/bookbarb/public_html/website/wp-content/plugins/azindex/az-index-cache.php on line 65

  72. Alex

    Ok so I downgraded and installed it on 2.5 – RC2. Installed perfectly and I can add entries. But when I try to preview them I get the following error – 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)

    Any ideas?

  73. Duane

    Same here… seems a lot of plug-ins are having trouble with the unserialize() parameters under 2.6… seems to work fine except for that warning…

  74. English Mike Post author

    Hey guys — I’ve just seen the comments — thanks for the feedback. I will take a look at the 2.6 issues today, though it could be a few hours before I have a fix — please bear with me.

    Cheers,

    Mike

  75. English Mike Post author

    Ok – I just put up version 0.5.4 with a fix for the unserialize error under WP 2.6. I have very limited testing facilities where I am at the moment, so please, if you have any other problems with 0.5.4 running under WP 2.6 let me know today if you can. After that, it will be a couple of weeks before I can work on the plugin again.

  76. English Mike Post author

    This is probably the last time I’ll be logging in for a couple of weeks. Feel free to continue posting questions and feedback (bug reports, etc) but I likely won’t be able to respond until the beginning of August. After that I hope to finish up the to-do list with AZIndex and the documentation. Until then, happy blogging!

  77. Henrik Sundholm

    I truly love this plugin! However, I have a suggestion to make.

    I would like a feature that allows me to set topics depending, not upon tags, but upon searchwords. Let’s say I’m running a movieblog, and that I’d like to make an index of all the posts featuring the name “Morgan Freeman”. At present, I would have to manually re-tag all older posts, right? How about just making the index use searchwords instead? Then all posts including the name “Morgan Freeman” would automatically show up in the index.

    I hope you see where I’m coming from. Otherwise, thank’s for a really great plugin!

  78. Henrik Sundholm

    Oh, and I have two more suggestions!

    1. The index doesn’t seem to support special characters. That is somewhat of a problem for a person like myself, who is Swedish, and makes use of “Å”, “Ä” and “Ö”.

    2. What if the front page could be made empty, and then you use the alphabetical list to navigate through specific indexes, so that you’ll only see one list at a time? For instance, you could click on the letter “F” and only browse through posts beginning with that letter. I think such navigation could be great for those who have really large indexes.

  79. Mike K

    what a great plugin. this is exactly what I was looking for to create an alphabetical index of my movie review posts for my home theater site. Nice job. Also really glad you provided an option to use custom style sheets for the index. that was very useful in my case.

    One feature request: can you provide an option (ideally a check box setting) to reverse sort? the way I have my podcasts title “Show #1, Show #2, etc) the ability to reverse sort would let me have the newest entry at the top of the list. I’m sure I could do this with a custom field, but figured I would ask, just in case this is possible.

  80. psnoonan

    When I first created the index, everything was great. But when I make a new post, it doesn’t show up in the index I created. Does this not auto-update?

  81. English Mike

    Thanks for all the suggestions, guys. I will be back in civilization in just over a week and will reply to your questions and suggestions then.

    psnoonan — have you checked to make sure that your new post has the right tags and/or categories? Otherwise I will try and help you when I get back to my own computer. (just on dial-up here at the moment).

  82. Richard

    I’m using alaknors post thumbs plugin that renders thumbnails for post images with this tag ?php the_thumb(); ?

    Where would I put this tag to show a thumbnail of each post in the index. I’m guessing it will be somewhere in az-index-content.php where you start to render the output.

    Thanks.

  83. Richard

    Using the excerpt to show images is not really the way to go for sites that already use excerpts as text prefixes. It would be better if you could create a new field that allowed tags for image displays, or defaulted to nothing with no input. That way users could use whatever thumbnail tag was available for their installation. I can think of a few, Alaknor thumbs, get_the_image, get_image Viva thumbs. I’m sure there are others, but they usually provide a wp-tag to render thumbs in php.

  84. TazaTek

    Mike, You’re a busy man taking care of all these comments, and the plugin. I haven’t tried it yet, but will be here shortly.

    I am going to create a business directory out of this, and wanted to know if the following is possible:

    A user goes to a page, that has a listing of business categories (Plumbers, Electricians, Accounts, etc)

    Let’s say that they click on accountants, this would bring them to another listing that would be like:

    Accountant A
    Accountant B
    Accountant C

    Then they could drill into Accountant A, and see a page on them

    Is this possible with your plugin to create a business directory like this, or can you think of a way that could make this happen?

    It seems that your wonderful little plugin does 90% of what I need!!

    Thanks

    Matt

  85. Roy

    Let’s say I have 40 categories and there’s one that I don’t want in the list, it would be very convenient to have an EXclude option, rather than INclude. Is that easy to change, or can I put it in the ideas box for a coming version?

  86. Jeff of RN Jobs

    Mike,

    This is one great plugin. I love it. I think, at least for the kind of content intensive sites that I create, this is a top 10 plugin.

    This is ideal for pulling together link bait (I hat the term) pages.

    This plugin is a huge time saver, an SEO gold mine for making keyword intensive pages.

    Thanks,

    Jeff

  87. English Mike Post author

    Hey guys — thanks for all the comments over the past couple of weeks. I’ve been away on vacation (safari!!) but I am almost back home — just one more flight in a couple of hours…

    Once I have slept off the jet lag I will go through the comments and suggestions and post some replies. Hopefully I will get through them within a couple of days.

  88. Richard

    A further notion that you may need to consider is making an option for indexes rel=”nofollow”> or else there will be issues of duplicate content with Google etc. WordPress already has problems with categories and tags regarding duplicate content. This plugin has an opportunity to close the loop on this one.

  89. Sue

    Hi Mike,

    I am using your AZIndex plugin on a page as an index to articles. These are child pages under the articles parent page, which shows the links with the use of your plugin. My problem is that all my pages are showing in the list not just the child pages. I’m not sure I fully understand how to use the features of the plugin. There may be an existing way to exclude certain pages and only include the child pages. Could you direct me in how to make it work if there is? If not could it be added?

    Love the plugin and it’s ease of use. Great for a novice blogger like myself.

  90. ciara

    I LOVE this plugin! Just what I was looking for. Thank you!

    I’m having one teensy problem, however.

    I’m trying to get rid of the list style type, which is set to “square” for the content area of the page throughout my theme. I’ve tried editing the CSS inside the AZindex, I’ve tried overriding it in the theme’s main CSS…nothing gets rid of it. So i have a square bullet before the sections and each item.

    Can you give me the magic wand to get rid of these easily, without having to remove the list style from the entire theme? Is this possible?

    Thank you! :)

  91. ciara

    With a little further investigation, I remembered about inheritance in CSS. The solution I came up with is simply removing the list-style-type: square. Couldn’t figure out any other way for it to “take.”

  92. Sean

    Hi i was wondering how to list all the numbers under one heading like instead of having each number under separate heading like 1 2 3 4 instead how could i list them under one heading like under #

  93. Ash

    Is there anyway i can drop in the A-Z Index (Links) into my template files?

    For example
    I’d like to display sitewide an A-Z menu in the sidebar.

  94. Pingback: AZIndex — Wordpress Thingees

  95. English Mike Post author

    Dave, yes that would be the case. I must admit that I hadn’t really considered the issue of child categories — and I know for sure that the query I use to fetch the items included in the index just looks for the specified categories and doesn’t include any children.

    I am still going through the backlog of questions and issues, but I will add this to the list. I think you’ve stumbled across something that I think should be fixed (otherwise having child categories doesn’t make much sense) and is probably not too difficult to fix. Please stay tuned, but for now, yes, you have to add all the child category names you want included.

  96. English Mike Post author

    Is there anyway i can drop in the A-Z Index (Links) into my template files? For example: I’d like to display sitewide an A-Z menu in the sidebar.

    Hi Ash. Yes! It is possible to do what you want. I have just posted a new tutorial giving step-by-step instructions on how to add an index to your sidebar. Please give it a try and let me know how you get on.

  97. English Mike Post author

    With a little further investigation, I remembered about inheritance in CSS. The solution I came up with is simply removing the list-style-type: square. Couldn’t figure out any other way for it to “take.”

    ciara, yes, bullets on lists are a pain when it comes to indexes. I had the same trouble with one of the themes I was using. The problem is that there are several ways to specify the bullets you want on a list, so if they start appearing in your index, you have to search through the theme to see which CSS definition is causing the problem and then figure out a way to remove it from your index without losing it from the rest of the theme. Added to that, some themes use the tag “!important” (which I initially thought was just a comment!) to override the usual CSS inheritance so anything you do in the index’s CSS is ignored.

    Anyway, I’m glad you figured out the problem. I will eventually have to bite the bullet and write some documentation on indexes and CSS, though I am not looking forward to it!

    EM

  98. English Mike Post author

    Hi i was wondering how to list all the numbers under one heading like instead of having each number under separate heading like 1 2 3 4 instead how could i list them under one heading like under #

    Hmm, that’s an interesting one. I guess you could also do the same thing for items beginning with punctuation marks like ! and ?. What do others think?

  99. Leila

    Hi Mike! Thank you for creating such a wonderful script. I really like it because it is simple but it also seem to have several functions that can be easily customized to make it more personal (like the book reviews). However, for some reason, the index does not show up for me in my blog. Instead, the code doesn’t seem to be “read” as when I see the published page, all it says is: [az-index id="1"]
    Do you perhaps have any ideas as to why this happens? I am fairly new to wordpress I must admit but I’ve looked around and cannot figure out why :(

  100. Leila

    Hi again Mike. I just wanted to say that the problem has been fixed. It turned out to be the theme that I was using. I have no idea as to why but it worked well when I changed theme.

  101. English Mike Post author

    Hey Leila — I’m glad you figured it out. It’s certainly difficult to track down all the problems with interactions between plugins and themes. Out of interest, could you tell me the name of the theme that was causing the problem? It might help diagnose other users’ problems in the future.

  102. English Mike Post author

    Cangia,

    No, you can’t limit the contents of index in the ways you are asking. While I see what you are asking, I don’t really think that it’s very common way to do things with an indexing tool like AZIndex. Excluding items from the index based on the initial letter of the title seems to be a little random, and I really don’t see the merit of restricting an alphabetical index to the last 20 items.

    The correct way to restrict items from showing up in the index is to use categories and tags. I am looking at adding an “exclude categories/tags” feature at the moment, which may help you do what you want.

    You can restrict the number of items on a page to 20 items (just turn on the “Use Multiple Pages” option and set the item count per page to 20 (or 50 or whatever you think looks good). There are also plenty of other ways of displaying an index of the last 20 items posted on your blog — it’s quite a common thing to do — just search the WordPress forums and/or Google and you should find a page template that will do what you want.

    Good luck!

    EM

  103. Elfenwald

    Hi and BIG thanks for this plugin which seems to be the only viable solution to set up kind of an “encyclopedia” in WordPress…

    Just two questions/suggestions:

    - same as posted before: some kind of exclusion mechanisms would be cool. E.g. AND/OR/NOT operators for tags and categories.

    - is there any way to have sub-pages indexed? I indended to place all the dictionary articles as child-pages under the index page (makes it more easy to un-clutter the pages menu etc.). Tagged them, but they don’t show up in the index. Moved them up to the main level – works. Any idea what snippet of code must be modified so the plugin scans for tagged sub-pages as well?

    Thanks & cheers!
    Martin

  104. English Mike Post author

    Hey Martin,

    The excluding tags/categories code is done, and will be in the next release of AZIndex very soon. I originally considered a more general AND, OR, NOT format but couldn’t get it to work at the time. I’ll add it to the list to take another look at some point, but I think once you have the exclude (NOT) option, the vast majority of queries people need are catered for.

    As for subpages — I just did a quick test and subpages worked for me. They are tagged with the same post_type (“page”) in the database as regular pages so the SQL query used by the plugin should work whether or not they have a parent page. I even specified a tag in the index used on the subpage and that worked too. So I am not sure why your subpages are not showing up.

    Depending on your level of technical knowledge — specifically if you know how to use phpMyAdmin on your blog’s database — there may be a couple of ways to help debug the problem you are having. If you go to line 284 (or thereabouts) in the plugin file az-index-cache.php, and uncomment the line:

    //az_println("fn:get_index_items : query = ".$query."
    rc =
    ".$posts);

    then you will see the full SQL query the plugin generates for your index. You can then copy the query (most of the text printed in yellow, but not all) and paste it into phpMyAdmin’s SQL query window (click on the little SQL icon below the phpMyAdmin title at the top-left of the main phpMyAdmin page to show it). Now, if you run that query, you should see that the results are the same whether or not your pages are subpages. If the subpages are not in the results list, then please check what those pages have in the “post_type” and “post_status” columns in the “wp_posts” table. If they don’t have “page” and “publish” then what do they have? If they do, then I really have no idea why they are not found by the query.

    The other usual think to try is to disable any plugins which might be interfering with the way AZIndex works. I have no idea what they could be, but then there are thousands of plugins you could have running! If you can, disable them all and see what happens.

    Let me know what you find.

    Mike

  105. Elfenwald

    Hey Mike!

    wow, you really invest time & effort in your plugs & support! thanks for that novel! ;-)

    As it happens often in life – I changed “something” – and now the display of subpages works… actually I did not do much, de-activated some other plugins, reactivated them one by one, re-arranged the pages with pageMash – and everything is fine. No idea. And sorry for the hassle.

    I can now even push around the pages at will with pageMash, hide them so they do not show up in the navigation, and they still get listed in the index….

    so: another happy user here, one step closer to getting rid of that boooooring old wiki layout on my site, and looking forward to the next version of AZindex!
    Cheers
    Martin

  106. English Mike Post author

    Thanks Martin. Good to know you sorted the problem. Hope the new version helps with your indexing.

    EM

  107. English Mike Post author

    If anyone is coming here to report SQL error on AZIndex 0.6 or 0.6.1, please try AZIndex 0.6.2 first. I just fixed a bug that is probably causing your problems.

    Thanks

    EM

  108. Paul

    Great plug-in. One minor request–the ability to remove “the” and “a” from the sort. We can remove quotes, but not words.

  109. English Mike Post author

    Paul,

    You can do what you want — it just takes a little more work. If you’re comfortable with modifying your blog theme’s files then this post explains how to add a filter to modify the headings before they are sorted and displayed. It will do exactly what you need.

    I am looking into making a couple of minor changes to the plugin to allow users to create an “az_index_user.php” file inside the AZIndex plugin directory, so that you can add filter functions or your own sort comparison functions there instead so you don’t have to modify your theme code if you’re not comfortable doing that.

  110. English Mike Post author

    Well, that didn’t work—adding a user file to the plugin directory actually is okay, but it gets wiped out when you upgrade AZIndex, so that’s no good.

    However, there is a nice solution — put the filter code in a new plugin! Just add the code to a file that will be recognized as a plugin by WordPress and you can add your own extensions to AZIndex without worrying about them being overwritten next time you upgrade AZIndex or your theme. Even nicer, if WordPress detects a problem with the code, it will disable the plugin, so if you make a mistake, it should not harm your blog’s operation. And finally, you can enable and disable the plugin whenever you like.

    I will be posting a new article (along with the new AZIndex User Extensions plugin (containing the filter code) shortly.

  111. MagOne

    Thanks for a nice plugin- Just what I needed.
    One question though? I´m wondering if it`s possible to make it support characters like æ ø å, which would be very usefull for us Scandinavians?

  112. Fiona

    This is absolute genius. Really, it’s exactly what I needed for review sites with multiple contributors. Thank you, thank you!

  113. Sherryness

    Hello,

    This is a great plug-in. I am trying to install it on a client’s WordPress site to index book titles. I’m doing this by setting a custom field for author in the index heading, because they don’t want a sub-heading or description – just the author’s name with a link back to the post.

    That part is working great except that sometimes they review more than one book per post. How can I have multiple “heading” fields so that they can enter two or three author’s name in the custom fields of just one post?

    I hope my question makes sense. Thank you for any help!

    -Sherry

  114. anthony

    this may be a silly question that i can figure out myself but i am not tons familiar with CSS and i don’t see a way to do it. i review root beers and the like on my site. i am trying to use this plug in to have a page of all of the reviews, with the brand as the heading and each soda made by that brand as the subhead, so there can be a few items under one brand, each a link to the review of it. i would like to have a list item type circle or square or whatever before each subhead entry. i can get them to display for the headings but no lower. i know the subhead items are not a list but i’d like to distinguish them somehow. even the zebra stripping would work. they just blend together too much now.
    thanks so much, great otherwise!

  115. LightBred

    Hello, I am trying to get rid of the large space between the top of the list and the rest of the content above the list, also remove the large space at the very bottom between the content the index list. How is this possible and where do I need to edit at?

    I also need to bring descriptions in even with the title of the post instead of the offset.

    Any help would be greatly appreciated, this plugin is a life saver!

    Thanks!

  116. Pingback: Tutorial: Glossar mit Begriffserklärungen für WordPress auf datenschmutz.net

  117. Sami

    Hi English Mike,
    I’m still getting this error :

    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)

    Over my site : http://www.lamedecinedouce.com/remedes

    I’m using child categories and I checked the “include child categories”.

    What could be the problem ?

    Thanks,

  118. Danny

    Mike,

    Thanks for implementing the zebra stripe request. Its great to see the continued development on this super plugin. Your efforts are really appreciated. Cheers. Danny

  119. Barbara

    I’m having the same problem as Sami with the error message:

    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)

    You can see it at http://www.appcraver.com/app-index.

    Im using WP 2.6.2, MSQL 5 and PHP 4.9. Everything was working fine until the last update.

  120. GREG

    Phew – I thought it was just me getting the following

    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)

    Help please!

  121. GREG

    Ok , have worked out what the prob was.

    After you have created your index etc and then goto Manage Pages and select the page the index is in, the short code given e.g [az-index id="1"] is incorect. Just remove the 2 speech marks either side of the id number, save then all will be well with your new index page.

    Cheers

  122. E.Y. Karaduman

    Hi Mike,

    Excellent plugin!
    But Turkish characters are not shown properly in alphabetical headings list for me.
    Is it possible to fix this problem?

    Thanks.

  123. Patrick

    Mike,

    I have the same problem as Jon – only [az-index] displaying in my page?

    Using WordPress 2.6.3

    No erros on install of plugin.

    Thanks,

    Patrick

  124. Mike

    Hi,
    Great plugin. I installed it and all is well. However I need a bit more flexibility as I am including index in a wordpress footer. The description above states “Control over the number of index items per page” however I don’t see a method of doing this other than limiting categories etc.
    What I feel I need as 4 columns simply aren’t enough is a method to have more columns, or a way to create index a with alphabet a-l etc and index b with alphebet l-z thereby ending up with 8 columns, or more.

    Is there any way of accomplishing this ?

  125. GREG

    Just upgraded to WP 2.7 beta 2, now az index not working :( .
    Installs ok, no error messages but when you click on Add New nothing happens.
    I may have to down grade WP back to 2.6

  126. Pingback: Threats from Web Hosting Service - Please Advice me | Web Tools and Tips

  127. Pingback: frEdSCAPEs 3.0 » Blog Archive » WordPress AZIndex plugin

  128. Pingback: » How to Create An Index For Your Wordpress Blog - Rickety

  129. Pingback: 10 - X Best Plugins for Comments « Feet up, eyes closed, head back

  130. miki

    Thanks for one of the best wordpress plugins ever!
    Unfortunatelly it doesn’t seem to work with wordpress 2.7 beta3 :(
    Do you plan any upgrade soon?

  131. The Evangelist

    Hi,

    I would like to hava a checkbox o the possibility to choose sort ASC or DESC, sometimes, some TAGS/CATEGORIES i need sort DESC and others ASC, this would be possible in a next release??

    I know this can be done with custom sort function but i think it is very complicated to only change the order of the sorting.

    Thanks.

  132. Sarangan

    Sir,
    This plugin is not compatible with wordpress 2.7 Beta 3
    We are looking forward to see an upgrade. Thank you.

  133. Lionel Chollet

    Well, guys, Mike’s last post on this blog was on September 17th; seems like he’s some interests or issues to deal with other than the AZIndex plugin. That’s life, everybody here must know that bitch. Please don’t blame him. Give him some time to get back on tracks with this plugin, and meanwhile, just don’t use beta software on critical sites!

    (Or donate, like I once did, to keep him motivated.) :-)

  134. Jamie

    Hi Mike,

    Just read your road rage account. You have a great descriptive handle of the English language and it’s a pleasure to read.

    Right, onto more important things. I was pointed towards your plug-in after putting a post up on the wordpress.org forum. Instead of repeating myself you can see the thread here:

    http://wordpress.org/support/topic/222446?replies=3

    So I downloaded AZIndex in anticipation but I’m a little lost as to how to replicate the tree on my website homepage I alluded to in the WP thread (the website is my current one, my WP blog is being developed offline). Of course I understand that some styling is required with CSS but I can’t get the three tiers to function as I’d like. What’s happening is Country and Region are the same link, when they should be independent of each other, and Location (the third tier) isn’t a link. I’d like all three links to be clickable tiers.

    Is this beyond AZIndex? Please let me know before I waste any more time playing around with it. Don’t think for one moment that I’ll bin it though – it’s a killer plug-in. Well done on the work.

    Thanks in advance,

    Jamie

  135. Rudolf Duncan French

    I couldn’t find a support forum for this plugin so I’ll post my question here;

    Is there a way to index by numbers? Specifically by integers larger than 9? I’m trying to put together an archive of product reviews arranged by price. I can eliminate the “$” sign no problem and the indexing agent is through a custom field but I’m returning an archive page that organizes the content by the first integer in a number and that is it, so say the prices $1.00, $10.00, and $100.00 are all categorized under a single heading of “1″. How do I fix this?

    A workaround I’m thinking of I’m thinking of is instead categorizing by price ranges with headings in a custom field reading “Products Less Than $10″ or “Products Between $10 & $20″ and so on but I’d like it to be a little more precise…or not. What are your thoughts? Would you recommend my initial approach or this workaround approach and if the former any suggestions on how to implement it? Thanks!

  136. Lionel Chollet

    @Rudolf,

    Yes, you can index by numbers. I dit it on a site where the posts were to be sorted by the reference number of the products they presented.

    You have to add these lines to the file functions.php in your theme’s folder:
    < ? php // In your file, get rid of the spaces in the php start code on this line, and delete this comment
    function my_numeric_compare($item1, $item2) {

    return (intval($item1['subhead']) – intval($item2['subhead']));

    }
    ?>

    Adapt the code as needed — you might not want to place you sorting number as a subhead, for instance.

    You can also read these previous comments:

    http://englishmike.net/azindex-plugin/#comment-248

    http://englishmike.net/azindex-plugin/#comment-341

    http://englishmike.net/azindex-plugin/#comment-347

  137. Andrew

    Hello,

    WordPress 2.7 is out – thats good news :)
    AZIndex is not compatible – thats bad news :(
    Please, please… wordpress is uncomplete without your fantastic plugin.

    Andy

  138. Roady

    There is a real quick and easy workaround for getting to the Edit screen of AZIndex in WordPress 2.7;
    1) Right click the Edit shortcut button and choose Copy Shortcut
    2) Paste this in the address bar
    3) Change edit.php to tools.php
    4) Press Enter

    Your string in the address bar should now look something like this;
    http://www.yourwordpressblog.com/wp-admin/tools.php?page=az-index-manager&action=az-edit-index&indexid=1

    The design looks a little bit messed up but at least your options are accessible again.

  139. Roady

    Just a little update on a better fix;
    1) open az-index-admin.php in an editor (could be in the WordPress Plugin Editor even)
    2) Locate the following line;
    define(‘AZ_PAGENAME’, ‘edit.php?page=az-index-manager’);
    3) Change it to;
    define(‘AZ_PAGENAME’, ‘tools.php?page=az-index-manager’);

  140. Rick

    On line 326 of az-index-content.php you have a span opening tag and a style closing tag. It fails XHTML 1.0 Strict, which is how I found it. There is another strict error that I haven’t found the cause of yet. Nevertheless, great plugin. Thanks

  141. Roady

    The other error is regarding the style definition in the middle of the HTML body. You can either solve this by editing the plugin to put it in the header or take out the entire style definition and put it in your css file.

    I chose for the last. Of course this means that you cannot use the editor supplied in the plugin anymore but you can still use your Theme Editor online (if you really want to edit everything online).

  142. Estrella

    I have a problem

    I make use this plugin months ago, but now after latest wordpress upgrade, I cannot find where is the plugin setting page, if I click “edit” on my old index, doesn’t happen. I try to deactivated the plugin, delete it and download it again, but I have the same problem.
    Also, it only shows parent category.

    Where is the problem?

    Many thanks.

  143. Cruth

    I really like your plugin. A very practical idea as people can more easily find useful posts. I just upgraded to WP 2.7 and am not able to create the index. Have tried a number of times. anyone else having this issue? Any help would be greatly appreciated.

  144. miki

    @Cruth and Estrella,
    Read previous comments, Roady kindly explained how to fix it, a couple of lines above :)

    @Mike
    Absolutely fantastic plugin… The more I use it, the more I love it :)

  145. Estrella

    Many thanks for your help. I have a new question but, I I am very much afraid that it has no solution. I am using ZDmultilang for English version. This plugin doesn’t distinguish between Spanish category or English category the only difference is in the URL

    On Spanish
    http://www.estrellaesteve.com/es/cocina/

    On English
    http://www.estrellaesteve.com/en/cocina/

    Is there any way to create different index for the two versions?
    Many thanks and Merry Christmas and a happy NEW YEAR

  146. LJ

    Cruth,
    I’m using 2.7 and just tried to install it on another blog and it just keeps saying “no index pages found.”

    I have it installed on another blog running 2.7 but it was installed prior to upgrading to 2.7

  147. LJ

    Sorry! Didn’t see the fix for this above.

    The code fix to make it work with 2.7 is also posted on wordpress.org

  148. Alex

    The fix doesn’t seem to work for me. I get this error when I input the code:

    Parse error: syntax error, unexpected ‘=’ in /home/baseb6/public_html/WordPress/wp-content/plugins/azindex/az-index-admin.php on line 49

    The plug-in then deactivates. Any solutions?

  149. Locke

    excelent plugin …

    only I will recommend to put in the custom css , and !important excalmation in the ul, li and ol in case of the theme overides this .

  150. Pingback: En.nicuilie.eu Blogs » Top 1000 WordPress Plugin Authors

  151. Emptyg

    content.php around line 152:

    $heading = ‘…

    What should it read to correct the missing anchor link? Right now it only outputs the hashmark as the anchor link and no character.

  152. Nagaraju

    I am using wordpress 2.7 and I got “No index pages found” message under Manage Indexes. I think your v0.6.2 is not compatible with wordpress 2.7! Can any one hlep me on this matter?

  153. Spill

    Great plugin! I cant belive that I havent seen this one before. The “hack” above works great with WP 2.7. Here is mye page with the plugin: http://www.spillnett.no/alle-spill/

    I think i will do some custom css to make it look a bit better.. You could add a standard option to have a line break line between each letter.. Like this:
    A
    __________________________________
    content with the title A
    __________________________________

    B
    __________________________________
    content with the title B
    __________________________________

    Im not sure if this will look ok, when i post the comment…:P let see..thanks anyway

  154. Roy

    Mike, I hadn’t noticed before because the indexes that I use work just fine, but I can’t edit or make a new index since I upgraded to WP 2.7. I can’t get it installed with the built in WP plugin installer (I’m at work, no FTP here), so I haven’t checked if that would help.

  155. Paul

    I’m trying to use the plugin to make a glossary of all the movies on my blog. What would be the best way to go about this? The titles of my post don’t all start with the titles of the movies so they are not listed in A-Z order by movie name. Is there a way to A-Z order by tags without having to enter each tag individually and to just include all tags?

  156. joris

    Is it possible to exclude titles which begin with a certain word. Like ‘The Next President’ to Next President, The’

  157. Scott

    Hi Mike,

    Awesome plugin but cant seem to get it to work in v2.7. Looked over your instructions a few times and when I click on “Manage Indexes (add new)” nothing happends.

    Please advise.

  158. ZeRo4

    in 2.7 you need to change the line 49 of az-index-admin.php…

    define(‘AZ_PAGENAME’, ‘edit.php?page=az-index-manager’);

    appears that it needs to be:

    define(‘AZ_PAGENAME’, ‘tools.php?page=az-index-manager’);

    works fine for me now!!!

  159. Joris

    Re post (sorry, maybe i wasn’t clear enough!): Many of my Dutch posts in the index start with de (the). Is it possible to automatically change the title to for example ‘President, De’ instead of De President?

  160. Life Regained

    I get the following error message on WP 2.7

    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)

    The code for the index is 2, so it is non-zero.

    1. English Mike Post author

      Hi there,

      Did this just happen when you upgraded to WP 2.7? Are you using the latest version of the plugin, I released today (0.6.3)? Is the index still visible on the AZIndex administration page? Does the number you are using match the ID of that index?

      Sorry to only reply with questions, but unless I have more information, then it will be difficult to help you. I tested the new version by installing it on my own blog here (which is now at WP 2.7) and it seems to be working fine.

      Mike

  161. Worth

    Mike

    I installed AZindex with WordPress 2.7. I get a good preview of the page, but when I go to publish it, and then open the page, I get the following error message:

    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)

    I’ve tried deleting and re-establishing the index and clearing the cache. Any thoughts on what I should do?

    Thanks

  162. English Mike Post author

    Hi, Worth. You are the second person to report a problem tonight, but when I try to reproduce the problem on my blog, and on a new install of WP 2.7 and AZIndex 0.6.3, everything is working fine. The only thing I can suggest, for now, is to try uninstalling the plugin (use the link on the AZIndex Admin page) and reactivating AZIndex from the plugin screen. Note you will lose all indexes you have defined — so only do this if you don’t mind recreating the indexes.

    Is this a new installation of AZIndex, or were you upgrading from an earlier version?

    At the moment, I can’t think of anything that would be causing this. It’s possible that WP 2.7 is interacting with the plugin differently in some way, but it’s not at all obvious what it could be at the moment, since I can’t see the problem myself.

    I will check back in the morning to see if anyone else is reporting the same problem.

  163. Roy

    Mike, 0.6.3 solves the problem I described above.
    An just as a request, I’d love to be able to handle letters like ä or æ better, either manually (like the characters to ignore) or by default, but ä becomes ae (or just a, because it’s not always German) æ, ae, ö o, etc.

  164. English Mike Post author

    Roy — glad the fixes worked for you. I hear you about the problems with non-English characters. It’s on the list of things to do, and now that I have started to look at the plugin again, I hope to do something about it soon.

  165. Worth

    Mike,

    I did as you suggested and still got the same results. For the record, this was a brand new install (no upgrade). Also, the index numbers match between the index number on the Admin page and the text of the “live” page. What other info do you need from me?

    Worth

    1. English Mike Post author

      Hi, Worth, thanks for the additional information. I have been looking through the AZIndex code and while I don’t know what the problem can be yet, it’s likely that the error message you are getting is a little misleading. The plugin can’t find the index, true, but not because it isn’t a valid one, but because there is some kind of database error when it tries to access the index settings from the database.

      That’s just a guess, but looking at the code, any database error will cause that message to be displayed, but the question is, why?

      So I have a few more questions (not solutions, yet, I’m afraid):

      1. What version of PHP and MySQL are you using (don’t worry if you don’t know how to find out)? There have been a couple of problems in the past associated with a specific version of PHP or MySQL.
      2. Try disabling the cache from the index settings (under Advanced Settings).
      3. What happens if you copy the shortcode reference to a published blog post and try it there?
      4. Can you confirm that the index works for unpublished (previewed) pages? More than once? (refresh the page to see what happens).
      5. If so, what happens if you publish a page, and then unpublish it again — does it start to work again?
      6. Have you tried disabling all the other plugins to see if that solves the problem?

      Thanks for persevering with this, Worth. I know how easy it is to give up on a plugin when you can’t get it to work right away, so I greatly appreciate your help.

      Thanks,

      Mike

    1. English Mike Post author

      Hey Paul,

      No, I’m afraid there isn’t, not easily anyway. The problem is that posts often have more than one tag, you would want that post to appear under each of its tags in the index, and the plugin isn’t really designed to work that way.

      There are a couple of ways of achieving close to what you want, but they would require some work setting up:

      1) If you only have one tag per post, you could place that tag in a custom field called “tag” and then sort on that custom field. If you have a lot of posts, that would be a chore to set up, but it would work. (There might be a plugin that might help you copy the tags over, though I am not aware of one.)

      2) If you don’t have too many tags, you could create an index for each tag which would only include posts with that tag. If you have, say, 20 tags, then you would need 20 indexes. You could then one more index to contain only those 20 index pages (a super-index?) which would list the tags. The user could then click the tag to go to the correct index, then click the post name. Obviously if you have 500 different tags, this would be difficult to set up, but with a limited number of tags this would work well (and allow posts to appear under more than one tag).

      Hope that helps.

      Mike

  166. Rick

    Is there a way to have multiple entries from the same blog post appear on the list? (e.g. a post that contains several recipes). I tried creating a custom field and putting each recipe in it, but AZindex only pulls in the first instance of that custom field.

    Ideas?

    1. English Mike Post author

      Sorry, Rick, the whole plugin is gear towards one index item per post. I’m afraid that if you want each recipe to appear separately in the index, you will have to give each of them its own post.

      I took a quick look at your site — very nicely done — and all I can suggest as an alternative, would be to put an index title in a custom field that best describes the recipes in that post as a group (e.g. “Cocktail Recipes”) and then add another custom field where you list the names of the recipes in the post (e.g. “Mai Tai, Pina Colada, Martini”) which you can then use in the “Description” field in the index, so the user can see which recipes are described in the post.

      What you are looking for is an index based on tags, which would allow for multiple index entries per post, so you would be able to add a tag for each recipe. It’s an interesting idea, but it would take a major overhaul of AZIndex to do it, so it’s not something I’m likely to be doing in the near future.

  167. Heather B

    I love the idea of this this plugin and would absolutely love to use it, but after I activate it and go to the tools section to set it up i get the following error…

    AZINDEX_PLUGIN_ERROR: The required AZIndex database table – wp_az_indexes – does not exist. Please deactivate then re-activate the AZIndex plugin to correct the problem.

    I have deactivated it and re-activated it more then enough times and still no go. I’m running WP 2.7, any help would be greatly appreciated :)

    1. English Mike Post author

      Rats — I thought it had to be the issue I just fixed. I’m back to being stumped. If you really want to try out this plugin today, then please try the older version 0.6.3 which, I hope, should work for you. You can find a link for downloading by clinking on the “Other Versions” link below the main download link.

      Sorry for the inconvenience. I really don’t know what’s going on, apart from the fact that the AZIndex database table is not being created. Most others have been installing and upgrading with no issue, so there must be something different with your WordPress configuration that my plugin is not allowing for. I will keep digging.

    1. English Mike Post author

      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.

    2. English Mike Post author

      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.

  168. Monika

    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

    1. English Mike Post author

      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.

    2. Monika

      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

    3. English Mike Post author

      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.

    4. English Mike Post author

      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.

  169. Nonaoco

    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)
    :(

    1. English Mike Post author

      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.

  170. Charles Hodgson

    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.

  171. English Mike Post author

    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

    1. Charles Hodgson

      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

    2. English Mike Post author

      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.

    3. Charles Hodgson

      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

    4. English Mike Post author

      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.

    5. Charles Hodgson

      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!

  172. Andy

    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

    1. English Mike Post author

      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

  173. Pingback: Artikel alphabetisch sortieren - nach Titel - nach benutzerdefinierten Feldern

  174. K

    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

    1. English Mike Post author

      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.

    1. English Mike Post author

      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.

    2. The Local Landing

      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!

    3. English Mike Post author

      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.

  175. Pingback: English Mike » Add-on Plugin for German AZIndex Users

  176. zonebattler

    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… ;-)

    1. English Mike Post author

      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!

    2. zonebattler

      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

    3. English Mike Post author

      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

    4. zonebattler

      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

    5. English Mike Post author

      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

    6. zonebattler

      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

    7. English Mike Post author

      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

    8. zonebattler

      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

    1. English Mike Post author

      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.

    1. Michael

      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.

    2. English Mike Post author

      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 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.

    3. Michael

      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!

  177. Roy

    I’ve just updated this plugin, but anything I try to do with it gives me the following error:

    AZINDEX_PLUGIN_ERROR: The required AZIndex database table – 03_az_indexes – does not exist. Please deactivate then re-activate the AZIndex plugin to correct the problem.

    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.)

  178. Roy

    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).

    1. English Mike Post author

      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.

  179. Roy

    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 :-)

    1. English Mike Post author

      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!

  180. Roy

    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.

    1. English Mike Post author

      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.

  181. Pingback: Les extensions (plugins) Wordpress utilisées sur ce blog | Blog gay de MensGo FR

  182. Pingback: AZIndex

  183. The Local Landing

    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. :(

    1. English Mike Post author

      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:

      Note: One common problem with some themes is that you’ll see bullets appearing next to items in the index. This happens when there is a CSS style in the theme’s stylesheet that defines the style tag ‘list-style-type’ or ‘list-style’. The easiest way to fix this is to comment out or delete this line from your theme’s stylesheet, but you should check to see if this causes other formatting issues in your blog. If you feel you can’t remove that line, the next easiest way to solve the problem is to make a copy of that style (it will begin something like “#content .page ul ol {“), turn on custom CSS styling for the index and paste the style into the stylesheet for the index. Then all you have to do is modify the “list-style” (or “list-style-type”) element and replace “disc” (or whatever the type is) with “none”.

      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.

  184. The Local Landing

    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. :)

    1. English Mike Post author

      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

  185. Israe

    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.

    1. English Mike Post author

      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

  186. Israel

    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?

  187. Israel

    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.

    1. English Mike Post author

      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

  188. Piet

    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

    1. English Mike Post author

      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!

    2. Piet

      and brilliant how it works with the custom fields!
      Thanks again for this great adaptable plugin, it makes my life a lot easier!

  189. Christian

    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

  190. zonebattler

    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

  191. Christian

    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

    1. English Mike Post author

      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.

  192. zonebattler

    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

  193. Christian

    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

    1. English Mike Post author

      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!

  194. Christian

    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 ;-)

  195. Gunther

    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).

    1. English Mike Post author

      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

    2. Gunther

      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

    1. English Mike Post author

      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

  196. Roy

    Mike, my again. I just noticed that version 075 and 076 does no longer make linked titles in the indexes! WP 271, any ideas?

    1. English Mike Post author

      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.

Comments are closed.