Closed (fixed)
Project:
Advanced Forum
Version:
7.x-2.0-rc1
Component:
Code
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2012 at 14:09 UTC
Updated:
1 Apr 2012 at 17:28 UTC
Hi. advanced_forum_preprocess_comment.inc line: 82
$uri['options'] += array('attributes' => array('class' => 'permalink', 'rel' => 'bookmark'));
shoudn't it looks like
$uri['options'] = array('attributes' => array('class' => 'permalink', 'rel' => 'bookmark'));
without + ?
Also, I need an advice. I want permalinks in my comments to looks exactly like in AD - I have been used this code:
function YOURTHEME_preprocess_comment(&$vars) {
$posts_per_page = variable_get('comment_default_per_page_' . $vars['node']->type, 50);
$page_number = !empty($_GET['page']) ? $_GET['page'] : 0;
if (!$page_number) {
$page_number = 0;
}
$linktext = '#' . (($page_number * $posts_per_page) + $vars['id']);
$vars['comment']->uri['options'] = array('attributes' => array('class' => 'permalink', 'rel' => 'bookmark'));
$vars['permalink'] = l($linktext, $vars['comment']->uri['path'], $vars['comment']->uri['options']);
}
but after update to drupal 7.12 it's not working anymore (permalink link is set to my homepage instead of comment)... Somebody know why ? How to fix it ? THX.
Comments
Comment #1
batigol commentedanybody ?
Comment #2
troky commented$uri['options'] is not necessarily empty so + operator is there to create array union.
Why don't you copy part of code from advanced_forum_preprocess_comment.inc and adjust it as you like?
for example:
Comment #3
batigol commentedOhh I do understand. I don't know php so I thought that + is an typo error (without it, code I used - from first post, in template.php works). Honestly I have no idea what should I do to display Permalink in comments like in AF. I would be glad If somebody can post it.
Comment #4
pwiniacki commentedI think that #numbers besides just Permalink link are a great idea! I would like to know the answer too. This is exactly the way it's is displayed here with comments on drupal.org
I can confirm that removing
+from first post will give you Permalinks as a #numbers but to link to a comment is wrong.Comment #5
kelutrab11 commentedAfter drupal update code
from stack overflow is not working anymore. When + is removed, like author said, code works partially. There are numbers but the link is wrong. Did any of you manage drupal 7.12 comments to work/look just like in AF? If yes, please let me know.
Comment #6
pwiniacki commentedis working great (from http://drupal.stackexchange.com/questions/4679/how-do-i-change-the-perma...) !
[Edit: Changed to php tags for highlighting]
Comment #6.0
michelleedit