Jump to content

Recommended Posts

Posted

Hello Ladies. I want to share my create Max Online PHP Script. I think many of you search this and can't find. So let's start:

 

create maxonline.sql and write

 

/*
MySQL Data Transfer
Source Host: localhost
Source Database: l2jdb
Target Host: localhost
Target Database: l2jdb
Date: 21.08.2010 14:10:39
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for maxonline
-- ----------------------------
DROP TABLE IF EXISTS `maxonline`;
CREATE TABLE `maxonline` (
  `MaxOnline` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records 
-- ----------------------------
INSERT INTO `maxonline` VALUES ('1');

 

Next execute this sql file in Navicat.

 

now create in root directory of site maxonline.php and write

 

<?php 
$mysql_host="localhost";    // MySQL Host             [localhost] 
$mysql_port="3306";            // MySQL Port                              [3306] 
$mysql_db="l2jdb";            // MySQL Database    [l2jdb] 
$mysql_login="root";        // MySQL User                             [root]     
$mysql_password="master";        // MySQL Password                            [root] 
$link = mysql_connect($mysql_host, $mysql_login, $mysql_password) or die("<br>Could not connect: " .mysql_error()); 
@mysql_select_db($mysql_db, $link); 
?> 
<? 
$sql = mysql_query("SELECT count(*) FROM characters WHERE online = 1") or die("Invalid query: " .mysql_error()); 
    $playsonline = mysql_result($sql, 0, 0);

$sql = mysql_query("SELECT maxonline FROM maxonline") or die("Invalid query: " .mysql_error()); 

    $playsmaxonline = mysql_result($sql, 0, 0); 

if($playsmaxonline < $playsonline)
{ mysql_query("UPDATE maxonline SET maxonline='$playsonline'") or die("Invalid query: " .mysql_error());  }



?> 
<?php echo $playsmaxonline; ?>

 

then include this file in your template :)

 

Credits to me

  • 3 weeks later...
  • 5 months later...
  • 3 weeks later...
Posted

Why do you need a whole table just to get the max online users? Why just using plain text on it.

Like GetOnlinePlayers example: 20 and set it like 20/500 (max online: 500).

No offence just saying :) because too many database connection first will slow the database + will slow the website.

 

Oups now see it old topic :S

  • 4 months later...
Posted

To be honest, this script is a nightmare from performance standpoint. Getting online player count EVERY time, when the page loads? I don't think so. It's much better to make it a cron job and execute it every minute or so. Only 60 queries per hour. And as ~LoL~ZozOQ stated: don't use mysql for this task. A plain text file would do just fine.

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


  • Posts

    • Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • 亲爱的合作伙伴! 目前我们非常需要以下项目: ➡ WhatsApp 老账户 ➡ Twitter 带粉丝和帖子账户(老账户) 请通过以下联系方式与我们联系。我们很高兴与您合作! 我们项目的有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear partners! At the moment we are in great need of the following positions: ➡ WhatsApp OLD Accounts ➡ Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock