Train Graphic
Great Western Passengers' Forum Great Western Coffee Shop - [home] and [about]
Read about the forum [here].
Register and contribute [here] - it's free.
 today - PEW, Wolmar, to edge of world
15/11/2018 - WWRUG - Westbury
16/11/2018 - TWSW AGM
17/11/2018 - GWRA Auction, Pershore
21/11/2018 - First Bath Bus panel
21/11/2018 - Consultation end - Angel Road
Random Image
Train Running @GWR Twitter Acronyms/Abbreviations Station Comparator Rail News GWR co. site Site Style 1 2 3 4 Chat on off
November 13, 2018, 05:22:29 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
Forgotten your username or password? - get a reminder
Most liked recent subjects
[101] Four track for Filton Bank - ongoing discussion
[91] Eurostar to Europe,
[53] MetroBus
[51] IETs into passenger service from 16 Oct 2017 and subsequent pe...
[46] West Somerset Railway - heritage line, Bishops Lydeard to Mine...
[41] Bumper picture quiz - November 2018.
News: A forum for passengers ... with input from rail professionals welcomed too
 
   Home   Help Search Calendar Login Register  
Pages: [1] 2 3 4
  Print  
Author Topic: The like button - what it does and does not do  (Read 25583 times)
grahame
Administrator
Hero Member
*****
Posts: 22439



View Profile WWW Email
« on: June 08, 2014, 05:27:55 am »

Thus far, 28 of our members have used the "like" button on a total of 71 posts. 

The "like" button - familiar to those of us who are regular Facebook users - is a great way to acknowledge and agree with a post, or show your appreciation, without having to write a somewhat banal positive yet null message. 

The way we've implemented the button on our very mature software is to simply turn the work "like" into "yum" when someone presses the button ... and at all future views of the page the name of the liker is shown up.   And if you've liked a post and change your mind, you can "unlike" once you've refreshed and your like is gone without trace (unless I were to trawl back through backups of the database!).

User names showing up on the 'like' are current ones - if you should change your visible user name (something we strongly discourage for the most part) then it will change on posts that you have liked to reflect your new persona.

At the present time there are no facilities to compress liker lists ("and 6 others") and no facilities for our members to do anything like sent personal messages or alerts to everyone who's liked a post, or who has liked any post within a thread, and there are no plans for such facilities.

I am aware that on the end of notifications sent by email, you may be getting an extra [like] word in the text.  Sorry about that - as the software wasn't written with the thought of having the like button, the fix doesn't look trivial and I'm concentrating more on getting passengers on the TransWilts line, a good input to the DfT consultation so that we can continue to get these good passenger numbers ( cos we still have an appropriate service - see http://www.railcustomer.info ), and on earning money to do the above and to feed ourselves, family and team.
« Last Edit: June 10, 2014, 11:09:20 am by grahame » Logged

Coffee Shop Admin, Member of Melksham Rail User Group, on the board of TravelWatch SouthWest and some more things besides
Red Squirrel
Transport Scholar
Hero Member
******
Posts: 2262


The first town plan. An idea that had legs.


View Profile
« Reply #1 on: June 08, 2014, 10:58:08 am »


The way we've implemented the button on our very mature software is to simply turn the work "like" into "yum" when someone presses the button ...


Presumably that was to avoid confusion with the Yellowdog Updater, Modified?
Logged

Sir. Does this mean that Ann-Margret's not coming?
LiskeardRich
Transport Scholar
Hero Member
******
Posts: 3107

richardwarwicker@hotmail.co.uk
View Profile
« Reply #2 on: June 08, 2014, 02:45:54 pm »

Grahame, when I liked your opening post here I was redirected to a blank page. Is that meant to happen?
Logged
grahame
Administrator
Hero Member
*****
Posts: 22439



View Profile WWW Email
« Reply #3 on: June 08, 2014, 03:29:33 pm »

Grahame, when I liked your opening post here I was redirected to a blank page. Is that meant to happen?

Which browser are you using?   The server responds to the "like" with a 204 status code (no content) so it should not happen.
Logged

Coffee Shop Admin, Member of Melksham Rail User Group, on the board of TravelWatch SouthWest and some more things besides
LiskeardRich
Transport Scholar
Hero Member
******
Posts: 3107

richardwarwicker@hotmail.co.uk
View Profile
« Reply #4 on: June 08, 2014, 10:13:12 pm »

Grahame, when I liked your opening post here I was redirected to a blank page. Is that meant to happen?

Which browser are you using?   The server responds to the "like" with a 204 status code (no content) so it should not happen.

I was on my ipad at the time, Safari of some kind

I've just liked the above post on IE10 and it goes into a load and continuously loads but going nowhere.
Logged
grahame
Administrator
Hero Member
*****
Posts: 22439



View Profile WWW Email
« Reply #5 on: June 10, 2014, 06:02:58 am »

Grahame, when I liked your opening post here I was redirected to a blank page. Is that meant to happen?

Which browser are you using?   The server responds to the "like" with a 204 status code (no content) so it should not happen.

I was on my ipad at the time, Safari of some kind

I've just liked the above post on IE10 and it goes into a load and continuously loads but going nowhere.

Hmm ... Status code 204 (the one I've used) is defined as follows:

Quote
10.2.5 204 No Content

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.

If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view.

The 204 response MUST NOT include a message-body, and thus is always terminated by the first empty line after the header fields.

Any geek-types like to advise me of a better alternative?  200 would always redraw the page ... can I write a form of "target = null" into my Javascript request to prevent display at the client end?
Logged

Coffee Shop Admin, Member of Melksham Rail User Group, on the board of TravelWatch SouthWest and some more things besides
81F
Transport Scholar
Full Member
******
Posts: 81


View Profile Email
« Reply #6 on: June 10, 2014, 06:55:18 am »

I tried to "like" Grahame's original post, and received

This page can^t be displayed
^Make sure the web address http://www.firstgreatwestern.info is correct.
^Look for the page with your search engine.
^Refresh the page in a few minutes.

My "like" does not appear to have registered.
Using IE (9?) on aol desktop
Logged
Brucey
Global Moderator
Hero Member
*****
Posts: 2259


View Profile WWW
« Reply #7 on: June 10, 2014, 07:13:15 am »

Try something like this, using jQuery (untested):

In the body:
Code:
<span id="txt155611" class="likebutton"><a href="#" class="likebutton">like</a></span>

In the head:
Code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).on('click', "a.likebutton", function() {
    var spanID = $(this).parent("span").attr("id");
    var targetURL = '/coffeeshop/lyke.php?id=' . spanID;
var jqxhr = $.ajax(targetURL).done(function() {
$('#'.spanID).html = 'yum!';
});
});
</script>

Get lyke.php to respond with 200.
« Last Edit: June 10, 2014, 07:39:32 am by Brucey » Logged
Godfrey Tables
Full Member
***
Posts: 37


View Profile
« Reply #8 on: June 10, 2014, 08:54:25 pm »

Quote
Any geek-types like to advise me of a better alternative?

I can highly recommend the dojo library which has a nice API for handling AJAX requests...
http://dojotoolkit.org/
.. or more specifically:
http://dojotoolkit.org/reference-guide/1.9/dojo/_base/xhr.html#dojo-base-xhr

Alternatively, would it be possible to just use the 'target' attribute of the anchor tag to load the anything returned by the server into a hidden iframe? That should 'contain' anything returned by the server without affecting the parent document, so it would be free to return a 200. This is a slightly hacky approach but it might be quick to implement...
Logged
grahame
Administrator
Hero Member
*****
Posts: 22439



View Profile WWW Email
« Reply #9 on: June 11, 2014, 07:58:00 am »

Those look like a couple of good ideas.  I'm a bit reluctant to start pulling in larger libraries although JQuery is getting to be pretty standard;  I will probably go with the "quick to implement" hack of redirecting to a hidden iFrame.   BIG pile of stuff on my plate for the next couple of days - probably a Sunday project for me to take further.
Logged

Coffee Shop Admin, Member of Melksham Rail User Group, on the board of TravelWatch SouthWest and some more things besides
LiskeardRich
Transport Scholar
Hero Member
******
Posts: 3107

richardwarwicker@hotmail.co.uk
View Profile
« Reply #10 on: July 12, 2014, 12:59:37 am »

Grahame, I'm using safari on iPad, and when clicking on like I just get a blank screen still. I couldn't gather from the above technical jargon whether this should have been rectified.
Screen print attached of what I am redirected to.
Logged
grahame
Administrator
Hero Member
*****
Posts: 22439



View Profile WWW Email
« Reply #11 on: July 14, 2014, 07:00:40 am »

Grahame, I'm using safari on iPad, and when clicking on like I just get a blank screen still. I couldn't gather from the above technical jargon whether this should have been rectified.
Screen print attached of what I am redirected to.

Not yet rectified - too busy with time-dependent stuff (walking in the carnival parade) and stuff that could go badly wrong if not handled ("Reading on Train" thread and fallout).  Busy "real job" week here too, so essentially don't expect a change in the next week - sorry.

As an aside, 390 registered "like"s to date. June forum posts down last month / a pattern we saw in June 2013 and June 2012 too; Some of that might (this year) be due to people clicking "like" who would otherwise have added a little comment to acknowledge reading and approving of the post.
Logged

Coffee Shop Admin, Member of Melksham Rail User Group, on the board of TravelWatch SouthWest and some more things besides
grahame
Administrator
Hero Member
*****
Posts: 22439



View Profile WWW Email
« Reply #12 on: August 04, 2014, 01:43:47 pm »

Pinging this up to the top of the pile ...

I've put in a mechanism to try and make it work nicer on other devices (a hidden iFrame) ... works on my browser, but please let me know how it works for you.

Up to 711 likes by 81 different members now ... so it's caught on a bit
Logged

Coffee Shop Admin, Member of Melksham Rail User Group, on the board of TravelWatch SouthWest and some more things besides
TeaStew
Sr. Member
****
Posts: 148


View Profile Email
« Reply #13 on: August 04, 2014, 01:59:18 pm »

Seems to work fine for me using Safari on my phone!
Logged
brompton rail
Sr. Member
****
Posts: 254



View Profile
« Reply #14 on: August 04, 2014, 02:49:35 pm »

Yeh, works for me on my iPad!
Logged
Do you have something you would like to add to this thread, or would you like to raise a new question at the Coffee Shop? Please [register] (it is free) if you have not done so before, or login (at the top of this page) if you already have an account - we would love to read what you have to say!

You can find out more about how this forum works [here] - that will link you to a copy of the forum agreement that you can read before you join, and tell you very much more about how we operate. We are an independent forum, provided and run by customers of Great Western Railway, for customers of Great Western Railway and we welcome railway professionals as members too, in either a personal or official capacity. Views expressed in posts are not necessarily the views of the operators of the forum.

As well as posting messages onto existing threads, and starting new subjects, members can communicate with each other through personal messages if they wish. And once members have made a certain number of posts, they will automatically be admitted to the "frequent posters club", where subjects not-for-public-domain are discussed; anything from the occasional rant to meetups we may be having ...

 
Pages: [1] 2 3 4
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
This forum is provided by a customer of Great Western Railway (formerly First Great Western), and the views expressed are those of the individual posters concerned. Visit www.gwr.com for the official Great Western Railway website. Please contact the administrators of this site if you feel that the content provided by one of our posters contravenes our posting rules (email link). Forum hosted by Well House Consultants