MySpace - Add Image Links 2

Created by Adrian.
Concept and original design by Steve Ryherd. Early code improvements and bugfixes by Zebra Gang.

This full updated documentation can be found at this location.

For more help not listed in this FAQ, check out these links:

Table of Contents

  1. Frequently Asked Questions
    1. What is this script and what does it do?
    2. What is this script not?
    3. The shortcuts are not showing up! Why?
    4. Shortcuts are/aren't appearing on the Forum's View Topics page. Why is this?
    5. The shortcuts don't look right on this profile.
    6. Your script seems to be messing up the layout of this page.
    7. A strange blue rotating wheel is showing up under the images instead of the links. Help!
    8. When I push Shift-Alt-I nothing happens, or I get a message saying Firefox has blocked a popup.
    9. When I click Edit Image Links nothing happens or a blank page appears!
    10. When I click Save Settings from the Preferences dialog, the page doesn't appear to apply the changes.
    11. The shortcuts are not showing the right icon for someone I added/removed from my friends/favorites/subscriptions/blog preferred list.
    12. Some shortcuts are showing up as transparent for a long period of time.
    13. What does "WARNING: Response returned an error, may not have completed." mean?
    14. I'm trying to use a shortcut, but it keeps giving me an error? What can I do?
    15. How do I create a Custom Icon Pack?
    16. I think I've found a bug. How do I report it?
    17. It would be great if this script did such-and-such!
    18. I would like to contribute some code, an icon pack, or documentation. Who do I send it to?
    19. I would like to re-post this script under my name without any copyright information onto a site like userscripts.org because I've modified a few lines. Is this OK?
    20. I would like to post this script on another site, such as an online forum or messageboard. Is that allowable?
  2. Preferences
    1. Shortcuts
    2. Icon Packs
    3. Icon Size
    4. Custom Icon Packs
    5. Auto Spacing
    6. Always 90
    7. Use Blank Icon
    8. No Page Fixes
    9. Open Links in New Window
    10. Quick Links
    11. Smart Links
    12. Roll Over
  3. Coding
    1. How To: Editing This Script
    2. Integrating Inside Another Script

Frequently Asked Questions

What is this script and what does it do?

MySpace - Add Image Links 2 is a user script intended to be used with Firefox and the Greasemonkey Extension, although it may be usable in other environments. It is designed to enhance the MySpace website to make it more easily usable and speed up common tasks.

This script adds a customizable set of links under image links to user's profiles. These links perform actions on the user associated with the image above them that would normally only be accessible from other parts of MySpace, such as within their profile.

What is this script not?

This script is not an all-in-one MySpace tool intended to do everything on MySpace in one place. If you're looking for a script like that, then good luck finding it.

This script is also not a replacement for MySpace's internal database or their software. It is intended to work with it, and never against it.

This script is not intended to be a hacking tool or a way to view other people's private data. It is also not intended to be used for spamming or unsolicited mail.

The shortcuts are not showing up! Why?

This could be caused by several different issues:

Shortcuts are/aren't appearing on the Forum's View Topics page. Why is this?

In previous versions, this script severely messed up the layout of this page. It has since been fixed (with the No Page Fixes option turned off), but Greasemonkey might have kept the directive to exclude this page from the script. If you would like to see shortcuts on this page, then remove it from the Exclude list in the Greasemonkey Manager. The downside is that the View Topics page becomes a lot less compact. If you would like to remove the shortcuts from this page, then add http://forum.myspace.com/*messageboard.viewcategory* to the Exclude list in the Greasemonkey Manager.

The shortcuts don't look right on this profile.

Chances are some style rule that was put on the profile is interfering. This script tries to override most of the common ones, but a few may have slipped by. If you can send a report to this script's author it may be fixed in a future release.

Your script seems to be messing up the layout of this page.

Well, that might be a side-effect of this script modifying page elements to fit the shortcuts better. If the layout of the page was generated by MySpace without a profile's stylesheet or another script interfering then it could be a bug. If so, then follow the instructions listed in the FAQ entry: I think I've found a bug. How do I report it? You might also like to read the section on No Page Fixes.

A strange blue rotating wheel is showing up under the images instead of the links. Help!

This is because the shortcuts are waiting for the image to finish loading. Sometimes, when MySpace is slow, the images may take some time or not even load at all. The script is set so that after a certain amount of time (about 20 seconds or so) it will give up and assume the image is 90px wide. If this seems to be happening very often, or if you have images turned off, then you should set the Always 90 option on.

When I push Shift-Alt-I nothing happens, or I get a message saying Firefox has blocked a popup.

This is due to a bug in Greasemonkey that seems to ignore the menu command. The script tries to work around it by creating its own keypress event, but that is vulnerable to Firefox's built-in popup blocker. In the meantime, you can get to the Preferences pane by right-clicking the monkey icon in the statusbar and choosing User Script Commands -> Edit Image Links. If you absolutely need to use Shift-Alt-I and are daring enough to trust popups on MySpace, then click the allow link on the message Firefox gives you.

When I click Edit Image Links nothing happens or a blank page appears!

Something might have gotten messed up on the current page preventing the popup from appearing. Try reloading the current page and try again. If that doesn't work then the script could be generating an error. Follow the instructions listed in the FAQ entry: I think I've found a bug. How do I report it?

When I click Save Settings from the Preferences dialog, the page doesn't appear to apply the changes.

This is caused by a bug in Greasemonkey [bug 16628] that involves the Script Commands (you'll also notice this bug if the grey layer doesn't appear over the page). As long as the dialog disappears you may rest assured your changes have been saved. All you have to do is reload the page and all is well.

The shortcuts are not showing the right icon for someone I added/removed from my friends/favorites/subscriptions/blog preferred list.

It looks like MySpace has managed to fool the script into not updating its cache. If you go into the Preferences dialog, click the button labeled Clear Cache and all the shortcuts will reload the data for each user. In the future, it may be best for you to keep Quick Links on and always use the shortcuts to perform actions.

Some shortcuts are showing up as transparent for a long period of time.

It looks like MySpace is being slow and/or rejecting our requests to get data from their servers. There is nothing that can be done in this case except to wait until MySpace is not as busy.

There is also a link (View Band's Showtimes) that may appear transparent on users that are not bands. This is normal.

What does "WARNING: Response returned an error, may not have completed." mean?

Sometimes when sending a request with Quick Links enabled MySpace will return its error page. This doesn't necessarily mean that the request failed, but MySpace's servers might have been too overloaded to display the result page. Sometimes, however, the request does fail, so it's always best to double-check to be sure that your action succeeded. If you have Smart Links enabled, the shortcut you clicked on should have switched to its opposite (except with an Add to Friends request; in this case, check your Pending Requests page).

I'm trying to use a shortcut, but it keeps giving me an error? What can I do?

Chances are MySpace's servers are overloaded and the requests are getting lost. You can try doing it the normal MySpace way, and see if that works. But otherwise you will have to wait until MySpace is not as busy.

How do I create a Custom Icon Pack?

You should check in the section labeled Custom Icon Packs. It explains the easiest way to create one. There are lots of free icon sets floating around on the internet, and if you want to compile one of them into an icon pack please be my guest. If you can turn one into a complete set and want it to be included in a future release, then you should submit it to the author of this script by following the instructions listed in the FAQ entry: I would like to contribute some code, an icon pack, or documentation. Who do I send it to?

I think I've found a bug. How do I report it?

If you've searched through this FAQ and can't find a solution to your problem, you may want to check out The Greasemonkey Group on MySpace. Another good place for help is on the Userscripts.org Forum. If nobody on these forums seem to be able to solve your problem, then your next stop is to message the author. Make sure your report is clear and concise, and includes a full description of your problem and what steps you took to produce them.

You should also include an error report. From Firefox, go into the Tools menu and choose JavaScript Console (may also be called Error Console on some machines). Copy the messages you see there into the bug report. It also helps to narrow down the errors to the specific event by clearing the errors there first before reproducing the problem. If you use the Error Console, be sure that you have selected to display Messages, Warnings, and Errors as all are needed to properly debug an issue. If you are able to take a screenshot of the problem and think it might help to clarify the description, please do so.

It would be great if this script did such-and-such!

You're probably right! But before asking the author to implement a feature, be sure that it fits the description of the script (listed in FAQ 1 and FAQ 2). First ask yourself if this feature is currently possible to do on MySpace already. If MySpace doesn't have the capability already, then it's doubtful that the author will be able to incorporate it into the script. Remember, all this script does is give the user easier access to features that MySpace already provides.

With all that aside, to request a feature simply message the author with a detailed request of the feature you want to see included in a future release.

I would like to contribute some code, an icon pack, or documentation. Who do I send it to?

Fantastic! The author would love to see it! Please make sure that any submissions are complete and documented. And be sure to test all code extensively for errors.

With that aside, to submit a contribution simply a href="http://www.myspace.com/adrian232">message the author with all the information needed to include your contribution in the next update, and you will be credited for the submission.

I would like to re-post this script under my name without any copyright information onto a site like userscripts.org because I've modified a few lines. Is this OK?

Absolutely not! This is out of the question! The script authors have put a lot of time and effort into creating this script for free and do not want to see it stolen by some amateur programmer. If you think your code is important enough, submit it to the author and you will be credited for your effort (see the FAQ entry: I would like to contribute some code, an icon pack, or documentation. Who do I send it to?).

I would like to post this script on another site, such as an online forum or messageboard.

Sure, go right ahead. All we ask is that you retain all of the credits and this document in the source. If you make any changes to the code, we ask that you inform your users of the change.

DO NOT try to claim that this script was your writing. DO NOT install malware into the source. DO NOT remove the documentation. And be courteous to everyone.


Preferences

This section describes each option in the Preferences dialog, what they do, and when to use them.

Shortcuts

The shortcuts are the icons with links to perform actions on MySpace. Here you will see a sample image on the left showing all the active shortcuts and how they will appear on most pages in MySpace. On the right are additional shortcuts that you may add to the active ones. To move the shortcuts around, click and drag the icons to the position you want on the sample. A dotted line will appear showing you where the icon will be placed. To place the icon on the right side of the shortcut, hold the shift key while dragging. When you've found the place you want, release the mouse button and the sample will refresh. To remove a shortcut from the sample, simply drag it off the sample.

Icon Packs

An icon pack is the set of icons, or theme, of the shortcuts. You can choose from many different pre-organized packs, or even create your own!

Here is a list of Icon Packs you may choose from:

Default
This resets the Icon Pack to its default (currently Silk).
Silk
A colorful, high-quality icon pack using transparent PNG images. Icons were collected and arranged by Adrian from FamFamFam's Silk Icons.
Explodingboy
A simple grey icon pack that fits well into just about any page or profile. Icons were collected and arranged by Adrian from ExplodingBoy More Pixel Icons.
Explodingboy (Grey/Blue/Orange)
An icon pack with simple square-shaped buttons in an assortment of colors. Icons were collected and arranged by Adrian from ExplodingBoy Pixel Icons.
Original (Incomplete)
A modified version of the original icon pack by Steve Ryherd from the very first version of this script. Several icons added and modified by Adrian.
Menu (Quick Links incompatible)
A compact menu-driven theme with a customizable style. Arranged by Adrian.
Text
A text-only theme with a customizable style. Arranged by Adrian.
Custom
(See the section on Custom Icon Packs for more info)

Icon Size

The icon size changes the size of the icons in the icon pack. You may choose from several different pre-arranged sizes:

The Default value uses the icon pack's default, or natural, icon size.

NOTE: Icon Size does not work for the Text, Menu, or Custom icon packs (See the section on Custom Icon Packs for more info).

Custom Icon Packs

A Custom Icon Pack is a way to allow you to create your own icon packs for MySpace - Add Image Links 2! Below are the steps you may take to use a Custom Icon Pack.

First, you must find or create a set of icons that you wish to use. All of the icons should be of the same format and width. The icons must be (re-)named appropriately for each shortcut.

Here is a list of the currently supported icon names:

add_friend delete_friend view_friends add_favorite delete_favorite
block_user report_user view_pictures view_videos view_showtimes
send_mail send_im add_comment view_comments add_group
view_groups rank_user forward_friend view_blog subscribe_blog
unsubscribe_blog add_preferred remove_preferred add_addressbook remove_addressbook

You must also choose one extension (file type) for all your icons, and put it in the field labeled Icon Pack's Extension. This should be one of gif, jpg, jpeg, or png. Append this extension to all your icon's filenames (e.g. send_mail.gif or add_friend.png). You might also want to add the icons' width in pixels to the field labeled Icon Pack's Width, but this value can be any number if you want a different display size for your icon pack.

Now, upload all these icons to their own directory somewhere accessible to the web. Photobucket is a good place for those of you with limited resourced, and it's free! Once uploaded, place the URL of the folder name into the field labeled URL of iconpack folder. (The folder name is the URL of one of the icons stripped down to the trailing '/', so that the icon's filename is removed)

If you're having trouble, the default Custom Icon Pack (Silk) has a good example of what it should look like.

Also, if you know CSS, you may change the style options in the field labeled Custom Style, such as adding a border, a background, or reducing the icon's opacity. (%width% in this field will be replaced by the pixel width specified in the Icon Pack's width field.)

If you've created an icon pack and would like it to be included in a future release, please message the author with the description and all the information needed to display the custom icon pack.

Auto Spacing

Default Value: on

If Enable Auto Spacing is checked, then the shortcuts will be spaced out under the image. The amount of space between each shortcut will vary, depending on the size of the image.

Always 90

Default Value: off

If Assume image width always 90px is checked, then the shortcuts will be placed as if the image was always 90px wide, no matter the size of the actual image. With this on, the script will not wait for the image to load before placing the shortcuts under it. Check this option if MySpace is being slow to load the images, or if you have images turned off.

NOTE: In all cases, this method is a fallback if the image takes too long to load.

Use Blank Icon

Default Value: on

If Use blank icon if none available is checked, then the page will display a placeholder image if the icon doesn't exist or fails to load. With this unchecked, instead text will be displayed in its place (as if it were part of the Text theme). The latter might not be ideal, since it will ruin the layout of the shortcuts. This works by suppressing the alt attribute of the icon.

No Page Fixes

Default Value: off

The script will attempt to fix up several MySpace pages to allow for more space to fit the shortcuts. If Don't fix pages to fit links is checked, then it will never do this. Check this option if this script is interfering with another script that modifies MySpace pages.

As of the writing of this document, the following pages are being modified:

The script also may modify other pages including profiles, such as the case when the image is inside an element that is less than 90px it will set the element to 90px. If you don't want this, then uncheck this option.

NOTE: Unchecking this option may cause shortcuts to look odd or bleed across the page, use only with caution!

Open Links in New Window

Default Value: off

If Open links in new window is checked, links opened by clicking on a shortcut will open in a new tab/window.

Default Value: on

If Use Quick Links is checked, then certain shortcuts that perform simple actions will be performed without directing you to another page. Otherwise, it will perform the default MySpace behavior, which is to open a page confirming the action. With Always ask me first checked, a dialog window will pop up asking you to confirm the action.

Quick Links will try to prevent you from being forced to view the user's profile whenever possible. This means that with this feature enabled, the Leave a Comment shortcut will direct you to your friend's view comments page, instead of their profile.

Default Value: on

Smart Links is an intuitive way to display shortcuts that are relevant to the user on which it performs actions. With Activate Smart Links checked, it will enable this feature.

With this feature enabled, the script will attempt to find out more information about the user, such as whether or not they are your friend, listed in your favorites, and much more! All of this information is cached within the script to ensure the shortcuts load quickly and to minimize client/server load.

Shortcuts will be automatically switched to a more proper action when it discovers this new information. For example, if the user is already listed as a friend the Add to Friends shortcut will be automatically changed to Remove from Friends, if you are already subscribed to their blog the Subscribe to Blog shortcut will be changed to Unsubscribe from Blog, and many more!

If a shortcut is gathering data then it will appear slightly transparent, indicating that it is not yet ready to be used. Whenever a change in data is detected, the cache for that action is cleared and will be reloaded. The script will do its best to detect these changes, however, it is still possible that you or MySpace could fool the Smart Links and cause it to display incorrect data. To prevent this situation turn Quick Links on and always use the shortcuts to perform actions. If the shortcuts are appearing repeatedly as incorrect, then you may use the Clear Cache button from within the Preferences dialog to start the data fresh.

Default Image

Default Value: off

if Show shortcuts under the Default Image is checked, shortcuts will appear under the Default Image in user's profiles and on the home page. Beware that this changes the formatting of these pages, and will remove the actions already under these images. This includes the view pics/videos on profiles, and the similar links on the home page.

This option will also place a menu of links to replace the User Shortcuts menu in the top bar on image and profile pages.

Roll Over

Default Value: off

If Only show shortcuts on rollover is checked, shortcuts will only appear when you roll over an image with your cursor. They will then disappear when you roll out. This is useful if you don't want the shortcuts to mess with the page layout.

NOTE: This does not apply to certain specially-placed shortcuts that don't affect layout (such as in the Who's Online box and the User Shortcuts menu in the top bar)


Coding

This section covers information about how to modify the script, make changes to the code, submit code changes to the author, and how to integrate this script in another. Unless you are very well experienced with JavaScript and Greasemonkey, I would not recommend reading this section or modifying this script in any way! With that said, this section assumes that you are able to understand this script's base coding languages and are interested in knowing how it works.

How To: Editing This Script

This section is still in the works! Check back in a later version.

Integrating Inside Another Script

MySpace - Add Image Links 2 has specific routines that can be called securely by triggering Events. All of the event objects are accessible globally (on the unsafeWindow object), but can also be created locally on your script.

Here is a list of the current events you can send:

GM_ImageLinks_Reload
Reloads the image links on the page.
GM_ImageLinks_ClearCache
Clears the Smart Link cache.

To send an event, simply include the following line in your source code:

document.dispatchEvent(unsafeWindow.EventName);

You can also add an event listener for any event that Add Image Links triggers, including the list above (however it is not guaranteed to happen neither before nor after Add Image Links).

Here is a list of all the events triggered by Add Image Links:

GM_ImageLinks_Load
Triggered when one set of shortcuts load under an image. event.target refers to the new shortcut DIV, event.target.previousSibling should be the profile link. If you want to catch this on an individual link, be sure to use link.parentNode since the link and shortcuts are siblings.

Currently viewing:
MySpace - Add Image Links 2 - Help

For additional help: