Drupal 6-自定义“谁在线”阻止私人消息链接。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Drupal 6-自定义“谁在线”阻止私人消息链接。相关的知识,希望对你有一定的参考价值。
Customises the "who's online" block to show what role type the user has + the links now point to private message instead of profiles.
function online_block() { $localIP=$_SERVER['SERVER_ADDR']; //Count users with activity in the past defined period. $time_period = variable_get('user_block_seconds_online', 150); //Perform database queries to gather online user lists. $total_guests = db_result(db_query('SELECT COUNT(hostname) FROM {sessions} WHERE timestamp >= %d AND uid = 0', time() - $time_period)); $users = db_query('SELECT DISTINCT u.uid, u.name, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', time() - $time_period); $total_users = db_result(db_query('SELECT DISTINCT COUNT(u.uid) FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 ORDER BY s.timestamp DESC', time() - $time_period)); //Display a list of currently online users. $max_users = variable_get('user_block_max_list_count', 10); if ($total_users && $max_users) { while ($max_users-- && $account = db_fetch_object($users)) { $items[] = $account; } $output.="<div class="item-list"><h4>Members online</h4><p>Within the last 150 seconds</p><ul>"; //Add the account type. $acc = ""; $acc = "Gold"; $acc = "Silver"; $acc = "Tim"; $acc = "Performer"; $acc = "Admin"; } $output .= '<li><a href="/messages/new/'.$items[$i]->uid.'">'.$items[$i]->name.'</a> - ' . $acc . '</li>'; } $output.="</ul><p>Lurkers online: ".$guests."</p></div>"; } return $output; }
以上是关于Drupal 6-自定义“谁在线”阻止私人消息链接。的主要内容,如果未能解决你的问题,请参考以下文章