Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Comment Links

13

Comments

  • URLs would still break in this scenario, using focus:
    1. Users make a posts with a link to comment X, Y and Z while Friendly URLs is turned on.
    2. Forum admin turns off Friendly URLs and removes the .htaccess file.
    3. URLs embedded in posts are now broken.

    I still stand by my speed argument, as the parsing through prior pages happens not only when following a link but also when the extension needs to know what to begin numbering of comments with on pages > 1. Its not as simple as multiplying number of comments per page by the page number when you throw whispers and deleted comments in the mix, because page 2 should start on discussion comment number 45 if page one had 4 whispers in it.

    I attempted to get consistent numbering across pages for all users--so that if somebody says "John, in comment #45, you said 'blah'", and John happened to be whispering to someone else earlier in the discussion he would see comment number 45 on page 2, while everyone without whispers would see it on page 1.

    The slowdown is actually caused by code I borrowed from your focus routine--although in retrospect my use of that code in regards to numbering is inappropriate because a more efficient solution is possible with a SQL query. Another solution that wouldn't require the extra query or looping through prior pages would be to expose the CommentID visibly in the comment link, (Woot does this, as all Community Server forums) but I preferred to keep things clean and number the comments starting from one in each discussion. Woot's huge IDs are really ugly, IMHO.
  • Wallphone - numbering consistent between users due to skipping whispers works for a particular moment, but isn't stable over time if people are free to whisperize and dewhisperize comments.

    Where does this lead? Use of comment IDs if you want unbreakable identification. I guess it puts number-within-thread in the category of an informal name - useful, but dangerous if people think it's fully reliable.

    Don't think it implies need to change the extension - just state of awareness of users.
  • Yah, true. Even if an administrator deletes a comment it will change the numbering.

    I don't feel there really is an appropriate way around this, as changing the numbering to count whispers and deleted comments will leave a odd gap in the numbering that would hint a comment has been whispered or deleted there.

    I'm also in the camp that says you shouldn't reveal database IDs... (a lot of recent discussions complaining about showing them in URLs) but some times it's unavoidable. Showing comment IDs wouldn't reveal whispers as the numbers are not going to be entirely sequential anyway... so maybe I will make this an option in the next version.
  • Hi, I do like this add-on. Strange thing I've found is that the 'Copy URL as...' JS dropdown has stopped functioning for me, although the permalink functionality still remains.

    I'm thinking it is the fault of another extension so I will try testing this extension whilst turning off the others...will post again with results...
  • JQ Thickbox and UserInfo ToolTip once conflicted with it. In those cases, it had to do with the onload body function conflicting. There is a workaround method I have used in Code Prettify to attach to this without conflicting, but haven't tested enough and have two other complex issues to roll into it before another release. Yes let me know what you find, I may be able to straighten it out.
  • How can I disable the popup menu? All I want is to have the hyperlinked comment ID number next to each comment.
  • Near the top of the default.php is this line: define('CommentLinks_CLIPBOARD', 1);

    Change that one to a zero
  • "Hi, I do like this add-on. Strange thing I've found is that the 'Copy URL as...' JS dropdown has stopped functioning for me, although the permalink functionality still remains.

    I'm thinking it is the fault of another extension so I will try testing this extension whilst turning off the others...will post again with results..."
    Hey, I discovered that the Notify extension must be causing this behavior - turning it on/off disables/enables the dropdown.

    Not sure why though. I'm having other difficulties with the Notify extension (when you click to subscribe or unsubscribe, the three green loading dots appear but the change never completes) so perhaps the Notify extension is unstable... I'll have a sniff over on it's discussion.
  • This is just a suggestion.

    Can you integrate the permalinks to work with the Add This button which will be located at the bottom of every comment?

    I believe this combo will create something more useful and versatile than the social bookmarking extension(the icons are just too much, too small and some links dont work well among other problems).

    Humbly awaiting your reply.
  • You want the AddThis button to appear inside the menu? Or just appear alongside the comment links using the same URL structure? Interesting idea.
  • I want it to appear alongside the comments links using the same url structure.


    But out of curiosity, I'll love to know how to make it work if it appears inside the menu
  • image
    As you can see, it actually works quite nicely inside the menu, but it is extra work.

    To get it in there, you have to edit the CopyMenu.js file, and change the last line of the BuildMenu() function, I just used boilerplate AddThis code, so yours may look slightly different. To link to the comment instead of the page itself, note that I used BaseUrl+'?CommentID='+CommentID instead of document.href in the AddThis code:return Menu+'<dt>Bookmark</dt><dd><a href="javascript: location.href='http://www.addthis.com/bookmark.php?pub=addthis&url='+encodeURIComponent(BaseUrl+'?CommentID='+CommentID)+'&title='+encodeURIComponent(document.title);"><img src="http://s3.addthis.com/button2-bm.png" title="Bookmark using any bookmark manager!" border="0" height="24" width="160"></a></dl>';
    The <dt> tags denote a menu title, which includes a bottom border line so you may want to just skip the extra code in those and just add the <dd> tags.

    Next thing I had to do is make the menu wider to fit the button. To do this, edit CopyMenu.css, and change the middle two lines, width and left. I am using px instead of em since the button is sized in pixels instead of font character widths:.CopyMenu dl { background: #fef9e9; border: 2px outset #ffedae; position: absolute; width: 188px; left: -188px; /* Always should negative value of the menu's width */ overflow: hidden; font-size: 12px; line-height: 150%; z-index: 65535; }




    Now, putting it alongside is much less work. To do that, edit the default.php file, and around line 125 you will see this code:$CommentList .= $Link .'">#&nbsp;'. $Number .'</a>';

    Make a new line underneath that, and modify your AddThis code to look something like this:$CommentList .= '<a href="javascript: location.href=\'http://www.addthis.com/bookmark.php?pub=addthis&url=\'+encodeURIComponent('. $Url .')+\'&title=\'+encodeURIComponent(document.title);"><img src="http://s3.addthis.com/button2-bm.png" title="Bookmark using any bookmark manager!" border="0" height="24" width="160"></a>';

    Take note that again location.href was replaced with '. $Url .' and single quotes already inside the addThis code got escaped with slashes before them.
  • Thanks man. I really appreciate your prompt help.

    You should prolly integrate the addthis button with your extension with options in the admin whether to use it below the the permalink or in the menu or not to use the addthis button at all.

    You can even port the sharethis plugin for wordpress since addthis is more like a third-party.
  • sorry if I sound too demanding . But I've just realised that having a addthis button in every comment is not the best thing.

    I think I'll prefer it if it only appears in the comment at the top of every page in a discussion.
  • For that, there is a RowNumber that you can easily check:if ($RowNumber == 1) { $CommentList .= '<a href="javascript: location.href=\'http://www.addthis.com/bookmark.php?pub=addthis&url=\'+encodeURIComponent('. $Url .')+\'&title=\'+encodeURIComponent(document.title);"><img src="http://s3.addthis.com/button2-bm.png" title="Bookmark using any bookmark manager!" border="0" height="24" width="160"></a>'; }
  • JQ Thickbox and UserInfo ToolTip once conflicted with it.

    In those cases, it had to do with the onload body function conflicting. There is a workaround method I have used in Code Prettify to attach to this without conflicting, but haven't tested enough and have two other complex issues to roll into it before another release.

    Yes let me know what you find, I may be able to straighten it out.
    could you give it a go?
  • Yah, I think its about time I dusted that one off.
  • Hi! Trying this extension and it doesn't work on my set up. Fresh install of vanilla and comment links, moved /extensions/CommentLinks/CommentLinksTheme/search_results_comments.php to /themes/vanilla/styles/default/, edited :var BaseUrl = '/my_vanilla_dir/' in /extensions/CommentLinks/CopyMenu.js and still nothing... Using FF 3 on Mac OS X 10.5.6, comment links work here but not on my test install. Any idea what might be wrong? Thanks in advance! Ricardo
  • The theme is only needed if you need the links on the search results pages, and you shouldn't have to edit the .js... What isn't working? Does the number appear but not the menu?
  • FF 3.0.10 Windows Vista
    Copying to clipboard doesn't work here at getvanilla and at my own install (using comment links version 1.3.1). It works with the IE7 though.
Sign In or Register to comment.