[INACTIVE][WEB] OnlinePlayers v1.1 - Live web list of online players[1060]

Discussion in 'Inactive/Unsupported Plugins' started by Flabaliki, Jul 7, 2011.

  1. Offline


    sethgandy, DreamPhreak and malex like this.
  2. Offline


    Wrong link. You download a map file.
  3. Offline


    Sorry, fixed now :)
  4. Offline


    Very nice plugin. good to see how is online with out loggin :)
  5. Offline


    Warning: fread() [function.fread]: Length parameter must be greater than 0 in /public_html/online/players.php on line 31

    [​IMG] Offline

    Don't work for me :(
  6. Offline


    It's saying that that 'onlinePlayers.txt' file is empty or it doesn't exist. Make sure that the 'onlinePlayers.txt' file exists in the same directory as the 'players.php' file too. I would suggest to check the URL in the plugins folder because your server doesn't appear to be connected.

    Open up the config.txt file in your /plugins/OnlinePlayers/ folder on the Minecraft server and point the URL to:

    Also make sure that the two passwords match.
    When you are done make sure to reload or restart your server.
  7. Offline


    I tried to play with this plugin, but not getting very far with it. I got the above error about the length paramater first. I fixed that by restarting my server.

    What I am really looking to do is, just call using a php include, a user list that conforms to my css formatting on my page. I don't need any fancy images or formatting, just simply a list of players. Can this be done? I looked at the txt file this creates, but it dumps the server port in there as well as the max number of players for the server on the same line as the username. Any way to make this just list username so I can call it in my existing php page?
  8. Offline


    @Opus, I can add an few options in that will be able to remove the online / offline part and the number of players online so that you only get the list of players.

    EDIT: I've updated the plugin to allow for what you've asked. Just replace the 'players.php' file and add this line to the 'config.txt' file in the website directory:
  9. Offline


    I really would like to install OnlinePlayer Plugin, but the problem is that we cant use our rented Server as Webserver, it also doesnt allow php. Is there any chance to run this on a seperated webserver? Thanks for info!
  10. Offline


    @neonoto Yes, the PHP scripts can be on a different server. All you have to do is set the URL in the configuration file (the one that goes in the Bukkit plugins folder), set that url to the location of players.php. For example:
    My server is mc.example.com
    My php script is on mysite.com/online/players.php
    I just need to edit the configuration file on my mc.example.com and set the url to: mysite.com/online/players.php

    If you need any more instructions just post back :)
  11. Offline


    @Flabaliki i'v updated all file... don't work :(

    config.txt (Webserver-side)

    Config.txt (server-side)
    #Enter the url of the players.php file, including http://
    #Enter the password for the scripts to connect. You must add
    #this into the other configuration file. Default is admin.
  12. Offline


    @Shooty The configuration files look fine, your problem is the 'onlinePlayers.txt' file. This file should be in the same directory as 'players.php'. It must also be chmod 0666 otherwise it will not work. Once it is there, try reloading or restarting the Minecraft server.
  13. Offline


    @Flabaliki Chmod 0777 is also right, no ? So i'll try 666

    EDIT : don't work :(

    Ok it's works :D http://stonecraft.fr/online/players.php

    But what is '[ajax]a1[/ajax]' and why my server was marked 'offlline'. And Is it be possible to have the same page as you (with the same background and all) .? (sorry i'm french)
  14. Offline


    Thank you for updating it. Its still not quite what I am looking for though.

    I simply want to call the txt file into my page.

    Currently the txt file gets written as 20 25565 player1 player2 player3 etc. Can it be made to format like so (removing the port and player count):


    Also, I'd like to give credit to you. Are you ok with me putting a powered by line at the bottom of my online box and linking back to this post?
  15. Offline


    @Shooty Glad you got it working :). You need to keep the [ajax]a1[/ajax] on the players.php file. You are not supposed to directly view that file. That is where the server sends the information. Users view the index.php file, which requires that the [ajax]a1[/ajax] be on the players.php file. So if you put that back and then visit this page: http://stonecraft.fr/online/ you will see a similar design to mine. Remember you can change any of the CSS styles in the configuration :)
    Ps, no need to apologize for being French, if anything I should be applauding you, your English is 1000x better than my French. All I know is: bonjour and oui oui :p

    @Opus Hrm, well it's pretty close to what you want, it doesn't have the online / offline thing or the player count, the only difference being is that it displays in a table. I figured that would be ok considering that you can alter any of the CSS styles in the configuration file. If you absolutely do want a straight out file, the best I could do (without having a new .txt file), would be to render players.php with only the names and absolutely nothing else, then you could just include that into your other webpage.
  16. Offline


  17. Offline


    @Shooty Ok, download the latest version. You only need to replace 'players.php' that is the only file changed in this version. It should fix the issue you have, if not, report back :). It knows you are an Op because next to your name the server sends an *, this is then interpreted as the user being an Op and then the appropriate code is applied to your name to make it green and shove it up the top.

    @Opus I forgot to answer your last question. By all means add a link back to this thread, that'd be really awesome!
  18. Offline


    It's not :( http://stonecraft.fr/online/ no statue :p
  19. Offline


    Nevermind.. fixed the plugin issue.
    I am calling your index.php (renamed to online.php for my server) and it is formatting great, but it will not update the list unless I seperately call players.php in a seperate browser window. Looking at the code, this should update when I call online.php should it not?
  20. Offline


    @Opus So sorry about all the issues this is causing. But, hey, this is good, it's ironing out some of the bugs in the plugin! Ok, so I updated it to v0.5.2. It used to do that before, where it would rename the folder, so instead of trying to muck around with it for hours, I just made it look for the plugins/onlineplayers folder. Basically, I just renamed the folder without the capitals.

    What you are going to have to do is upload the new 'OnlinePlayers.jar' and make sure the config file is in the folder /plugins/onlineplayers not /plugins/OnlinePlayers

    EDIT: Damn, you fixed it yourself... Oh well, this change is for the better anyways, I had this issue before.

    In regards to renaming the file, if you are using the php include. You may need to include the full path to phpUpdate.js for it to update it. I believe that it is not finding that file.

    @Shooty Did that not fix the problem?
  21. Offline


    Hey, its a learning experience. I know nothing about java, but I have enough web building and computer experience to be really dangerous :) Thanks for the support.

    All of the files are still in the same folder. I only renamed the index.php to online.php because I have an index page already.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  22. Offline


    @Flabaliki it's works http://stonecraft.fr/online/ but i'v a little issue 'Warning: fclose(): supplied argument is not a valid stream resource in /public_html/online/players.php on line 70'

    EDIT : ok i'v just fixed issue (just remove the line 70)
  23. Offline


    @Opus are you doing a php include? If so, I think you need to move some of the code around so it works. As the index.php is a full webpage it has a the header and the body. The javascript needs to be added in the header:
    <script type="text/javascript" src="phpUpdate.js"></script>
    And the <body> tag needs this added:
    <body onload="phpUpdate('players.php')">
    Additionally if you do not care about any of the CSS options, you don't even need the index.php. All you need are the two afformentioned bits of code and then, wherever you want the list to pop up, you just need:
    <span id="a1"></span>
    Hope this helps to solve the problem :)

    @Shooty Ahh, thanks for bringing that up, I can fix that in the actual script, but yes, removing that line does work, but is a bit dangerous, should your server ever decide to actually connect.
  24. Offline


    i would not remove players.php line 70, just change fclose($server); to @fclose($server);
  25. Offline


    This is allowing me to show the users on the page, but it still won't update unless I call players.php in a different window to force the update.
  26. Offline


    @Opus Oops, sorry forgot to give you a bit of code that -actually- refreshes it :S. Chuck the following code in the header:
    <script type="text/javascript">
            setInterval("phpUpdate('players.php')", 10000);
  27. Offline


    Still a no go.

    My page in progress is at http://www.trappedminer.net/temp if you want to take a look.

    players.php and phpUpdate.js are both in the root. Still have to manually call players.php to get an update.
  28. Offline


    @Opus it appeared to work for me. I just joined the server and my name popped up without the need to refresh.

    A quick way to check is by highlighting some of the names and if the highlight disappears after the interval, then you know it is refreshing.
  29. Offline


    Ahh.. I think I found the error. It refreshes in Firefox, but not in IE.
  30. Offline


    @Flabaliki ok thanks, but i have a request (idk if it's possible) but this is actually the homepage of my forum : http://stonecraft.fr/index.php?/index and on the right you can see iframe with your plugins, but how can i do if i just need the 'statue circle' (red or green).

    EDIT : I'v resolved the problem with an ifram on http://stonecraft.fr/online/players.php :p

    So i'v an other problem : if nobody is connected, the server appear 'offline' then it's online ? Why :(


Share This Page