collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Bot Member page & online characters  (Read 4416 times)

0 Members and 1 Guest are viewing this topic.

Offline Iheaca

  • BeBot User
  • **
  • Posts: 33
  • Karma: +0/-0
Bot Member page & online characters
« on: November 02, 2010, 02:57:11 pm »
Got a request from guild members to be able to have the guild roster on web portal and connected members as well.

This is really just a simple SQL query and an HTML table is generated.

The whole is then published as a part of a Drupal content.

Thought that might be helpful for some of you.

Example: http://manants.hyboria.info/membres-des-manants

This is all in french and would need some translation. Please note that if you wish to use the original names, you might want to edit the query to remove the translation part.

Code: [Select]
<?php
//Connexion à la base de donnée
mysql_connect("localhost""user""password") or die (mysql_error());
mysql_select_db("bot_database") or die (mysql_error());

//Récupération des données
$botdata mysql_query("SELECT whois.nickname, class_translation.French, whois.level, alts.main, whois.online
FROM whois
INNER JOIN class_translation ON whois.class = class_translation.English
LEFT JOIN alts ON whois.nickname = alts.alt
INNER JOIN bot_users ON whois.nickname = bot_users.nickname
WHERE bot_users.deleted_by IS NULL
ORDER BY whois.online DESC , whois.nickname"
)  or die (mysql_error());

//Création de la table
print'<table border="0" cellpadding="2" width="550" valign="center">
  <tr>
    <td width="150">Nom</td>
    <td width="150">Classe</td>
    <td width="30">Niveau</td>
    <td width="130">Alt de</td>
    <td width="90" align="center">En jeu</td>
  </tr>'
;
  
while(
$botinfo mysql_fetch_array($botdata))
{
print
'
  <tr>
    <td>'
.$botinfo['nickname'].'</td>
    <td>'
.$botinfo['French'].'</td>
    <td>'
.$botinfo['level'].'</td>
    <td>'
.$botinfo['main'].'</td>
    <td><img src="http://manants.hyboria.info/~bot/'
.$botinfo['online'].'.png"</td>
  </tr>'
;
}    
print
'</table>';
?>

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 437
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal