Allegro.cc - Online Community

Allegro.cc Forums » The Depot » A.cc Extension: Smiley Counter

This thread is locked; no one can reply to it. rss feed Print
A.cc Extension: Smiley Counter
ImLeftFooted
Member #3,935
October 2003
avatar

New a.cc javascript extension. Displays a count of the smileys found in a given thread.

To install, select all of this text (make sure to scroll down!) and copy it to your clipboard (control + C):

1// Smiley counter app Version 0.3
2//
3// namespace: csmiley
4 
5function csmiley_load()
6{
7 var tbl = document.getElementById("thread-topic");
8 
9 if(tbl == null)
10 return;
11 
12 var imgs = document.getElementsByTagName("img");
13 var count = 0;
14
15 for(var i = 0; i < imgs.length; i++)
16 if(imgs<i>.src.indexOf("/forums/smileys") != -1)
17 count++;
18
19 var td = tbl.getElementsByTagName("td")[0];
20
21 td.innerHTML += ' <img src="/forums/smileys/lipsrsealed.gif"> x' + count;
22}
23 
24doc.add_onLoad(csmiley_load);

Then navigate to the extensions page and select the bottom text box with your mouse and paste (control + V). You must be logged in to navigate to this page.

Please note that you may be required to refresh a couple of times or perform a hard refresh in your browser (the F5 key for firefox).

Click save and enjoy!

{"name":"591683","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/c\/1cc861d4fd831ee10a80b26f2934d274.png","w":721,"h":553,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/c\/1cc861d4fd831ee10a80b26f2934d274"}591683
Changelog Version 0.2: <ul> <li>Added a space before the smiley counter</li> </ul> Version 0.3: <ul> <li>Fixed the error message for non-thread a.cc pages</li> </ul>

Kibiz0r
Member #6,203
September 2005
avatar

Hm. Doesn't seem to work for me. Is there an option I need to have on to enable the custom JS?

Edit: Actually, I just decided to try refreshing and it worked!

LennyLen
Member #5,313
December 2004
avatar

It seems it's count is a little off here:

{"name":"591684","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/3\/f3e1425c473ad2db2a728ffd1dd2c5f0.png","w":383,"h":227,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/3\/f3e1425c473ad2db2a728ffd1dd2c5f0"}591684

ImLeftFooted
Member #3,935
October 2003
avatar

Its counting the 16 smileys below your new-post box.

LennyLen
Member #5,313
December 2004
avatar

Quote:

Its counting the 16 smileys below your new-post box.

Ah, of course.

kentl
Member #2,905
November 2002

Nice work. Is this your full time job now days?

I would like to know how many smileys I'm using. I'm far too friendly.

kazzmir
Member #1,786
December 2001
avatar

Completely unrelated but you know what would be cool is if when someone posted to a thread I cared about I would get an IM and my IM's could be used as posts back to the forum. Or maybe not so cool, but it sounds like an interesting idea. Someone make that.

le_y_mistar
Member #8,251
January 2007
avatar

that's very useful:P

-----------------
I'm hell of an awesome guy :)

Kibiz0r
Member #6,203
September 2005
avatar

So, like...

AllegroForum: Kibiz0r has posted in A.cc Extension: Smiley Counter "Hey, look at me, I'm making a post." Make a response here.

?

ImLeftFooted
Member #3,935
October 2003
avatar

I would make it, but I doubt Matt would let it exist with the extra bandwidth it would require.

Kibiz0r
Member #6,203
September 2005
avatar

If we were going to go that route, we might as well just use IRC and periodically dump a log of it on the site.

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

I would make it, but I doubt Matt would let it exist with the extra bandwidth it would require.

What extra bandwidth? It's one client looking at the recent threads page.

It's not hard to do, really. Just get a bot to harvest all the posts made to the site, then examine triggers set by users. Create an AIM account for the bot to use, and have clients add it to their buddy lists. In order to allow replying, clients have to provide their username and password to the bot.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Go to: