Function qtc_chat_link

Use the module function qtc_chat_link().

This function can be used for example in template files. The function return the HTML link "Chat with user".

<?php
qtc_chat_link
($uid, $name, $realname = FALSE, $link_text = FALSE, $check = TRUE)
?>

Required parameters

  • $uid, An user ID
  • $name, An user name

Optional parameters

  • $realname, The user realname.
  • $link_text, Rewrite the default link text "Chat with user".
  • $check, Check if the user to invite to chat is online. Disable this check with FALSE

Example node template

Make the "Chat with user" available on all submitted by lines.

<?php
// $Id: node.tpl.php,v 1.17.2.2 2010/06/19 19:50:54 jarek Exp $
...
$link_text = t('Chat');
$cat_link = qtc_chat_link($node->uid, $node->name, FALSE, $link_text, TRUE);
?>

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">

  <div class="node-header">

    <?php if (!$page): ?>
      <h2 class="node-title"><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
    <?php endif; ?>

    <?php if ($submitted): ?>
      <div class="meta"><?php print $submitted ?> <?php print $cat_link ?></div>
    <?php endif; ?>

Another example

QTChat even used the function. Please take a look at the function _qtc_invite_to_chat_author_pane() in the file qtc.author-pane.inc.