Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Introduction

The SDN forums are an ambivalent experience for me - I like the idea, but I struggle often with content and features. Some have similar problems, which can be seen in the long thread Suggestions for forum improvements (check it out if you haven't seen it yet).

Anyhow, I've whined already often enough about features I'd like to see, so this time I'll take a more constructive approach and describe some minor tweaks I'm using to make my forum experience more enjoyable. Don't expect anything great though, because it's just me implementing some simple, quick and dirty hacks... 😉

My Tweaks

The following is a random collection of some tweaks I find useful. I'm actually in favour of a much more condensed reading layout (other  vi-lovers might appreciate it), but I find it irritating when I post messages and they look completely different to what other users see. So let's stick to a short feature list:

Add user details: I couldn't care less when a user registered  on SDN, but I do find it useful to know the

  • Number of  total and open questions
  • Location/country
  • Number of  total points (if displayed on business card)

Here's why I  like to see this: There's too many very simple silly questions (lots of  users don't seem to like investigating anything on their own) and even  worse, lots of people don't seem to care about questions they ask. I  call the latter the fire-and-forget-syndrome. If possible, I'd  like to avoid spending time on questions that are possibly no longer of  interest (and due noise and poor search capabilities I doubt that the  forums can currently serve as a knowledge base).

The country  (flag) of the user is a nice addition, because it shows the truly global  community we have and sometimes helps me in putting a posting into a  cultural context (and thus better understand it). Makes it also more  personal, which I find important (and as such I'd wish that users would  stick to using their real name instead of some odd pseudonym).

I  also added a link to the user's company (if present). I don't really  care about that, but I've seen others being interested in that. Not to  mention that I couldn't resist, because most links on business cards  seem broken because the http:// prefix is missing...

Relative  posting times: I couldn't care less at what time a message was  posted. What I really want to know is how old it is. Thus I replaced any  message posting times with a relative time using two time units like 3years  1month ago or 7h 30min ago.This way you can easily see if a  message is really new or old.

To avoid looking at wrong relative  times I update them every minute. I know it's silly to do this for  really old messages, but my KISS desire  drove this choice. 😉

Fix broken CSS: I got really tired  of users posting overlong coding lines or quotes without any spaces,  which screw up all the messages in a thread. My fixed version now shows a  horizontal scrollbar for those overlong postings. Ah, and as an ABAP developer I had to switch to the familiar Arial monospaced for SAP font for the code listings.

Funny enough, I  just added another silly tweak that should be soon obsolete (because  I'm sure SAP will fix this): All quotes are currently right justified,  so I made it left-justified again.

Localize some links: I  never understood why each message has an anchor on the page, but the  links in the replies don't use those anchors and instead cause a page  reload. As I sometimes see messages posted without referencing some  necessary context I do occasionaly like to go to the original message.  If it's on the same page, my fix will now make sure that the reference  is to the anchor, so that no page reloading occurs.

Quickstart for the Impatient (Try at your own risk)

For the non-technical minded dare-devils who just want to see what I did, here's the cookbook approach for Windows:

  1. Download Firefox portable if you don't use this browser yet (the portable version can be easily deleted afterwards without leaving any trace on your machine)
  2. Start your portable Firefox and install Greasemonkey in it (just open the linked URL with Firefox)
  3. Head over to my Enhanced SAP SDN forums threads Greasemonkey script and click on the Install button. Pretend that you know what you're doing and that you fully trust me, SAP and whomever else and hit install (everybody else might want to read on)
  4. Head over to your favourite SDN forum and look at an individual message.
Note that you can easily enable/disable Greasemonkey by clicking on the monkey face in the lower right corner of the Firefox status bar. Reload the page with Greasmonkey enabled and disabled and you should see the difference...

Short Background on Used Tools (for Other Developers)

Due to the volume of posted messages I use an RSS reader for quickly browsing through new messages. I find the web interface completely unsuitable and thus didn't obther with any attempts to tweak it. Individual threads I tune minimally by using

Greasemonkey is a very powerful tool that allows you to inject/execute custom Javascript code on specific web pages and jQuery is an awesome library that makes the HTML DOM manipulations much easier. Firebug is a must-have for inspecting the DOM, manipulating styles on the fly, debugging Javascript, etc.

Obviously there's some security risks associated with Greasemonkey, so make sure you understand what you're doing or be at least willing to accept the consequences if something goes wrong.

Note that Greasemonkey is not compatible with the latest jQuery version, so for now we'll stick to jQuery 1.3.2 (see Greasemonkey jQuery compatibility).

Greasemonkey scripts can be found in general at userscripts.org, but essentially  any local file with Javascript code does the job as long as you use the  extension .user.js (then a simple drag&drop into the browser  window installs the script). Alternatively you can also use Greasemonkey's context menu to create a new user script (but then you have some limitations because you cannot specify required libraries).

If you haven't used Greasemonkey before, start by reading the documentation on wiki.greasespot.net. If you're like me and you don't breathe HTML and Javascript (as you get paid for ABAP programming or similar stuff), be prepared to get stuck. One part that bit me in particular was the sandbox design, which prevented a straightforward application of the jQuery.data() method (I wanted to use this to attach the parsed posting time, but it doesn't work, see for example here).

The script almost works in Chrome (though I prefer the portable version SRWare Iron based on Chromium), which has native support for such user scripts (they are called content scripts there). I just had to change the loading of the jQuery library via the @require tag to a simple inclusion of the library in the source file of my script.

Final Comments

With such a huge and diverse SCN community it's clear that SAP is unlikely to pursue any quick changes as response to our Suggestions for forum improvements. So for now we're probably stuck with fragile and ugly screen-scraping techniques like I used (unless we'd magically get the something like the requested REST API for SCN).

My enhancement generates additional traffic for looking up user/business card information. In fact for each user I need two AJAX requests, which is rather ugly. So I apologize to SAP for causing some higher load on the servers, but to some degree I just follow the spirit of Sharing and Updating your Business Card has never been easier!... 😉

15 Comments