#113826 by wololo
Sat Nov 26, 2011 3:44 am
Today I added a plugin to the forum. This plugin detects the names of some homebrews in your posts, and adds a popup with a description of the homebrew, as well as a link to its download page on our database. You will recognize these automated links with their purple/blue background.

For example if you type "Wagic", the script should detect it in your post, and if you move your mouse over it, it will give you some information.

Image

I made it with performance in mind, therefore it has a few limitations:
- If the page is big, the links will take some time to appear. This is to avoid the script taking too much resources on your machines.
- The script is limited to 500 homebrews for now. In order to help people discover new content, the homebrews are a mix of the most succesful homebrews and homebrews that are not getting enough attention.

You can help make this functionality better!

Broken link? New version? A homebrew should get a popup?
You can add homebrews to our database by following the instructions here: viewtopic.php?f=2&t=9380
As we add more homebrews and download links, the plugin will become more and more useful
And keep voting for your favorite homebrews on /Downloads. It's simple (1 click to rate, no login required), and it will help the plugin choose the most important homebrews!

Add this plugin to your own forum/website!
I made this plugin so that it can be used on your own site if you are interested. To add the plugin to your forum, just add the following lines just before the closing "body" tag of your website:
Code: Select all<script type="text/javascript" src="http://wololo.net/talk/hblist.js"></script>
<script type="text/javascript" src="http://wololo.net/talk/downloads.js"></script>

This will add the script to your entire page. If you want to fine-tune where the script runs, you can define the global variable w_classes, which will then apply the plugin only on divs of the matching classes. For example, a good value for a phpBB forum is:

Code: Select all<script type="text/javascript">var w_classes="content,signature";</script>
<script type="text/javascript" src="http://wololo.net/talk/hblist.js"></script>
<script type="text/javascript" src="http://wololo.net/talk/downloads.js"></script>

This will apply the plugin only to posts and signatures, and not to other parts of the site.

alternatively, you can download hblist.js and downloads.js on your own servers if you prefer. Note however that the file hblist.js gets updated regularly with a more accurate list of homebrews. You can also create your own list of homebrews to replace hblist.js (the format is straightforward: string to match, and id of the download page, as long as it matches an entry on /Downloads) if you want

I've tested this plugin a lot on various browsers, but please let me know if you run into problems.
What do you think?
Advertising
#113862 by waratte
Sat Nov 26, 2011 6:38 am
This is pretty nice, I've noticed that today and I had no idea what that was. It surprised me a bit. :)

There are three things I've noticed about this new plugin is that if you make the text a "URL" first, the plugin won't make the text become a link.

Having at least one wide-latin character in the text will also do the same. The text won't be made into a link by the plugin.

The last one being that it seems to capitalize the text if it does become a link by the plugin. :???:
#113910 by ViP3R
Sat Nov 26, 2011 11:10 am
This is cool :) thanks
#113926 by wololo
Sat Nov 26, 2011 12:22 pm
me7i wrote:Just my personal opinion but this is anoying, its like more ads

Err, I was expecting some comments about the plugin being slow, or not showing enough information, but I must admit I wasn't expecting that type of comment :shock: The fact that it uses an interface similar to some ads mechanisms shouldn't misguide you. Those are not commercial links, they are links that are here to help (reminder: the homebrews are free and created by people like you and me, from communities like this one). People are constantly looking for homebrews and end up on these forums looking for download links, now people who mention some homebrews don't even have to look for a download link, it will be found instantly, along with a screenshot and a description.

Can you give details about why you find this annoying? Does it distract you from reading?
I guess mid-term I can probably add an option in the user panel for people to deactivate it, but I'd like to understand why you find that annoying "like ads". Is it the functionality itself (the fact that it gets the homebrew information from my server), or the way it is implemented (the popup thing)?

waratte wrote:There are three things I've noticed about this new plugin is that if you make the text a "URL" first, the plugin won't make the text become a link.

Right, this is intentional, I'm not messing up with other people's links, this just highlights "pure" text.


waratte wrote:Having at least one wide-latin character in the text will also do the same. The text won't be made into a link by the plugin.

Ah, that's very possible, do you have an example?

The last one being that it seems to capitalize the text if it does become a link by the plugin. :???:

Right. I'll see what I can do for this one
#113935 by waratte
Sat Nov 26, 2011 2:17 pm
Here's an example...

Normal text, the plugin makes it a link:

Wagic

Mixed text, the "W" (The only wide-latin char in the text) causes the plugin to not make the text a link:

Wagic

Wide-latin, the text isn't made into a link:

Wagic
#113941 by wololo
Sat Nov 26, 2011 2:31 pm
Ok, thanks for the example, I think I won't fix that. I could probably do some clever encoding detection, but that would make the plugin slow on everybody's computer.

Who is online

Users browsing this forum: No registered users and 0 guests