• 0
Sign in to follow this  
Celes

Players online in div element?

Question

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.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
On 8/30/2018 at 11:57 PM, Celes said:

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.

same problem to me

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0
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. 😞 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this