is it possible show some user info in comment (for example avatar and n. of comments) from vb after leave comment in drupal?

Comments

sun’s picture

Status: Active » Closed (won't fix)

Currently not. Feel free to re-open this issue if you want to provide a patch.

taylormm’s picture

Status: Closed (won't fix) » Needs review

I got this to work by theming comment.tpl.php
Make sure you go into vbulletin admin and change Avatar to serve off filesystem instead of database.
Here is the code I used to theme the comment.tpl.php

Under:

<!-- start comment.tpl.php -->
<div class="comment <?php print $comment_classes;?> clear-block">

Add the following:

<?
  //theme drupal comments with vb users' avatar
  module_load_include('inc', 'drupalvb');
  $vb_uid = db_result(db_query("SELECT userid FROM {drupalvb_users} WHERE uid = %d", $comment->uid));
  if(!empty($vb_uid)) {
    $avatar_id = db_result(drupalvb_db_query("SELECT avatarid FROM {user} WHERE userid = '%s'", $vb_uid));
  }
  if(!empty($avatar_id)) {
    $avatar_picture = db_result(drupalvb_db_query("SELECT avatarpath FROM {avatar} WHERE avatarid = '%s'", $avatar_id));
    echo "<img src='/forum/$avatar_picture'>";
  }
?>

Note that the img link is hardcoded as /forum/ because my forum is located at mydomain.com/forum/
This works for me. My only concern is that this could severely hurt performance if the community gets very large (loading the drupalvb includes, and querying the database on every pageload with a comment). If anyone has any suggestions for how this could be done better please let me know...
Currently using this code at http://screplays.com

sun’s picture

Status: Needs review » Active

No patch here. This should use a module_preprocess_HOOK() function to just expose the variables to the template.

sun’s picture

Status: Active » Closed (won't fix)

Overall, I think this goes in a wrong direction. To display Drupal information inside of vB, you need a vB plugin.