post static twitter handle to comment tweet + link to commenter's twitter not website

as part of the comment tweet being generated, I'd like to add my client's twitter ID to the tweet.

also, the commenter's name ends up is linked to their website and not their twitter ID or twitter homepage. how can I change that?

  • Kimberly

    scwtech,

    Hiya and Welcome to WPMU :slight_smile:

    From looking at the plugin and your question I am assuming that there is no designation on the actual comment as from where the user commented from, and that you wish to add a Twitter link to this. Is this correct?

    the commenter's name ends up is linked to their website and not their twitter ID or twitter homepage. how can I change that?

    Is it the same if they choose the "sign in from twitter" option?

    Best,

    Kimberly

  • scwtech

    hi, thanks for your reply. this isn't quite what I meant. I want the tweet that gets generated to contain my client's twitter ID. right now, the tweet starts with a link back to the blog entry (which we also want, of course) and then the comment. We need it to start with my client's twitter ID (hence my calling it a 'static' twitter ID since it will be the same for all comments) and then the link, and then the comment.

    re: the commenter's name, I probably wasn't clear in what I wrote. in the comment on the post page (which is different from the tweet that's generated) the commente'rs name turns into a link. that link is linked to the commenter's website (which is part of their twitter profile) and not to their twitter ID or twitter homepage address (i.e. http://www.twitter.com/######). I want that link to be to their twitter homepage.

    one final thing: the comments are threaded as one unit, with fb and tw and wp comments all together (which is great) but there is no designation of which service they used to comment. Why not?

    here's a link to the post in question: http://scottmacintyre.com/wp/2012/02/heartstrings-on-itunes/

  • Kimberly

    scwtech,

    I visited the site and then clicked Tweet to check out the generated tweet...I found that it does include the twitter handle ( See screenshot ) If you are looking for something different I think you will need some coding. I am not sure if that is something the plugin controls, it is probably the way twitter reads the link.

    in the comment on the post page

    I'm struggling to find this.. If you could provide a screenshot of the location you are actually talking about perhaps I could understand a little better :slight_smile:

    one final thing: the comments are threaded as one unit, with fb and tw and wp comments all together (which is great) but there is no designation of which service they used to comment. Why not?

    That is probably because the service is used to serve an end result, which is commenting. Wordpress just needs you to be signed in, it doesn't much care how you do so if the user is allowed to use external ways (i.e. social media apps) to do so. But a Great question! I wondered the same thing myself when I first checked this out :slight_smile:

    Best,

    Kimberly

  • scwtech

    hmm, no screen shot attached to your message. when you say you "clicked Tweet to check out the generated tweet" do you mean you signed in to the commenting system using your twitter ID and then created a new comment, and checked to see what the resulting tweet looked like?

    I just did some more digging. I signed into my own twitter back-end and deleted my website from my profile. I then went back to the blog post in question and signed in to the commenting system using my twitter ID. I issued a new comment. It appeared on the blog page, but my name is now not linked to anything; I need it (and every other twitter user who comments) to be linked to their twitter homepage (i.e. https://twitter.com/#!/twitterIDgoeshere).

    In addition, the tweet my comment generated does not in fact include any twitter handle as you stated in your comment above. I've included a screen grab of the tweet.

  • Kimberly

    Sorry for the confusion and for my lapse in adding the screenshot.

    I've revisited so that I can start my reply with a fresh pic :slight_smile:

    Here is what I was trying to say:

    When I shared the tweet and went to my twitter page...

    When I clicked on the @tag I got this...

    I tried to log in with my twitter and cannot, just a blank screen, so I don't know for sure how the other posts look aside from what I see you have generated on the blog post.

    I'm assuming, from what you say and what I've done, that the tweets generated by the plugin are different from those by the twitter share interface.

    Unfortunately this is how the plugin operates, it's not specific to any social media and asking it to display accordingly to twitter will require some coding. If you are wanting to go forward with that you can post a custom job ticket on our job forum.

    Or if you are a brave soul you can use an inspect tool like Firebug for Firefox and try to figure out how the posts are being displayed and alter it yourself :slight_smile:

    In any case, please let me know if there is anything else I can do for you!

    Best,

    Kimberly

  • Vladislav

    Hello,

    Just to fill in, at the moment the plugin works just like Kimberly explained. However, in the next plugin release (currently in development/testing) we'll have a new an add-on that will give you an opportunity to enter a Twitter username that will be automatically prepended to all outgoing Tweets.

    As for having the Twitter user links pointing to their Twitter profile rather then their actual site, you can achieve that with a few lines of code, something like this:

    function scwtech_twitter_profile_as_url ($data) {
    	$twitter_username = $data['comment_author'];
    	$data['comment_author_url'] = "https://twitter.com/#!/{$twitter_username}";
    	return $data;
    }
    add_filter('wdcp-comment_data-twitter', 'scwtech_twitter_profile_as_url');

    You can place this code in your theme's functions.php, or as a mu-plugin. To add it as mu-plugin, create a new .php file under wp-content/mu-plugins, name it any way you wish, and open it for editing. Once you opened it, add "<?php", hit Enter then paste this code in.

  • scwtech

    Brilliant! thank you for this. I edited functions.php and the code works almost perfectly. Instead of turning the twitter user name in the comments thread into a link to their twitter homepage, it turns it into an invalid link. In other words, it should have been

    https://twitter.com/#!/singersteve

    but it ended up being

    https://twitter.com/#!/StevenC.Wilson

    Thanks again for your help. I'll look for that update to enable the prepending of a static twitter ID.

  • Vladislav

    Hello,

    I'm sorry for the mix up - the error is entirely on my part, I was checking it with a couple of accounts but neither had profiles populated except the bare basics (being test accounts) so the user "name" returned by the system was actually the username, not the actual name from the profile. I'll need to add some modifications for this to work properly, but I'll attach a possible solution to this thread as soon as I have something.

  • Vladislav

    Hello,

    Just to update, I made some tweaks to the plugin so the proper Twitter username is fetched along the real name, as it is entered in the profile. While I was at it, I also added a new add-on for using Twitter profile URLs instead of their websites for your Twitter commenters. The add-on is named "Link to Twitter profile", and it will do what we aimed for with the custom code (only, of course, hopefully correct this time). You can safely remove that code from you functions.php and just activate the add-on instead. All the mentioned changes are in the latest plugin version (v1.4, just released).

  • scwtech

    this is truly fantastic, thank you so much! it of course generated a few follow-up requests, and I'm sorry to keep this thing open but I hope these are requests that other users will want. I'll add that I have a couple other clients (including a prominent contestant on The Voice) for whom I'd love to use this plugin, so your excellent work will be seen by many commenters.

    - see attached images; the url of the post that gets fed to the tweet ends up taking up most of the 140 characters, but strangely, when I hover over that url, I see a shortened url down in the corner of my browser. I'm not sure why the shortened url isn't appearing in the tweet, but as you can see, my comment got shortened to 'cong' instead of congrats. the url of the tweet is https://twitter.com/#!/singersteve/status/179412097917128705

    - is there a way to build a character limit into the comment field when people choose twitter, that would also take into account the url of the post? I would hope that the url would be shortened and that the shortened version would have a finite number of characters which would be subtracted from the 140 from the start.

    - when I click on my name in the comment, the url is indeed exactly right (thank you for that!! and thank you for the embedded static twitter ID) but I'd love for the code to include target="_blank" so that the url launches in a new tab or window. I'm fairly sure I can add that to the php for your plugin, if that's something you'd rather me do, but if it were an option in the plugin settings, that would be awesome.

    Again, thank you so much for this great work.

  • Vladislav

    Hi,

    As for the character counter, that's a very nice idea, and we'll try to fit it in for the next release. Another good thing would be to get the URLs through a shortening service of some sort before posting them on Twitter, so that's also something we'll be looking into.

    As for opening the links in the new window, are you perhaps using "Custom Comment Template" add-on? If not, this link behavior is regulated by your theme's comments.php template file, so editing this file to include target="_blank" for author URLs should be solve the issue.

  • scwtech

    Hi, thanks again for your help. I have two followup requests:

    - my client has told me that twitter has a strange requirement that in order for a tweet to go out to all followers, it cannot start with the @ symbol and the static twitter name. I wasn't aware of this when I made the original help request on here, but I'm hoping perhaps the order of the generated tweet can be changed so that the blog post url is first, then the static twitter ID, then the comment. if this can be accomplished with a PHP file edit, please let me know which one it is and I'll see if I can accomplish it.

    - I wasn't able to get the twitter url to open in a new window by editing the comments.php file. I'm not using the custom comment template. my theme is arras. I'd be happy to copy and paste the contents of comments.php here.

    I'll see if my previously mentioned ideas (URL shortener, character count) show up in a future release. That would be great!

  • Kimberly

    scwtech,

    Hi!

    Perhaps this will help your link issue?

    http://wordpress.org/extend/plugins/comment-link-manager/

    As for the twitter post, I believe that ...comments-plus\lib\plugins\wdcp-tw_mention_me.php might be a good place to start. It is where the twitter handle is prepended to the post, if not then I'm sure it will give you some direction on where to look!

    Thanks for the great suggestions, I also hope to see them implemented soon :slight_smile:

    Best,

    Kimberly

    If this thread is not resolved because the suggested action did not work or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.