Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6.1 is here with critical security patches. One of them has been publicly disclosed.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Comment Permalinks to CommentID

edited July 2009 in Vanilla 2.0 - 2.3
I'm using this:

<?php /* Extension Name: Comments Permalinks Extension Url: http://lussumo.com/docs/ Description: Adds a "permalink" link to every comment, so you can share a single comment's url. Version: 1.0 Author: Remi Cieplicki Author Url: http://remouk.alt-tab.org/ You should cut & paste this language definition into your conf/your_language.php file (replace "your_language" with your chosen language, of course): */ $Context->Dictionary['Permalink'] = 'permalink'; function CommentGrid_Permalinks(&$CommentGrid) { global $RowNumber; $Comment = &$CommentGrid->DelegateParameters['Comment']; $CommentList = &$CommentGrid->DelegateParameters["CommentList"]; $CommentList .= '<a class="PermLink" href="#Item_'. $RowNumber .'" id="Permalink_'. $RowNumber .'">#'.$Comment->CommentID.'</a>'; $RowNumber++; } $RowNumber = 1; $Context->AddToDelegate("CommentGrid", "PostCommentOptionsRender", "CommentGrid_Permalinks"); ?>

What would be the easiest way for the words permalink to become "#CommentID"? Not like the other permalink addon where it's #1, #2, #3 ... and so on in every thread. Their actual number from the database.

Edit: I've edited the above code, as I got it to work. If anyone is interested in using it.
Sign In or Register to comment.