Gossamer Forum
Quote Reply
[UPDATE] Alpha_Bar
I've played with this plugin, and the current version seems to work with 2.1.

Bug reports, or suggestions can be posted here.






PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
In Reply To:
I've played with this plugin...
Are there any changes/updates you made? No problems so far.




~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] [UPDATE] Alpha_Bar In reply to
No, the playing was to see if any changes had to be made. I didn't find any. I did update the shareware message so it displayed properly as above. That's all.

Changes in 2.1 affect plugins and scripts differently.




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Hi Pugdog:

I have submited a question before purchase LinksSQL because I want to short the search results by selected field order

http://www.gossamer-threads.com/...orum.cgi?post=184076

I also want short the categories by alphabetic order (like Google) and Alex said me that the alpha_bar could make it...

I have installed alpha_bar and I don't know as making what I want. Your you can help me?

Thank you in advance!

-----------------------
Nomada
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Hi,

The "alpha bar" is sort of a misnomer... It started out to be an alpha-bar, where you would have a letter bar, and the click on it to see the items with that letter.

But, in the process, I stopped that, because it didn't seem as useful as what it ended up as.

The "alpha_bar" plugin will let you search by the first letter(s) of a string. You can see it in operation on http://identitydots.com

You can find domain names that either start-with or contain a certain string.

To make the alphabet bar, you'd need to mostly create the template, and pass in both the initial query, and the category string (and/or field name) to search on.

I've been meaning to do it, but I just haven't had the time. It's a lot of template work, and the current "start-with" or "include" search seems to do most of everything now.

I've been meaning to do it, since I have a couple of directories where using the alphabet bar in the categories would be helpful.

But, if you look -- it's often better to be able to type the "first few" characters, rather than just the "a" or "b".

Check out http://identitydots.com and see if that does what you need.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Thanks pugdog!

But when I have more than 5.000 categories I need an alphabetical index to make more easy the search option.

How I can make it?

-----------------------
Nomada
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Actually, that is what the "categories" are for.

The plug in was never meant to list categories alphabetically, or in groups, only the links. The code is all there, you just need to take the sample HTML and create an alpha bar of your own ' - a - b - ... ' etc.

I'm now confused as to what you are trying to do.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
I am not very good with perl, what it is what I have to cut and to paste? Where are the code?

Quote:
I'm now confused as to what you are trying to do.

I want to display an alpha_bar like Google, only for the categories. You can see at the bottom of this URL http://directory.google.com/Top/Sports/

Greetings and Thanks!!

-----------------------
Nomada
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
This is what I was afraid you were trying to draw at.

That's trying to organize the categories, and I don't think anyone has done that. The only requests have been for the links, not the categories.

This would need a bunch of code changes and rewrites. I guess the base code to look at would be the code for the "build_category" in Links::Build.pm It's kind of complex, since it seems to mix subcategories and related categories.

Maybe Alex would have a suggestion, I can't think of the code fragment off the top of my head now to start with.

although, you could probably use it as it was, and use the results in the @{$display{category_loop}} array to find matching items and generate an index page, as well as linked status bar.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
I posted in your other thread, I think I talked myself through a way to do it, but it will take a bit of debugging, and some changes to the plugin to handle the extra parameters and function calls.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Ok,

This is a quick hack, and it's hard coded, as a function call:

Code:
<%if Username eq 'test_cat'%>
Values Are:<BR>
<%Plugins::Alpha_Bar::cat_list ($category_id)%>
<%cat_header_bar%>
<%cat_list2%>
<%endif%>


This is inserted in the template (again, as a hack in this example)

You need to log on at http://origami.net and log in with 'test_cat' as the username and password.

As you can see by the code above, this will only be displayed if you are logged in as that user. It makes a function call, and sends in the current category_id. The back-end function uses that to select all categories which have that category_id as the Father_ID. It then returns a formatted HTML string, and the alpha bar.

It's a "shortened" alpha bar, since it only displays letters that have subcatgories, and if you follow it on down, it works pretty well (actually surprised me <G>).

But it's a hack, and still some issues to work out if it is going to be used in static and dynamic sites as index pages, rather than a status bar.

As I said before, there are a lot of permutations, but the alpha bar can be linked to generate individual pages, or to function as a jump-down to a section of a single page.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Uaaauhhh!!

Is a good beginning Pugdog, but I believe that the best operation would be to create a subcategory for each letter,

MAIN CATEGORY/A
MAIN CATEGORY/B
...


and each one includes the categories that I want to put manually.

But the search of these categories should be omitted omitted (only search in certain categories mod? exist for LinksSQL) and that each subcategoria under MAIN CATEGORY/A points to the suitable category (I think Google works this way...)

The problem is that I don't know as making these last two steps to make work my idea...

You know how to making it?

Thank you Pugdog!!

-----------------------
Nomada
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Now I really don't have a clue.

If you want to do this _manually_ just create an HTML page, and type in the categories and link them to where you want to go. Simply insert this as a link in your template, and you'd have saved me a couple of hours of playing around.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
I don't want to make it manually, but if there is not another solution I will have to make it this way...

I know that it is difficult to build a code so that can make what I want, but also, I have up to 5 levels of categories

MAIN CATEGORY/SUCAT1/SUBCAT2/SUBCAT3/SUBCAT4

and many of them are duplicated, example

USA/Organizations/Private
Spain/Organizations/Private
...


and I think that the automatic code that you can to build perhaps can show many repeated categories...

I see that the solution is not easy and I don't want to continue making you lose the time

The solution that you offer above is not good because it shows the subcategories inside a category, it doesn't show the alpha list for the whole directory.

Sorry and thanks again!!

-----------------------
Nomada
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Wait a second...

This is completely different from what I heard before, and was working on. It looked like you wanted a way to sort the categories in a sub category like Sports, where there might be a couple of hundred items.

You are saying you want to search on the CATEGORIES only?

This is best done through the existing search function, which will return categories that are appropriate to their search.

To list categories by letter, without any other criteria, is really not a useful thing to do across a directory, whether you list all the levels or not.

The whole purpose of the "alpha bar" was to make navigating a subcategory or sub-search easier, when the list would contain perhaps several hundred items. You could jump to the part of the search you were interested in quickly.

But, to use your example, if someone was looking for "private" they would do much better searching for "private" rather than for "p".


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Quote:
This is completely different from what I heard before, and was working on. It looked like you wanted a way to sort the categories in a sub category like Sports, where there might be a couple of hundred items.

I want to make the same thing that I explained to you at the beginning.

Quote:
are saying you want to search on the CATEGORIES only?

I don't only want to look for in the categories.

I want to show the categories alphabetically as Google, but Google it doesn't include all the categories and subcategories because they would be too many, for that reason I think that they work with a field different like 'include_as_alpha' and they select the categories that they want to show.

When you have more than 5000 categories, your users will thank to be able to navigate the categories alphabetically...

-----------------------
Nomada
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Yes, but the categories they show are the categories LOWER than the position you are currently at, not all the categories.

that means, the "path" information is not needed, since the path is the current directory.

I'll check google again, but when I looked, this is how I thought I saw them working, the same way most letter bars work -- moving you ACROSS the current category, not really up or down.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Ok,

I looked at the link you posted again, and it's doing (or seems to be) what I am saying.

It's listing all the subcategories AT THAT LEVEL. If you mouse-over the links, you'll see they are all in ../Top/Sports except for a few, which are linked from other categories, and appear to be what we'd call "related" categories.

If you click on one, it moves you into THAT LEVEL's categories, for instance, Equestrian, would move you into .../Top/Sports/Equestrian and list the sub-categories (and related) that are available at that level.

This is what my code is doing, but not quite so elegantly. I've added the list to the top of the category page.

I'll see if I can clean it up to make it work like Google, _but_ I can almost guarantee that the first (only?) version will use dynamic pages, not build a static directory. I could, I guess, have it write out the files, but you'd have to rebuild any time you change your directory structure.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
Actually.... What Google is really doing, is simply NOT putting links on any pages until you get down to a leaf node, or a leaf-1 node.

If you remove your Links from any categories except from the leaf nodes, your exisiting Links directory will work exactly like google, showing only the Categories and Related Categories on each page, until you get to a page with Links.

So now I'm really, truly confused :)

I wish someone would jump in and explain to me what I'm missing.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Have you seen the end of the page where says?

Sports Categorized by Letter:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

I think that Google works with a new field, a few subroutines and template to make this, it can be something like that:

Field = alpha (YES,NO)
Sub1 = make list alphabetically of all categories wiht alpha (YES) (example sub alpha_bar)
Template = <% if alpha = yes%>Categorized by Letter:<br><%alpha_bar%><%endif%>

Google select the category where wants to show the Sports Categorized by Letter: only in /Sports - /Sports/College_and_University - /Sports/Soccer. This one can make with category template.


What do you think?

Cheers!

-----------------------
Nomada

Last edited by:

Nomada: Mar 24, 2002, 2:49 AM
Quote Reply
Re: [Nomada] [UPDATE] Alpha_Bar In reply to
I think it's still working as I said. But, it's adding in "related" categories.

I think you can see that in picking the letter "A" and rolling over "Angling". You'll see it is linked to "sports/outdoors/fishing". This is probably a "related" term in one of the subcategories.

The difference is that it's pulling the categories from all the lower categories, not just the current level.

I'm trying to figure an efficient algorithm for finding all the child subcategories, but I think it's probably only a brute force thing.

Take starting subcat (subcat1)
find all categories with FatherID=subcat1, and push their ID into "find" hash
find all categories with FatherID= to the ID's found as you walk the tree.
stop when you run out of ID's

Do an IN type search for Related categories in the list of ID's.

sort this list alphabetically, using either a HOA or HOH data structure, then write out the "include block" for each letter to a file. By writing out a "block" file, you can dynamically or statically include it into the page files, and still serve up dynamic data around the "content block".

I don't know if Alex has a built in function for finding the subcategories of a category. If he does, there might be a slightly more efficient way of doing it, but you'd still use the HOA or HOH structure (similar to the GB function).


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Quote:
I don't know if Alex has a built in function for finding the subcategories of a category. If he does, there might be a slightly more efficient way of doing it, but you'd still use the HOA or HOH structure (similar to the GB function).

Just a quick thought: maybe GT::SQL::Tree is, what you are looking for (it's included in the latest GForum version 1.1.3).

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [pugdog] [UPDATE] Alpha_Bar In reply to
Pugdog:

Can you make this code? I don't know how to work with Perl Unsure

Thanks Yogy for your support!

-----------------------
Nomada