Jump to content

Recommended Posts

Posted

Hello Ladies i want to share guide about how to write php script.it's very easy. so let's start. say for example we need top pvp kills script.

first create config.php and write there this:

 

<?php
$L2JBS_config["mysql_host"]="localhost";	// MySQL Host 	["localhost"]
$L2JBS_config["mysql_port"]="3306";		// MySQL Port			["3306"]
$L2JBS_config["mysql_db"]="l2jdb";		// MySQL Database	["l2jdb"]
$L2JBS_config["mysql_login"]="root";		// MySQL User			["root"]	
$L2JBS_config["mysql_password"]="root";	// MySQL Password			["root"]
include("_config_procs.php");
error_reporting(0);
?>

 

now create _config_procs.php

 

<?php
  $link = mysql_connect($L2JBS_config['mysql_host'].":".$L2JBS_config['mysql_port'], $L2JBS_config['mysql_login'], $L2JBS_config['mysql_password']);
  if (!$link)
die("Couldn't connect to MySQL");
  @mysql_select_db($L2JBS_config['mysql_db'], $link);
error_reporting(0);

?>

 

now create toppvp.php and write there this:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>TOP PvP Script By Leki</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

<!--

body,td,th {

color: #CCCCCC;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}

body {

background-color: #000000;

}

-->

</style>

</head>

<body>

<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">

  <tr>

    <th class='Stil7' colspan="5" align="center" width="100%">Top 100 PvP</th>

  </tr>

  <tr>

    <th width="1%" style="border: 1px solid; border-color: #444444; background-color:#222222;">ID</th>

    <th width="10%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Character </th>

    <th width="2%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Level </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Status </th>

  </tr>

 

  <?php

require("Config.php");

$activity = mysql_query("MySQL Query");

$i = 1;

 

while($row = mysql_fetch_array($activity))

 

{

if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";

else

echo "<tr bgcolor='#161616' align='center'>";

echo "<td>"."<center>".$i."</center>"."</td>";

echo "<td>"."<center>".$row['char_name']."</center>"."</td>";

echo "<td>"."<center>".$row['level']."</center>"."</td>";

echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";

echo "<td>"."<center>".$row['online']."</center>"."</td>";

$i++;

}

?>

</table>

</body>

</html>

 

now we need MySQL query. so open Navicat. go to your database and then open characters table.now click File -> Query Table. Then Query Builder.now we need to select fields. we need 4 field. character name,character object id, character pvpkills , characters level and of course character online status.

So for my database(La2Base Interlude) i have this fields: obj_id,char_name,level,pvpkills,online.

 

when you select your fields, again click on Query Editor. you see your sql script

i have this

 

SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

 

now we need to specify now many player must be in top script and how to order.. so add this to your sql script

 

ORDER BY characters.pvpkills DESC LIMIT 10

 

so we have

 

SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

ORDER BY characters.pvpkills DESC LIMIT 10

 

so copy and paste in our php script this sql query

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>TOP PvP Script By Leki</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

<!--

body,td,th {

color: #CCCCCC;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}

body {

background-color: #000000;

}

-->

</style>

</head>

<body>

<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">

  <tr>

    <th class='Stil7' colspan="5" align="center" width="100%">Top 100 PvP</th>

  </tr>

  <tr>

    <th width="1%" style="border: 1px solid; border-color: #444444; background-color:#222222;">ID</th>

    <th width="10%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Character </th>

    <th width="2%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Level </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Status </th>

  </tr>

 

  <?php

require("Config.php");

$activity = mysql_query("SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

ORDER BY characters.pvpkills DESC LIMIT 10");

$i = 1;

 

while($row = mysql_fetch_array($activity))

 

{

if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";

else

echo "<tr bgcolor='#161616' align='center'>";

echo "<td>"."<center>".$i."</center>"."</td>";

echo "<td>"."<center>".$row['char_name']."</center>"."</td>";

echo "<td>"."<center>".$row['level']."</center>"."</td>";

echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";

echo "<td>"."<center>".$row['online']."</center>"."</td>";

$i++;

}

?>

</table>

</body>

</html>

 

now we need to discuss online and offline characters yes?

so replace this

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>TOP PvP Script By Leki</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

<!--

body,td,th {

color: #CCCCCC;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}

body {

background-color: #000000;

}

-->

</style>

</head>

<body>

<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">

  <tr>

    <th class='Stil7' colspan="5" align="center" width="100%">Top 100 PvP</th>

  </tr>

  <tr>

    <th width="1%" style="border: 1px solid; border-color: #444444; background-color:#222222;">ID</th>

    <th width="10%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Character </th>

    <th width="2%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Level </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Status </th>

  </tr>

 

  <?php

require("Config.php");

$activity = mysql_query("SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

ORDER BY characters.pvpkills DESC LIMIT 10");

$i = 1;

 

while($row = mysql_fetch_array($activity))

 

{

if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";

else

echo "<tr bgcolor='#161616' align='center'>";

echo "<td>"."<center>".$i."</center>"."</td>";

echo "<td>"."<center>".$row['char_name']."</center>"."</td>";

echo "<td>"."<center>".$row['level']."</center>"."</td>";

echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";

if ($row['online'] == 1)

echo "<td>"."<center>Online</center>"."</td>";

else

echo "<td>"."<center>Offline</center>"."</td>";

$i++;

}

?>

</table>

</body>

</html>

 

So it's look like this:

 

37668565.png

 

Finish. I think i deserve karma  :P

Posted

Man i think is wrong way to learn How to Write PHP Script.

 

If someone want to write php script let go to php.net to learn the basics for php language and after let read a tutorial for sql language and finaly lets write a php script.

 

This is my opinion...

  • 2 months later...
Posted

damn i know 000000 about this,whaen you say create config.php file,you mean how?Say i create a php file,i add the code in there?What i add to website...I dont undersatnd a thing,if anyone with video guide or else pls post..

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.



  • Posts

    • ➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • LF any side/clan that is currently playing L2Deflect? It’s a high rate BR server with high population 200x, tired to play with the BR/VZ players and not understand most of what they saying.. Kinda wish to find an archer side to have some fun with in kiting the latins. Since I’m not very active here please feel free to pm me on discord  > tovaritch7105 or in game on the server “sToppaH or “iCSu . Cheers and see you there!✌️
    • Hi guys, me and my friends plus one more CP is going to try L2Avalon.net, we're currently looking for maybe 1 or 2 more CP's that would like to join us to smack some russians, the summer season is gonna be 20x, i did play before in eternal server and it was  awesome, if you want to join us please contact  me on discord Discord: TheGamersGuild
    • ⭐[L2OFF H5] GX-EXT⭐ (Public Test Version)   Hello everyone, I'm releasing a public test version of my custom extender for Lineage 2 High Five (L2OFF platform), named GX-EXT. This extender is built over official High Five files, designed for performance, customization, and enhanced gameplay features. 🔹 Note: This test version is intended for personal use, allowing you and up to 20 friends to test and explore the features freely.   🔧 Key Features (Some may be disabled in this build): AIOBuffer AutoAnnounce AutoLearnSkill AutoLoot AutoStart BuilderCmd Bypass ClassManager OlympiadSystem CommunityBoard Security System (Client Extension / Active Anti-Cheat) DropList Custom Raid Drops Shift+Click Drop Info EnchantSystem ItemDelivery LureProtection MenuPlayer PrimeShop PvPAnnounce Rankings RestoreOfflineShop SchemeBuffer Services System SpawnProtection TeleportData TerritoryData TVT Event VisualArmor   For deeper insight, feel free to check the configuration files — most features are fully customizable.   📦Enlaces de descarga: Cliente: Download Client GX-EXT Servidor: Download Server GX-EXT  (Password: 115599)   🖥️ Minimum Requirements: Platform: Windows Server 2012 or newer RAM: 16 GB Storage: SSD Base: Official High Five (L2OFF) files   Commands: //admin //admin2 .menu ALT+B   Feel free to post your questions or feedback here, or contact me via private message. 🔸 Test it, break it, and enjoy it with your friends. This version is perfect for small team trials (up to 20 online users). Enjoy testing GX-EXT!    
  • 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