Jump to content
  • 0

Players online in div element?


Celes

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  08/31/18
  • Last Seen:  

Hi rAthena. ?

I've been messing around with customizing a web-template and things went pretty flawless at first but now I've come to a point were I'm stuck.  The thing is I've made a player online and peak player section on the right side of the template including a div and css element belonging to it, but I'm unable to actually make the online count (from status.php) display in the part of my custom code. Here is the image:

image.png.f31c6fb6e4a66f08d0134a41feb9071a.png

And here my div element:

                  <div class="onlineplayers"> </div>
                  <div class="onlinepeak"> </div>


I've tried to put <?php echo $gameServer['playersOnline'] ?> and <?php echo $gameServer['playersPeak'] ?> but it returns an error that $gameServer isn't being defined, however when I go to the original '/?module=server&action=status' link it works fine. Could anyone be so kind to help?  I'm sure I'm missing some very important step.

Thanks a lot.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   57
  • Joined:  11/24/16
  • Last Seen:  

because you need to include the server status.php in module.. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  08/31/18
  • Last Seen:  

5 hours ago, Hurtsky said:

because you need to include the server status.php in module.. 

Thanks. Can you point me into the right direction to properly include it?  I've tried adding this in header and footer php:

	<?php include ($_SERVER['DOCUMENT_ROOT']."/themes/new/server/status.php"); ?>


But still gives undefined error on all pages except module=server&action=status page (on that specific page it shows at the side). But I'd like for it to show on every page. Sorry, php newbie here. ? 

Link to comment
Share on other sites

×
×
  • Create New...