Hello! I'd like to start off by thanking those who have worked on this excellent module! A special thanks to Michelle.

I've been building a community site with Drupal the last week and I'm almost finished re-skinning the forums for this site (One of my last projects before populating the website). I've really learned a lot about CSS and Drupal, but I'm pretty much stumped on what I assume is a pretty simple fix.

The forums can be viewed here: http://pebkacg.com/forum

The issue I am having can only be viewed once logged in, I've attached a picture to hopefully help with my explanation. The issue I'm having is the quote, delete, edit, and reply buttons do not show past the first thread. After the first thread, it simply displays a link instead of a button. At first I thought it was a CSS styling issue, or possibly even PHP coding issue, but I've replaced the style folder in my Advanced Forum module folder to use the default styles, along with using a default Drupal website style, and I was still experiencing the same problem.

I'm starting to think this is custom code, and not accomplished using the default code that comes with the Advanced Forum module (or maybe I'm completely wrong, a pebkac error, how about that irony...) But I've spent about 6 hours now trying to figure how to do this and duplicate how the demo site works (http://shellsn.com/forum).

I don't expect anyone to code this site for me and I'd gladly pay for the help, I'm just pretty much stumped, and I just need fresh eyes to look at the code. Even just being pointed in the right direction would be highly appreciated.

Thank you so much!

CommentFileSizeAuthor
#5 issue.png241.38 KBrizedr
Forum Icons.png312.92 KBLourido
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcdruid’s picture

Category: support » bug

The same problem was mentioned in another issue: #1214508: Gravatar / Animated forum Avatars do not seem to work with new theme updates.

I'll look into it as soon as I can.

mcdruid’s picture

I can't reproduce the links being themed as plain text links; I've tried with and without node comments on 2.0-alpha4 and the current dev version.

Lourido are you still having this problem? can't see on your site as you need to be a registered user - do you mind me registering a test account to have a look?

As for being pointed in the right direction, the button styling is applied in the CSS via the af-button-small class, which should be added to the links by this function in advanced_forum.module:

/**
 * Implementation of hook_link_alter().
 */
function advanced_forum_link_alter(&$links, $node, $comment = NULL) {
  if (empty($comment)) {
    $object = $node;
    $object_type = 'node';
  }
  else {
    $object = $comment;
    $object_type = 'comment';
  }

  // Check if we are altering links on a node that is displayed in a teaser.
  // @TODO: Find out if there's a better way to tell if this is a teaser.
  $teaser = !(arg(0) == 'node' && arg(1) > 0);

  if (advanced_forum_is_styled($object, $teaser, $object_type)) {
    // Change first post from "add comment" to "reply" if it isn't already.
    if (!empty($links['comment_add'])) {
      $links['comment_add']['title'] = t('reply');
    }    

    // List the keys we are interested in.
    $affected_keys = array('post_edit', 'comment_edit', 'post_delete', 'comment_delete', 'quote', 'comment_add', 'comment_reply', 'comment_mover_node_prune', 'comment_mover_comment_prune');

    // Add extra span tags for image replacement.
    foreach ($links AS $key => $link) {
      if (in_array($key, $affected_keys)) {
        $current_classes = (empty($links[$key]['attributes']['class'])) ? '' : $links[$key]['attributes']['class'];
        $links[$key]['attributes']['class'] = "$current_classes af-button-small";
        $links[$key]['title'] = '<span>' . $links[$key]['title'] . '</span>';
        $links[$key]['html'] = TRUE;
      }
    }

    // Put the links in a consistent order.
    foreach ($affected_keys as $key) {
      if (isset($links[$key])) {
        $temp = $links[$key];
        unset($links[$key]);
        $links[$key] = $temp;
      }
    }
  }
}
luisfn’s picture

I'm having this same issue here, but can't try to solve because don't have write permissions to the server right now. For some reason it's isn't applying the class af-button-small in the following replies, but applies to the "Top" button.

Just looking to the code, I believe it's is something with line 464

if (in_array($key, $affected_keys)) {

I'll check it tomorrow.

multimediavt’s picture

I don't know if this will help, but I had an odd problem like this happen to me, NOT with Advanced Forum. CSS styles were being ignored and weird display things were happening, even though the code was clearly correct. Took me about two hours of debugging to find the answer, for me. I had to move a piece of code in the template files from the theme I was using in order for the CSS to work correctly (code below). I had to move the insertion of a dynamic style (old location indicated with comment) to just before all other styles get loaded. I did that and everything worked fine from there on. So, try checking the theme you are using and make sure your CSS styles are loading into the template in the correct order. Seemed weird to me that it would make a difference, but it did for me and might for you.

	<head>
    <!-- I am using page-node-138.tpl.php  -->
		<title><?php print $head_title ?></title>
		<?php
				$rt_utils_includes = path_to_theme() . "/rt_utils.php";
				include $rt_utils_includes;
				$style_switcher = path_to_theme() . "/rt_styleswitcher.php";
				include $style_switcher;
		?>
		<?php print $head ?>
		
                <!-- begin section I moved -->
		<?php
			$head_includes = path_to_theme() . "/rt_head_includes.php";
			include $head_includes;
		?>	
		
                <!-- end section I moved -->

		<?php print $styles ?>	
		<?php print $scripts ?>
		
		<script type="text/javascript" src="<?php echo base_path() . path_to_theme(); ?>/js/loginmenu.js"></script>
		<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
		
		<!-- includes were here -->
		
		<?php
			if (isset($_GET['tstyle']) ) {
				$change = "tstyle";
				$styleVar = $_GET['tstyle'];
				affinity_change_theme($change, $styleVar);
			}
		?>
		
		<link href="<?php echo base_path() . path_to_theme(); ?>/css/general.css" rel="stylesheet" type="text/css" />
		
		
		<!--[if IE 8]>
		<link href="<?php echo base_path() . path_to_theme(); ?>/css/template_ie8.css" rel="stylesheet" type="text/css" />	
		<![endif]-->
		
		<!--[if IE 7]>
		<link href="<?php echo base_path() . path_to_theme(); ?>/css/template_ie7.css" rel="stylesheet" type="text/css" />	
		<![endif]-->	
		
		<!--[if lte IE 6]>
		<link href="<?php echo base_path() . path_to_theme(); ?>/css/template_ie6.css" rel="stylesheet" type="text/css" />
		<script src="<?php echo base_path() . path_to_theme(); ?>/js/DD_belatedPNG.js"></script>
		<script type="text/javascript">
			var pngClasses = ['.png', '.roksearch_wrapper1', '.roksearch_wrapper2', '.feature-arrow-l', '.feature-arrow-r', '.feature-block-tl', '.feature-block-tr', '.feature-block-bl', '.feature-block-br', '.rokstories-tip', '.feature-block-title2', '.feature-block-title3', '.roksearch_odd', '.roksearch_even'];
			
			pngClasses.each(function(fixMePlease) {
				DD_belatedPNG.fix(fixMePlease);
			});
		</script>
		<![endif]-->
		


		
	</head>
rizedr’s picture

FileSize
241.38 KB

Quote button doesn't display at all in the drupal 7 version.

Idas’s picture

Version: 6.x-2.0-alpha4 » 7.x-2.6
Issue tags: +quote

I have the same problem on Drupal 7 with "Quote" module installed. I cant see "edit" or "delete" button when quote is enabled.