Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Plugin in the works... AlphaBar v3

Quote Reply
Plugin in the works... AlphaBar v3
Hi,

After having a request for this plugin, I've come up with something pretty cool =) As far as I know, its almost nothing like pugdog's version (not even sure if the functionality is the same - as I never really managed to get his version working :().

You can see a working version of it on our site:

http://www.ultranerds.com/...d_Plugins/index.html

You can see that when you click on a letter, it loads all the respective links that *start* with the character in question. Once on a "letter" from the bar, you can see it goes "red" (so they know what page they are on, as if its needed :D).

The things I'm still working on:


1) Fixing any bugs (if anyone spots any =))
2) Writing some documentation up
3) Actually transferring it from a global and single .cgi script (as it currently is), into a full plugin - with settings etc (to make customizing even easier).
4) Probably going to make some rewrite_rules and code changes to that you can use links such as : /alpha/A/123.html (A => letter, 123 => category ID)

I'm looking at offering this one for $25 (a small fee, considering its taken quite a while to get it to this point, and will still need another 1/2 a day of work to get it ready for release. I would love to offer it for free, but as some of you have probably read, I'm having some financial problems at the moment - so can't afford to just "give things away" (at the moment - I'm working on some freebies too, trust me =)).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Mar 16, 2007, 9:24 AM
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Nice work Andy,

Can't wait to see the completed plugin, glad you are back!



Cheers...
Quote Reply
Re: [rascal] Plugin in the works... AlphaBar v3 In reply to
Hi,

This plugin is now complete: [url to ultranerds site for buying it and more details coming soon =)]

Dummy site:
http://www.myuksearch.co.uk/.../Training/index.html

Example "H" page (with spanning pages);

http://www.myuksearch.co.uk/...gi?letter=H;catid=52

It also now accomidates 0-9 charachters, as this was found to be an issue on our MyUKSearch site, as some sites - i.e "21st Century Leader", have a digit in the first charachter of their name =)

I'm just putting together our official page - where you will be able to find out a bit more info, and also buy if you want =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Hi,

Here is the official page :)

http://www.ultranerds.com/...ugins/AlphaBar_L170/

If you have any questions, please don't hesitate to ask.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Hi Andy,

I test version 3 available with the ULTRA Package PRO.

I encounter two problems.

1) This version does not have the numbers (0 1 2 3 ...).

2) Alpha.cgi does not take into account the Globals.

It causes error like: Unknown Tag: 'category_short'

An idea ?

Thank you for your answer.

oyo
Quote Reply
Re: [Oyo] Plugin in the works... AlphaBar v3 In reply to
Hi,

Thanks for your reply.

Quote:
1) This version does not have the numbers (0 1 2 3 ...).

Mmm.. can you PM/email me your copy of /admin/Plugins/AlphaBar.pm, so I can make sure its the correct version?

Quote:
2) Alpha.cgi does not take into account the Globals.

I'm guessing you don't actually mean "globals", as they are bits of code/"global" strings that can be used on any template. The globals definatly work.

I think the problem you have, is that the <%category_short%> global doesn't exist. You can fix this by opening /cgi-bin/alpha.cgi, and changing:

Code:
print Links::SiteHTML::display('category', {
category_loop => \@cats,

..to:

Code:
print Links::SiteHTML::display('category', {
category_loop => \@cats,
category_short => $cat->{Name},

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Hi,

I've now made this plugin mod_rewrite compatible. You need to set ModRewrite_Enabled to "1" , and also set the ModRewrite_URL option.

Once these are set, the URL's will appear like:

http://www.myuksearch.co.uk/alpha/letter_F/cat_52/
http://www.myuksearch.co.uk/...letter_C/cat_52/p_2/

For this site, the Rewrite rules were setup in the /www/alpha/ folder (an empty folder, with just the .htaccess file in it).

The contents of the .htaccess file is as follows:

Code:
RewriteEngine On

RewriteRule ^letter_(.*)/cat_([0-9]+)/$ /cgi-bin/alpha.cgi?letter=$1&catid=$2 [L]
RewriteRule ^letter_(.*)/cat_([0-9]+)/p_([0-9]+)/$ /cgi-bin/alpha.cgi?letter=$1&catid=$2&nh=$3 [L]

If you have any questions, please don't hesitate to ask.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Oyo] Plugin in the works... AlphaBar v3 In reply to
Hi,

In Reply To:
1) This version does not have the numbers (0 1 2 3 ...).

2) Alpha.cgi does not take into account the Globals.

It causes error like: Unknown Tag: 'category_short'

These 2 issues should now be sorted, in the latest version (available for download in our Members Area)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Hi,

Just a note, I've released a bug fix that fixes a problem with the span pages. For those who don't want to upgrade, the fix is as follows:

Open up /cgi-bin/alpha.cgi, and find:

Code:
use Links::Build;

..and add below it:

Code:
use POSIX qw(ceil);

..so it looks like:

Code:
use Links::Build;
use POSIX qw(ceil);

...then, replace the

sub do_toolbar { } function with:

Code:
sub do_toolbar {
# --------------------------------------------------------
# Create an Altavista style toolbar for the next and previous pages.
#

my $page_num = $IN->param('nh') || $IN->param('page') || 1;

my $num_rows = $_[0]; # number of matching rows...

my $html;

# first, lets work out the number of pages needed...
my $pages = ceil($num_rows / $per_page);
}

for (my $i = 1; $i <= $pages; $i++) {
if ($page_num == $i) {
$html .= qq| <b>$i</b> |;
} else {
if ($use_rewrite) {
$html .= qq| <a href="$rewrite_url/letter_$letter/cat_$catid/p_$i/">$i</a> |;
} else {
$html .= qq| <a href="$CFG->{cgi_root_url}/alpha.cgi?letter=$letter;catid=$catid;nh=$i">$i</a> |;
}
}
}

return $html;

}

Thats it :) This bug has been fixed in the download area of our site, so you don't need to apply this bug fix if you are using the latest version.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Hi Andy

This script is formidable. It is very complete.

It is a very great contribution.

I strongly recommend it.

Thank you Andy

Oyo
Quote Reply
Re: [Oyo] Plugin in the works... AlphaBar v3 In reply to
In Reply To:
This script is formidable. It is very complete.

It is a very great contribution.

I strongly recommend it.

Thanks Cool

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Wow andy, just what I need!

If there are no titles beginning with x, then the bar wont have the live link to x. Correct?

If the script going through the database to determine this, then how is the effect on the build speed.

Thanks.

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Plugin in the works... AlphaBar v3 In reply to
Hi,

At the moment, it will just show all the 0-9 A-Z characters, but will only show "links" for those that actually have links in them, that match the ^letter criteria.

If you don't want it to do this, then its a simple case of just editing the /admin/Plugins/AlphaBar.pm file, so that the foreach() in the sub AlphaBar { } function, looks like:

Code:
foreach (@letters) {

if ($DB->table('CatLinks','Links')->count( GT::SQL::Condition->new( 'CatLinks.CategoryID','=',$catid,'Title','LIKE',"$_%" ) ) > 0) {
if ($IN->param('letter') =~ /^$_$/i) {
if ($use_rewrite) {
$back .= qq~| <a style="color:$selected_color;" href="$rewrite_url/letter_$_/cat_$catid/">$_</a> ~;
} else {
$back .= qq~| <a style="color:$selected_color;" href="$url?letter=$_;catid=$catid">$_</a> ~;
}
} else {
if ($use_rewrite) {
$back .= qq~| <a style="color:$color;" href="$rewrite_url/letter_$_/cat_$catid/">$_</a> ~;
} else {
$back .= qq~| <a style="color:$color;" href="$url?letter=$_;catid=$catid">$_</a> ~;
}
}
}
}

That simple =)

Quote:
If the script going through the database to determine this, then how is the effect on the build speed.

It does indeed (do live checks to count if entries exist matching the criteria). The speed different on a dynamic site is a *little* slower (depending on DB size - we tested it on a 100k site, and the speed difference is negligible) - but for a static build site, you shouldn't notice much of a difference at all.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Excellent - Cool

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Plugin in the works... AlphaBar v3 In reply to
Hi,

Just FYI, I've made this an option in the plugin itself now. Version 3.1 also fixes a little bug, whereas the | delimiter was being shown at the beginning of the alpha-bar, i.e;

| 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 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

..should actually be:

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 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

(note the missing | at the beginning of it, which is how its mean't to be =))

You can see the modified (fixed =)) version in operation here:

http://www.ultranerds.com/...L_Plugins/index.html

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin in the works... AlphaBar v3 In reply to
Hi,

I've just released version 3.2, which has a minor bug fix Smile

You can also apply this fix manually if you want - just do the following:

Open /admin/Plugins/AlphaBar.pm, and find:

Code:
if ($show_with_no_links) {
$back .= qq~| <small>$_</small> ~;
}


..change to:

Code:
if ($show_with_no_links) {
$back .= qq~$delim <small>$_</small> ~;
}

That simple :)

For anyone who doesn't want to play with the codes, you can get the new version from our Members Area as of now.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
AlphaBar v3.3 In reply to
Hi,

For anyone using this plugin, with Payments enabled - please upgrade to this version. It has a bug fix for the generated page (basically, it was showing listings even if they were not paid for [i.e they had either expired, or they never went through with the payments])

Its a simple upgrade - just download version 3.3 from our Members Area, and then install it over the current version. The only file changes are in alpha.cgi and AlphaBar.pm - so you don't need to make any changes to anything else Smile

Please let me know if anyone has any issues with this.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] AlphaBar v3.3 In reply to
Hey Andy,

How do you get the spanning pages capability to work?

I have <%~Links::Utils::paging()~%>

30 links beginning with A, 10 show but no 123 toolbar links are present.

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] AlphaBar v3.3 In reply to
Ok got it by looking through the code

<%next_span%>

Thanks.

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] AlphaBar v3.3 In reply to
Eraser wrote:
Ok got it by looking through the code

<%next_span%>

Thanks.
Hi,

Yeah, I may make it so that paging() works too - but for now, only next_span will work Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] AlphaBar v3.3 In reply to
Hi Andy,

do you have a page where I see this working ?


Many thanks,

Erich
Quote Reply
Re: [erichcyber] AlphaBar v3.3 In reply to
Hi,

I'm afraid I can't think of any at the moment (I've set it up on quite a few sites before, but can't remember any of them ATM :()

If you are interested in buying it, please PM me - and I'll arange for you to have a test of it :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] AlphaBar v3.3 In reply to
Hi,

I've just released version 3.5 now.

This includes several fixes:

1) The user details (if someone is logged in), are now available in the template
2) The "paging" works with the standard GLinks 3.2 format (luna) - as well as <%next_span%>
3) The isNew, isPopular tags are now working correctly (they were always returning "true", which caused it to break the formatting in the templates on some sites)

This new version can be downloaded from the Members Area.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!