Jump to content
πŸ‘‰ Click here to explore Remote Jobs, Work From Home & Global News – USA πŸ‡ΊπŸ‡Έ | UK πŸ‡¬πŸ‡§ | Canada πŸ‡¨πŸ‡¦ | Pakistan πŸ‡΅πŸ‡° Γ—
🚫 Guest Access Notice Γ—

Recommended Posts

Posted

Hi,

Earlier i saw some people was asking how AltisLife created their Server Statistic at the top of their website. This guide will help you make exactly the same.

  1. Go to Admin CP -> Customization -> Themes -> Your Theme -> Edit HTML and CSS -> CSS -> custom.css and open the css file.
  2. Paste the following CSS code onto the custom.css:
    .infoTab {
    	float: left;
        line-height: 42px;
        font-family: 'Montserrat', sans-serif;
        font-size: 130%;
        padding-left: 75px; 
    }
    
    .msg {
      float:right;
      line-height:42px;
      font-family:'Montserrat', sans-serif;
      font-size:140%;
    }
    
    .serverBar li {
      padding-left:10px;
    }
    
    .playerCount {
      color:#536e41;
    }
    
    .msgText {
      margin-right:15px;
    }
    
    .serverOnline {
      color:#536e41;
    }
    
    .serverOffline {
      color:#972E33;
    }

    Β 

  3. Go to Templates -> core -> front -> global -> globalTemplate and open it.
  4. Paste the following HTML code into the globalTemplate:
    <div class="ipsLayout_container ipsClearfix" style="margin-bottom: 4px;">
                <div id="navBar" class="ipsClearfix">
                  <ul style="font-size: 1.4rem;" class="infoTab ipsList_inline cSignedIn ipsClearfix ipsResponsive_showDesktop serverBar">
                    <li class="serverName" data-ipstooltip="" data-ipstooltip-label="Tooltiphere">TEAMSPEAK</li>
                    {block="ts_slot_check"}
                    <li class="serverName" data-ipstooltip="" data-ipstooltip-label="Tooltiphere">SOME</li>
                    <li class="playerCount" data-ipstooltip="" data-ipstooltip-label="Tooltiphere"><span id="server_0" class="serverOnline">ONLINE</span></li>
                    <li class="serverName" data-ipstooltip="" data-ipstooltip-label="Tooltiphere">CONTENT</li>
                    <li class="playerCount" data-ipstooltip="" data-ipstooltip-label="Tooltiphere"><span id="server_1" class="serverOnline">ONLINE</span></li>
                    <li class="serverName" data-ipstooltip="" data-ipstooltip-label="Tooltiphere">HERE</li>
                    <li class="playerCount" data-ipstooltip="" data-ipstooltip-label="Tooltiphere"><span id="server_3" class="serverOnline">ONLINE</span></li>
                    <li style="font-size: 1.4rem;" class="msg" data-ipstooltip="" data-ipstooltip-label="Tooltiphere">Your Website Name</li>
                  </ul>
                </div>
              </div>

    Β 

  5. Now you need to create a php block that can display real time server status. In this example i will show you how to do it with the Teamspeak, for others you have to write your own script or get one from internet.
  6. Go to Pages -> Block -> Create New Block -> Custom -> Manual PHP -> Next
  7. Name: Anything you want
    Template Key:Β ts_slot_check
    Content:Β 
    require_once("misc/libraries/TeamSpeak3/TeamSpeak3.php"); try {$ts3 = TeamSpeak3::factory("serverquery://SERVERQUERYUSERNAMEHERE:SERVERQUERYPASSWORDHERE@SERVERIPORDNSHERE:10011/?server_port=9987"); echo "<li class='playerCount' data-ipstooltip='' data-ipstooltip-label='Tooltiphere'><span id='server_2' class='serverOnline'>" . $ts3->virtualserver_clientsonline . " / " . $ts3->virtualserver_maxclients . "</span></li>";} catch(Exception $e){echo "<li class='playerCount' data-ipstooltip='' data-ipstooltip-label='Tooltiphere'><span id='server_2' class='serverOffline'>OFFLINE</span></li>";}

    Β 

  8. And now you just have to download PlanetTeamSpeak Framework from HERE
  9. Then copy the libraries folder and all of its content to your webserver /misc/ folder. It should looks like /misc/libraries/TeamSpeak3/TeamSpeak3.php
  10. The script is working now, and your website will display the user number on your teamspeak.

Please note that this guide is only makes possible to display Teamspeak status. The other 3 column is just a static content that you can make dynamic with a script.

EnjoyΒ :biggrin:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Forum Statistics

    2.7k
    Total Topics
    10.2k
    Total Posts


Γ—
Γ—
  • Create New...

Important Information

FundayForum uses essential cookies to run the community. Optional cookies support analytics and advertising. Choose Accept or Reject below. Read our Privacy Policy, Terms of Use and Guidelines. Essential cookies keep this community running. Choose Accept or Reject for optional cookies. Read our cookie policy and manage your cookie preferences.