Website USER ONLINE

11/16/2013 13:09 h4rvswagg#1
How to fix User Online @ website?
11/17/2013 16:15 Lumi#2
Can you post us your Quellcode which are not working?
11/17/2013 19:44 Icetea#3
So the first error variation would be:

- You have not the world-server started and so the script cant read a value. (Which I do not think...)

and the second variation:

- You mean that this function outputs a wrong value.

But these are only two variations... The best way is you show us the error or tell us what disturb you at the script.

Regards,
Icetea'
11/18/2013 04:49 h4rvswagg#4
Quote:
<?php
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
odbc_exec($mssql, 'USE [LOGGING_01_DBF]');
$peak = odbc_exec($mssql, 'SELECT TOP 1 number FROM [LOG_USER_CNT_TBL] ORDER BY [number] DESC');
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
$accounts = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL]');
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$character = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL]');
$guilds = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [GUILD_TBL]');
odbc_exec($mssql, 'USE [LOGGING_01_DBF]');
$peak = odbc_exec($mssql, 'SELECT TOP 1 number FROM [LOG_USER_CNT_TBL] ORDER BY [number] DESC');
?>
<h1>Server Information</h1>
<div class="panel">
<table>
<tr>
<td>Server Time:</td>
<td id="srvtime"></td>
</tr>
<tr>
<td>Server Date:</td>
<td><?php echo date('d.m.Y'); ?></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td>Server Status:</td>
<td><div id="srvworld"><img src="./img/load.gif" alt="" /></div></td>
</tr>

<tr>
<td colspan="2"><br /></td>
</tr>

<br><tr><td>Accounts:</td><td><?php echo odbc_result($accounts, 'count'); ?></td></tr>
<tr><td>Character:</td><td><?php echo odbc_result($character, 'count'); ?></td></tr>
<tr><td>Guild:</td><td><?php echo odbc_result($guilds, 'count'); ?></td></tr>
<tr>

<tr>
<td colspan="2"><br /></td>
</tr>

<td>Server Peak:</td>
<td><?php echo odbc_result($peak, 'number'); ?></td>
</tr>
<tr>
<td>Online User:</td>
<td><?php echo odbc_result($online, 'count'); ?></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td>EXP Rate:</td>
<td>3000x</td>
</tr>
<tr>
<td>Drop Rate:</td>
<td>3000x</td>
</tr>
<tr>
<td>Penya Rate:</td>
<td>3000x</td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td>Teamspeak IP:</td>
<td>12.34.567.89</td>
</tr>
<tr>
<td>Teamspeak Port:</td>
<td>1234</td>
</tr>
</table>
</div>
that 1 :/
11/18/2013 07:49 Icetea#5
Quote:
Originally Posted by h4rvswagg View Post
that 1 :/
Thats only the HTML and PHP script. You have to tell us what you do not like at the script or where the fault lies. So we do not get on... :(

Leave us the following information:
  • What bothers you the script?
  • Is it a real error?
  • Which homepage do you use?

Regards,
Icetea'
11/18/2013 08:32 raventh1984#6
@iceTea
He already have told that the online user count is not good

Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');

To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
#online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0);
11/18/2013 16:34 Lumi#7
Quote:
Originally Posted by raventh1984 View Post
@iceTea
He already have told that the online user count is not good

Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');

To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
#online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0);
He didn't told us that the online user count is not good. He told us how to fix them.

Well, the script which raventh already posted should works.
11/20/2013 05:13 h4rvswagg#8
Quote:
Originally Posted by raventh1984 View Post
@iceTea
He already have told that the online user count is not good

Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');

To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
#online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0);
It gives me more error sir
11/20/2013 08:34 raventh1984#9
What error do you have.

I think because you just copied and paste. If thats the case have you changed # to an $
11/21/2013 14:34 h4rvswagg#10
Quote:
Originally Posted by raventh1984 View Post
What error do you have.

I think because you just copied and paste. If thats the case have you changed # to an $
i change but still .. do you have any website template that has user online sir?
11/21/2013 17:55 Thejin#11
Quote:
Originally Posted by raventh1984 View Post
@iceTea
He already have told that the online user count is not good

Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');

To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0');
Did u miss the ' ?
11/21/2013 20:05 Lumi#12
Maybe you tell us your error?
11/22/2013 18:16 Icetea#13
So, this function should be work. Credits goes of course to raventh. I have only tested this variable and corrected typographical errors.

Code:
odbc_exec($mssql, 'USE[CHARACTER_01_DBF]');
$online_function = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM[CHARACTER_TBL] WHERE multiServer > 0');
But in this code we see the variable $mssql. That means the SQL-Server Connection, it wont work when this function isn't declared. So, when in you use a Stefan Pfeifer Page it should be declared in the config.php.

So when you use a Stefan Pfeifer Homepage, is that the right script to output your number X of User Online Count:

Code:
<?php echo odbc_result($online_function, 'count'); ?>
If you still have questions, let me know. (via PN)
I think the problem is now solved.

I think the problem is solved now.
Therefore I send a #closerquest

Kind Regards,
Icetea'
11/24/2013 00:24 h4rvswagg#14
Quote:
Originally Posted by Icetea' View Post
So, this function should be work. Credits goes of course to raventh. I have only tested this variable and corrected typographical errors.

Code:
odbc_exec($mssql, 'USE[CHARACTER_01_DBF]');
$online_function = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM[CHARACTER_TBL] WHERE multiServer > 0');
But in this code we see the variable $mssql. That means the SQL-Server Connection, it wont work when this function isn't declared. So, when in you use a Stefan Pfeifer Page it should be declared in the config.php.

So when you use a Stefan Pfeifer Homepage, is that the right script to output your number X of User Online Count:

Code:
<?php echo odbc_result($online_function, 'count'); ?>
If you still have questions, let me know. (via PN)
I think the problem is now solved.

I think the problem is solved now.
Therefore I send a #closerquest

Kind Regards,
Icetea'
Thanks sir and now it works :)

Quote:
Originally Posted by ​Lumi View Post
Maybe you tell us your error?
Done thanks hehe ;)