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

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

Author Topic: Post On-/Offline Status to a Website  (Read 7953 times)

0 Members and 1 Guest are viewing this topic.

Offline dillinger

  • BeBot Apprentice
  • ***
  • Posts: 91
  • Karma: +0/-0
Post On-/Offline Status to a Website
« on: September 28, 2009, 09:16:01 am »
Hi Community!

It there a way to make online members' status (Age of Conan guild) visible on a website?

Thanx in advance!

dill

Offline Slacklin

  • BeBot User
  • **
  • Posts: 52
  • Karma: +0/-0
  • My spoon is too big!
    • United Org Site
Re: Post On-/Offline Status to a Website
« Reply #1 on: September 28, 2009, 09:54:23 am »
Try the script I posted here: http://bebot.link/ao-0-6-support/online-query/msg12818/#msg12818

Should help you get a remote query to the bot database.

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #2 on: September 28, 2009, 09:26:28 pm »
ok, I know this is probably a mysql issue, but was wondering if you could work me through it to see what I might be missing (google is threatening to boycot me because of all the queries)
first off, running 0.6.5 bebot for ao, mysql 5.2.1 on windows box....webserver is a shared hosting on linux box.

I run bebot locally, and have my web page hosted remotely. trying out your script, I found out that I had only allowed localhost connections to the bebot db. I added a new user to the db, for the sake of argument bebot2@'%'.

this allowed me to be able to connect to the db via mysql maestro from another computer on the intranet, so I think the command took.

So I uploaded the script to my webserver, changing the parts that needed to be changed and I get this when I run the script from a browser:
Code: [Select]
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'xx.xx.xx.xx' (113) in /<<path to script>>/onlinestatus.php on line 6
Error connecting to mysql2

so thought it might be a firewall setting, so checked both the router and the system, and firewall is disabled on both. made sure port 3306 was forwarded to that machine.  (basically have so many ports pointing to that machine, it might as well be on the DMZ)
everything should be fine, yet for some reason it does not allow me to connect.

I would rather not move the sql db to the remote hosting, as it is both slow and cumbersome for the bots. likewise, I would not want to move the hosting to the local machine as the office does not have enough bandwidth to support such an action.

Any help, nudges, pointers, subscriptions to rogaine to replace pulled hair, would be greatly appreciated..

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #3 on: September 29, 2009, 02:58:32 am »
update: looks like I have to pull the rest of my hair out. Found out it is a hosting issue on the linux shared server blocking all outgoing ports, back to square one. Woulda been a nice script, if I coulda used it.

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: Post On-/Offline Status to a Website
« Reply #4 on: September 29, 2009, 11:12:40 am »
make incomming connection then:)

update web db from your bot machine

Offline Slacklin

  • BeBot User
  • **
  • Posts: 52
  • Karma: +0/-0
  • My spoon is too big!
    • United Org Site
Re: Post On-/Offline Status to a Website
« Reply #5 on: September 30, 2009, 10:01:03 am »
I had the same problem with my host. I ended up contacting them and they unblocked the port for my account. Might be a good try.

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #6 on: September 30, 2009, 12:14:57 pm »
yeah tried that, they said they wouldn't do it for a shared, but was a perfect time to upgrade to v-ded hosting. Gotta love a sales pitch.

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: Post On-/Offline Status to a Website
« Reply #7 on: September 30, 2009, 02:08:51 pm »
this will create and upload your html table on web.
style it, or make xml, your choce. i made table so it will display characters immediately

calling of query file and upload, just configure it to your needs. didnt test but it should work

Code: [Select]
/*
    this is part where you call query for online users
*/
ob_start();
require('file-where-query-is-made-and-table-created.php');
$data = ob_get_contents();
ob_end_clean();
// make temp file
file_put_contents('temp.php', $data);
/*
    make upload here
*/
$c = ftp_connect('ftpserver') or die('Can not connect to FTP server!');
if (@!ftp_login($c, 'ftpusername', 'ftppassword')) {
    @ftp_close($c);
    die('Can not log onto FTP server with given data!');
}
// here you put data to some file on your webserver
ftp_put($c, 'path-to-file', 'temp.php', FTP_BINARY);

@ftp_close($c);
unset($c, $data);

file where is actual query made, used one from someones post for online
Code: [Select]
<table>
<?php
/*
    this will make list of your members that are online
    i used sql from http://bebot.link/ao-0-6-support/online-query/msg12818/#msg12818
*/
$sql "select o.nickname, w.profession, w.level, w.defender_rank_id from online as o, whois as w where o.status_gc = '1' and o.nickname = w.nickname order by o.nickname ASC";
$query mysql_query($sql) or die('error!<br>'.mysql_error());
if (
mysql_affected_rows() > 0) {
    while (
$r mysql_fetch_object($query)) {
?>

<tr>
<td><?=$r->nickname?></td>
<td><?=$r->profession?></td>
<td><?=$r->level?></td>
<td><?=$r->defender_rank_id?></td>
</tr>
<?php
        
unset($r);
    }
    
mysql_free_result($query);
}
unset(
$sql);
?>

</table>

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: Post On-/Offline Status to a Website
« Reply #8 on: October 07, 2009, 02:40:57 pm »
did you try this clash? or this is not what you were looking for?

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #9 on: October 07, 2009, 02:44:55 pm »
I haven't had a chance as of yet snyder...hopefully I'll get a chance this weekend to play around with the scripts and work something out...

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #10 on: October 07, 2009, 02:48:03 pm »
and still toying with the idea of getting a vded and hosting the bot on that...with a combined db...

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #11 on: October 19, 2009, 06:54:35 pm »
ok, I got the virtual dedicated, forums is working, I can connect to teh bot's sql but running the php as either a block or standalone gives no output whatsoever..I tested teh db connection and it works fine so it is hitting the db...just not getting any output

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Post On-/Offline Status to a Website
« Reply #12 on: October 19, 2009, 07:23:13 pm »
Try this code?

Code: [Select]
<?php
/*
    this will make list of your members that are online
    i used sql from http://bebot.link/ao-0-6-support/online-query/msg12818/#msg12818
*/
print '<table>'
$sql "SELECT o.nickname, w.profession, w.level, w.defender_rank_id FROM online AS o LEFT JOIN whois AS w ON o.nickname = w.nickname WHERE o.status_gc = '1' AND o.botname NOT LIKE '%IRC' ORDER BY o.nickname ASC";

$query mysql_query($sql) or die('error!<br>'.mysql_error());
if (
mysql_affected_rows() > 0) {
  while (
$r mysql_fetch_object($query)) {
    print 
'<tr>
            <td>'
.$r->nickname.'</td>
            <td>'
.$r->profession.'</td>
            <td>'
.$r->level.'</td>
            <td>'
.$r->defender_rank_id.'</td>
           </tr>'
;
    unset(
$r);
  }
  
mysql_free_result($query);
}
unset(
$sql);
print 
'</table>';
?>
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Post On-/Offline Status to a Website
« Reply #13 on: October 19, 2009, 07:39:47 pm »
yeah was figuring out how to put that in to the one with the remote db call as I can do that now...so used the original code from here: http://bebot.link/ao-0-6-support/online-query/msg12818/#msg12818. I can connect to the remot bot's db, just doesn't display any output, not even an error

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: Post On-/Offline Status to a Website
« Reply #14 on: October 19, 2009, 07:44:01 pm »
Change
Code: [Select]
$result = mysql_query($query);To
Code: [Select]
$result = mysql_query($query) or die('error!<br>'.mysql_error());
Or even add this to afer <?php
Code: [Select]
error_reporting(E_ALL);
ini_set("display_errors", 1);
« Last Edit: October 19, 2009, 07:47:13 pm by Getrix »
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 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: 758
  • 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