Personalized Quick Links menu


AlienOne

 

Posted

Many of us have some forum locations that we visit frequently, and sometimes it can be nice to have easy access to them.

This Greasemonkey script hijacks the Quick Links nav-menu item, and replaces it with a user-defined list of links.

example:



Greasemonkey is a Firefox addon that allows you to run little scripts that can modify websites, in this case the coH forums. Some other browsers can also run them, but I won't cover that here.


In order to run this script on Firefox, here's what you need to do:
(Disclaimer: you might not want to do this if you're not comfortable with managing Firefox addons.)


1) Install Greasemonkey.
It can be found here (click "Add to Firefox")
Once installation is complete it will ask you to restart Firefox. Do so.

2) Add the script.
It can be found here (click "Install")



Once you've done this, you'll probably want to change the script so that it uses your own favorite links. By default it just contains a few examples, and that's rather boring.


To change what items are on the menu, this is what you do:

1) Locate the Greasemonkey icon (monkey icon that's normally in the lower right part of Firefox), right-click it and select "Manage user-scripts...".

2) Select "Quick Link Favorites (CoH)" in the list on the left, and then click the Edit button.

If this is your first time editing a Greasemonkey script, it will ask you to choose a text editor. If you don't have any other preference, you can use Notepad (usually found at C:\Windows\Notepad.exe").





The script should now open in your editor, and you should see something that starts like this:


// ==UserScript==
// @name Quick Link Favorites (CoH)
// @namespace tag:stargazer.coh,2009
// @description Puts the links of your choosing on the Quick Links nav menu item on the City of Heroes forums
// @include http://boards.cityofheroes.com*
// @include http://boards.cityofvillains.com*
// ==/UserScript==



/*Begin user-configuration
-------------------------------*/


//List of item names. Names should be surrounded by "" and separated by ,
var names=["Favorites:",
"Main forums",
"Dev Digest",
"Comm. Digest",
"Miscellaneous:",
"Mark Forums Read",
"Tags",
"Subscribed Threads",
"How to:",
"Use this menu"];

//List of item link targets. Links should be surrounded by "" and separated by ,
var links=["",
"/forumdisplay.php?f=547",
"/showthread.php?t=144850",
"/showthread.php?t=117725",
"",
"/forumdisplay.php?do=markread",
"/tags.php",
"/subscription.php",
"",
"/showthread.php?p=2095949"];




//OPTIONAL: selects if an entry should be on a grey background (0) or a blue/red (skin dependant) background (1).
//If a complete list of colors (one color for each entry specified above) is not provided, all entries will use blue/red.
var bg_color =[0, 1, 1, 1, 0, 1, 1, 1, 0, 1];

//OPTIONAL: selects if an entry should act as a link (1) or be a plain text entry (0).
//If a complete list of types (one type for each entry specified above) is not provided, all entries will act as links.
//Plain text entries still need an entry on the links list above, but you can use ""
var is_link = [0, 1, 1, 1, 0, 1, 1, 1, 0, 1];



/*-------------------------------
End user-configuration*/





You can skip past the first part, all you need to bother with is the yellow part.

The first thing you have to change is the list of item names (starting with "var names=[" and ending with "];"). This is a list of the item names that will appear on your Quick List menu. Each name should be contained within "", and separated by commas. e.g. "Main Forum".

After this is the list of item link targets. These specify what link should be targeted when you click each item on the menu. These should also be contained within "", and separated by commas. e.g "/forumdisplay.php?f=547". You can link to just about anything that can be accessed by links, forum listings/threads/posts/profiles/...., your grandmother's recipe for apple pie, ...
Each name entry will need a corresponding name in the links list. The first name will link to the first link, the 3rd name will link to the 3rd link, and so on.

Tip: If the link is to a page on the CoH forums, you can ommit "http://boards.cityofheroes.com" and "http://boards.cityofvillains.com" from the links. Something like "/forumdisplay.php?f=547" will then lead to "http://boards.cityofheroes.com/forumdisplay.php?f=547" if you're currently using the hero forums, and "http://boards.cityofvillains.com/forumdisplay.php?f=547" if you're currently using the villain forums.




If you want to further customize your Quick Links menu, you can look at the optional orange part above.


For each entry you have the option of using a grey background, or a blue/red background (dependant on your current skin). This is handled by the bg_color list. To make an entry use the grey background, its value should be 0, and to use the blue/red background the value should be 1. Again, each value will be associated to its corresponding names entry. The first entry sets the color of the first menu item, and so on.
If the number of items on the color list does not match the number of menu item names, all entries will use the blue/red background. This is what makes the setting optional, but it also has the side-effect that if your Quick Links menu has exactly 10 entries, it will use the pre-defined color settings of the default example menu. Adding or removing a vale will take care of this.


Next is the option to make an entry work as a link or not. This is handled through the is_link list, and a value of 1 means that the entry will work as a link, and a value of 0 that it will not (it'll just display the name of the entry, which can be good for naming different parts of the menu). This time, if the number of items on the is_link list does not match the number of menu item names, all entries will act as links. This is what makes the setting optional here too, but it again has the side-effect that if your Quick Links menu has exactly 10 entries, it will use the pre-defined link/not-link settings of the default example menu. Adding or removing a vale will take care of this.



Knowing this, we can look at what the default example menu will look like.

1: A text label of "Favorites:" on a grey background.
2: A link named "Main Forums" on a blue/red background, leading to the English sub-forum.
3: A link named "Dev Digest" on a blue/red background, leading to the (currently non-working Dev Digest.
4: A link named "Comm. Digest" on a blue/red background, leading to the (currently non-working Community Digest.
5: A text label of "Miscellaneous:" on a grey background.
6: A link named "Mark Forums Read" on a blue/red background, marking all forums as read (from the original Quick Links menu).
7: A link named "Tags" on a blue/red background, leading to the forum Tags page.
8: A link named "Subscribed Threads" on a blue/red background, leading to your subscribed threads (from the original Quick Links menu).
9: A text label of "How to use:" on a grey background.
10: A link named "This menu" on a blue/red background, leading to this page.

As you can see that's also what's showed in the image above.



If you want to temporarily disable the script you can right-click the Greasemonkey icon (while on the forums) and unselect it from the list of active scripts (this helps if you want to look at the original Quick Links menu to copy things from it). You can also disable or remove the script from the Greasemonkey "Manage user-scripts" window used above.


Should you make an error in the editing (e.g. mismatches with ",;[] etc.) the script will simply fail to run, and you'll get the original Quick Links menu.


Hopefully that wasn't *too* complicted.


Oh. If you want to you can use images in the item names too, with <img src=\"path to image\"> (it's important that you use \" instead of " to surround the image path).


 

Posted

It's a nice guide, but it's only for Firefox users? I know you say other browsers have scripts that you aren't covering here, so could you edit the title to reflect that this is for Firefox users please?

Thanks.


Comic and Hero/Villain Culture
Saturday January 29th, 2005 (12:37 PM) ~ Monday August 9th, 2010
Those Who Lived It Will Remember Long after your Ban Hammer Crumbles and the servers flicker dead.
We Will Remember This One Moment In Time! ~ Shadow Ravenwolf

 

Posted

Heh, I'm using Maxthon and had the exact same reaction.


Comic and Hero/Villain Culture
Saturday January 29th, 2005 (12:37 PM) ~ Monday August 9th, 2010
Those Who Lived It Will Remember Long after your Ban Hammer Crumbles and the servers flicker dead.
We Will Remember This One Moment In Time! ~ Shadow Ravenwolf

 

Posted

Quote:
It's a nice guide, but it's only for Firefox users? I know you say other browsers have scripts that you aren't covering here, so could you edit the title to reflect that this is for Firefox users please?
Quote:
Originally Posted by Shadow Ravenwolf View Post
Heh, I'm using Maxthon and had the exact same reaction.

I'm not really familiar with Maxthon, but...

There's a Maxthon plugin called More Scripts (link), and if you install it you should then be able to install the Quick Links script from its userscript page.

(works for me in Maxthon 2.5.8.1332 at least, though I may have needed to click the "Run and Manage User Scripts button" (that is added by More Scripts) to enable the Quick Link script after it was installed)

More information about More Scripts can be found here.


I've been meaning to update the script, and if/when I do, I'll add the information about how to install it for Maxthon too.


Also, first post from Maxthon.


edit: Oh, I should clarify something. The script is not really "for Firefox". While userscripts *can* include browser-specific code, they tend to use standardized code that work on a multitude of browsers. This particular script works without modification on Firefox (with Greasemonkey), Opera and Maxthon (with More Scripts), and I would assume that it would also work on Safari and Chrome. What differs is how you *install/use* the script on each browser, and since I'm not using all browsers, I don't know how to do that on all browsers. I chose to describe how to install it for Firefox/Greasemonkey since 1) Lots of people use Firefox, and 2) *I* use Firefox/Greasemonkey, so I'm familiar with the procedure. To find out how to use userscripts for other browsers, a web search for "userscripts <browser name>" is usually a good place to start.


 

Posted

Since the forum Dev/Community digests now work, I updated the script to have the default Quick Menu point to them.